35 namespace porosityModels
45 Foam::porosityModels::DarcyForchheimer::DarcyForchheimer
48 const word& modelType,
51 const word& cellZoneName
57 D_(cellZoneIDs_.size()),
58 F_(cellZoneIDs_.size()),
59 rhoName_(coeffs_.lookupOrDefault<
word>(
"rho",
"rho")),
60 muName_(coeffs_.lookupOrDefault<
word>(
"mu",
"thermo:mu")),
61 nuName_(coeffs_.lookupOrDefault<
word>(
"nu",
"nu"))
63 adjustNegativeResistance(dXYZ_);
64 adjustNegativeResistance(fXYZ_);
66 calcTransformModelData();
80 if (coordSys_.R().uniform())
82 forAll(cellZoneIDs_, zoneI)
88 D_[zoneI][0].xx() = dXYZ_.value().x();
89 D_[zoneI][0].yy() = dXYZ_.value().y();
90 D_[zoneI][0].zz() = dXYZ_.value().z();
92 D_[zoneI][0] = coordSys_.R().transformTensor(D_[zoneI][0]);
96 F_[zoneI][0].xx() = 0.5*fXYZ_.value().x();
97 F_[zoneI][0].yy() = 0.5*fXYZ_.value().y();
98 F_[zoneI][0].zz() = 0.5*fXYZ_.value().z();
100 F_[zoneI][0] = coordSys_.R().transformTensor(F_[zoneI][0]);
105 forAll(cellZoneIDs_, zoneI)
109 D_[zoneI].setSize(cells.
size());
110 F_[zoneI].setSize(cells.
size());
115 D_[zoneI][i].xx() = dXYZ_.value().x();
116 D_[zoneI][i].yy() = dXYZ_.value().y();
117 D_[zoneI][i].zz() = dXYZ_.value().z();
121 F_[zoneI][i].xx() = 0.5*fXYZ_.value().x();
122 F_[zoneI][i].yy() = 0.5*fXYZ_.value().y();
123 F_[zoneI][i].zz() = 0.5*fXYZ_.value().z();
133 if (debug && mesh_.time().writeTime())
140 mesh_.time().timeName(),
153 mesh_.time().timeName(),
183 apply(Udiag, Usource, V, rho, mu, U);
185 force = Udiag*U - Usource;
212 apply(Udiag, Usource, V, rho, mu, U);
219 apply(Udiag, Usource, V, rho, rho*nu, U);
256 apply(Udiag, Usource, V, rho, mu, U);
277 apply(AU, rho, mu, U);
static word group(const word &name)
Return group (extension part of name)
Abstract base class for coordinate rotation.
bool writeData(Ostream &os) const
Write.
#define forAll(list, i)
Loop across all elements in list.
defineTypeNameAndDebug(powerLawLopesdaCosta, 0)
Ostream & indent(Ostream &os)
Indent stream.
A list of keyword definitions, which are a keyword followed by any number of values (e...
addToRunTimeSelectionTable(porosityModel, powerLawLopesdaCosta, mesh)
const GeometricField< Type, fvPatchField, volMesh > & psi() const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
virtual ~DarcyForchheimer()
Destructor.
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
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.
A class for handling words, derived from string.
static word groupName(Name name, const word &group)
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const dimensionSet dimForce
virtual tmp< tensorField > transformTensor(const tensorField &st) const =0
Transform tensor field using transformation tensorField.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
#define R(A, B, C, D, E, F, K, M)
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.
A List with indirect addressing.
A special matrix type and solver, designed for finite volume solutions of scalar equations.
virtual Ostream & write(const token &)=0
Write next token to stream.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Top level model for porosity models.
const dimensionSet & dimensions() const