39 namespace incompressible
53 fixedValueFvPatchScalarField::typeName
70 const scalar defaultEps =
72 subOrEmptyDict(
"advectionDiffusionCoeffs").
73 getOrDefault<scalar>(
"epsilon", 0.1);
104 nybf[patchi] == -
patches[patchi].nf();
117 adjointEikonalSolver::adjointEikonalSolver
127 dict_(
dict.subOrEmptyDict(
"adjointEikonalSolver")),
128 RASModelVars_(RASModelVars),
129 adjointTurbulence_(adjointVars.adjointTurbulence()),
130 sensitivityPatchIDs_(sensitivityPatchIDs),
141 adjointVars.useSolverNameForFields() ?
142 "da" + adjointTurbulence_().adjointSolverName() :
177 dict_ =
dict.subOrEmptyDict(
"adjointEikonalSolver");
206 Info<<
"Adjoint Eikonal Iteration : " << iter <<
endl;
217 scalar residual = daEqn.solve().initialResidual();
225 Info<<
"\n***Reached adjoint eikonal convergence limit, iteration " 226 << iter <<
"***\n\n";
246 Info<<
"Calculating distance sensitivities " <<
endl;
256 distanceSens[patchi] =
267 Info<<
"Calculating distance sensitivities " <<
endl;
311 return tdistanceSens;
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
autoPtr< boundaryVectorField > distanceSensPtr_
Wall face sens w.r.t. (x,y.z)
const surfaceVectorField & Sf() const
Return cell face area vectors.
virtual bool readDict(const dictionary &dict)
Read dict if changed.
defineTypeNameAndDebug(adjointEikonalSolver, 0)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const volScalarField & da()
Return the adjoint distance field.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void solve()
Calculate the adjoint distance field.
wordList patchTypes(nPatches)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelHashSet & sensitivityPatchIDs_
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
boundaryVectorField & distanceSensitivities()
Return the sensitivity term depending on da.
wordList patchTypes() const
Return the boundary condition types for da.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Class including all adjoint fields for incompressible flows.
virtual tmp< volScalarField > distanceSensitivities()=0
Sensitivity terms resulting from the differentiation of the distance field. Misses dxdb...
void read()
Read options each time a new solution is found.
const dimensionedScalar e
Elementary charge.
autoPtr< typename GeometricField< Type, fvPatchField, volMesh >::Boundary > createZeroBoundaryPtr(const fvMesh &mesh, bool printAllocation=false)
tmp< surfaceScalarField > computeYPhi()
Compute convecting velocity.
tmp< volVectorField > gradEikonal()
Return the gradient of the eikonal equation.
const autoPtr< incompressible::RASModelVariables > & RASModelVars_
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of entries in the list.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
zeroField SuSp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
const dictionary & schemesDict() const
The current schemes dictionary, respects the "select" keyword.
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
void accumulateIntegrand(const scalar dt)
Accumulate source term.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
int debug
Static debugging option.
Type gMax(const FieldField< Field, Type > &f)
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
dimensionedScalar pow3(const dimensionedScalar &ds)
autoPtr< Foam::incompressibleAdjoint::adjointRASModel > & adjointTurbulence_
labelHashSet wallPatchIDs_
const volScalarField & d()
Return the distance field.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
const polyBoundaryMesh & patches
Automatically write from objectRegistry::writeObject()
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
const fvBoundaryMesh & boundary() const noexcept
Return reference to boundary mesh.
tmp< volTensorField > getFISensitivityTerm() const
Return the volume-based sensitivity term depending on da.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
A class for managing temporary objects.
void reset()
Reset source term.
Defines the attributes of an object for which implicit objectRegistry management is supported...
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
Do not request registration (bool: false)
const dimensionSet & dimensions() const noexcept
Return dimensions.
Solver of the adjoint to the eikonal PDE.
static constexpr const zero Zero
Global zero (0)