Go to the documentation of this file.
43 namespace incompressibleAdjoint
45 namespace adjointRASModels
54 adjointSpalartAllmaras,
195 return pos(fieldSwitch) +
neg(fieldSwitch)*
Cs_;
209 return pos(fieldSwitch)*(dFv2dChi*
nuTilda()*invDenom/
nu() +
fv2*invDenom);
222 return - 2.*
pos(fieldSwitch)*aux/
y_;
234 *(scalar(10) -
r_)/(scalar(10) -
r_ + SMALL)
236 tdrdNutilda.ref().boundaryFieldRef() ==
Zero;
250 *(scalar(10) -
r_)/(scalar(10) -
r_ + SMALL)
266 *(scalar(10) -
r_)/(scalar(10) -
r_ + SMALL)
284 return pow6Cw3/(pow6g + pow6Cw3)
285 *
pow((1.0 + pow6Cw3)/(pow6g + pow6Cw3), 1.0/6.0)
341 return -
Cb1_*dStildadNuTilda;
362 if(!isA<coupledFvPatch>(
patch))
379 Info<<
"Updating primal-based fields of the adjoint turbulence "
380 <<
"model ..." <<
endl;
474 adjointSpalartAllmaras::adjointSpalartAllmaras
479 const word& adjointTurbulenceModelName,
480 const word& modelName
489 adjointTurbulenceModelName
529 Cw1_(Cb1_/
sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_),
567 limitAdjointProduction_
569 coeffDict_.getOrDefault(
"limitAdjointProduction", true)
572 y_(primalVars_.RASModelVariables()().d()),
574 mask_(allocateMask()),
576 symmAdjointProductionU_
580 "symmAdjointProductionU",
590 productionDestructionSource_
594 "productionDestructionSource",
664 "momentumSourceMult",
674 gradU_(fvc::
grad(primalVars.
U())),
675 gradNuTilda_(fvc::
grad(nuTilda())),
676 minStilda_(
"SMALL", Stilda_.dimensions(), SMALL)
799 if (isA<wallFvPatch>(
patch) &&
patch.size() != 0)
801 wallShapeSens[patchI] =
808 return wallShapeSens;
821 wallFloCoSens[patchI] =
826 return wallFloCoSens;
854 "adjointEikonalSource" +
type(),
865 SAwallFunctionPatchField;
873 forAll(nutBoundary, patchi)
878 isA<SAwallFunctionPatchField>(nutBoundary[patchi])
882 const scalar
kappa_(0.41);
883 const scalar E_(9.8);
912 ((
kappa_/E_)*(
exp(kUu) - 1 - kUu - 0.5*kUu*kUu));
935 adjointEikonalSource[cellI] -=
936 2.*( rt[faceI] + Uap_t[faceI] )
937 * vtau[faceI]*Cwf_d[faceI]*magSf[faceI]
945 return tadjointEikonalSource;
962 if (isA<wallFvPatch>(
patch))
983 (gradU & gradU)().
T()
984 - (gradU & gradU.T())
999 tmp<volTensorField> tvolSensTerm
1020 return tvolSensTerm;
1062 + gradNua*oneOverSigmaNut
1074 nuaTildaEqn.ref().relax();
1081 scalar maxDeltaNuaTilda =
1084 Info<<
"Max mag of nuaTilda = " << maxNuaTilda.
value() <<
endl;
1085 Info<<
"Max mag of delta nuaTilda = " << maxDeltaNuaTilda <<
endl;
bool useSolverNameForFields() const
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Manages the adjoint mean flow fields and their mean values.
virtual tmp< Field< Type > > snGrad() const
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
class for managing incompressible objective functions.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const volVectorField & Ua() const
const word & solverName() const
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
tmp< volScalarField > fv1(const volScalarField &chi) const
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
volVectorField gradNuTilda_
tmp< volScalarField > r(const volScalarField &Stilda) const
autoPtr< boundaryVectorField > wallShapeSensitivitiesPtr_
const nearWallDist & y() const
A class for handling words, derived from Foam::string.
dimensionedTensor skew(const dimensionedTensor &dt)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
A class for managing temporary objects.
static constexpr const zero Zero
const surfaceScalarField & phi() const
tmp< volScalarField > dStilda_dNuTilda(const volScalarField &Omega, const volScalarField &fv2, const volScalarField &dFv2dChi) const
dimensionedScalar sigmaNut_
virtual tmp< volScalarField > nuEff() const
tmp< volScalarField > fv2(const volScalarField &chi, const volScalarField &fv1) const
static word timeName(const scalar t, const int precision=precision_)
virtual tmp< volVectorField > adjointMeanFlowSource()
tmp< volScalarField > dStilda_dOmega(const volScalarField &Omega, const volScalarField &fv2) const
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< volScalarField > dnut_dNuTilda(const volScalarField &fv1, const volScalarField &dFv1dChi) const
tmp< volScalarField > dfw_dOmega(const volScalarField &Stilda, const volScalarField &dfwdr, const volScalarField &dStildadOmega) const
virtual const boundaryVectorField & adjointMomentumBCSource() const
autoPtr< boundaryVectorField > wallFloCoSensitivitiesPtr_
Ostream & endl(Ostream &os)
tmp< volScalarField > dfw_dDelta(const volScalarField &Stilda, const volScalarField &dfwdr, const volScalarField &dStildadDelta) const
const Type & value() const
tmp< volScalarField > dr_dNuTilda(const volScalarField &Stilda) const
bool changedPrimalSolution_
dimensionedScalar exp(const dimensionedScalar &ds)
dimensionedScalar minStilda_
tmp< volScalarField > dFv2_dChi(const volScalarField &chi, const volScalarField &fv1, const volScalarField &dFv1dChi) const
label min(const labelHashSet &set, label minValue=labelMax)
virtual tmp< volScalarField > distanceSensitivities()
tmp< volScalarField > dr_dDelta(const volScalarField &Stilda) const
volScalarField & nuaTilda()
tmp< volScalarField > dfw_dNuTilda(const volScalarField &Stilda, const volScalarField &dfwdr, const volScalarField &dStildadNuTilda) const
tmp< volScalarField > dfw_dr(const volScalarField &Stilda) const
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
static void nullifyField(GeometricField< Type, PatchField, GeoMesh > &fieldPtr)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
tmp< fvMatrix< Type > > SuSp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
dimensionedScalar pow6(const dimensionedScalar &ds)
volSymmTensorField symmAdjointProductionU_
bool printMaxMags() const
tmp< fvMatrix< Type > > Sp(const volScalarField::Internal &, const GeometricField< Type, fvPatchField, volMesh > &)
Generic templated field type.
bool readIfPresent(const dictionary &dict)
tmp< volVectorField > conservativeMomentumSource()
tmp< volScalarField > dD_dNuTilda(const volScalarField &fw, const volScalarField &dfwdNuTilda) const
dimensionedScalar pow3(const dimensionedScalar &ds)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
autoPtr< boundaryVectorField > adjMomentumBCSourcePtr_
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual tmp< Field< Type > > patchInternalField() const
virtual tmp< volTensorField > FISensitivityTerm()
SolverPerformance< Type > solve(faMatrix< Type > &, Istream &)
const volScalarField & nuTilda() const
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual tmp< scalarField > diffusionCoeffVar1(label patchI) const
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
label max(const labelHashSet &set, label maxValue=labelMin)
const volScalarField & nut() const
Switch adjointTurbulence_
const volScalarField & y_
static void setField(autoPtr< GeometricField< Type, fvPatchField, volMesh >> &fieldPtr, const fvMesh &mesh, const word &baseName, const word &solverName, const bool useSolverNameForFields)
This boundary condition provides a wall constraint on the turbulent viscosity, i.e....
dimensionedScalar pow5(const dimensionedScalar &ds)
Macros for easy insertion into run-time selection tables.
const volVectorField & U() const
Generic dimensioned Type class.
Abstract base class for incompressible turbulence models.
const uniformDimensionedVectorField & g
const solverControl & getSolverControl() const
objectiveManager & objectiveManager_
tmp< volScalarField > dFv1_dChi(const volScalarField &chi) const
tmp< volScalarField > allocateMask()
void correctBoundaryConditions()
tmp< volScalarField > dr_dStilda(const volScalarField &Stilda) const
const autoPtr< incompressible::RASModelVariables > & RASModelVariables() const
const fvBoundaryMesh & boundary() const
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
tmp< volScalarField > Stilda(const volScalarField &chi, const volScalarField &fv1) const
virtual tmp< volScalarField > nutJacobianTMVar1() const
tmp< volScalarField > fw(const volScalarField &Stilda) const
void storePrevIter() const
addToRunTimeSelectionTable(adjointRASModel, adjointLaminar, dictionary)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
volTensorField momentumSourceMult_
defineTypeNameAndDebug(adjointLaminar, 0)
void updatePrimalRelatedFields()
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedScalar sqrt(const dimensionedScalar &ds)
autoPtr< volScalarField > adjointTMVariable1Ptr_
tmp< volScalarField > chi() const
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
fileName::Type type(const fileName &name, const bool followLink=true)
static tmp< volScalarField > createLimiter(const fvMesh &mesh, const dictionary &dict)
static tmp< T > New(Args &&... args)
incompressibleAdjointMeanFlowVars & adjointVars_
const dictionary & coeffDict() const
void relax(const scalar alpha)
incompressibleVars & primalVars_
bool limitAdjointProduction_
virtual tmp< volSymmTensorField > devReff() const
tmp< volScalarField > dP_dNuTilda(const volScalarField &dStildadNuTilda) const
const volVectorField & UaInst() const
virtual void addTMEqn1Source(fvScalarMatrix &adjTMEqn1)=0
const Time & time() const
virtual tmp< fvVectorMatrix > divDevReff(volVectorField &U) const
tmp< volScalarField > nu() const
tmp< volScalarField > dStilda_dDelta(const volScalarField &Omega, const volScalarField &fv2) const
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
virtual const boundaryVectorField & wallShapeSensitivities()
volScalarField productionDestructionSource_
tmp< volScalarField > DnuTildaEff() const
const word & adjointSolverName() const
Generic GeometricField class.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
dimensionedScalar neg(const dimensionedScalar &ds)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
Smooth ATC in cells next to a set of patches supplied by type.
Type gMax(const FieldField< Field, Type > &f)
Base class for solution control classes.
static autoPtr< boundaryAdjointContribution > New(const word &managerName, const word &adjointSolverName, const word &simulationType, const fvPatch &patch)
const Boundary & boundaryField() const
const dimensionSet dimless
virtual const boundaryVectorField & wallFloCoSensitivities()
const DimensionedField< scalar, volMesh > & V() const
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar pos(const dimensionedScalar &ds)