50 void Foam::fv::verticalDamping::add
53 fvMatrix<vector>& eqn,
62 const DimensionedField<scalar, volMesh>& V = mesh_.V();
70 s =
max(
s, ramp_->value(
x));
75 - V.dimensions()*(lgg.dimensions() & alphaRhoU.dimensions());
81 const label c = cells_[i];
82 force[i] = V[
c]*
s[
c]*(lgg.value() & alphaRhoU[
c]);
87 const label c = cells_[i];
88 eqn.source()[
c] += force[i];
92 if (debug && mesh_.time().writeTime())
98 type() +
":forceCoeff",
99 mesh_.time().timeName(),
117 const word& modelType,
140 add(eqn.
psi(), eqn, fieldi);
151 add(rho*eqn.
psi(), eqn, fieldi);
163 add(alpha*rho*eqn.
psi(), eqn, fieldi);
175 lambda_.dimensions(),
176 coeffs_.lookup(lambda_.name())
179 const bool foundRamp = coeffs_.found(
"ramp");
180 const bool foundOgn = coeffs_.found(
"origin");
181 const bool foundDir = coeffs_.found(
"direction");
182 const bool foundOgns = coeffs_.found(
"origins");
183 const bool foundDirs = coeffs_.found(
"directions");
184 const bool foundAll =
187 (foundOgn && foundDir && !foundOgns && !foundDirs)
188 || (!foundOgn && !foundDir && foundOgns && foundDirs)
190 const bool foundAny =
191 foundRamp || foundOgn || foundDir || foundOgns || foundDirs;
206 directions_.setSize(1);
207 coeffs_.lookup(
"origin") >> origins_.last();
208 coeffs_.lookup(
"direction") >> directions_.last();
212 coeffs_.lookup(
"origins") >> origins_;
213 coeffs_.lookup(
"directions") >> directions_;
218 || directions_.size() == 0
219 || origins_.size() != directions_.size()
223 <<
"The same, non-zero number of origins and " 229 directions_[i] /=
mag(directions_[i]);
233 if (!foundAll && foundAny)
236 <<
"The ramping specification is incomplete. \"ramp\", " 237 <<
"\"origin\" and \"direction\" (or \"origins\" and " 238 <<
"\"directions\"), must all be specified in order to ramp " 239 <<
"the damping. The damping will be applied uniformly across " 243 fieldNames_ =
wordList(1, coeffs_.lookupOrDefault<
word>(
"U",
"U"));
245 applied_.setSize(1,
false);
defineTypeNameAndDebug(option, 0)
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UniformDimensionedField< vector > uniformDimensionedVectorField
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.
static const char *const typeName
const GeometricField< Type, fvPatchField, volMesh > & psi() const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
addToRunTimeSelectionTable(option, fixedTemperatureConstraint, dictionary)
virtual bool read(const dictionary &dict)
Read source dictionary.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
void clear()
Delete object (if the pointer is valid) and set pointer to.
bool read(const char *, int32_t &)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
virtual bool read(const dictionary &dict)
Read dictionary.
List< word > wordList
A List of words.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
verticalDamping(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
#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.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Cell-set options abtract 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...
static autoPtr< Function1< Type > > New(const word &entryName, const dictionary &dict)
Selector.