72 const scalar magU =
mag(
U[celli]);
86 const auto percent = [](scalar num, label denom) -> scalar
88 return (denom ? 1
e-2*round(1e4*num/denom) : 0);
93 << percent(nDamped, nTotCells)
94 <<
"%) of cells, with max limit " <<
UMax_ <<
endl;
103 const word& modelType,
128 dict_.writeEntry(name_,
os);
136 coeffs_.readEntry(
"UMax", UMax_);
138 if (!coeffs_.readIfPresent(
"UNames", fieldNames_))
140 fieldNames_.resize(1);
141 fieldNames_.first() = coeffs_.getOrDefault<
word>(
"U",
"U");
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Mesh data needed to do the Finite Volume discretisation.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
labelList cells_
Set of cells to apply source to.
Base abstract class for handling finite volume options (i.e. fvOption).
const fvMesh & mesh_
Reference to the mesh database.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const word name_
Source name.
Constrain given velocity fields to dampen velocity fluctuations exceeding a given value within a spec...
scalar UMax_
Maximum velocity magnitude.
virtual void writeData(Ostream &os) const
Write data.
void addDamping(fvMatrix< vector > &eqn)
Constrain the given velocity fields by a given maximum value.
virtual bool read(const dictionary &dict)
Read dictionary.
virtual void constrain(fvMatrix< vector > &eqn, const label fieldi)
Constrain vector matrix.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
messageStream Info
Information stream (stdout output on master, null elsewhere)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
dimensionedScalar cbrt(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
void diag(pointPatchField< vector > &, const pointPatchField< tensor > &)