31 #include "surfaceInterpolate.H" 35 template<
class modelType>
36 template<
class GeometricField>
42 auto& fieldBf =
field.boundaryFieldRef();
44 forAll(pair_.phase1().phi().boundaryField(), patchi)
48 isA<fixedValueFvsPatchScalarField>
50 pair_.phase1().phi().boundaryField()[patchi]
54 fieldBf[patchi] =
Zero;
62 template<
class modelType>
65 const phasePair::dictTable& modelTable,
66 const blendingMethod& blending,
67 const phasePair& pair,
68 const orderedPhasePair& pair1In2,
69 const orderedPhasePair& pair2In1,
70 const bool correctFixedFluxBCs
77 correctFixedFluxBCs_(correctFixedFluxBCs)
79 if (modelTable.found(pair_))
91 if (modelTable.found(pair1In2_))
97 modelTable[pair1In2_],
103 if (modelTable.found(pair2In1_))
109 modelTable[pair2In1_],
119 template<
class modelType>
126 template<
class modelType>
130 tmp<volScalarField> f1, f2;
132 if (model_ || model1In2_)
134 f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed());
137 if (model_ || model2In1_)
139 f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed());
144 IOobject::scopedName(modelType::typeName,
"K"),
145 IOobject::NO_REGISTER,
146 pair_.phase1().mesh(),
152 x.ref() += model_->K()*(f1() - f2());
157 x.ref() += model1In2_->K()*(1 - f1);
162 x.ref() += model2In1_->K()*f2;
168 && (model_ || model1In2_ || model2In1_)
171 correctFixedFluxBCs(
x.ref());
178 template<
class modelType>
182 tmp<surfaceScalarField> f1, f2;
184 if (model_ || model1In2_)
188 blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed())
192 if (model_ || model2In1_)
196 blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed())
202 IOobject::scopedName(modelType::typeName,
"Kf"),
203 pair_.phase1().mesh(),
209 x.ref() += model_->Kf()*(f1() - f2());
214 x.ref() += model1In2_->Kf()*(1 - f1);
219 x.ref() += model2In1_->Kf()*f2;
225 && (model_ || model1In2_ || model2In1_)
228 correctFixedFluxBCs(
x.ref());
235 template<
class modelType>
240 tmp<volScalarField> f1, f2;
242 if (model_ || model1In2_)
244 f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed());
247 if (model_ || model2In1_)
249 f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed());
254 IOobject::scopedName(modelType::typeName,
"F"),
255 IOobject::NO_REGISTER,
256 pair_.phase1().mesh(),
257 dimensioned<Type>(modelType::dimF,
Zero)
262 x.ref() += model_->F()*(f1() - f2());
267 x.ref() += model1In2_->F()*(1 - f1);
272 x.ref() -= model2In1_->F()*f2;
278 && (model_ || model1In2_ || model2In1_)
281 correctFixedFluxBCs(
x.ref());
288 template<
class modelType>
292 tmp<surfaceScalarField> f1, f2;
294 if (model_ || model1In2_)
298 blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed())
302 if (model_ || model2In1_)
306 blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed())
312 IOobject::scopedName(modelType::typeName,
"Ff"),
313 IOobject::NO_REGISTER,
314 pair_.phase1().mesh(),
318 x.ref().setOriented();
322 x.ref() += model_->Ff()*(f1() - f2());
327 x.ref() += model1In2_->Ff()*(1 - f1);
332 x.ref() -= model2In1_->Ff()*f2;
338 && (model_ || model1In2_ || model2In1_)
341 correctFixedFluxBCs(
x.ref());
348 template<
class modelType>
352 tmp<volScalarField> f1, f2;
354 if (model_ || model1In2_)
356 f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed());
359 if (model_ || model2In1_)
361 f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed());
366 IOobject::scopedName(modelType::typeName,
"D"),
367 IOobject::NO_REGISTER,
368 pair_.phase1().mesh(),
374 x.ref() += model_->D()*(f1() - f2());
379 x.ref() += model1In2_->D()*(1 - f1);
384 x.ref() += model2In1_->D()*f2;
390 && (model_ || model1In2_ || model2In1_)
393 correctFixedFluxBCs(
x.ref());
400 template<
class modelType>
403 const class phaseModel& phase
408 &phase == &(pair_.phase1())
415 template<
class modelType>
421 return &
phase == &(pair_.phase1()) ? *model1In2_ : *model2In1_;
bool hasModel(const phaseModel &phase) const
Return true if a model is specified for the supplied phase.
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
~BlendedInterfacialModel()
Destructor.
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.
tmp< volScalarField > K() const
Return the blended force coefficient.
tmp< surfaceScalarField > Ff() const
Return the face blended force.
tmp< GeometricField< Type, fvPatchField, volMesh > > F() const
Return the blended force.
#define forAll(list, i)
Loop across all elements in list.
const modelType & phaseModel(const phaseModel &phase) const
Return the model for the supplied phase.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< surfaceScalarField > Kf() const
Return the face blended force coefficient.
tmp< volScalarField > D() const
Return the blended diffusivity.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
A class for managing temporary objects.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
const dimensionSet dimArea(sqr(dimLength))
static constexpr const zero Zero
Global zero (0)