48 objectiveIncompressible,
49 objectivePowerDissipation,
60 const word& adjointSolverName,
61 const word& primalSolverName
86 createZeroFieldPtr<vector>
96 createZeroFieldPtr<scalar>
99 (
"divDxdbMult" +
type()),
107 createZeroFieldPtr<tensor>
110 (
"gradDxdbMult" +
type()),
130 for (
const label zI : zones_)
134 scalarField integrandZone(integrand.primitiveField(), zoneI);
163 for (
const label zI : zones_)
166 for (
const label cellI : zoneI)
168 dJdvPtr_()[cellI] = dnutdU()[cellI];
176 for (
const label zI : zones_)
179 for (
const label cellI : zoneI)
181 dJdvPtr_()[cellI] += integrand[cellI];
223 for (
const label zI : zones_)
226 for (
const label cellI : zoneI)
228 divDxDbMult[cellI] = integrand[cellI];
244 for (
const label zI : zones_)
247 for (
const label cellI : zoneI)
249 gradDxDbMult[cellI] = integrand[cellI];
252 gradDxDbMult.correctBoundaryConditions();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
objectivePowerDissipation(const fvMesh &mesh, const dictionary &dict, const word &adjointSolverName, const word &primalSolverName)
Construct from components.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
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_
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.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
void update_dJdTMvar(autoPtr< volScalarField > &dJdTMvarPtr, tmp< volScalarField >(incompressibleAdjoint::adjointRASModel::*JacobianFunc)() const, const volScalarField &JacobianMultiplier, const labelList &zones)
Compute dJdTMVar{1,2}.
compressible::turbulenceModel & turb
void checkCellZonesSize(const labelList &zoneIDs) const
Check if cellZones provided include at least one cell.
defineTypeNameAndDebug(objectiveFlowRate, 0)
void update_dJdv()
Update values to be added to the adjoint outlet velocity.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Macros for easy insertion into run-time selection tables.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
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.
scalar J()
Return the objective function value.
Type gSum(const FieldField< Field, Type > &f)
A class for handling words, derived from Foam::string.
autoPtr< volVectorField > dJdvPtr_
A List of wordRe with additional matching capabilities.
void update_dJdTMvar1()
Update field to be added to the first adjoint turbulence model PDE.
const autoPtr< incompressibleAdjoint::adjointRASModel > & adjointTurbulence() const
Return const reference to the adjointRASModel.
scalar J_
Objective function value and weight.
const volVectorField & U() const
Return const reference to velocity.
Istream and Ostream manipulators taking arguments.
virtual void update_divDxDbMultiplier()
Update div(dx/db multiplier). Volume-based sensitivity term.
void update_dJdTMvar2()
Update field to be added to the second adjoint turbulence model PDE.
void allocatedJdTurbulence()
Allocate fields related to the differentiation of turbulence models, if necessary.
autoPtr< volScalarField > divDxDbMultPtr_
Multiplier of d(Volume)/db.
virtual void update_gradDxDbMultiplier()
Update grad(dx/db multiplier). Volume-based sensitivity term.
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 correctBoundaryConditions()
Correct boundary field.
autoPtr< volTensorField > gradDxDbMultPtr_
Emerging from volume objectives that include spatial derivatives.
const autoPtr< incompressible::turbulenceModel > & turbulence() const
Return const reference to the turbulence model.
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.
const volVectorField & UInst() const
Return const reference to velocity.
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.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
virtual tmp< volScalarField > nutJacobianTMVar1() const
Jacobian of nut wrt the first turbulence model variable.
static constexpr const zero Zero
Global zero (0)