55 const bool isTopoField,
57 const scalar minSetValue,
58 const bool fixATildaValues
72 mesh.time().timeName(),
81 fixedValueFvPatchScalarField::typeName :
82 zeroGradientFvPatchScalarField::typeName
93 if (isA<wallFvPatch>(
patch))
95 bTilda.boundaryFieldRef()[patchI] ==
wallValue_;
100 DimensionedField<scalar, volMesh> sourceField
105 mesh.time().timeName(),
115 for (label iter = 0; iter <
iters; ++iter)
128 setValues(smoothEqn, isTopoField, minSetValue);
131 const scalar residual(
mag(smoothEqn.solve().initialResidual()));
139 mesh.time().printExecutionTime(
Info);
142 if (residual < tolerance)
144 Info<<
"\n***Reached regularisation equation convergence limit, " 145 "iteration " << iter <<
"***\n\n";
151 result = bTilda.primitiveField();
157 Foam::Helmholtz::Helmholtz
165 solveOnActiveCells_(
dict.getOrDefault<bool>(
"solveOnActiveCells", false)),
166 wallValue_(
dict.getOrDefault<scalar>(
"wallValue", 1))
177 const bool isTopoField,
179 const scalar minSetValue,
180 const bool fixATildaValues
Base class for selecting the regulatisation radius.
fvMatrix< scalar > fvScalarMatrix
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 Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
virtual void addRegularisationTerm(fvScalarMatrix &matrix, bool isTopoField) const =0
Term including the regulatisation of the field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Base class for selecting the regulatisation PDE.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
Macros for easy insertion into run-time selection tables.
A regulatisation PDE based on a Helmholtz filter.
#define forAll(list, i)
Loop across all elements in list.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
void setValues(fvScalarMatrix &bTildaEqn, const bool isTopoField, const scalar minSetValue=Zero)
Set fixed bTilda values.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
scalar wallValue_
Fixed value at wall boundaries. Defaults to 1.
const Mesh & mesh() const noexcept
Return mesh.
Bound the given scalar field if it has gone unbounded.
defineTypeNameAndDebug(combustionModel, 0)
void solveEqn(const volScalarField &aTilda, const scalarField &source, scalarField &result, const bool isTopoField, const regularisationRadius &radius, const scalar minSetValue=Zero, const bool fixATildaValues=true)
Solve the regulatisation equation.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
loopControl iters(runTime, aMesh.solutionDict(), "solution")
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
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...
Defines the attributes of an object for which implicit objectRegistry management is supported...
virtual void regularise(const volScalarField &aTilda, const scalarField &source, scalarField &result, const bool isTopoField, const regularisationRadius &radius, const scalar minSetValue=Zero, const bool fixATildaValues=true)
Regularise field (or sensitivities) using a Laplace PDE.
bool growFromWalls_
Whether to apply a fixedValue BC or zeroGradient one to alphaTilda, when regularisation is performed...
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
static constexpr const zero Zero
Global zero (0)