35#include "surfaceInterpolate.H"
51namespace multiphaseInter
68 limitedPhiAlphas_(phaseModels_.size()),
69 Su_(phaseModels_.size()),
70 Sp_(phaseModels_.size())
126 this->alphaTransfer(Su_, Sp_);
144 mesh_.time().timeName(),
156 !(++alphaSubCycle).end();
160 rhoPhiSum += (mesh_.time().deltaT()/totalDeltaT)*rhoPhi_;
210 "phi" +
alpha1.name() +
"Corr",
215 "div(phi," +
alpha1.name() +
')'
230 if (!cAlphas_.found(key12))
233 <<
"Phase compression factor (cAlpha) not found for : "
237 scalar cAlpha = cAlphas_.find(key12)();
266 alpha1.boundaryField()[patchi];
268 forAll(phiAlphaCorrp, facei)
270 if (phi1p[facei] < 0)
272 phiAlphaCorrp[facei] = alpha1p[facei]*phi1p[facei];
309 1.0/mesh_.time().deltaT().value(),
330 mesh_.time().timeName(),
367 phiAlpha += alpha1Eqn.
flux();
381 phase.alphaPhi() = phiAlpha;
393 mesh_.time().timeName(),
412 Info<<
"Phase-sum volume fraction, min, max = "
414 <<
' ' <<
min(sumAlpha).value()
415 <<
' ' <<
max(sumAlpha).value()
425 Info<<
alpha.name() <<
" volume fraction = "
426 <<
alpha.weightedAverage(mesh_.V()).value()
427 <<
" Min(alpha) = " <<
min(
alpha).value()
428 <<
" Max(alpha) = " <<
max(
alpha).value()
474 auto iter = phaseModels_.cbegin();
476 scalar maxVal =
max(iter()->diffNo()).value();
478 for (++iter; iter != phaseModels_.cend(); ++iter)
480 maxVal =
max(maxVal,
max(iter()->diffNo()).value());
483 return maxVal * mesh_.time().deltaT().value();
490 return limitedPhiAlphas_;
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
surfaceScalarField::Boundary & phicBf
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
const volScalarField & alpha1
const volScalarField & alpha2
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weightField) const
Calculate and return weighted average.
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
const T * set(const label i) const
static word timeName(const scalar t, const int precision=precision_)
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T * set(const label i) const
void setSize(const label n)
Alias for resize()
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A special matrix type and solver, designed for finite volume solutions of scalar equations....
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux() const
Return the face-flux field from the matrix.
SolverPerformance< Type > solve(const dictionary &)
Solve returning the solution statistics.
void boundaryManipulate(typename GeometricField< Type, fvPatchField, volMesh >::Boundary &values)
Manipulate based on a boundary field.
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Basic first-order Euler implicit/explicit ddt using only the current and previous time-step values.
Basic second-order convection using face-gradients and Gauss' theorem.
virtual bool coupled() const
Return true if this patch field is coupled.
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
const fvMesh & mesh_
Reference to the mesh.
const fvMesh & mesh() const
Return mesh.
phaseModelTable phaseModels_
Phase models.
dimensionedScalar ddtAlphaMax() const
Access to ddtAlphaMax.
SuSpTable & Su()
Access Su.
const UPtrList< phaseModel > & phases() const
Return phases.
UPtrList< phaseModel > phases_
Unallocated phase list.
scalarTable cAlphas_
Table for compression factors between phases.
const compressionFluxTable & limitedPhiAlphas() const
Access to compression fluxes for phaes.
SuSpTable & Sp()
Access Sp.
void calculateSuSp()
Calculate Sp and Su.
SuSpTable Sp_
Sp phase source terms.
scalar maxDiffNo() const
Maximum diffusion number.
SuSpTable Su_
Su phase source terms.
virtual void solve()
Solve for the phase fractions.
virtual bool read()
Read thermophysical properties dictionary.
void solveAlphas()
Solve alphas.
const word & name() const
The name of this phase.
Incompressible multi-phase mixture with built in solution for the phase fractions with interface comp...
A class representing the concept of a field of 1 used to avoid unnecessary manipulations for objects ...
An ordered or unorder pair of phase names. Typically specified as follows.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const word & name() const
const dimensionedScalar & rho() const
Return const-access to phase1 density.
const dictionary & solverDict(const word &name) const
Return the solver controls dictionary for the given field.
Perform a subCycleTime on a field.
Upwind differencing scheme class.
A class for handling words, derived from Foam::string.
A class representing the concept of a field of 0 used to avoid unnecessary manipulations for objects ...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Area-weighted average a surfaceField creating a volField.
Calculate the first temporal derivative.
Calculate the divergence of the given field.
Calculate the face-flux of the given field.
Calculate the gradient 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 matrix for the first temporal derivative.
Calculate the finiteVolume matrix for implicit and explicit sources.
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)
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.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.