49 void Foam::fv::limitMag::readCoeffs()
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,
120 set_(mesh, coeffs()),
121 fieldName_(
word::null),
152 set_.topoChange(map);
164 set_.distribute(map);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Finite volume options abstract base class.
const dictionary & coeffs() const
Return dictionary.
virtual bool read(const dictionary &dict)
Read source 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.
#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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
word name(const bool)
Return a word representation of a bool.
dimensionedScalar sqrt(const dimensionedScalar &ds)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
UList< label > labelUList
dimensioned< scalar > magSqr(const dimensioned< Type > &)