49 Foam::fv::limitVelocity::limitVelocity
52 const word& modelType,
58 UName_(coeffs_.lookupOrDefault<
word>(
"U",
"U")),
61 fieldNames_.setSize(1, UName_);
62 applied_.setSize(1,
false);
72 coeffs_.lookup(
"max") >> max_;
85 const scalar maxSqrU =
sqr(max_);
91 const label celli = cells_[i];
93 const scalar magSqrUi =
magSqr(Uif[celli]);
95 if (magSqrUi > maxSqrU)
97 Uif[celli] *= maxSqrU/magSqrUi;
102 if (selectionMode_ == smAll)
114 const scalar magSqrUi =
magSqr(Up[facei]);
116 if (magSqrUi > maxSqrU)
118 Up[facei] *= maxSqrU/magSqrUi;
defineTypeNameAndDebug(option, 0)
#define forAll(list, i)
Loop across all elements in list.
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)
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual bool read(const dictionary &dict)
Read dictionary.
Macros for easy insertion into run-time selection tables.
A class for handling words, derived from string.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
Mesh data needed to do the Finite Volume discretisation.
Cell-set options abtract base class. Provides a base set of controls, e.g.:
virtual void correct(volVectorField &U)
Correct the energy field.