Go to the documentation of this file.
50 const word& modelType,
56 UName_(coeffs_.getOrDefault<
word>(
"U",
"U")),
57 max_(coeffs_.get<scalar>(
"max"))
59 fieldNames_.setSize(1, UName_);
60 applied_.setSize(1,
false);
81 const scalar maxSqrU =
sqr(max_);
85 for (
const label celli : cells_)
87 const scalar magSqrUi =
magSqr(Uif[celli]);
89 if (magSqrUi > maxSqrU)
91 Uif[celli] *=
sqrt(maxSqrU/magSqrUi);
96 if (selectionMode_ == smAll)
98 volVectorField::Boundary& Ubf =
U.boundaryFieldRef();
108 const scalar magSqrUi =
magSqr(Up[facei]);
110 if (magSqrUi > maxSqrU)
112 Up[facei] *=
sqrt(maxSqrU/magSqrUi);
121 U.correctBoundaryConditions();
A class for handling words, derived from Foam::string.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
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)
limitVelocity(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
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 velocity field.
scalar max_
Maximum velocity magnitude.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)