55 const word& managerType,
57 const word& primalSolverName
76 const word& managerType,
78 const word& primalSolverName
82 auto* ctorPtr = dictionaryConstructorTable(solverType);
89 "incompressibleAdjointSolver",
91 *dictionaryConstructorTablePtr_
98 ctorPtr(
mesh, managerType,
dict, primalSolverName)
107 if (adjointSolver::readDict(
dict))
117 return getAdjointVars().useSolverNameForFields();
133 refCast<incompressibleAdjointVars>(
const_cast<variablesSet&
>(vars_()));
142 refCast<incompressibleAdjointVars>(
const_cast<variablesSet&
>(vars_()));
165 getAdjointVars().adjointTurbulence()->setChangedPrimalSolution();
166 ATCModel_().updatePrimalBasedQuantities();
167 getAdjointVars().updatePrimalBasedQuantities();
184 getAdjointVars().adjointTurbulence()
206 forAll(mesh_.boundary(), patchI)
208 const fvPatch& patch = mesh_.boundary()[patchI];
209 if (isA<wallFvPatch>(patch))
212 gradUbf[patchI] = tnf*
U.boundaryField()[patchI].snGrad();
233 - tnuEff*(gradU &
twoSymm(tgradUa()))
239 - (tgradUa & stress())
244 for (label idir = 0; idir < pTraits<vector>::nComponents; ++idir)
248 createZeroFieldPtr<vector>
249 (mesh_,
"stressDir", stress().dimensions())
253 unzipRow(stress(), idir, stressDirPtr());
255 forAll(mesh_.boundary(), pI)
257 if (!isA<coupledFvPatch>(mesh_.boundary()[pI]))
271 ATCModel_->getFISensitivityTerm()
276 flowTerm += pa*tgradU;
279 flowTerm +=
T(adjointRAS->FISensitivityTerm());
283 (objectiveManagerPtr_->getObjectiveFunctions());
287 if (objI.hasGradDxDbMult())
289 flowTerm += objI.weight()*objI.gradDxDbMultiplier();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
Internal & ref(const bool updateAccessTime=true)
Return a reference to the dimensioned internal field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void correctBoundaryConditions()
Correct boundary field.
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Base class for adjoint solvers.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
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
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Base class for incompressibleAdjoint solvers.
const incompressibleVars & getPrimalVars() const
Access to the incompressible primal variables set.
const autoPtr< ATCModel > & getATCModel() const
Access to the ATC model.
virtual void additionalSensitivityMapTerms(boundaryVectorField &sensitivityMap, const labelHashSet &patchIDs, const scalar dt)
virtual bool readDict(const dictionary &dict)
Read dict if updated.
virtual const incompressibleAdjointVars & getAdjointVars() const
Access to the incompressible adjoint variables set.
virtual bool useSolverNameForFields() const
Should solver name be appended to fields.
virtual void updatePrimalBasedQuantities()
virtual tmp< volTensorField > computeGradDxDbMultiplier()
Compute the multiplier for grad(dxdb)
Class including all adjoint fields for incompressible flows.
Base class for primal incompressible solvers.
Base class for solution control classes.
Abstract base class for objective functions. No point in making this runTime selectable since its chi...
A class for managing temporary objects.
void clear() const noexcept
Base class for creating a set of variables.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
void unzipRow(const FieldField< Field, SymmTensor< Cmpt > > &input, const direction idx, FieldField< Field, Vector< Cmpt > > &result)
Extract a symmTensor field field row (x,y,z) == (0,1,2)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.