49 void Foam::fv::limitMag::readCoeffs()
51 fieldName_ = coeffs().lookup<word>(
"field");
52 max_ = coeffs().lookup<scalar>(
"max");
57 inline bool Foam::fv::limitMag::constrainType
59 GeometricField<Type, fvPatchField, volMesh>& psi
62 const scalar maxSqrPsi =
sqr(max_);
64 Field<Type>& psiif = psi.primitiveFieldRef();
70 const label celli = cells[i];
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_(coeffs(), mesh),
152 set_.topoChange(map);
164 set_.distribute(map);
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
A list of keyword definitions, which are a keyword followed by any number of values (e...
virtual bool read(const dictionary &dict)
Read dictionary.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
virtual bool movePoints()
Update for mesh motion.
Macros for easy insertion into run-time selection tables.
A class for handling words, derived from string.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
#define IMPLEMENT_FV_CONSTRAINT_CONSTRAIN_FIELD(Type, constraintType)
static const word null
An empty word.
Limits the magnitude of the specified field to the specified max value.
List< label > labelList
A List of labels.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
List< word > wordList
A List of words.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Mesh data needed to do the Finite Volume discretisation.
FOR_ALL_FIELD_TYPES(DefineFvWallInfoType)
limitMag(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual bool read(const dictionary &dict)
Read source dictionary.
Class containing mesh-to-mesh mapping information.
Finite volume options abstract base class.