26 #include "twoPhaseSystem.H" 27 #include "dragModel.H" 28 #include "virtualMassModel.H" 60 phase1_(phaseModels_[0]),
61 phase2_(phaseModels_[1])
63 phase2_.volScalarField::operator=(scalar(1) - phase1_);
66 mesh.setFluxRequired(alpha1.name());
173 return transfersMass(
phase1());
189 const Time& runTime = mesh_.time();
194 const dictionary& alphaControls = mesh_.solverDict(alpha1.name());
201 word alphaScheme(
"div(phi," + alpha1.name() +
')');
209 tmp<volScalarField::Internal> tdgdt;
211 if (phase1_.divU().valid() && phase2_.divU().valid())
221 else if (phase1_.divU().valid())
229 else if (phase2_.divU().valid())
244 tmp<surfaceScalarField> alphaDbyA;
291 if (dgdt[celli] > 0.0)
293 Sp[celli] -= dgdt[celli]/
max(1.0 - alpha1[celli], 1
e-4);
294 Su[celli] += dgdt[celli]/
max(1.0 - alpha1[celli], 1
e-4);
296 else if (dgdt[celli] < 0.0)
298 Sp[celli] += dgdt[celli]/
max(alpha1[celli], 1
e-4);
319 surfaceScalarField::Boundary& alphaPhic1Bf =
320 alphaPhic1.boundaryFieldRef();
327 if (!alphaPhic1p.coupled())
332 forAll(alphaPhic1p, facei)
334 if (phi1p[facei] < 0)
336 alphaPhic1p[facei] = alpha1p[facei]*phi1p[facei];
344 tmp<volScalarField> trSubDeltaT;
355 !(++alphaSubCycle).end();
366 (alphaSubCycle.index()*
Sp)(),
367 (
Su - (alphaSubCycle.index() - 1)*
Sp*alpha1)(),
372 if (alphaSubCycle.index() == 1)
374 phase1_.alphaPhi() = alphaPhic10;
378 phase1_.alphaPhi() += alphaPhic10;
398 phase1_.alphaPhi() = alphaPhic1;
401 if (alphaDbyA.valid())
412 phase1_.alphaPhi() += alpha1Eqn.flux();
415 phase1_.alphaRhoPhi() =
418 phase2_.alphaPhi() = phi - phase1_.alphaPhi();
419 alpha2 = scalar(1) -
alpha1;
420 phase2_.alphaRhoPhi() =
423 Info<< alpha1.name() <<
" volume fraction = " 424 << alpha1.weightedAverage(mesh_.V()).value()
425 <<
" Min(alpha1) = " <<
min(alpha1).value()
426 <<
" Max(alpha1) = " <<
max(alpha1).value()
fvsPatchField< scalar > fvsPatchScalarField
fvMatrix< scalar > fvScalarMatrix
#define forAll(list, i)
Loop across all elements in list.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.
const virtualMassModel & virtualMass(const phaseModel &phase) const
Return the virtual mass model for the given phase.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< surfaceScalarField > Ff() const
Return the combined face-force (lift + wall-lubrication)
tmp< volVectorField > F() const
Return the combined force (lift + wall-lubrication)
const double e
Elementary charge.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const phaseModel & phase() const
tmp< volScalarField > D() const
Return the turbulent diffusivity.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
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)")
tmp< surfaceScalarField > Vmf() const
Return the face virtual mass coefficient.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
Calculate the matrix for the laplacian of the field.
tmp< GeometricField< Type, fvPatchField, volMesh > > Sp(const volScalarField &sp, const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate the snGrad of the given volField.
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
surfaceScalarField phir(phic *interface.nHatf())
tmp< volScalarField > sigma() const
Return the surface tension coefficient.
surfaceScalarField Ff(fluid.Ff())
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
surfaceScalarField Kdf("Kdf", fluid.Kdf())
Calculate the first temporal derivative.
volScalarField Kd(fluid.Kd())
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
bool transfersMass() const
Return true if there is mass transfer.
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
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)
Calulate the matrix for the first temporal derivative.
twoPhaseSystem(const fvMesh &)
Construct from fvMesh.
Calculate the field for explicit evaluation of implicit and explicit sources.
label readLabel(Istream &is)
Calculate the divergence of the given field.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
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 phaseModel & otherPhase() const
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
virtual void solve()
Solve for the phase fractions.
tmp< volScalarField > Kd() const
Return the drag coefficient.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
virtual ~twoPhaseSystem()
Destructor.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void correctBoundaryConditions()
Correct boundary field.
const dragModel & drag(const phaseModel &phase) const
Return the drag model for the given phase.
MULES: Multidimensional universal limiter for explicit solution.
tmp< volScalarField > dmdt() const
Return the interfacial mass flow rate.
surfaceScalarField Vmf("Vmf", fluid.Vmf())
A class for managing temporary objects.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Calculate the matrix for implicit and explicit sources.