45 UName_ = coeffs().lookupOrDefault<
word>(
"U",
"U");
52 coeffs().lookup(lambda_.name())
55 const bool foundScale = coeffs().found(
"scale");
56 const bool foundOgn = coeffs().found(
"origin");
57 const bool foundDir = coeffs().found(
"direction");
58 const bool foundOgns = coeffs().found(
"origins");
59 const bool foundDirs = coeffs().found(
"directions");
63 (foundOgn && foundDir && !foundOgns && !foundDirs)
64 || (!foundOgn && !foundDir && foundOgns && foundDirs)
67 foundScale || foundOgn || foundDir || foundOgns || foundDirs;
82 directions_.setSize(1);
83 coeffs().lookup(
"origin") >> origins_.last();
84 coeffs().lookup(
"direction") >> directions_.last();
88 coeffs().lookup(
"origins") >> origins_;
89 coeffs().lookup(
"directions") >> directions_;
94 || directions_.size() == 0
95 || origins_.size() != directions_.size()
99 <<
"The same, non-zero number of origins and " 105 directions_[i] /=
mag(directions_[i]);
109 if (!foundAll && foundAny)
112 <<
"The scaling specification is incomplete. \"scale\", " 113 <<
"\"origin\" and \"direction\" (or \"origins\" and " 114 <<
"\"directions\"), must all be specified in order to scale " 115 <<
"the damping. The damping will be applied uniformly across " 129 type() +
":forceCoeff",
142 const scalarField x((c - origins_[i]) & directions_[i]);
143 forceCoeff =
max(forceCoeff, scale_->value(x));
146 forceCoeff *= lambda_.value();
149 if (debug &&
mesh().time().writeTime())
155 type() +
":forceCoeff",
160 lambda_.dimensions(),
164 vForceCoeff.correctBoundaryConditions();
177 const word& modelType,
182 fvModel(name, modelType, dict, mesh),
defineTypeNameAndDebug(fixedTemperatureConstraint, 0)
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
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...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool read(const dictionary &dict)
Read source dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void readCoeffs()
Non-virtual read.
Finite volume model abstract base class.
damping(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
const dimensionSet dimless
const dimensionedScalar c
Speed of light in a vacuum.
void clear()
Delete object (if the pointer is valid) and set pointer to.
const dimensionSet dimTime
virtual bool read(const dictionary &dict)
Read dictionary.
A class for handling words, derived from string.
static const word null
An empty word.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
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.
#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.
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...
dimensioned< scalar > mag(const dimensioned< Type > &)
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...
tmp< volScalarField::Internal > forceCoeff() const
Return the force coefficient.
static autoPtr< Function1< Type > > New(const word &name, const dictionary &dict)
Selector.