Go to the documentation of this file.
52 Foam::fv::limitVelocity::limitVelocity
55 const word& modelType,
61 UName_(coeffs_.getOrDefault<
word>(
"U",
"U")),
62 max_(coeffs_.get<scalar>(
"max"))
64 fieldNames_.setSize(1, UName_);
65 applied_.setSize(1,
false);
86 const scalar maxSqrU =
sqr(max_);
90 for (
const label celli : cells_)
92 const scalar magSqrUi =
magSqr(Uif[celli]);
94 if (magSqrUi > maxSqrU)
96 Uif[celli] *=
sqrt(maxSqrU/magSqrUi);
101 if (selectionMode_ == smAll)
103 volVectorField::Boundary& Ubf =
U.boundaryFieldRef();
113 const scalar magSqrUi =
magSqr(Up[facei]);
115 if (magSqrUi > maxSqrU)
117 Up[facei] *=
sqrt(maxSqrU/magSqrUi);
126 U.correctBoundaryConditions();
A class for handling words, derived from Foam::string.
Cell-set options abstract base class. Provides a base set of controls, e.g.:
virtual bool fixesValue() const
Return true if this patch field fixes a value.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
virtual bool read(const dictionary &dict)
Read dictionary.
word name(const complex &c)
Return string representation of complex.
dictionary coeffs_
Dictionary containing source coefficients.
virtual bool read(const dictionary &dict)
Read source dictionary.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
Mesh data needed to do the Finite Volume discretisation.
virtual void correct(volVectorField &U)
Correct the energy field.
scalar max_
Maximum velocity magnitude.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)