39 namespace porosityModels
49 Foam::porosityModels::DarcyForchheimer::DarcyForchheimer
52 const word& modelType,
61 D_(cellZoneIDs_.size()),
62 F_(cellZoneIDs_.size()),
63 rhoName_(coeffs_.getOrDefault<
word>(
"rho",
"rho")),
64 muName_(coeffs_.getOrDefault<
word>(
"mu",
"thermo:mu")),
65 nuName_(coeffs_.getOrDefault<
word>(
"nu",
"nu"))
80 darcyCoeff.xx() = dXYZ_.value().x();
81 darcyCoeff.yy() = dXYZ_.value().y();
82 darcyCoeff.zz() = dXYZ_.value().z();
87 forchCoeff.xx() = 0.5*fXYZ_.value().x();
88 forchCoeff.yy() = 0.5*fXYZ_.value().y();
89 forchCoeff.zz() = 0.5*fXYZ_.value().z();
93 forAll(cellZoneIDs_, zonei)
98 D_[zonei] = csys().transform(darcyCoeff);
99 F_[zonei] = csys().transform(forchCoeff);
104 forAll(cellZoneIDs_, zonei)
109 mesh_.cellZones()[cellZoneIDs_[zonei]]
112 D_[zonei] = csys().transform(cc, darcyCoeff);
113 F_[zonei] = csys().transform(cc, forchCoeff);
122 mesh_.time().writeTime()
123 || mesh_.time().timeIndex() == mesh_.time().startTimeIndex()
141 forAll(cellZoneIDs_, zonei)
145 if (csys().uniform())
147 UIndirectList<tensor>(Dout,
cells) = D_[zonei].first();
148 UIndirectList<tensor>(Fout,
cells) = F_[zonei].first();
152 UIndirectList<tensor>(Dout,
cells) = D_[zonei];
153 UIndirectList<tensor>(Fout,
cells) = F_[zonei];
177 force = Udiag*
U - Usource;
218 apply(Udiag, Usource, V, geometricOneField(),
nu,
U);
287 dict_.writeEntry(name_,
os);
bool writeData(Ostream &os) const
Write.
defineTypeNameAndDebug(powerLawLopesdaCosta, 0)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
addToRunTimeSelectionTable(porosityModel, powerLawLopesdaCosta, mesh)
GeometricField< tensor, fvPatchField, volMesh > volTensorField
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static void apply(bitSet &selection, const Detail::parcelSelection::actionType action, const Predicate &accept, const UList< Type > &list, const AccessOp &aop)
const dimensionSet dimless
Dimensionless.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
void adjustNegativeResistance(dimensionedVector &resist)
Adjust negative resistance values to be multiplier of max value.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
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.
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< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
const dimensionSet dimForce
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
const dimensionedScalar mu
Atomic mass unit.
virtual void correct(fvVectorMatrix &UEqn) const
Add resistance.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Mesh data needed to do the Finite Volume discretisation.
fvMatrix< vector > fvVectorMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
UIndirectList< point > pointUIndList
UIndirectList of point.
Tensor of scalars, i.e. Tensor<scalar>.
Top level model for porosity models.
static constexpr const zero Zero
Global zero (0)