40 template<
class CloudType>
53 this->owner().db().time().
timeName(),
64 applyLimiting_(this->coeffDict().
lookup(
"applyLimiting")),
65 applyGravity_(this->coeffDict().
lookup(
"applyGravity")),
66 alphaMin_(this->coeffDict().getScalar(
"alphaMin")),
67 rhoMin_(this->coeffDict().getScalar(
"rhoMin"))
74 template<
class CloudType>
82 phiCorrect_(cm.phiCorrect_()),
83 uCorrect_(cm.uCorrect_()),
84 applyLimiting_(cm.applyLimiting_),
85 applyGravity_(cm.applyGravity_),
86 alphaMin_(cm.alphaMin_),
95 template<
class CloudType>
102 template<
class CloudType>
116 const auto& rhoAverage =
121 const auto& uAverage =
126 const auto& uSqrAverage =
132 mesh.setFluxRequired(alpha_.name());
138 alpha_ =
max(this->owner().theta(), alphaMin_);
139 alpha_.correctBoundaryConditions();
151 rho.primitiveFieldRef() =
max(rhoAverage.primitiveField(), rhoMin_);
152 rho.correctBoundaryConditions();
165 auto& tauPrime = ttauPrime.ref();
167 tauPrime.primitiveFieldRef() =
168 this->particleStressModel_->dTaudTheta
170 alpha_.primitiveField(),
171 rho.primitiveField(),
175 tauPrime.correctBoundaryConditions();
212 alphaEqn +=
fvm::div(phiGByA(), alpha_);
243 U.correctBoundaryConditions();
253 phiCorrect_.ref() -= phiGByA();
256 forAll(phiCorrect_(), facei)
259 const scalar phiCurr =
phi[facei];
260 scalar& phiCorr = phiCorrect_.ref()[facei];
264 if (phiCurr*phiCorr < 0)
270 else if (phiCorr > 0)
272 phiCorr =
max(phiCorr - phiCurr, 0);
276 phiCorr =
min(phiCorr - phiCurr, 0);
282 phiCorrect_.ref() += phiGByA();
293 uCorrect_->correctBoundaryConditions();
310 template<
class CloudType>
320 const label celli =
p.cell();
321 const label facei =
p.tetFace();
324 const vector U = uCorrect_()[celli];
328 const scalar nMag =
mag(nHat);
333 const label patchi =
mesh.boundaryMesh().whichPatch(facei);
336 phi = phiCorrect_()[facei];
341 phiCorrect_().boundaryField()[patchi]
343 mesh.boundaryMesh()[patchi].whichFace(facei)
348 const scalar t =
p.coordinates()[0];
352 return U + (1.0 - t)*nHat*(
phi/nMag - (
U & nHat));
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
Implicit model for applying an inter-particle stress to the particles.
virtual tmp< Field< Type > > primitiveField() const =0
Return an internal field of the average.
virtual void cacheFields(const bool store)
Calculate the inter particles stresses.
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
const word zeroGradientType
A zeroGradient patch field type.
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...
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > linearInterpolate(const GeometricField< Type, fvPatchField, volMesh > &vf)
const word & name() const noexcept
Return the object name.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Reconstruct volField from a face flux field.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
tmp< volScalarField > trho
Base class for packing models.
virtual ~Implicit()
Destructor.
Calculate the matrix for the laplacian of the field.
Template invariant parts for fvPatchField.
const dimensionSet dimless
Dimensionless.
Lookup type of boundary radiation properties.
const CloudType & owner() const
Return const access to the owner cloud.
#define forAll(list, i)
Loop across all elements in list.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
Implicit(const dictionary &dict, CloudType &owner)
Construct from components.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
const Time & time() const noexcept
Return time registry.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate the matrix for the first temporal derivative.
const objectRegistry & db() const noexcept
Return the local objectRegistry.
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.
const dimensionSet dimPressure
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< scalar >::calculatedType())
Return tmp field (NO_READ, NO_WRITE) from name, mesh, dimensions and patch type. [Takes current timeN...
ParcelType parcelType
Type of parcel the cloud was instantiated for.
const uniformDimensionedVectorField & g
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
virtual void cacheFields(const bool store)
Cache dependent sub-model fields.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
const dimensionSet dimDensity
Calculate the matrix for the divergence of the given field and flux.
const fvMesh & mesh() const
Return reference to the mesh.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Mesh data needed to do the Finite Volume discretisation.
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const
Calculate the velocity correction.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Defines the attributes of an object for which implicit objectRegistry management is supported...
Templated base class for dsmc cloud.
Do not request registration (bool: false)
dimensionedScalar deltaT() const
Return time step.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity