Go to the documentation of this file.
50 Foam::fa::limitVelocity::limitVelocity
53 const word& modelType,
59 UName_(coeffs_.getOrDefault<
word>(
"U",
"U")),
60 max_(coeffs_.
get<scalar>(
"max"))
73 coeffs_.readEntry(
"max", max_);
84 const scalar maxSqrU =
sqr(max_);
88 for (
const label facei : faces_)
90 const scalar magSqrUi =
magSqr(Uif[facei]);
92 if (magSqrUi > maxSqrU)
94 Uif[facei] *=
sqrt(maxSqrU/
max(magSqrUi, SMALL));
103 if (!Up.fixesValue())
107 const scalar magSqrUi =
magSqr(Up[facei]);
109 if (magSqrUi > maxSqrU)
111 Up[facei] *=
sqrt(maxSqrU/
max(magSqrUi, SMALL));
120 U.correctBoundaryConditions();
Limits the maximum velocity magnitude to the specified max value.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
A class for handling words, derived from Foam::string.
Intermediate abstract class for handling face-set options for the derived faOptions.
virtual bool read(const dictionary &dict)
defineTypeNameAndDebug(limitVelocity, 0)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
faPatchField< vector > faPatchVectorField
bool useSubMesh() const noexcept
Generic templated field type.
void setSize(const label n)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
label max(const labelHashSet &set, label maxValue=labelMin)
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.
virtual bool read(const dictionary &dict)
virtual void correct(areaVectorField &U)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Base abstract class for handling finite area options (i.e. faOption).
dimensionedScalar sqrt(const dimensionedScalar &ds)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
word name(const expressions::valueTypeCode typeCode)
addToRunTimeSelectionTable(option, limitVelocity, dictionary)
Generic GeometricField class.