47 objectiveIncompressible,
59 const word& adjointSolverName,
60 const word& primalSolverName
73 createZeroFieldPtr<scalar>
76 (
"divDxdbMult"+
type()) ,
96 for (
const label zI : zones_)
99 for (
const label cellI : zoneI)
132 createZeroFieldPtr<vector>
140 for (
const label zI : zones_)
143 for (
const label cellI : zoneI)
145 dJdvPtr_()[cellI] = dnutdU()[cellI];
155 const autoPtr<incompressible::RASModelVariables>&
195 for (
const label zI : zones_)
198 for (
const label cellI : zoneI)
200 divDxDbMult[cellI] =
sqr(
nut[cellI]);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
objectiveNutSqr(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
Construct from components.
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...
const word adjointSolverName_
void update_dJdTMvar2()
Update field to be added to the second adjoint turbulence model PDE.
autoPtr< volScalarField > dJdTMvar2Ptr_
Second turbulence model variable.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
virtual const incompressibleAdjointVars & getAdjointVars() const
Access to the incompressible adjoint variables set.
void update_dJdv()
Update values to be added to the adjoint outlet velocity.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void update_dJdTMvar(autoPtr< volScalarField > &dJdTMvarPtr, tmp< volScalarField >(incompressibleAdjoint::adjointRASModel::*JacobianFunc)() const, const volScalarField &JacobianMultiplier, const labelList &zones)
Compute dJdTMVar{1,2}.
void checkCellZonesSize(const labelList &zoneIDs) const
Check if cellZones provided include at least one cell.
defineTypeNameAndDebug(objectiveFlowRate, 0)
scalar J()
Return the objective function value.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
void update_divDxDbMultiplier()
Update field to be added to be added to volume-based sensitivity derivatives, emerging from delta ( d...
Macros for easy insertion into run-time selection tables.
Base class for incompressibleAdjoint solvers.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
A class for handling words, derived from Foam::string.
autoPtr< volVectorField > dJdvPtr_
A List of wordRe with additional matching capabilities.
const autoPtr< incompressibleAdjoint::adjointRASModel > & adjointTurbulence() const
Return const reference to the adjointRASModel.
scalar J_
Objective function value and weight.
void update_dJdTMvar1()
Update field to be added to the first adjoint turbulence model PDE.
void allocatedJdTurbulence()
Allocate fields related to the differentiation of turbulence models, if necessary.
const autoPtr< incompressible::RASModelVariables > & RASModelVariables() const
Return const reference to the turbulence model variables.
autoPtr< volScalarField > divDxDbMultPtr_
Multiplier of d(Volume)/db.
const incompressibleVars & vars_
dimensionedScalar pow3(const dimensionedScalar &ds)
addToRunTimeSelectionTable(objectiveIncompressible, objectiveFlowRate, dictionary)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
void correctBoundaryConditions()
Correct boundary field.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
bool foundObject(const word &name, const bool recursive=false) const
Is the named Type found?
A class for managing temporary objects.
autoPtr< volScalarField > dJdTMvar1Ptr_
First turbulence model variable.
virtual tmp< volScalarField > nutJacobianTMVar2() const
Jacobian of nut wrt the second turbulence model variable.
Abstract base class for objective functions in incompressible flows.
virtual tmp< volScalarField > nutJacobianTMVar1() const
Jacobian of nut wrt the first turbulence model variable.
static constexpr const zero Zero
Global zero (0)