58 const word& adjointSolverName,
59 const word& primalSolverName
62 objectiveIncompressible(
mesh,
dict, adjointSolverName, primalSolverName),
84 const label patchI = patches_[pI];
85 flowRates_[pI] =
gSum(
phi.boundaryField()[patchI]);
95 for (
const label patchI : patches_)
104 for (
const label patchI : patches_)
113 for (
const label patchI : patches_)
124 for (
const scalar flowRate : flowRates_)
Istream and Ostream manipulators taking arguments.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
label size() const noexcept
The number of elements in list.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
wordList sortedToc() const
Return the sorted table of contents.
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const surfaceScalarField & phiInst() const
Return const reference to volume flux.
Abstract base class for objective functions in incompressible flows.
autoPtr< boundaryScalarField > bdJdvnPtr_
Adjoint outlet pressure.
const incompressibleVars & vars_
autoPtr< boundaryVectorField > bdJdvPtr_
autoPtr< OFstream > objFunctionFilePtr_
File to keep the objective values after the end of the primal solver.
unsigned int width_
Default width of entries when writing in the objective files.
scalar J_
Objective function value and weight.
const dictionary & dict() const
Return objective dictionary.
Minimize/maximize flow rate through a given set of patches.
virtual void addHeaderColumns() const
Write headers for additional columns.
virtual void update_boundarydJdvn()
Update values to be added to the adjoint outlet pressure.
virtual scalar J()
Return the objective function value.
virtual void update_boundarydJdv()
Update values to be added to the adjoint outlet velocity.
virtual void addColumnValues() const
Write information to additional columns.
objectiveFlowRate(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Type gSum(const FieldField< Field, Type > &f)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Omanip< int > setw(const int i)
static constexpr const zero Zero
Global zero (0).
autoPtr< typename GeometricField< Type, fvPatchField, volMesh >::Boundary > createZeroBoundaryPtr(const fvMesh &mesh, bool printAllocation=false)
#define forAll(list, i)
Loop across all elements in list.