49 void Foam::fv::limitVelocity::readCoeffs()
51 UName_ = coeffs().lookupOrDefault<word>(
"U",
"U");
52 max_ = coeffs().lookup<scalar>(
"max");
61 const word& modelType,
85 const scalar maxSqrU =
sqr(max_);
93 const label celli = cells[i];
95 const scalar magSqrUi =
magSqr(Uif[celli]);
97 if (magSqrUi > maxSqrU)
99 Uif[celli] *=
sqrt(maxSqrU/magSqrUi);
116 const scalar magSqrUi =
magSqr(Up[facei]);
118 if (magSqrUi > maxSqrU)
120 Up[facei] *=
sqrt(maxSqrU/magSqrUi);
133 set_.updateMesh(mpm);
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
virtual bool constrain(volVectorField &U) const
Constrain the velocity field.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool fixesValue() const
Return true if this patch field fixes a value.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual wordList constrainedFields() const
Return the list of fields constrained by the fvConstraint.
virtual void updateMesh(const mapPolyMesh &)
Update for mesh changes.
virtual bool read(const dictionary &dict)
Read dictionary.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Macros for easy insertion into run-time selection tables.
A class for handling words, derived from string.
static const word null
An empty word.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
addToRunTimeSelectionTable(fvConstraint, fixedTemperatureConstraint, dictionary)
List< word > wordList
A List of words.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
Mesh data needed to do the Finite Volume discretisation.
virtual bool read(const dictionary &dict)
Read source dictionary.
limitVelocity(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Finite volume options abstract base class.