55 const bool splitPhaseFlux
62 const bool meanFluxReference
67 const scalar vDotResidualAlpha
85 label solvePhasesi = 0;
101 phases()[phasei].correctBoundaryConditions();
129 bool dilatation =
false;
195 if (&phase2 != &phase)
199 vDot += alpha2()*phase.
divU()()();
218 /
max(1 -
alpha[celli], vDotResidualAlpha);
221 /
max(1 -
alpha[celli], vDotResidualAlpha);
223 else if (vDot[celli] < 0)
227 /
max(
alpha[celli], vDotResidualAlpha);
244 alphaPtrs[phasei] = &
phases()[phasei];
254 !(++alphaSubCycle).
end();
279 splitPhaseFlux ?
phi_ : phase.
phi()(),
281 "div(phi," +
alpha.name() +
')'
295 if (&phase2 == &phase)
continue;
312 min(cAlpha()*phic,
max(phic))
316 const word phirScheme
338 if (&phase2 == &phase)
continue;
349 phase.
phi() - phase2.
phi()
359 min(cAlpha()*phic,
max(phic))
363 const word phirScheme
422 alphasMoving.
set(movingPhasei, &phase);
427 &alphaPhis[phase.
index()]
434 forAll(solvePhases, solvePhasei)
451 if (alphaSubCycle.index() == 1)
466 forAll(solvePhases, solvePhasei)
484 forAll(solvePhases, solvePhasei)
488 Info<< phase.
name() <<
" fraction, min, max = "
490 <<
' ' <<
min(phase).value()
491 <<
' ' <<
max(phase).value()
495 if (referencePhasePtr)
498 referenceAlpha = alphaVoid;
500 forAll(solvePhases, solvePhasei)
502 referenceAlpha -= solvePhases[solvePhasei];
523 Info<<
"Phase-sum volume fraction, min, max = "
525 .weightedAverage(
mesh_.
V()).value()
540 forAll(solvePhases, solvePhasei)
548 forAll(solvePhases, solvePhasei)
558 if (referencePhasePtr)
560 phaseModel& referencePhase = *referencePhasePtr;
564 forAll(solvePhases, solvePhasei)
575 referenceAlpha = alphaVoid;
577 forAll(solvePhases, solvePhasei)
579 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 primitive 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 fvSolution.
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 bool stationary() const =0
Return whether the phase is stationary.
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.
virtual tmp< surfaceScalarField > alphaDByAf(const PtrList< volScalarField > &rAs) const =0
Return the phase diffusivity.
const fvMesh & mesh_
Reference to the mesh.
const phaseModelPartialList & movingPhases() const
Return the models for phases that are moving.
virtual void solve(const PtrList< volScalarField > &rAs)
Solve for the phase fractions.
const phaseModelList & phases() const
Return the phase models.
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.
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)
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)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable