Go to the documentation of this file.
26 #include "multiphaseSystem.H"
27 #include "alphaContactAngleFvPatchScalarField.H"
74 PtrList<surfaceScalarField> alphaPhiCorrs(
phases().size());
88 "phi" +
alpha1.name() +
"Corr",
93 "div(phi," +
alpha1.name() +
')'
105 if (&
phase2 == &phase)
continue;
109 cAlphaTable::const_iterator cAlpha
111 cAlphas_.find(phasePairKey(phase.name(),
phase2.
name()))
114 if (cAlpha != cAlphas_.end())
141 alphaPhiCorr.boundaryField()[
patchi];
143 if (!alphaPhiCorrp.coupled())
148 forAll(alphaPhiCorrp, facei)
150 if (phi1p[facei] < 0)
152 alphaPhiCorrp[facei] = alpha1p[facei]*phi1p[facei];
179 const scalar rDeltaT = 1.0/mesh_.time().deltaTValue();
204 mesh_.time().timeName(),
220 alphaPhic += upwind<scalar>(mesh_, phi_).flux(phase);
227 mesh_.time().timeName(),
239 mesh_.time().timeName(),
247 if (phase.divU().valid())
253 if (dgdt[celli] > 0.0)
255 Sp[celli] -= dgdt[celli];
256 Su[celli] += dgdt[celli];
258 else if (dgdt[celli] < 0.0)
272 if (&
phase2 == &phase)
continue;
280 if (dgdt2[celli] < 0.0)
290 else if (dgdt2[celli] > 0.0)
292 Sp[celli] -= dgdt2[celli];
307 phase.alphaPhi() += alphaPhic;
309 Info<< phase.name() <<
" volume fraction, min, max = "
310 << phase.weightedAverage(mesh_.V()).value()
318 Info<<
"Phase-sum volume fraction, min, max = "
319 << sumAlpha.weightedAverage(mesh_.V()).value()
348 return gradAlphaf/(
mag(gradAlphaf) + deltaN_);
373 surfaceVectorField::GeometricBoundaryField& nHatb
376 const volScalarField::GeometricBoundaryField& gbf
379 const fvBoundaryMesh&
boundary = mesh_.boundary();
383 if (isA<alphaContactAngleFvPatchScalarField>(gbf[
patchi]))
385 const alphaContactAngleFvPatchScalarField& acap =
386 refCast<const alphaContactAngleFvPatchScalarField>(gbf[
patchi]);
392 mesh_.Sf().boundaryField()[
patchi]
393 /mesh_.magSf().boundaryField()[
patchi]
396 alphaContactAngleFvPatchScalarField::thetaPropsTable::
401 if (
tp == acap.thetaProps().end())
404 <<
"Cannot find interface "
406 <<
"\n in table of theta properties for patch "
407 << acap.patch().name()
413 scalar theta0 = convertToRad*
tp().theta0(matched);
416 scalar uTheta =
tp().uTheta();
421 scalar thetaA = convertToRad*
tp().thetaA(matched);
422 scalar thetaR = convertToRad*
tp().thetaR(matched);
430 Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
435 nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
439 nWall /= (
mag(nWall) + SMALL);
445 theta += (thetaA - thetaR)*
tanh(uwall/uTheta);
459 b2[facei] =
cos(
acos(a12[facei]) - theta[facei]);
467 nHatPatch = a*AfHatPatch +
b*nHatPatch;
469 nHatPatch /= (
mag(nHatPatch) + deltaN_.
value());
481 tmp<surfaceVectorField> tnHatfv = nHatfv(
phase1,
phase2);
486 return -
fvc::div(tnHatfv & mesh_.Sf());
511 zeroGradientFvPatchScalarField::typeName
514 cAlphas_(
lookup(
"interfaceCompression")),
525 mesh_.setFluxRequired(alphai.name());
543 tmp<surfaceScalarField> tSurfaceTension
550 mesh_.time().timeName(),
557 dimensionSet(1, -2, -2, 0, 0),
571 cAlphaTable::const_iterator cAlpha(cAlphas_.find(key12));
573 if (cAlpha != cAlphas_.end())
585 return tSurfaceTension;
592 tmp<volScalarField> tnearInt
599 mesh_.time().timeName(),
622 const Time& runTime = mesh_.time();
631 tmp<volScalarField> trSubDeltaT;
641 PtrList<volScalarField> alpha0s(
phases().size());
642 PtrList<surfaceScalarField> alphaPhiSums(
phases().size());
674 subCycleTime alphaSubCycle
676 const_cast<Time&
>(runTime),
679 !(++alphaSubCycle).end();
699 alpha.timeIndex() = runTime.timeIndex();
703 alpha.oldTime().timeIndex() = runTime.timeIndex();
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static const volScalarField & localRDeltaT(const fvMesh &mesh)
Return the reciprocal of the local time-step.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
virtual const tmp< volScalarField > & divU() const
Return the phase dilatation rate (d(alpha)/dt + div(alpha*phi))
void solve()
Solve for the mixture phase-fractions.
tmp< surfaceScalarField > nHatf(const volScalarField &alpha1, const volScalarField &alpha2) const
static tmp< volScalarField > localRSubDeltaT(const fvMesh &mesh, const label nAlphaSubCycles)
Calculate and return the reciprocal of the local sub-cycling.
tmp< surfaceScalarField > surfaceTension(const phaseModel &phase) const
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
Calculate the mesh motion flux and convert fluxes from absolute to relative and back.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
fvsPatchField< scalar > fvsPatchScalarField
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
Calculate the snGrad of the given volField.
faceListList boundary(nPatches)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &vf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
Calculate the divergence of the given field.
const word & name() const
Return const reference to name.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
volScalarField tp(IOobject("tp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), mesh, dimensionedScalar("tp", dimensionSet(0, 0, 1, 0, 0, 0, 0), 0))
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
Calculate the field for explicit evaluation of implicit and explicit sources.
surfaceScalarField phir(phic *interface.nHatf())
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
CGAL::Exact_predicates_exact_constructions_kernel K
static bool enabled(const fvMesh &mesh)
Return true if LTS is enabled.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
tmp< GeometricField< Type, fvPatchField, volMesh > > Su(const GeometricField< Type, fvPatchField, volMesh > &su, const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual ~multiphaseSystem()
Destructor.
dimensionedScalar tanh(const dimensionedScalar &ds)
tmp< surfaceVectorField > nHatfv(const volScalarField &alpha1, const volScalarField &alpha2) const
Calculate the matrix for the laplacian of the field.
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const word & name() const
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
cellIbMask *cellIbMaskExt *faceIbMask *cellIbMask boundaryField().evaluateCoupled()
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const scalar psiMax, const scalar psiMin, const bool returnCorr)
const double e
Elementary charge.
const surfaceScalarField & phi() const
Calculate the matrix for implicit and explicit sources.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void correctBoundaryConditions()
Correct boundary field.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const volVectorField & U() const
void correctContactAngle(const phaseModel &alpha1, const phaseModel &alpha2, surfaceVectorField::GeometricBoundaryField &nHatb) const
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
volScalarField divU(fvc::div(fvc::absolute(phi, U)))
dimensionedScalar acos(const dimensionedScalar &ds)
Calculate the face-flux of the given field.
multiphaseSystem::phaseModelList & phases
label readLabel(Istream &is)
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
const PtrDictionary< phaseModel > & phases() const
Return the phases.
Calculate the first temporal derivative.
DimensionedField< Type, GeoMesh > DimensionedInternalField
dimensionedScalar det(const dimensionedSphericalTensor &dt)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const surfaceScalarField &phi, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< GeometricField< Type, fvPatchField, volMesh > > Sp(const volScalarField &sp, const GeometricField< Type, fvPatchField, volMesh > &vf)
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
MULES: Multidimensional universal limiter for explicit solution.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
multiphaseSystem(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
static const scalar convertToRad
Conversion factor for degrees into radians.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
Calulate the matrix for the first temporal derivative.
stressControl lookup("compactNormalStress") >> compactNormalStress
tmp< volScalarField > K(const phaseModel &alpha1, const phaseModel &alpha2) const
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar pos(const dimensionedScalar &ds)