38namespace incompressibleAdjoint
118 const word& adjointTurbulenceModelName
126 adjointTurbulenceModelName
132 "adjointRASProperties",
140 objectiveManager_(objManager),
142 adjointTurbulence_(get<
word>(
"adjointTurbulence")),
143 printCoeffs_(getOrDefault<
Switch>(
"printCoeffs", false)),
144 coeffDict_(subOrEmptyDict(
type +
"Coeffs")),
148 adjointTMVariable1Ptr_(nullptr),
149 adjointTMVariable2Ptr_(nullptr),
150 adjointTMVariablesBaseNames_(0),
151 adjointTMVariable1MeanPtr_(nullptr),
152 adjointTMVariable2MeanPtr_(nullptr),
156 includeDistance_(false),
157 changedPrimalSolution_(true)
168 const word& adjointTurbulenceModelName
175 "adjointRASProperties",
186 Info<<
"Selecting adjointRAS turbulence model " << modelType <<
endl;
188 auto* ctorPtr = dictionaryConstructorTable(modelType);
197 *dictionaryConstructorTablePtr_
208 adjointTurbulenceModelName
237 IOdictionary::readStream
273 "adjointTMVariable1" +
type(),
300 "adjointTMVariable2" +
type(),
368 "nutJacobianTMVar1"+
type(),
391 "nutJacobianTMVar2"+
type(),
449 const label iAverageIter = solControl.
averageIter();
450 scalar avIter(iAverageIter);
451 scalar oneOverItP1 = 1./(avIter+1);
452 scalar mult = avIter*oneOverItP1;
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const
Return Time associated with the objectRegistry.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
const word & constant() const
Return constant name.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
label size() const noexcept
The number of elements in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
const word & name() const
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
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const Time & time() const
Return the top-level database.
Manages the adjoint mean flow fields and their mean values.
const solverControl & getSolverControl() const
Return const reference to solverControl.
Abstract base class for incompressible turbulence models.
virtual tmp< scalarField > diffusionCoeffVar1(label patchI) const
virtual tmp< volScalarField > nutJacobianTMVar2() const
Jacobian of nut wrt the second turbulence model variable.
volScalarField & getAdjointTMVariable1Inst()
Return non-constant reference to adjoint turbulence model variable 1.
dictionary coeffDict_
Model coefficients dictionary.
autoPtr< volScalarField > adjointTMVariable1MeanPtr_
Adjoint turbulence model variable 1, mean value.
autoPtr< volScalarField > adjointTMVariable2MeanPtr_
Adjoint turbulence model variable 2, mean value.
volScalarField & getAdjointTMVariable2Inst()
Return non-constant reference to adjoint turbulence model variable 2.
virtual void correct()
Solve the adjoint turbulence equations.
nearWallDist y_
Near wall distance boundary field.
Switch adjointTurbulence_
Turbulence on/off flag.
bool changedPrimalSolution_
Has the primal solution changed?
virtual tmp< volScalarField > nutJacobianTMVar1() const
Jacobian of nut wrt the first turbulence model variable.
virtual void printCoeffs()
Print model coefficients.
bool includeDistance() const
Should the adjoint to the eikonal equation be computed.
autoPtr< volScalarField > & getAdjointTMVariable2InstPtr()
Return non-constant autoPtr to adjoint turbulence model variable 2.
autoPtr< volScalarField > adjointTMVariable1Ptr_
Adjoint turbulence model variable 1.
autoPtr< volScalarField > adjointTMVariable2Ptr_
Adjoint turbulence model variable 2.
void computeMeanFields()
Average adjoint fields on the fly.
void resetMeanFields()
Reset mean fields to zero.
void setChangedPrimalSolution()
Set flag of changed primal solution to true.
volScalarField & getAdjointTMVariable2()
Return non-constant reference to adjoint turbulence model variable 2.
volScalarField & getAdjointTMVariable1()
Return non-constant reference to adjoint turbulence model variable 1.
wordList adjointTMVariablesBaseNames_
Base names of the adjoint fields.
virtual tmp< scalarField > diffusionCoeffVar2(label patchI) const
autoPtr< volScalarField > & getAdjointTMVariable1InstPtr()
Return non-constant autoPtr to adjoint turbulence model variable 1.
Switch printCoeffs_
Flag to print the model coeffs at run-time.
void setMeanFields()
Set mean fields.
virtual bool read()
Read adjointRASProperties dictionary.
const wordList & getAdjointTMVariablesBaseNames()
Abstract base class for incompressible adjoint turbulence models (RAS, LES and laminar).
incompressibleAdjointMeanFlowVars & adjointVars_
virtual void correct()=0
Solve the adjoint turbulence equations.
virtual const volScalarField & nut() const
Return the turbulence viscosity.
Base class for solution control classes.
const volVectorField & U() const
Return const reference to velocity.
virtual void correct()
Correct for mesh geom/topo changes.
class for managing incompressible objective functions.
constant condensation/saturation model.
bool changing() const noexcept
Is mesh changing (topology changing and/or moving)
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation. Note:
Base class for solver control classes.
bool doAverageIter() const
label & averageIter()
Return average iteration index reference.
bool useAveragedFields() const
bool average() const
Whether averaging is enabled or not.
A class for managing temporary objects.
type
Volume classification types.
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.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimless
Dimensionless.
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
autoPtr< typename GeometricField< Type, fvPatchField, volMesh >::Boundary > createZeroBoundaryPtr(const fvMesh &mesh, bool printAllocation=false)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
static constexpr char close