49 void Foam::fv::limitMag::readCoeffs(
const dictionary&
dict)
51 fieldName_ =
dict.lookup<word>(
"field");
52 max_ =
dict.lookup<scalar>(
"max");
57 inline bool Foam::fv::limitMag::constrainType
62 const scalar maxSqrPsi =
sqr(max_);
64 Field<Type>& psiif =
psi.primitiveFieldRef();
72 const scalar magSqrPsii =
magSqr(psiif[celli]);
74 if (magSqrPsii > maxSqrPsi)
76 psiif[celli] *=
sqrt(maxSqrPsi/magSqrPsii);
84 psi.boundaryFieldRef();
88 fvPatchField<Type>& psip = psibf[
patchi];
90 if (!psip.fixesValue())
94 const scalar magSqrPsii =
magSqr(psip[facei]);
96 if (magSqrPsii > maxSqrPsi)
98 psip[facei] *=
sqrt(maxSqrPsi/magSqrPsii);
114 const word& modelType,
121 fieldName_(
word::null),
152 zone_.topoChange(map);
164 zone_.distribute(map);
172 zone_.read(coeffs(
dict));
173 readCoeffs(coeffs(
dict));
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
GeometricBoundaryField< Type, GeoMesh, PrimitiveField > Boundary
Type of the boundary field.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Finite volume options abstract base class.
virtual bool read(const dictionary &dict)
Read source dictionary.
const dictionary & coeffs(const dictionary &) const
Return the coefficients sub-dictionary.
Mesh data needed to do the Finite Volume discretisation.
Limits the magnitude of the specified field to the specified max value.
virtual bool movePoints()
Update for mesh motion.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
limitMag(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define IMPLEMENT_FV_CONSTRAINT_CONSTRAIN_FIELD(Type, constraintType)
const volScalarField & psi
addToRunTimeSelectionTable(fvConstraint, bound, dictionary)
defineTypeNameAndDebug(bound, 0)
List< word > wordList
A List of words.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
void magSqr(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)