55 const bool isTopoField,
57 const scalar minSetValue,
58 const bool fixATildaValues
72 mesh.time().timeName(),
81 fixedValueFvPatchScalarField::typeName :
82 zeroGradientFvPatchScalarField::typeName
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();
157Foam::Helmholtz::Helmholtz
177 const bool isTopoField,
179 const scalar minSetValue,
180 const bool fixATildaValues
190 setValues(mesh_,
cells, values, isTopoField);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Bound the given scalar field if it has gone unbounded.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Mesh & mesh() const noexcept
Return const reference to mesh.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void rmap(const UList< Type > &mapF, const labelUList &mapAddressing)
1 to 1 reverse-map from the given field
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Internal & internalField() const noexcept
Return a const-reference to the dimensioned internal field.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
A regulatisation PDE based on a Helmholtz filter.
scalar wallValue_
Fixed value at wall boundaries. Defaults to 1.
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.
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 solveOnActiveCells_
Solve the regularisationPDE only on a subset mesh made of the active cell zones.
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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...
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Base class for selecting the regulatisation PDE.
bool growFromWalls_
Whether to apply a fixedValue BC or zeroGradient one to alphaTilda, when regularisation is performed.
void setValues(fvScalarMatrix &bTildaEqn, const bool isTopoField, const scalar minSetValue=Zero)
Set fixed bTilda values.
Base class for selecting the regulatisation radius.
virtual void addRegularisationTerm(fvScalarMatrix &matrix, bool isTopoField) const =0
Term including the regulatisation of the field.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
const dimensionSet dimless
Dimensionless.
fvMatrix< scalar > fvScalarMatrix
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0).
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
loopControl iters(runTime, aMesh.solutionDict(), "solution")
#define forAll(list, i)
Loop across all elements in list.