40 #ifndef objectiveIncompressible_H 41 #define objectiveIncompressible_H 135 const word& adjointSolverName,
136 const word& primalSolverName
138 (
mesh,
dict, adjointSolverName, primalSolverName)
149 const word& adjointSolverName,
150 const word& primalSolverName
161 const word& adjointSolverName,
162 const word& primalSolverName
173 virtual scalar
J() = 0;
354 virtual bool write(
const bool valid =
true)
const;
380 #include "objectiveIncompressibleI.H" bool hasdJdTMVar2() const noexcept
bool hasBoundarydJdv() const noexcept
virtual void update_meanValues()
Some objectives need to store some auxiliary values. If averaging is enabled, update these mean value...
virtual void update_boundarydJdp()
virtual void doNormalization()
Normalize all fields allocated by the objective.
static autoPtr< objectiveIncompressible > New(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
Return a reference to the selected turbulence model.
fvMatrix< scalar > fvScalarMatrix
const labelIOList & zoneIDs
virtual void update_boundarydJdnut()
const dictionary & dict() const
Return objective dictionary.
autoPtr< volScalarField > dJdpPtr_
autoPtr< volScalarField > dJdTMvar2Ptr_
Second turbulence model variable.
autoPtr< boundaryScalarField > bdJdTMvar2Ptr_
Adjoint outlet turbulence model var 2.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool hasBoundarydJdTMVar1() const noexcept
bool hasBoundarydJdGradU() const noexcept
virtual void update()
Update objective function derivatives.
declareRunTimeSelectionTable(autoPtr, objectiveIncompressible, dictionary,(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName),(mesh, dict, adjointSolverName, primalSolverName))
autoPtr< volScalarField > dJdTPtr_
bool hasBoundarydJdvn() const noexcept
void update_dJdTMvar(autoPtr< volScalarField > &dJdTMvarPtr, tmp< volScalarField >(incompressibleAdjoint::adjointRASModel::*JacobianFunc)() const, const volScalarField &JacobianMultiplier, const labelList &zones)
Compute dJdTMVar{1,2}.
bool hasdJdv() const noexcept
Inline functions for checking whether pointers are set or not.
void checkCellZonesSize(const labelList &zoneIDs) const
Check if cellZones provided include at least one cell.
bool hasBoundarydJdp() const noexcept
virtual void update_boundarydJdv()
autoPtr< boundaryTensorField > bdJdGradUPtr_
Term multiplying gradU variations.
virtual void update_divDxDbMultiplier()
Update div( dx/db multiplier). Volume-based sensitivity term.
virtual void update_boundarydJdvn()
bool hasBoundarydJdT() const noexcept
virtual void update_boundarydJdvt()
const boundaryScalarField & boundarydJdTMvar1()
Objective partial deriv wrt turbulence model var 1 for all patches.
bool hasBoundarydJdnut() const noexcept
autoPtr< boundaryScalarField > bdJdnutPtr_
Jacobian wrt to nut.
const volScalarField & dJdTMvar1()
Contribution to field adjoint turbulence model variable 1.
Base class for solution control classes.
const boundaryVectorField & boundarydJdv()
Objective partial deriv wrt velocity for all patches.
virtual ~objectiveIncompressible()=default
Destructor.
virtual void update_dJdT()
A class for handling words, derived from Foam::string.
virtual void nullify()
Update objective function derivatives.
const boundaryScalarField & boundarydJdTMvar2()
Objective partial deriv wrt turbulence model var 2 for all patches.
Abstract base class for incompressible turbulence models.
autoPtr< volVectorField > dJdvPtr_
virtual void update_boundarydJdT()
const volVectorField & dJdv()
Contribution to field adjoint momentum eqs.
virtual void update_dJdp()
virtual void update_dJdb()
bool hasdJdTMVar1() const noexcept
virtual scalar J()=0
Return the objective function value.
autoPtr< boundaryVectorField > bdJdvPtr_
virtual bool write(const bool valid=true) const
Write objective function history.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
virtual void update_boundarydJdTMvar1()
autoPtr< boundaryVectorField > bdJdpPtr_
Adjoint (intlet,wall) velocity.
const boundaryTensorField & boundarydJdGradU()
Objective partial deriv wrt gradU.
bool hasBoundarydJdTMVar2() const noexcept
bool hasdJdp() const noexcept
autoPtr< boundaryScalarField > bdJdTPtr_
Adjoint outlet temperature.
const boundaryScalarField & boundarydJdnut()
Objective partial deriv wrt nut for all patches.
void allocatedJdTurbulence()
Allocate fields related to the differentiation of turbulence models, if necessary.
const incompressibleVars & vars_
virtual void addSource(fvVectorMatrix &matrix)
Vector sources can be given only to the adjoint momentum equations. Implemented in base objectiveInco...
virtual void update_dJdbField()
const boundaryVectorField & boundarydJdvt()
Objective partial deriv wrt tangent velocity for all patches.
bool hasBoundarydJdvt() const noexcept
virtual void update_dJdTMvar2()
Mesh data needed to do the Finite Volume discretisation.
virtual void update_dJdv()
Update vol and boundary fields and derivatives.
fvMatrix< vector > fvVectorMatrix
const volScalarField & dJdp()
Contribution to field adjoint continuity eq.
const volScalarField & dJdT()
Contribution to field adjoint energy eq.
autoPtr< boundaryVectorField > bdJdvtPtr_
Adjoint outlet velocity.
const volScalarField & dJdTMvar2()
Contribution to field adjoint turbulence model variable 2.
TypeName("incompressible")
Runtime type information.
const boundaryVectorField & boundarydJdp()
Objective partial deriv wrt pressure (times normal) for all patches.
const boundaryScalarField & boundarydJdvn()
Objective partial deriv wrt normal velocity for all patches.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
const boundaryScalarField & boundarydJdT()
Objective partial deriv wrt temperature for all patches.
autoPtr< boundaryScalarField > bdJdTMvar1Ptr_
Adjoint outlet turbulence model var 1.
A class for managing temporary objects.
autoPtr< boundaryScalarField > bdJdvnPtr_
Adjoint outlet pressure.
virtual void update_boundarydJdGradU()
autoPtr< volScalarField > dJdTMvar1Ptr_
First turbulence model variable.
virtual void update_boundarydJdTMvar2()
Abstract base class for objective functions in incompressible flows.
bool hasdJdT() const noexcept
virtual void update_dJdTMvar1()
virtual void update_gradDxDbMultiplier()
Update grad( dx/db multiplier). Volume-based sensitivity term.