26 #include "twoPhaseSystem.H" 27 #include "dragModel.H" 28 #include "virtualMassModel.H" 61 phase1_(phaseModels_[0]),
62 phase2_(phaseModels_[1])
64 phase2_.volScalarField::operator=(scalar(1) - phase1_);
67 mesh.setFluxRequired(alpha1.name());
121 const Time& runTime = mesh_.time();
126 const dictionary& alphaControls = mesh_.solverDict(alpha1.name());
133 word alphaScheme(
"div(phi," + alpha1.name() +
')');
140 tmp<volScalarField::Internal> tdgdt;
142 if (phase1_.divU().valid() && phase2_.divU().valid())
152 else if (phase1_.divU().valid())
160 else if (phase2_.divU().valid())
173 tmp<surfaceScalarField> alphaDbyA;
174 if (DByAfs().
found(phase1_.name()) && DByAfs().found(phase2_.name()))
178 *DByAfs()[phase1_.name()] + *DByAfs()[phase2_.name()]
222 if (dgdt[celli] > 0.0)
224 Sp[celli] -= dgdt[celli]/
max(1 - alpha1[celli], 1
e-4);
225 Su[celli] += dgdt[celli]/
max(1 - alpha1[celli], 1
e-4);
227 else if (dgdt[celli] < 0.0)
229 Sp[celli] += dgdt[celli]/
max(alpha1[celli], 1
e-4);
254 tmp<volScalarField> trSubDeltaT;
265 !(++alphaSubCycle).end();
276 (alphaSubCycle.index()*
Sp)(),
277 (
Su - (alphaSubCycle.index() - 1)*
Sp*alpha1)(),
278 UniformField<scalar>(phase1_.alphaMax()),
282 if (alphaSubCycle.index() == 1)
304 UniformField<scalar>(phase1_.alphaMax()),
311 if (alphaDbyA.valid())
322 phase1_.alphaPhiRef() += alpha1Eqn.flux();
325 phase1_.alphaRhoPhiRef() =
328 phase2_.alphaPhiRef() = phi_ - phase1_.alphaPhi();
329 phase2_.correctInflowOutflow(phase2_.alphaPhiRef());
330 phase2_.alphaRhoPhiRef() =
333 Info<< alpha1.name() <<
" volume fraction = " 334 << alpha1.weightedAverage(mesh_.V()).value()
335 <<
" Min(alpha1) = " <<
min(alpha1).value()
336 <<
" Max(alpha1) = " <<
max(alpha1).value()
343 alpha2 = scalar(1) -
alpha1;
fvMatrix< scalar > fvScalarMatrix
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
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< volScalarField > sigma() const
Return the surface tension 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.
Calculate the snGrad of the given volField.
const surfaceScalarField & alphaPhi1
surfaceScalarField alphaPhi10(alphaPhi10Header, phi *fvc::interpolate(alpha1))
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
const volScalarField Kd(fluid.Kd())
tmp< volScalarField > Kd() const
Return the drag coefficient.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Calculate the first temporal derivative.
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Calculate the face-flux of the given field.
const volScalarField & alpha1
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate 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)
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
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.
virtual void solve()
Solve for the phase fractions.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
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 surfaceScalarField Kdf("Kdf", fluid.Kdf())
MULES: Multidimensional universal limiter for explicit solution.
const doubleScalar e
Elementary charge.
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
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 matrix for implicit and explicit sources.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.