Go to the documentation of this file.
27 #include "alphaContactAngleFvPatchScalarField.H"
72 "transportProperties",
75 IOobject::MUST_READ_IF_MODIFIED,
80 phases_(
lookup(
"phases"), phase::iNew(
U,
phi)),
112 zeroGradientFvPatchScalarField::typeName
126 sigmas_(
lookup(
"sigmas")),
127 dimSigma_(1, 0, -2, 0, 0),
144 PtrDictionary<phase>::const_iterator iter =
phases_.begin();
146 tmp<volScalarField>
trho = iter()*iter().rho();
148 for (++iter; iter !=
phases_.end(); ++iter)
150 trho() += iter()*iter().rho();
160 PtrDictionary<phase>::const_iterator iter = phases_.begin();
162 tmp<scalarField>
trho = iter().boundaryField()[
patchi]*iter().rho().value();
164 for (++iter; iter != phases_.end(); ++iter)
166 trho() += iter().boundaryField()[
patchi]*iter().rho().value();
176 PtrDictionary<phase>::const_iterator iter = phases_.begin();
178 tmp<volScalarField> tmu = iter()*iter().rho()*iter().nu();
180 for (++iter; iter != phases_.end(); ++iter)
182 tmu() += iter()*iter().rho()*iter().nu();
192 PtrDictionary<phase>::const_iterator iter = phases_.begin();
194 tmp<scalarField> tmu =
195 iter().boundaryField()[
patchi]
196 *iter().rho().value()
199 for (++iter; iter != phases_.end(); ++iter)
202 iter().boundaryField()[
patchi]
203 *iter().rho().value()
214 PtrDictionary<phase>::const_iterator iter = phases_.begin();
216 tmp<surfaceScalarField> tmuf =
219 for (++iter; iter != phases_.end(); ++iter)
239 return nu_.boundaryField()[
patchi];
253 tmp<surfaceScalarField> tstf
259 "surfaceTensionForce",
260 mesh_.time().timeName(),
266 "surfaceTensionForce",
267 dimensionSet(1, -2, -2, 0, 0),
277 const phase&
alpha1 = iter1();
279 PtrDictionary<phase>::const_iterator iter2 = iter1;
282 for (; iter2 != phases_.end(); ++iter2)
284 const phase&
alpha2 = iter2();
286 sigmaTable::const_iterator
sigma =
289 if (
sigma == sigmas_.end())
292 <<
"Cannot find interface " << interfacePair(
alpha1,
alpha2)
293 <<
" in list of sigma values"
314 const Time& runTime = mesh_.time();
341 !(++alphaSubCycle).end();
345 rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi_;
362 forAllIter(PtrDictionary<phase>, phases_, iter)
391 return gradAlphaf/(
mag(gradAlphaf) + deltaN_);
416 surfaceVectorField::GeometricBoundaryField& nHatb
419 const volScalarField::GeometricBoundaryField& gbf
422 const fvBoundaryMesh&
boundary = mesh_.boundary();
426 if (isA<alphaContactAngleFvPatchScalarField>(gbf[
patchi]))
428 const alphaContactAngleFvPatchScalarField& acap =
429 refCast<const alphaContactAngleFvPatchScalarField>(gbf[
patchi]);
435 mesh_.Sf().boundaryField()[
patchi]
436 /mesh_.magSf().boundaryField()[
patchi]
439 alphaContactAngleFvPatchScalarField::thetaPropsTable::
443 if (
tp == acap.thetaProps().end())
446 <<
"Cannot find interface " << interfacePair(
alpha1,
alpha2)
447 <<
"\n in table of theta properties for patch "
448 << acap.patch().name()
452 bool matched = (
tp.key().first() ==
alpha1.name());
454 scalar theta0 = convertToRad*
tp().theta0(matched);
457 scalar uTheta =
tp().uTheta();
462 scalar thetaA = convertToRad*
tp().thetaA(matched);
463 scalar thetaR = convertToRad*
tp().thetaR(matched);
468 U_.boundaryField()[
patchi].patchInternalField()
469 - U_.boundaryField()[
patchi]
471 Uwall -= (AfHatPatch & Uwall)*AfHatPatch;
476 nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch
480 nWall /= (
mag(nWall) + SMALL);
486 theta += (thetaA - thetaR)*
tanh(uwall/uTheta);
500 b2[facei] =
cos(
acos(a12[facei]) - theta[facei]);
508 nHatPatch = a*AfHatPatch +
b*nHatPatch;
510 nHatPatch /= (
mag(nHatPatch) + deltaN_.
value());
522 tmp<surfaceVectorField> tnHatfv = nHatfv(
alpha1,
alpha2);
527 return -
fvc::div(tnHatfv & mesh_.Sf());
534 tmp<volScalarField> tnearInt
541 mesh_.time().timeName(),
551 tnearInt() =
max(tnearInt(),
pos(iter() - 0.01)*
pos(0.99 - iter()));
563 static label nSolves=-1;
566 word alphaScheme(
"div(phi,alpha)");
572 PtrList<surfaceScalarField> alphaPhiCorrs(phases_.size());
575 forAllIter(PtrDictionary<phase>, phases_, iter)
577 phase&
alpha = iter();
596 forAllIter(PtrDictionary<phase>, phases_, iter2)
614 1.0/mesh_.time().deltaT().value(),
638 mesh_.time().timeName(),
647 forAllIter(PtrDictionary<phase>, phases_, iter)
649 phase&
alpha = iter();
676 Info<<
"Phase-sum volume fraction, min, max = "
677 << sumAlpha.weightedAverage(mesh_.V()).value()
692 PtrList<entry> phaseData(
lookup(
"phases"));
695 forAllIter(PtrDictionary<phase>, phases_, iter)
697 readOK &= iter().read(phaseData[
phasei++].
dict());
700 lookup(
"sigmas") >> sigmas_;
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 scalar convertToRad
Conversion factor for degrees into radians.
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.
const dimensionedScalar mu
Atomic mass unit.
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
tmp< volScalarField > K(const phase &alpha1, const phase &alpha2) const
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
multiphaseMixture(const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
void correct()
Correct the mixture properties.
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))
tmp< volScalarField > nu() const
Return the kinematic laminar viscosity.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
surfaceScalarField phir(phic *interface.nHatf())
dimensioned< scalar > mag(const dimensioned< Type > &)
Constant dispersed-phase particle diameter model.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Field< vector > vectorField
Specialisation of Field<T> for vector.
CGAL::Exact_predicates_exact_constructions_kernel K
virtual bool read()=0
Read transportProperties dictionary.
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< surfaceScalarField > nuf() const
Return the face-interpolated dynamic laminar viscosity.
dimensionedScalar tanh(const dimensionedScalar &ds)
tmp< surfaceVectorField > nHatfv(const volScalarField &alpha1, const volScalarField &alpha2) const
void limitSum(UPtrList< scalarField > &phiPsiCorrs)
tmp< surfaceScalarField > surfaceTensionForce() const
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
bool read()
Read base transportProperties dictionary.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
cellIbMask *cellIbMaskExt *faceIbMask *cellIbMask boundaryField().evaluateCoupled()
void solve()
Solve for the mixture phase-fractions.
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.
tmp< volScalarField > rho() const
Return the mixture density.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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 > mu() const
Return the dynamic laminar viscosity.
word alpharScheme("div(phirb,alpha)")
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
void solveAlphas(const scalar cAlpha)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
dimensionedScalar acos(const dimensionedScalar &ds)
Calculate the gradient of the given field.
Calculate the face-flux of the given field.
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
label readLabel(Istream &is)
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m2/K4].
dimensionedScalar det(const dimensionedSphericalTensor &dt)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const surfaceScalarField &phi, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
MULES: Multidimensional universal limiter for explicit solution.
tmp< surfaceScalarField > nHatf(const volScalarField &alpha1, const volScalarField &alpha2) const
void correctContactAngle(const phase &alpha1, const phase &alpha2, surfaceVectorField::GeometricBoundaryField &nHatb) const
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
stressControl lookup("compactNormalStress") >> compactNormalStress
PtrDictionary< phase > phases_
Dictionary of phases.
dimensionedScalar cos(const dimensionedScalar &ds)
tmp< surfaceScalarField > muf() const
Return the face-interpolated dynamic laminar viscosity.
dimensionedScalar pos(const dimensionedScalar &ds)