Go to the documentation of this file.
27 #include "alphaContactAngleFvPatchScalarField.H"
75 psiThermo(
U.
mesh(), word::null),
76 phases_(
lookup(
"phases"), phaseModel::iNew(p_, T_)),
108 zeroGradientFvPatchScalarField::typeName
111 sigmas_(
lookup(
"sigmas")),
112 dimSigma_(1, 0, -2, 0, 0),
134 PtrDictionary<phaseModel>::iterator
phasei = phases_.begin();
164 ico &= phase().thermo().incompressible();
177 iso &= phase().thermo().incompressible();
190 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
210 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
233 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
252 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
293 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
311 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
313 tmp<scalarField>
trho
330 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
350 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
369 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
389 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
408 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
428 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
430 tmp<scalarField> tgamma
448 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
468 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
470 tmp<scalarField> tCpv
488 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
508 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
510 tmp<scalarField> tCpByCpv
543 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
561 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
563 tmp<scalarField> tkappa
583 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
602 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
604 tmp<scalarField> tkappaEff
626 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
645 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
666 PtrDictionary<phaseModel>::const_iterator
phasei = phases_.begin();
682 tmp<surfaceScalarField> tstf
688 "surfaceTensionForce",
689 mesh_.time().timeName(),
695 "surfaceTensionForce",
696 dimensionSet(1, -2, -2, 0, 0),
708 PtrDictionary<phaseModel>::const_iterator
phase2 =
phase1;
715 sigmaTable::const_iterator
sigma =
718 if (
sigma == sigmas_.end())
721 <<
"Cannot find interface " << interfacePair(
alpha1,
alpha2)
722 <<
" in list of sigma values"
741 const Time& runTime = mesh_.time();
757 !(++alphaSubCycle).end();
761 rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi_;
795 return gradAlphaf/(
mag(gradAlphaf) + deltaN_);
820 surfaceVectorField::GeometricBoundaryField& nHatb
823 const volScalarField::GeometricBoundaryField& gbf
826 const fvBoundaryMesh&
boundary = mesh_.boundary();
830 if (isA<alphaContactAngleFvPatchScalarField>(gbf[
patchi]))
832 const alphaContactAngleFvPatchScalarField& acap =
833 refCast<const alphaContactAngleFvPatchScalarField>(gbf[
patchi]);
839 mesh_.Sf().boundaryField()[
patchi]
840 /mesh_.magSf().boundaryField()[
patchi]
843 alphaContactAngleFvPatchScalarField::thetaPropsTable::
847 if (
tp == acap.thetaProps().end())
850 <<
"Cannot find interface " << interfacePair(
alpha1,
alpha2)
851 <<
"\n in table of theta properties for patch "
852 << acap.patch().name()
856 bool matched = (
tp.key().first() ==
alpha1.name());
858 scalar theta0 = convertToRad*
tp().theta0(matched);
861 scalar uTheta =
tp().uTheta();
866 scalar thetaA = convertToRad*
tp().thetaA(matched);
867 scalar thetaR = convertToRad*
tp().thetaR(matched);
872 U_.boundaryField()[
patchi].patchInternalField()
873 - U_.boundaryField()[
patchi]
875 Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
880 nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
884 nWall /= (
mag(nWall) + SMALL);
890 theta += (thetaA - thetaR)*
tanh(uwall/uTheta);
904 b2[facei] =
cos(
acos(a12[facei]) - theta[facei]);
912 nHatPatch = a*AfHatPatch +
b*nHatPatch;
914 nHatPatch /= (
mag(nHatPatch) + deltaN_.
value());
926 tmp<surfaceVectorField> tnHatfv = nHatfv(
alpha1,
alpha2);
931 return -
fvc::div(tnHatfv & mesh_.Sf());
938 tmp<volScalarField> tnearInt
945 mesh_.time().timeName(),
955 tnearInt() =
max(tnearInt(),
pos(phase() - 0.01)*
pos(0.99 - phase()));
967 static label nSolves=-1;
970 word alphaScheme(
"div(phi,alpha)");
976 PtrList<surfaceScalarField> alphaPhiCorrs(phases_.size());
979 forAllIter(PtrDictionary<phaseModel>, phases_, phase)
981 phaseModel&
alpha = phase();
1018 1.0/mesh_.time().deltaT().value(),
1019 geometricOneField(),
1042 mesh_.time().timeName(),
1055 forAllIter(PtrDictionary<phaseModel>, phases_, phase)
1057 phaseModel&
alpha = phase();
1067 mesh_.time().timeName(),
1079 mesh_.time().timeName(),
1092 if (dgdt[celli] < 0.0 &&
alpha[celli] > 0.0)
1094 Sp[celli] += dgdt[celli]*
alpha[celli];
1095 Su[celli] -= dgdt[celli]*
alpha[celli];
1097 else if (dgdt[celli] > 0.0 &&
alpha[celli] < 1.0)
1099 Sp[celli] -= dgdt[celli]*(1.0 -
alpha[celli]);
1114 if (dgdt2[celli] > 0.0 &&
alpha2[celli] < 1.0)
1116 Sp[celli] -= dgdt2[celli]*(1.0 -
alpha2[celli]);
1117 Su[celli] += dgdt2[celli]*
alpha[celli];
1119 else if (dgdt2[celli] < 0.0 &&
alpha2[celli] > 0.0)
1121 Sp[celli] += dgdt2[celli]*
alpha2[celli];
1128 geometricOneField(),
1148 Info<<
"Phase-sum volume fraction, min, max = "
1149 << sumAlpha.weightedAverage(mesh_.V()).value()
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
void correctContactAngle(const phaseModel &alpha1, const phaseModel &alpha2, surfaceVectorField::GeometricBoundaryField &nHatb) const
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
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)
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
List< label > labelList
A List of labels.
const dimensionedScalar mu
Atomic mass unit.
#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.
Info<< "Creating turbulence model\n"<< endl;tmp< volScalarField > talphaEff
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
static const scalar convertToRad
Conversion factor for degrees into radians.
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.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
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.
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
const Type & value() const
Return const reference to value.
virtual bool isochoric() const
Return true if the equation of state is isochoric.
surfaceScalarField phir(phic *interface.nHatf())
dimensioned< scalar > mag(const dimensioned< Type > &)
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
tmp< surfaceScalarField > surfaceTensionForce() const
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Field< vector > vectorField
Specialisation of Field<T> for vector.
CGAL::Exact_predicates_exact_constructions_kernel K
virtual tmp< volScalarField > kappaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
surfaceScalarField alphaPhi(IOobject("alphaPhi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), phi *fvc::interpolate(alpha1))
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)
dimensionedScalar tanh(const dimensionedScalar &ds)
const dimensionedScalar h
Planck constant.
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual tmp< volScalarField > Cv() const
Heat capacity at constant volume [J/kg/K].
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
PtrDictionary< phaseModel > phases_
Dictionary of phases.
virtual volScalarField & he()
Enthalpy/Internal energy [J/kg].
cellIbMask *cellIbMaskExt *faceIbMask *cellIbMask boundaryField().evaluateCoupled()
virtual void correct()
Update properties.
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 dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
const double e
Elementary charge.
const volScalarField & alphaEff
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual tmp< volScalarField > hc() const
Chemical enthalpy [J/kg].
void correctBoundaryConditions()
Correct boundary field.
GeometricField< vector, fvPatchField, volMesh > volVectorField
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< volScalarField > trho
tmp< volScalarField > rCv() const
Return the phase-averaged reciprocal Cv.
word alpharScheme("div(phirb,alpha)")
virtual tmp< scalarField > THE(const scalarField &h, const scalarField &p, const scalarField &T0, const labelList &cells) const
Temperature from enthalpy/internal energy for cell-set.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
tmp< volScalarField > K(const phaseModel &alpha1, const phaseModel &alpha2) const
volScalarField divU(fvc::div(fvc::absolute(phi, U)))
dimensionedScalar acos(const dimensionedScalar &ds)
Calculate the gradient of the given field.
virtual tmp< volScalarField > Cp() const
Heat capacity at constant pressure [J/kg/K].
Calculate the face-flux of the given field.
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [J/m/s/K].
multiphaseMixtureThermo(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
label readLabel(Istream &is)
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
virtual tmp< volScalarField > gamma() const
Gamma = Cp/Cv [].
DimensionedField< Type, GeoMesh > DimensionedInternalField
dimensionedScalar det(const dimensionedSphericalTensor &dt)
void solve()
Solve for the mixture phase-fractions.
virtual bool incompressible() const
Return true if the equation of state is incompressible.
virtual void correct()
Update properties.
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
const dimensionSet & dimensions() const
Return const reference to dimensions.
MULES: Multidimensional universal limiter for explicit solution.
tmp< surfaceVectorField > nHatfv(const volScalarField &alpha1, const volScalarField &alpha2) const
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void solveAlphas(const scalar cAlpha)
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
void correctRho(const volScalarField &dp)
Update densities for given pressure change.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
stressControl lookup("compactNormalStress") >> compactNormalStress
tmp< surfaceScalarField > nHatf(const volScalarField &alpha1, const volScalarField &alpha2) const
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar pos(const dimensionedScalar &ds)