38 namespace porosityModels
48 void Foam::porosityModels::fixedCoeff::apply
66 const label celli =
cells[i];
68 const tensor Cd =
rho*(alphaZones[j] + betaZones[j]*
mag(
U[celli]));
69 const scalar isoCd =
tr(Cd);
71 Udiag[celli] += V[celli]*isoCd;
72 Usource[celli] -= V[celli]*((Cd -
I*isoCd) &
U[celli]);
78 void Foam::porosityModels::fixedCoeff::apply
85 forAll(cellZoneIDs_, zoneI)
94 const label celli =
cells[i];
95 const label j = fieldIndex(i);
107 Foam::porosityModels::fixedCoeff::fixedCoeff
110 const word& modelType,
113 const wordRe& cellZoneName
119 alpha_(cellZoneIDs_.size()),
120 beta_(cellZoneIDs_.size())
135 alphaCoeff.xx() = alphaXYZ_.value().x();
136 alphaCoeff.yy() = alphaXYZ_.value().y();
137 alphaCoeff.zz() = alphaXYZ_.value().z();
141 betaCoeff.xx() = betaXYZ_.value().x();
142 betaCoeff.yy() = betaXYZ_.value().y();
143 betaCoeff.zz() = betaXYZ_.value().z();
147 forAll(cellZoneIDs_, zonei)
149 alpha_[zonei].resize(1);
150 beta_[zonei].resize(1);
152 alpha_[zonei] = csys().transform(alphaCoeff);
153 beta_[zonei] = csys().transform(betaCoeff);
158 forAll(cellZoneIDs_, zonei)
163 mesh_.cellZones()[cellZoneIDs_[zonei]]
166 alpha_[zonei] = csys().transform(cc, alphaCoeff);
167 beta_[zonei] = csys().transform(cc, betaCoeff);
184 const scalar rhoRef = coeffs_.
get<scalar>(
"rhoRef");
188 force = Udiag*
U - Usource;
205 coeffs_.readEntry(
"rhoRef",
rho);
227 coeffs_.readEntry(
"rhoRef",
rho);
245 coeffs_.readEntry(
"rhoRef",
rho);
254 dict_.writeEntry(name_,
os);
defineTypeNameAndDebug(powerLawLopesdaCosta, 0)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
addToRunTimeSelectionTable(porosityModel, powerLawLopesdaCosta, mesh)
static void apply(bitSet &selection, const Detail::parcelSelection::actionType action, const Predicate &accept, const UList< Type > &list, const AccessOp &aop)
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type get(const label i) const
Return bool value at specified position, always false for out-of-range access.
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
label fieldIndex(const label index) const
Return label index.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
void adjustNegativeResistance(dimensionedVector &resist)
Adjust negative resistance values to be multiplier of max value.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static const Identity< scalar > I
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void calcTransformModelData()
Transform the model data wrt mesh changes.
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.
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const fvMesh & mesh_
Reference to the mesh database.
const dimensionSet dimForce
OBJstream os(runTime.globalPath()/outputName)
labelList cellZoneIDs_
Cell zone IDs.
const dimensionedScalar mu
Atomic mass unit.
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
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.
bool writeData(Ostream &os) const
Write.
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.
virtual void calcForce(const volVectorField &U, const volScalarField &rho, const volScalarField &mu, vectorField &force) const
Calculate the porosity force.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
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)