59 const bool splitPhaseFlux
66 const bool meanFluxReference
84 label solvePhasesi = 0;
100 phases()[phasei].correctBoundaryConditions();
128 bool dilatation =
false;
194 if (&phase2 != &phase)
196 if (phase.
divU().valid())
198 dgdt += alpha2()*phase.
divU()()();
201 if (phase2.
divU().valid())
215 Sp[celli] -= dgdt[celli]/
max(1 -
alpha[celli], 1
e-4);
216 Su[celli] += dgdt[celli]/
max(1 -
alpha[celli], 1
e-4);
218 else if (dgdt[celli] < 0)
237 alphaPtrs[phasei] = &
phases()[phasei];
247 !(++alphaSubCycle).
end();
272 splitPhaseFlux ?
phi_ : phase.
phi()(),
274 "div(phi," +
alpha.name() +
')'
288 if (&phase2 == &phase)
continue;
305 min(cAlpha()*phic,
max(phic))
309 const word phirScheme
331 if (&phase2 == &phase)
continue;
342 phase.
phi() - phase2.
phi()
352 min(cAlpha()*phic,
max(phic))
356 const word phirScheme
415 alphasMoving.
set(movingPhasei, &phase);
420 &alphaPhis[phase.
index()]
427 forAll(solvePhases, solvePhasei)
444 if (alphaSubCycle.index() == 1)
459 forAll(solvePhases, solvePhasei)
477 forAll(solvePhases, solvePhasei)
481 Info<< phase.
name() <<
" fraction, min, max = "
483 <<
' ' <<
min(phase).value()
484 <<
' ' <<
max(phase).value()
488 if (referencePhasePtr)
491 referenceAlpha = alphaVoid;
493 forAll(solvePhases, solvePhasei)
495 referenceAlpha -= solvePhases[solvePhasei];
516 Info<<
"Phase-sum volume fraction, min, max = "
518 .weightedAverage(
mesh_.
V()).value()
533 forAll(solvePhases, solvePhasei)
541 forAll(solvePhases, solvePhasei)
551 if (referencePhasePtr)
553 phaseModel& referencePhase = *referencePhasePtr;
557 forAll(solvePhases, solvePhasei)
568 referenceAlpha = alphaVoid;
570 forAll(solvePhases, solvePhasei)
572 referenceAlpha -= solvePhases[solvePhasei];
MULES: Multidimensional universal limiter for explicit solution.
#define forAll(list, i)
Loop across all elements in list.
const label nAlphaSubCycles(alphaControls.lookup< label >("nAlphaSubCycles"))
const dictionary & alphaControls
const label nAlphaCorr(alphaControls.lookup< label >("nAlphaCorr"))
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &, const Field< Type > &)
Return a temporary field constructed from name, mesh,.
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &) const
Calculate and return weighted average.
Generic GeometricField class.
void maxMin(const dimensioned< Type > &minDt, const dimensioned< Type > &maxDt)
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
bool empty() const
Return true if the hash table is empty.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
friend class const_iterator
Declare friendship with the const_iterator.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const word & name() const
Return name.
static word groupName(Name name, const word &group)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
bool set(const label) const
Is element set.
label size() const
Return the number of elements in the UPtrList.
void setSize(const label)
Reset size of UPtrList. This can only be used to set the size.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const word & name() const
Return const reference to name.
A special matrix type and solver, designed for finite volume solutions of scalar equations....
SolverPerformance< Type > solve(const dictionary &)
Solve segregated or coupled returning the solution statistics.
tmp< SurfaceField< Type > > flux() const
Return the face-flux field from the matrix.
const Time & time() const
Return the top-level database.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
const fvSolution & solution() const
Return the fvSchemes.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
static tmp< volScalarField > localRSubDeltaT(const fvMesh &mesh, const label nAlphaSubCycles)
Calculate and return the reciprocal of the local sub-cycling.
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Class to represent an interface between phases. Derivations can further specify the configuration of ...
scalar alphaMax() const
Return the maximum phase-fraction (e.g. packing limit)
virtual const autoPtr< volScalarField > & divU() const =0
Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual tmp< surfaceScalarField > phi() const =0
Return the volumetric flux.
label index() const
Return the index of the phase.
virtual surfaceScalarField & alphaRhoPhiRef()=0
Access the mass flux of the phase.
virtual tmp< volVectorField > U() const =0
Return the velocity.
virtual surfaceScalarField & alphaPhiRef()=0
Access the volumetric flux of the phase.
void correctInflowOutflow(surfaceScalarField &alphaPhi) const
Ensure that the flux at inflow/outflow BCs is preserved.
const word & name() const
Return the name of this phase.
virtual const volScalarField & rho() const =0
Return the density field.
virtual tmp< surfaceScalarField > alphaPhi() const =0
Return the volumetric flux of the phase.
const fvMesh & mesh_
Reference to the mesh.
const phaseModelPartialList & movingPhases() const
Return the models for phases that are moving.
const phaseModelList & phases() const
Return the phase models.
virtual void solve(const PtrList< volScalarField > &rAUs, const PtrList< surfaceScalarField > &rAUfs)
Solve for the phase fractions.
cAlphaTable cAlphas_
Interface compression coefficients.
const phaseModelPartialList & stationaryPhases() const
Return the models for phases that are stationary.
surfaceScalarField phi_
Total volumetric flux.
virtual bool implicitPhasePressure() const
Returns true if the phase pressure is treated implicitly.
tmp< volScalarField > sumAlphaMoving() const
Return the sum of the phase fractions of the moving phases.
tmp< surfaceScalarField > nHatf(const volScalarField &alpha1, const volScalarField &alpha2) const
Normal to interface between two phases dotted with face areas.
virtual tmp< surfaceScalarField > alphaDByAf(const PtrList< volScalarField > &rAUs, const PtrList< surfaceScalarField > &rAUfs) const =0
Return the phase diffusivity.
word referencePhaseName_
Name of optional reference phase which is not solved for.
const dictionary & solverDict(const word &name) const
Return the solver controls dictionary for the given field.
Perform a subCycleTime on a field or list of fields.
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &, const tmp< surfaceScalarField > &, const tmp< surfaceScalarField > &)
Return the face-interpolate of the given cell field.
A class for managing temporary objects.
A class for handling words, derived from string.
static const word null
An empty word.
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the face-flux of the given field.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
Calculate the snGrad of the given volField.
Calculate the field for explicit evaluation of implicit and explicit sources.
Calculate the matrix for the first temporal derivative.
Calculate the matrix for the laplacian of the field.
Calculate the matrix for implicit and explicit sources.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
bool valid(const PtrList< ModelType > &l)
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 > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
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.
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
tmp< fvMatrix< Type > > ddt(const VolField< Type > &vf)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable