34 void Foam::solvers::compressibleMultiphaseVoF::alphaSolve()
36 const word alphaScheme(
"div(phi,alpha)");
37 const word alpharScheme(
"div(phirb,alpha)");
42 UPtrList<const volScalarField> alphas(
phases.size());
43 PtrList<surfaceScalarField> alphaPhis(
phases.size());
49 alphas.set(phasei, &
alpha);
56 "phi" +
alpha.name() +
"Corr",
70 compressibleVoFphase& alpha2 =
phases[phasej];
72 if (&alpha2 == &
alpha)
continue;
155 if (vDot[celli] < 0.0 &&
alpha[celli] > 0.0)
157 Sp[celli] += vDot[celli]*
alpha[celli];
158 Su[celli] -= vDot[celli]*
alpha[celli];
160 else if (vDot[celli] > 0.0 &&
alpha[celli] < 1.0)
162 Sp[celli] -= vDot[celli]*(1.0 -
alpha[celli]);
170 const compressibleVoFphase& alpha2 =
phases[phasej];
172 if (&alpha2 == &
alpha)
continue;
178 if (vDot2[celli] > 0.0 && alpha2[celli] < 1.0)
180 Sp[celli] -= vDot2[celli]*(1.0 - alpha2[celli]);
181 Su[celli] += vDot2[celli]*
alpha[celli];
183 else if (vDot2[celli] < 0.0 && alpha2[celli] > 0.0)
185 Sp[celli] += vDot2[celli]*alpha2[celli];
201 Info<<
alpha.name() <<
" volume fraction, min, max = "
222 const label nAlphaSubCycles = ceil(nAlphaSubCyclesPtr->value(alphaCoNum));
224 if (nAlphaSubCycles > 1)
243 alphas.
set(phasei, &phases[phasei]);
253 !(++alphaSubCycle).end();
257 rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
DimensionedField< Type, GeoMesh, PrimitiveField > Internal
Type of the internal field from which this GeometricField is derived.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
IOobject(const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
dimensionedScalar deltaT() const
Return time step.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool set(const label) const
Is element set.
const Type & value() const
Return const reference to value.
const word & name() const
Return const reference to name.
const Time & time() const
Return the top-level database.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
tmp< surfaceScalarField > nHatf(const volScalarField &alpha1, const volScalarField &alpha2) const
const fvMesh & mesh
Region mesh.
const surfaceScalarField & phi
Reference to the mass-flux field.
surfaceScalarField rhoPhi
Mass flux field.
autoPtr< volScalarField > divU
Pointer to the momentum divergence field.
const volVectorField & U
Reference to the velocity field.
UPtrListDictionary< compressibleVoFphase > & phases
Reference to the phases.
virtual void alphaPredictor()
Solve for the phase-fractions.
compressibleMultiphaseVoFMixture & mixture
The compressible two-phase mixture.
MULES::control MULEScontrols
MULES controls.
Perform a subCycleTime on a field or list of fields.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Calculate the face-flux of the given field.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
void limitSum(const UPtrList< const volScalarField > &psis, const PtrList< surfaceScalarField > &alphaPhiBDs, UPtrList< surfaceScalarField > &psiPhis, const surfaceScalarField &phi)
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &psiPhi, const SpType &Sp, const SuType &Su)
void limit(const control &controls, const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &psiPhi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
tmp< SurfaceField< typename innerProduct< vector, Type >::type > > flux(const VolField< Type > &vf)
Return the face-flux field obtained from the given volVectorField.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
tmp< VolField< Type > > div(const SurfaceField< Type > &ssf)
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
SurfaceField< scalar > surfaceScalarField
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
VolField< scalar > volScalarField
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.