59 const word& adjointSolverName,
60 const word& primalSolverName
65 percentInDenom_(
dict.getOrDefault<bool>(
"percentInDenom", true))
68 dJdbPtr_.reset(createZeroFieldPtr<scalar>(
mesh_,
"dJdb",
dimless));
85 - targetPercentage_->value(
time);
88 J_ /= targetPercentage_->value(
time);
94 <<
"Beta field not yet registered in database. OK for start-up" 104 dJdbPtr_().primitiveFieldRef() = -scalar(1)/
gSum(
mesh_.
V());
107 dJdbPtr_().primitiveFieldRef() /= targetPercentage_->value(
time);
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
autoPtr< OFstream > objFunctionFilePtr_
File to keep the objective values after the end of the primal solver.
Abstract base class for objective functions that contain only geometric quantities.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
virtual void update_dJdb()
Contribution to field sensitivities.
Macros for easy insertion into run-time selection tables.
objectiveTopOVolume(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
From components.
Type gSum(const FieldField< Field, Type > &f)
A class for handling words, derived from Foam::string.
defineTypeNameAndDebug(objectivePartialVolume, 1)
scalar J_
Objective function value and weight.
const Time & time() const noexcept
Return Time associated with the objectRegistry.
Istream and Ostream manipulators taking arguments.
virtual void addHeaderColumns() const
Write headers for additional columns.
addToRunTimeSelectionTable(objectiveGeometric, objectivePartialVolume, dictionary)
unsigned int width_
Default width of entries when writing in the objective files.
scalar timeOutputValue() const
Return the current user-time value. (ie, after applying any timeToUserTime() conversion) ...
#define WarningInFunction
Report a warning using Foam::Warning.
Mesh data needed to do the Finite Volume discretisation.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void addColumnValues() const
Write information to additional columns.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
Omanip< int > setw(const int i)
virtual scalar J()
Return the objective function value.
static constexpr const zero Zero
Global zero (0)