54 const word& modelType,
57 const word& defaultAreaName
92 label nFacesAbove = 0;
97 for (
const label facei : faces_)
99 auto& hval = hif[facei];
103 hval *= max_/
max(hval, SMALL);
109 label nEdgesAbove = 0;
115 if (!hp.fixesValue())
117 for (
auto& hval : hp)
121 hval *= max_/
max(hval, SMALL);
130 const auto percent = [](scalar num, label denom) -> scalar
132 return (denom ? 1
e-2*round(1e4*num/denom) : 0);
136 reduce(nFacesAbove, sumOp<label>());
137 reduce(nEdgesAbove, sumOp<label>());
139 Info<<
type() <<
' ' << name_ <<
" Limited "
140 << nFacesAbove <<
" ("
141 << percent(nFacesAbove, nTotFaces)
142 <<
"%) of faces, with max limit " << max_ <<
endl;
144 if (nFacesAbove || nEdgesAbove)
148 h.correctBoundaryConditions();
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void resize(const label len)
Adjust allocated size of list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect,...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
labelList faces_
Set of faces to apply source to.
virtual bool read(const dictionary &dict)
Read source dictionary.
bool useSubMesh() const noexcept
True if sub-selection should be used.
faceSetOption(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
Construct from components.
Limits the film height to a specified max value.
limitHeight(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh, const word &defaultAreaName=word())
Construct from components.
virtual void correct(areaScalarField &h)
Correct the height field.
word hName_
Name of operand height field.
virtual bool read(const dictionary &dict)
Read dictionary.
scalar max_
Maximum height [m].
Base abstract class for handling finite area options (i.e. faOption).
const fvMesh & mesh() const noexcept
Return const access to the volume mesh.
List< bool > applied_
Applied flag list - corresponds to each fieldNames_ entry.
wordList fieldNames_
Field names to apply source to - populated by derived models.
dictionary coeffs_
Dictionary containing source coefficients.
const word & name() const noexcept
The source name.
const word name_
Source name.
Mesh data needed to do the Finite Volume discretisation.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Namespace for finite-area.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void reduce(T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Reduce inplace (cf. MPI Allreduce).
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
faPatchField< scalar > faPatchScalarField