51 type() +
":forceCoeff",
52 mesh_.time().timeName(),
65 forceCoeff =
max(forceCoeff, scale_->value(x));
68 forceCoeff *= lambda_.value();
71 if (debug && mesh_.time().writeTime())
77 type() +
":forceCoeff",
78 mesh_.time().timeName(),
86 vForceCoeff.correctBoundaryConditions();
99 const word& modelType,
124 lambda_.dimensions(),
125 coeffs_.lookup(lambda_.name())
128 const bool foundScale = coeffs_.found(
"scale");
129 const bool foundOgn = coeffs_.found(
"origin");
130 const bool foundDir = coeffs_.found(
"direction");
131 const bool foundOgns = coeffs_.found(
"origins");
132 const bool foundDirs = coeffs_.found(
"directions");
133 const bool foundAll =
136 (foundOgn && foundDir && !foundOgns && !foundDirs)
137 || (!foundOgn && !foundDir && foundOgns && foundDirs)
139 const bool foundAny =
140 foundScale || foundOgn || foundDir || foundOgns || foundDirs;
155 directions_.setSize(1);
156 coeffs_.lookup(
"origin") >> origins_.last();
157 coeffs_.lookup(
"direction") >> directions_.last();
161 coeffs_.lookup(
"origins") >> origins_;
162 coeffs_.lookup(
"directions") >> directions_;
167 || directions_.size() == 0
168 || origins_.size() != directions_.size()
172 <<
"The same, non-zero number of origins and " 178 directions_[i] /=
mag(directions_[i]);
182 if (!foundAll && foundAny)
185 <<
"The scaling specification is incomplete. \"scale\", " 186 <<
"\"origin\" and \"direction\" (or \"origins\" and " 187 <<
"\"directions\"), must all be specified in order to scale " 188 <<
"the damping. The damping will be applied uniformly across " 192 fieldNames_ =
wordList(1, coeffs_.lookupOrDefault<
word>(
"U",
"U"));
194 applied_.setSize(1,
false);
defineTypeNameAndDebug(option, 0)
#define forAll(list, i)
Loop across all elements in list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
damping(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
virtual bool read(const dictionary &dict)
Read source dictionary.
void clear()
Delete object (if the pointer is valid) and set pointer to.
bool read(const char *, int32_t &)
virtual bool read(const dictionary &dict)
Read dictionary.
A class for handling words, derived from string.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
This boundary condition applies a zero-gradient condition from the patch internal field onto the patc...
List< word > wordList
A List of words.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
const dimensionedScalar c
Speed of light in a vacuum.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
dimensioned< scalar > mag(const dimensioned< Type > &)
Cell-set options abstract base class. Provides a base set of controls, e.g.:
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A class for managing temporary objects.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static autoPtr< Function1< Type > > New(const word &entryName, const dictionary &dict)
Selector.
tmp< volScalarField::Internal > forceCoeff() const