32 #include "surfaceInterpolate.H" 47 void Foam::interfaceProperties::correctContactAngle
49 surfaceVectorField::Boundary& nHatb,
50 const surfaceVectorField::Boundary& gradAlphaf
60 if (isA<alphaContactAngleTwoPhaseFvPatchScalarField>(abf[patchi]))
62 alphaContactAngleTwoPhaseFvPatchScalarField& acap =
63 const_cast<alphaContactAngleTwoPhaseFvPatchScalarField&
> 65 refCast<const alphaContactAngleTwoPhaseFvPatchScalarField>
90 b2[facei] =
cos(
acos(a12[facei]) - theta[facei]);
98 nHatp = a*nf +
b*nHatp;
99 nHatp /= (
mag(nHatp) + deltaN_.
value());
101 acap.gradient() = (nf & nHatp)*
mag(gradAlphaf[patchi]);
108 void Foam::interfaceProperties::calculateK()
110 const fvMesh&
mesh = alpha1_.mesh();
114 tmp<volVectorField> tgradAlpha;
115 if (nAlphaSmoothCurvature_ < 1)
123 auto& alpha1L = talpha1L.ref();
125 for (
int i = 0; i < nAlphaSmoothCurvature_; ++i)
130 tgradAlpha =
fvc::grad(talpha1L,
"nHat");
147 correctContactAngle(nHatfv.boundaryFieldRef(), gradAlphaf.boundaryField());
150 nHatf_ = nHatfv & Sf;
171 Foam::interfaceProperties::interfaceProperties
175 const IOdictionary&
dict 178 transportPropertiesDict_(
dict),
179 nAlphaSmoothCurvature_
182 getOrDefault<int>(
"nAlphaSmoothCurvature", 0)
216 "interfaceProperties:K",
233 return sigmaPtr_->sigma()*K_;
247 return pos0(alpha1_ - 0.01)*
pos0(0.99 - alpha1_);
259 alpha1_.mesh().solverDict(alpha1_.name()).readEntry(
"cAlpha", cAlpha_);
260 sigmaPtr_->readDict(transportPropertiesDict_);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
fvsPatchField< vector > fvsPatchVectorField
const Type & value() const noexcept
Return const reference to value.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensionedScalar acos(const dimensionedScalar &ds)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
const surfaceVectorField & Sf() const
Return cell face area vectors.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Unit conversion functions.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
bool read()
Read transportProperties dictionary.
Calculate the snGrad of the given volField.
GeometricBoundaryField< scalar, fvPatchField, volMesh > Boundary
Type of boundary fields.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
tmp< surfaceScalarField > surfaceTensionForce() const
Area-weighted average a surfaceField creating a volField.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionedScalar e
Elementary charge.
dimensionedScalar cos(const dimensionedScalar &ds)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Calculate the gradient of the given field.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar cbrt(const dimensionedScalar &ds)
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Calculate the divergence of the given field.
const Mesh & mesh() const noexcept
Return mesh.
dimensionedScalar pos0(const dimensionedScalar &ds)
tmp< volScalarField > sigmaK() const
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.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< GeometricField< Type, fvPatchField, volMesh > > average(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Area-weighted average a surfaceField creating a volField.
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const dimensionSet dimArea(sqr(dimLength))
static constexpr const zero Zero
Global zero (0)
const volScalarField & alpha1