26 #include "BlendedInterfacialModel.H" 28 #include "surfaceInterpolate.H" 32 template<
class ModelType>
33 template<
class GeometricField>
39 typename GeometricField::Boundary& fieldBf =
40 field.boundaryFieldRef();
46 isA<fixedValueFvsPatchScalarField>
48 phase1_.phi()().boundaryField()[
patchi]
60 template<
class ModelType>
65 const blendingMethod& blending,
66 autoPtr<ModelType> model,
67 autoPtr<ModelType> model1In2,
68 autoPtr<ModelType> model2In1,
69 const bool correctFixedFluxBCs
76 model1In2_(model1In2),
77 model2In1_(model2In1),
78 correctFixedFluxBCs_(correctFixedFluxBCs)
82 template<
class ModelType>
86 const blendingMethod& blending,
87 const phasePair& pair,
88 const orderedPhasePair& pair1In2,
89 const orderedPhasePair& pair2In1,
90 const bool correctFixedFluxBCs
96 correctFixedFluxBCs_(correctFixedFluxBCs)
98 if (modelTable.found(pair))
110 if (modelTable.found(pair1In2))
116 modelTable[pair1In2],
122 if (modelTable.found(pair2In1))
128 modelTable[pair2In1],
138 template<
class ModelType>
145 template<
class ModelType>
148 const class phaseModel& phase
154 : model2In1_.valid();
158 template<
class ModelType>
161 const class phaseModel& phase
164 return &phase == &(phase1_) ? model1In2_ : model2In1_;
168 template<
class ModelType>
172 tmp<volScalarField>
f1, f2;
174 if (model_.valid() || model1In2_.valid())
176 f1 = blending_.f1(phase1_, phase2_);
179 if (model_.valid() || model2In1_.valid())
181 f2 = blending_.f2(phase1_, phase2_);
184 tmp<volScalarField>
x 190 ModelType::typeName +
":K",
191 phase1_.mesh().time().timeName(),
204 x.ref() += model_->K()*(scalar(1) -
f1() - f2());
206 if (model1In2_.valid())
208 x.ref() += model1In2_->K()*
f1;
210 if (model2In1_.valid())
212 x.ref() += model2In1_->K()*f2;
218 && (model_.valid() || model1In2_.valid() || model2In1_.valid())
221 correctFixedFluxBCs(
x.ref());
228 template<
class ModelType>
232 tmp<volScalarField>
f1, f2;
234 if (model_.valid() || model1In2_.valid())
236 f1 = blending_.f1(phase1_, phase2_);
239 if (model_.valid() || model2In1_.valid())
241 f2 = blending_.f2(phase1_, phase2_);
244 tmp<volScalarField>
x 250 ModelType::typeName +
":K",
251 phase1_.mesh().time().timeName(),
264 x.ref() += model_->K(residualAlpha)*(scalar(1) -
f1() - f2());
266 if (model1In2_.valid())
268 x.ref() += model1In2_->K(residualAlpha)*
f1;
270 if (model2In1_.valid())
272 x.ref() += model2In1_->K(residualAlpha)*f2;
278 && (model_.valid() || model1In2_.valid() || model2In1_.valid())
281 correctFixedFluxBCs(
x.ref());
288 template<
class ModelType>
292 tmp<surfaceScalarField>
f1, f2;
294 if (model_.valid() || model1In2_.valid())
298 blending_.f1(phase1_, phase2_)
302 if (model_.valid() || model2In1_.valid())
306 blending_.f2(phase1_, phase2_)
310 tmp<surfaceScalarField>
x 316 ModelType::typeName +
":Kf",
317 phase1_.mesh().time().timeName(),
330 x.ref() += model_->Kf()*(scalar(1) -
f1() - f2());
333 if (model1In2_.valid())
335 x.ref() += model1In2_->Kf()*
f1;
338 if (model2In1_.valid())
340 x.ref() += model2In1_->Kf()*f2;
346 && (model_.valid() || model1In2_.valid() || model2In1_.valid())
349 correctFixedFluxBCs(
x.ref());
356 template<
class ModelType>
361 tmp<volScalarField>
f1, f2;
363 if (model_.valid() || model1In2_.valid())
365 f1 = blending_.f1(phase1_, phase2_);
368 if (model_.valid() || model2In1_.valid())
370 f2 = blending_.f2(phase1_, phase2_);
373 tmp<GeometricField<Type, fvPatchField, volMesh>>
x 375 new GeometricField<Type, fvPatchField, volMesh>
379 ModelType::typeName +
":F",
380 phase1_.mesh().time().timeName(),
387 dimensioned<Type>(
"zero", ModelType::dimF,
Zero)
393 x.ref() += model_->F()*(scalar(1) -
f1() - f2());
396 if (model1In2_.valid())
398 x.ref() += model1In2_->F()*
f1;
401 if (model2In1_.valid())
403 x.ref() -= model2In1_->F()*f2;
409 && (model_.valid() || model1In2_.valid() || model2In1_.valid())
412 correctFixedFluxBCs(
x.ref());
419 template<
class ModelType>
423 tmp<surfaceScalarField>
f1, f2;
425 if (model_.valid() || model1In2_.valid())
429 blending_.f1(phase1_, phase2_)
433 if (model_.valid() || model2In1_.valid())
437 blending_.f2(phase1_, phase2_)
441 tmp<surfaceScalarField>
x 447 ModelType::typeName +
":Ff",
448 phase1_.mesh().time().timeName(),
461 x.ref() += model_->Ff()*(scalar(1) -
f1() - f2());
464 if (model1In2_.valid())
466 x.ref() += model1In2_->Ff()*
f1;
469 if (model2In1_.valid())
471 x.ref() -= model2In1_->Ff()*f2;
477 && (model_.valid() || model1In2_.valid() || model2In1_.valid())
480 correctFixedFluxBCs(
x.ref());
487 template<
class ModelType>
491 tmp<volScalarField>
f1, f2;
493 if (model_.valid() || model1In2_.valid())
495 f1 = blending_.f1(phase1_, phase2_);
498 if (model_.valid() || model2In1_.valid())
500 f2 = blending_.f2(phase1_, phase2_);
503 tmp<volScalarField>
x 509 ModelType::typeName +
":D",
510 phase1_.mesh().time().timeName(),
523 x.ref() += model_->D()*(scalar(1) -
f1() - f2());
525 if (model1In2_.valid())
527 x.ref() += model1In2_->D()*
f1;
529 if (model2In1_.valid())
531 x.ref() += model2In1_->D()*f2;
537 && (model_.valid() || model1In2_.valid() || model2In1_.valid())
540 correctFixedFluxBCs(
x.ref());
HashTable< dictionary, phasePairKey, phasePairKey::hash > dictTable
Dictionary hash table.
#define forAll(list, i)
Loop across all elements in list.
bool hasModel(const phaseModel &phase) const
Return true if a model is specified for the supplied phase.
~BlendedInterfacialModel()
Destructor.
tmp< volScalarField > K() const
Return the blended force coefficient.
tmp< surfaceScalarField > Ff() const
Return the face blended force.
tmp< surfaceScalarField > Kf() const
Return the face blended force coefficient.
tmp< GeometricField< Type, fvPatchField, volMesh > > F() const
Return the blended force.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const ModelType & model(const phaseModel &phase) const
Return the model for the supplied phase.
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.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< volScalarField > D() const
Return the blended diffusivity.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const dimensionSet dimArea(sqr(dimLength))