46 multiphaseMangrovesTurbulenceModel,
79 const scalar a =
aZone_[i];
88 for (label celli : cz)
95 kCoeff.correctBoundaryConditions();
111 typeName +
":epsilonCoeff",
112 mesh_.time().timeName(),
125 const scalar a = aZone_[i];
126 const scalar
N = NZone_[i];
127 const scalar Cep = CepZone_[i];
128 const scalar Cd = CdZone_[i];
130 for (label zonei : zoneIDs_[i])
132 const cellZone& cz = mesh_.cellZones()[zonei];
134 for (label celli : cz)
136 epsilonCoeff[celli] = Cep*Cd*a*
N*
mag(
U[celli]);
141 epsilonCoeff.correctBoundaryConditions();
143 return tepsilonCoeff;
149 Foam::fv::multiphaseMangrovesTurbulenceModel::multiphaseMangrovesTurbulenceModel
152 const word& modelType,
165 epsilonName_(
"epsilon")
181 if (eqn.
psi().
name() == epsilonName_)
189 else if (eqn.
psi().
name() == kName_)
209 if (eqn.
psi().
name() == epsilonName_)
217 else if (eqn.
psi().
name() == kName_)
219 fvMatrix<scalar> kEqn
232 if (!coeffs_.readIfPresent(
"epsilonNames", fieldNames_))
234 if (coeffs_.found(
"epsilon"))
236 fieldNames_.resize(1);
237 coeffs_.readEntry(
"epsilon", fieldNames_.first());
241 fieldNames_.resize(2);
242 fieldNames_[0] =
"epsilon";
243 fieldNames_[1] =
"k";
249 const dictionary& regionsDict(coeffs_.subDict(
"regions"));
261 const dictionary& modelDict = regionsDict.subDict(
regionName);
263 const word zoneName(modelDict.get<word>(
"cellZone"));
265 zoneIDs_[i] = mesh_.cellZones().indices(zoneName);
266 if (zoneIDs_[i].empty())
269 <<
"Unable to find cellZone " << zoneName <<
nl 270 <<
"Valid cellZones are:" << mesh_.cellZones().names()
274 modelDict.readEntry(
"a", aZone_[i]);
275 modelDict.readEntry(
"N", NZone_[i]);
276 modelDict.readEntry(
"Ckp", CkpZone_[i]);
277 modelDict.readEntry(
"Cep", CepZone_[i]);
278 modelDict.readEntry(
"Cd", CdZone_[i]);
virtual bool read(const dictionary &dict)
Read dictionary.
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.
const word & name() const noexcept
Return the object name.
scalarList NZone_
Number of plants per unit of area.
constexpr char nl
The newline '\n' character (0x0a)
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
tmp< volScalarField > kCoeff(const volVectorField &U) const
Return the k coefficient.
const Time & time() const
Return the top-level database.
labelListList zoneIDs_
Zone indices.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Foam::word regionName(Foam::polyMesh::defaultRegion)
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 INVALID.
A class for handling words, derived from Foam::string.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
virtual bool read(const dictionary &dict)
Read source dictionary.
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.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
addToRunTimeSelectionTable(option, atmAmbientTurbSource, dictionary)
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Add implicit contribution to momentum equation.
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
const Vector< label > N(dict.get< Vector< label >>("N"))
List< word > wordList
List of word.
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.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef()
tmp< volScalarField > epsilonCoeff(const volVectorField &U) const
Return the epsilon coefficient.
A class for managing temporary objects.
scalarList aZone_
Width of the vegetation element.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Calculate the finiteVolume matrix for implicit and explicit sources.
scalarList CdZone_
Drag coefficient.
Base abstract class for handling finite volume options (i.e. fvOption).
static constexpr const zero Zero
Global zero (0)