30 #include "dragModel.H" 31 #include "virtualMassModel.H" 64 phase1_(phaseModels_[0]),
65 phase2_(phaseModels_[1])
145 if (phase1_.divU().valid() && phase2_.divU().valid())
155 else if (phase1_.divU().valid())
163 else if (phase2_.divU().valid())
176 tmp<surfaceScalarField> alphaDbyA;
177 if (DByAfs().
found(phase1_.name()) && DByAfs().found(phase2_.name()))
181 *DByAfs()[phase1_.name()] + *DByAfs()[phase2_.name()]
196 mesh_.newIOobject(
"Sp"),
203 mesh_.newIOobject(
"Su"),
215 if (dgdt[celli] > 0.0)
220 else if (dgdt[celli] < 0.0)
247 tmp<volScalarField> trSubDeltaT;
258 !(++alphaSubCycle).
end();
269 (alphaSubCycle.index()*
Sp)(),
270 (
Su - (alphaSubCycle.index() - 1)*
Sp*
alpha1)(),
271 UniformField<scalar>(phase1_.alphaMax()),
275 if (alphaSubCycle.index() == 1)
297 UniformField<scalar>(phase1_.alphaMax()),
304 if (alphaDbyA.valid())
315 phase1_.alphaPhiRef() += alpha1Eqn.flux();
318 phase1_.alphaRhoPhiRef() =
321 phase2_.alphaPhiRef() = phi_ - phase1_.alphaPhi();
322 phase2_.correctInflowOutflow(phase2_.alphaPhiRef());
323 phase2_.alphaRhoPhiRef() =
328 <<
" Min(alpha1) = " <<
min(
alpha1).value()
329 <<
" Max(alpha1) = " <<
max(
alpha1).value()
virtual ~twoPhaseSystem()
Destructor.
phaseModel & phase1_
Phase model 1.
void clamp_range(const dimensioned< MinMax< Type >> &range)
Clamp field values (in-place) to the specified range.
bool valid() const noexcept
Identical to good(), or bool operator.
tmp< volScalarField > Kd() const
Return the drag coefficient.
fvMatrix< scalar > fvScalarMatrix
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
const word & name() const noexcept
Return the object name.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
tmp< volScalarField > sigma() const
Return the surface tension coefficient.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const volScalarField Kd(fluid.Kd())
static tmp< volScalarField > localRSubDeltaT(const fvMesh &mesh, const label nAlphaSubCycles)
Calculate and return the reciprocal of the local sub-cycling.
word alpharScheme("div(phirb,alpha)")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Calculate the matrix for the laplacian of the field.
const fvMesh & mesh() const
Return the mesh.
Calculate the snGrad of the given volField.
const volScalarField & alpha2
const dimensionSet dimless
Dimensionless.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
surfaceScalarField & phi1
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
void setFluxRequired(const word &name) const
Set flux-required for given name (mutable)
Class which solves the volume fraction equations for two phases.
#define forAll(list, i)
Loop across all elements in list.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
virtual void solve()
Solve for the phase fractions.
Calculate the first temporal derivative.
const dimensionedScalar e
Elementary charge.
phaseModel & phase2_
Phase model 2.
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
Class to represent a system of phases and model interfacial transfers between them.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Calculate the face-flux of the given field.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate the matrix for the first temporal derivative.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.
twoPhaseSystem(const fvMesh &)
Construct from fvMesh.
Calculate the field for explicit evaluation of implicit and explicit sources.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
surfaceScalarField & phi2
Calculate the divergence of the given field.
An ordered or unorder pair of phase names. Typically specified as follows.
const surfaceScalarField Kdf("Kdf", fluid.Kdf())
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
defineTypeNameAndDebug(combustionModel, 0)
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.
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.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
MULES: Multidimensional universal limiter for explicit solution.
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weightField) const
Calculate and return weighted average.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const surfaceScalarField & alphaPhi1
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Calculate the finiteVolume matrix for implicit and explicit sources.
static constexpr const zero Zero
Global zero (0)
const volScalarField & alpha1