47 multiphaseMangrovesSource,
70 const scalar a =
aZone_[i];
76 for (label zonei : zones)
80 for (label celli : cz)
105 auto& inertiaCoeff = tinertiaCoeff.ref();
111 const scalar a = aZone_[i];
112 const scalar
N = NZone_[i];
113 const scalar Cm = CmZone_[i];
117 for (label zonei : zones)
119 const cellZone& cz = mesh_.cellZones()[zonei];
121 for (label celli : cz)
123 inertiaCoeff[celli] = 0.25*(Cm+1)*
pi*a*a*
N;
128 inertiaCoeff.correctBoundaryConditions();
130 return tinertiaCoeff;
136 Foam::fv::multiphaseMangrovesSource::multiphaseMangrovesSource
139 const word& modelType,
199 if (!coeffs_.readIfPresent(
"UNames", fieldNames_))
201 fieldNames_.resize(1);
202 fieldNames_.first() = coeffs_.getOrDefault<
word>(
"U",
"U");
207 const dictionary& regionsDict(coeffs_.subDict(
"regions"));
220 const word zoneName(modelDict.
get<
word>(
"cellZone"));
222 zoneIDs_[i] = mesh_.cellZones().indices(zoneName);
223 if (zoneIDs_[i].empty())
226 <<
"Unable to find cellZone " << zoneName <<
nl 227 <<
"Valid cellZones are:" << mesh_.cellZones().names()
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
defineTypeNameAndDebug(atmAmbientTurbSource, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const fvMesh & mesh_
Reference to the mesh database.
constexpr char nl
The newline '\n' character (0x0a)
scalarList CdZone_
Drag coefficient.
const dimensionSet dimless
Dimensionless.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
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...
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate the matrix for the first temporal derivative.
virtual bool read(const dictionary &dict)
Read source dictionary.
scalarList NZone_
Number of plants per unit of area.
constexpr scalar pi(M_PI)
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.
tmp< volScalarField > dragCoeff(const volVectorField &U) const
Return the drag force coefficient.
labelListList zoneIDs_
Porosity coefficient.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
scalarList aZone_
Width of the vegetation element.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual bool read(const dictionary &dict)
Read dictionary.
const Vector< label > N(dict.get< Vector< label >>("N"))
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add implicit contribution to momentum equation.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
A special matrix type and solver, designed for finite volume solutions of scalar equations.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
A class for managing temporary objects.
tmp< volScalarField > inertiaCoeff() const
Return the inertia force coefficient.
Do not request registration (bool: false)
Calculate the finiteVolume matrix for implicit and explicit sources.
Base abstract class for handling finite volume options (i.e. fvOption).
static constexpr const zero Zero
Global zero (0)