58 const word& adjointSolverName,
59 const word& primalSolverName
67 flowRates_(patches_.size(),
Zero)
84 const label patchI = patches_[pI];
96 for (
const label patchI : patches_)
105 for (
const label patchI : patches_)
114 for (
const label patchI : patches_)
125 for (
const scalar flowRate : flowRates_)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
objectiveFlowRate(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
from components
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.
Minimize/maximize flow rate through a given set of patches.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
defineTypeNameAndDebug(objectiveFlowRate, 0)
virtual void addHeaderColumns() const
Write headers for additional columns.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Type gSum(const FieldField< Field, Type > &f)
scalar J()
Return the objective function value.
void update_boundarydJdvn()
Update values to be added to the adjoint outlet pressure.
A class for handling words, derived from Foam::string.
A List of wordRe with additional matching capabilities.
scalar J_
Objective function value and weight.
autoPtr< boundaryVectorField > bdJdvPtr_
Istream and Ostream manipulators taking arguments.
virtual void addColumnValues() const
Write information to additional columns.
const incompressibleVars & vars_
unsigned int width_
Default width of entries when writing in the objective files.
addToRunTimeSelectionTable(objectiveIncompressible, objectiveFlowRate, dictionary)
void update_boundarydJdv()
Update values to be added to the adjoint outlet velocity.
Mesh data needed to do the Finite Volume discretisation.
const std::string patch
OpenFOAM patch number as a std::string.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
Omanip< int > setw(const int i)
const volVectorField & UInst() const
Return const reference to velocity.
autoPtr< boundaryScalarField > bdJdvnPtr_
Adjoint outlet pressure.
Abstract base class for objective functions in incompressible flows.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
static constexpr const zero Zero
Global zero (0)