30#include "alphaContactAngleFvPatchScalarField.H"
60void Foam::multiphaseSystem::calcAlphas()
67 alphas_ += level*
phases()[i];
73void Foam::multiphaseSystem::solveAlphas()
86 mesh_.time().timeName(),
92 forAll(stationaryPhases(), stationaryPhasei)
94 alphaVoid -= stationaryPhases()[stationaryPhasei];
115 forAll(stationaryPhases(), stationaryPhasei)
129 forAll(movingPhases(), movingPhasei)
155 cAlphaTable::const_iterator cAlpha
160 if (cAlpha != cAlphas_.end())
183 phase.correctInflowOutflow(alphaPhiCorr);
193 min(alphaVoid.primitiveField(),
phase.alphaMax())(),
201 forAll(stationaryPhases(), stationaryPhasei)
203 fixedAlphaPhiCorrs.insert(stationaryPhases()[stationaryPhasei].index());
208 forAll(movingPhases(), movingPhasei)
222 mesh_.time().timeName(),
235 if (
phase.divU().valid())
241 if (dgdt[celli] > 0.0)
243 Sp[celli] -= dgdt[celli];
244 Su[celli] += dgdt[celli];
246 else if (dgdt[celli] < 0.0)
268 if (dgdt2[celli] < 0.0)
278 else if (dgdt2[celli] > 0.0)
280 Sp[celli] -= dgdt2[celli];
315 mesh_.time().timeName(),
321 forAll(movingPhases(), movingPhasei)
323 sumAlphaMoving += movingPhases()[movingPhasei];
326 Info<<
"Phase-sum volume fraction, min, max = "
327 << (sumAlphaMoving + 1 - alphaVoid)().weightedAverage(mesh_.V()).value()
328 <<
' ' <<
min(sumAlphaMoving + 1 - alphaVoid).value()
329 <<
' ' <<
max(sumAlphaMoving + 1 - alphaVoid).value()
333 forAll(movingPhases(), movingPhasei)
335 movingPhases()[movingPhasei] *= alphaVoid/sumAlphaMoving;
340Foam::tmp<Foam::surfaceVectorField> Foam::multiphaseSystem::nHatfv
362 return gradAlphaf/(
mag(gradAlphaf) + deltaN_);
366Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::nHatf
383void Foam::multiphaseSystem::correctContactAngle
408 const reactingMultiphaseEuler::
409 alphaContactAngleFvPatchScalarField
416 mesh_.Sf().boundaryField()[patchi]
417 /mesh_.magSf().boundaryField()[patchi]
420 reactingMultiphaseEuler::alphaContactAngleFvPatchScalarField::
421 thetaPropsTable::const_iterator tp =
425 if (tp == acap.thetaProps().end())
428 <<
"Cannot find interface "
430 <<
"\n in table of theta properties for patch "
431 << acap.patch().name()
435 bool matched = (tp.key().first() ==
phase1.
name());
437 scalar theta0 =
degToRad(tp().theta0(matched));
440 scalar uTheta = tp().uTheta();
445 const scalar thetaA =
degToRad(tp().thetaA(matched));
446 const scalar thetaR =
degToRad(tp().thetaR(matched));
454 Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
459 nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
463 nWall /= (
mag(nWall) + SMALL);
469 theta += (thetaA - thetaR)*
tanh(uwall/uTheta);
483 b2[facei] =
cos(
acos(a12[facei]) - theta[facei]);
491 nHatPatch = a*AfHatPatch +
b*nHatPatch;
493 nHatPatch /= (
mag(nHatPatch) + deltaN_.value());
499Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::K
510 return -
fvc::div(tnHatfv & mesh_.Sf());
537 cAlphas_(
lookup(
"interfaceCompression")),
568 tSurfaceTension.ref().setOriented();
578 cAlphaTable::const_iterator cAlpha(cAlphas_.find(key12));
580 if (cAlpha != cAlphas_.end())
582 tSurfaceTension.ref() +=
592 tSurfaceTension->setOriented();
594 return tSurfaceTension;
598Foam::tmp<Foam::volScalarField>
675 !(++alphaSubCycle).
end();
689 if (
phase.stationary())
continue;
702 if (
phase.stationary())
continue;
704 phase.alphaRhoPhiRef() =
CGAL::Exact_predicates_exact_constructions_kernel K
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
MULES: Multidimensional universal limiter for explicit solution.
const volScalarField & alpha1
const volScalarField & alpha2
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weights, const label comm=UPstream::worldComm) const
Return the global weighted average.
static tmp< GeometricField< scalar, fvsPatchField, surfaceMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvsPatchField< scalar >::calculatedType())
DimensionedField< scalar, volMesh > Internal
void clamp_range(const dimensioned< MinMax< Type > > &range)
Clamp field values (in-place) to the specified range.
Internal & ref(const bool updateAccessTime=true)
Same as internalFieldRef().
GeometricBoundaryField< vector, fvsPatchField, surfaceMesh > Boundary
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ AUTO_WRITE
Automatically write from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
const word & name() const noexcept
Return the object name.
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
autoPtr< T > set(const label i, const word &key, T *ptr)
Set element to pointer provided and return old element.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
A fvBoundaryMesh is a fvPatch list with a reference to the associated fvMesh, with additional search ...
Mesh data needed to do the Finite Volume discretisation.
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...
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Incompressible multi-phase mixture with built in solution for the phase fractions with interface comp...
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
multiphaseSystem(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
const PtrDictionary< phaseModel > & phases() const
Return the phases.
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
void solve()
Solve for the mixture phase-fractions.
const Time & time() const noexcept
Return time registry.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
virtual tmp< volScalarField > divU() const =0
Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi)).
const volVectorField & U() const
const surfaceScalarField & phi() const
const word & name() const
An ordered or unorder pair of phase names. Typically specified as follows.
Class to represent a system of phases and model interfacial transfers between them.
const fvMesh & mesh_
Reference to the mesh.
phaseSystem(const fvMesh &mesh)
Construct from fvMesh.
const fvMesh & mesh() const
Return the mesh.
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.
Lookup type of boundary radiation properties.
void setFluxRequired(const word &name) const
Set flux-required for given name (mutable).
A class for managing sub-cycling times.
bool end() const
Return true if the number of sub-cycles has been reached.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &, const tmp< surfaceScalarField > &, const tmp< surfaceScalarField > &)
Return the face-interpolate of the given cell field.
A class for managing temporary objects.
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.
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 finiteVolume matrix for implicit and explicit sources.
PtrList< surfaceScalarField > alphafs(phases.size())
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< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
dimensionedScalar pos0(const dimensionedScalar &ds)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar tanh(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
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.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
void Sp(fvMatrix< typename Expr::value_type > &m, const Expr2 &mult, const Expr &expression)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)
void Su(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
multiphaseSystem::phaseModelList & phases
#define forAll(list, i)
Loop across all elements in list.
surfaceScalarField alphaPhi(phi.name()+alpha1.name(), fvc::flux(phi, alpha1, alphaScheme))
Unit conversion functions.