35 #include "surfaceInterpolate.H" 51 namespace multiphaseInter
68 limitedPhiAlphas_(phaseModels_.size()),
69 Su_(phaseModels_.size()),
70 Sp_(phaseModels_.size())
85 const multiphaseInter::phaseModel& pm = iter()();
126 this->alphaTransfer(Su_, Sp_);
144 mesh_.time().timeName(),
156 !(++alphaSubCycle).
end();
160 rhoPhiSum += (mesh_.time().deltaT()/totalDeltaT)*rhoPhi_;
201 for (multiphaseInter::phaseModel&
phase1 : phases_)
210 "phi" +
alpha1.name() +
"Corr",
215 "div(phi," +
alpha1.name() +
')' 222 for (multiphaseInter::phaseModel&
phase2 : phases_)
230 if (!cAlphas_.found(key12))
233 <<
"Phase compression factor (cAlpha) not found for : " 237 scalar cAlpha = cAlphas_.find(key12)();
257 forAll(phiAlphaCorr.boundaryField(), patchi)
260 phiAlphaCorr.boundaryFieldRef()[patchi];
262 if (!phiAlphaCorrp.coupled())
266 alpha1.boundaryField()[patchi];
268 forAll(phiAlphaCorrp, facei)
270 if (phi1p[facei] < 0)
272 phiAlphaCorrp[facei] = alpha1p[facei]*phi1p[facei];
282 for (
const multiphaseInter::phaseModel& phase : phases_)
298 for (multiphaseInter::phaseModel& phase : phases_)
309 1.0/mesh_.time().deltaT().value(),
330 mesh_.time().timeName(),
338 for (multiphaseInter::phaseModel& phase : phases_)
352 fv::EulerDdtScheme<scalar>(mesh_).fvmDdt(
alpha1)
353 + fv::gaussConvectionScheme<scalar>
357 upwind<scalar>(mesh_,
phi)
363 alpha1Eqn.boundaryManipulate(
alpha1.boundaryFieldRef());
367 phiAlpha += alpha1Eqn.flux();
381 phase.alphaPhi() = phiAlpha;
393 mesh_.time().timeName(),
403 for (multiphaseInter::phaseModel& phase : phases_)
412 Info<<
"Phase-sum volume fraction, min, max = " 413 << sumAlpha.weightedAverage(mesh_.V()).value()
414 <<
' ' <<
min(sumAlpha).value()
415 <<
' ' <<
max(sumAlpha).value()
420 for (multiphaseInter::phaseModel& phase : phases_)
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_;
const fvMesh & mesh() const
Return mesh.
fvsPatchField< scalar > fvsPatchScalarField
UPtrList< phaseModel > phases_
Unallocated phase list.
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)
fvMatrix< scalar > fvScalarMatrix
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool read()
Read thermophysical properties dictionary.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Calculate the snGrad of the given volField.
label size() const noexcept
The number of elements in table.
const word & name() const
The name of this phase.
const volScalarField & alpha2
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
const dictionary & solverDict(const word &name) const
Return the solver controls dictionary for the given field.
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
SuSpTable & Sp()
Access Sp.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
Area-weighted average a surfaceField creating a volField.
SuSpTable & Su()
Access Su.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
Calculate the first temporal derivative.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
const fvMesh & mesh_
Reference to the mesh.
void solveAlphas()
Solve alphas.
virtual void solve()
Solve for the phase fractions.
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
multiphaseSystem(const fvMesh &)
Construct from fvMesh.
const phaseModel & phase(const label i) const
Constant access phase model i.
Calculate the gradient of the given field.
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
virtual bool coupled() const
True if this patch field is coupled.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Calculate the face-flux of the given field.
Calculate the matrix for the first temporal derivative.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
dimensionedScalar ddtAlphaMax() const
Access to ddtAlphaMax.
Perform a subCycleTime on a field.
const compressionFluxTable & limitedPhiAlphas() const
Access to compression fluxes for phaes.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Calculate the divergence of the given field.
defineTypeNameAndDebug(interfaceCompositionModel, 0)
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
scalarTable cAlphas_
Table for compression factors between phases.
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.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
surfaceScalarField::Boundary & phicBf
const word & name() const noexcept
Return const reference to name.
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
SuSpTable Su_
Su phase source terms.
phaseModelTable phaseModels_
Phase models.
SuSpTable Sp_
Sp phase source terms.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Mesh data needed to do the Finite Volume discretisation.
IOobject(const IOobject &)=default
Copy construct.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
scalar maxDiffNo() const
Maximum diffusion number.
messageStream Info
Information stream (stdout output on master, null elsewhere)
defineRunTimeSelectionTable(interfaceCompositionModel, dictionary)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
void setSize(const label n)
Alias for resize()
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
Defines the attributes of an object for which implicit objectRegistry management is supported...
const UPtrList< phaseModel > & phases() const
Return phases.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
void calculateSuSp()
Calculate Sp and Su.
CMULES: Multidimensional universal limiter for explicit corrected implicit solution.
Calculate the finiteVolume matrix for implicit and explicit sources.
forAllConstIters(mixture.phases(), phase)
static constexpr const zero Zero
Global zero (0)
const volScalarField & alpha1