63 typeName +
":dragCoeff",
76 const scalar a =
aZone_[i];
82 for (label zonei : zones)
86 for (label celli : cz)
108 typeName +
":inertiaCoeff",
109 mesh_.time().timeName(),
117 auto& inertiaCoeff = tinertiaCoeff.ref();
123 const scalar a = aZone_[i];
124 const scalar
N = NZone_[i];
125 const scalar Cm = CmZone_[i];
129 for (label zonei : zones)
131 const cellZone& cz = mesh_.cellZones()[zonei];
133 for (label celli : cz)
135 inertiaCoeff[celli] = 0.25*(Cm+1)*pi*a*a*
N;
140 inertiaCoeff.correctBoundaryConditions();
142 return tinertiaCoeff;
151 const word& modelType,
211 if (!coeffs_.readIfPresent(
"UNames", fieldNames_))
213 fieldNames_.resize(1);
214 fieldNames_.first() = coeffs_.getOrDefault<
word>(
"U",
"U");
219 const dictionary& regionsDict(coeffs_.subDict(
"regions"));
232 const word zoneName(modelDict.
get<
word>(
"cellZone"));
234 zoneIDs_[i] = mesh_.cellZones().indices(zoneName);
235 if (zoneIDs_[i].empty())
238 <<
"Unable to find cellZone " << zoneName <<
nl
239 <<
"Valid cellZones are:" << mesh_.cellZones().names()
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
virtual bool read()
Re-read model coefficients if they have changed.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
static word timeName(const scalar t, const int precision=precision_)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
wordList toc() const
Return the table of contents.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A special matrix type and solver, designed for finite volume solutions of scalar equations....
const GeometricField< Type, fvPatchField, volMesh > & psi(const label i=0) const
Return psi.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
labelListList zoneIDs_
Porosity coefficient.
virtual bool read(const dictionary &dict)
Read dictionary.
tmp< volScalarField > dragCoeff(const volVectorField &U) const
Return the drag force coefficient.
scalarList aZone_
Width of the vegetation element.
tmp< volScalarField > inertiaCoeff() const
Return the inertia force coefficient.
scalarList NZone_
Number of plants per unit of area.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add implicit contribution to momentum equation.
scalarList CdZone_
Drag coefficient.
Base abstract class for handling finite volume options (i.e. fvOption).
const fvMesh & mesh_
Reference to the mesh database.
void resetApplied()
Resize/reset applied flag list for all fieldNames_ entries.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Calculate the matrix for the first temporal derivative.
Calculate the finiteVolume matrix for implicit and explicit sources.
constexpr scalar pi(M_PI)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
const dimensionSet dimless
Dimensionless.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
const Vector< label > N(dict.get< Vector< label > >("N"))