26 #include "twoPhaseSystem.H" 28 #include "BlendedInterfacialModel.H" 29 #include "virtualMassModel.H" 30 #include "heatTransferModel.H" 31 #include "liftModel.H" 32 #include "wallLubricationModel.H" 33 #include "turbulentDispersionModel.H" 35 #include "surfaceInterpolate.H" 46 #include "blendingMethod.H" 62 mesh.time().constant(),
64 IOobject::MUST_READ_IF_MODIFIED,
105 IOobject::READ_IF_PRESENT,
112 phase2_.volScalarField::operator=(scalar(1) - phase1_);
118 blendingMethods_.insert
175 new BlendedInterfacialModel<dragModel>
179 blendingMethods_.found(
"drag")
180 ? blendingMethods_[
"drag"]
181 : blendingMethods_[
"default"]
192 new BlendedInterfacialModel<virtualMassModel>
196 blendingMethods_.found(
"virtualMass")
197 ? blendingMethods_[
"virtualMass"]
198 : blendingMethods_[
"default"]
208 new BlendedInterfacialModel<heatTransferModel>
212 blendingMethods_.found(
"heatTransfer")
213 ? blendingMethods_[
"heatTransfer"]
214 : blendingMethods_[
"default"]
224 new BlendedInterfacialModel<liftModel>
228 blendingMethods_.found(
"lift")
229 ? blendingMethods_[
"lift"]
230 : blendingMethods_[
"default"]
240 new BlendedInterfacialModel<wallLubricationModel>
242 lookup(
"wallLubrication"),
244 blendingMethods_.found(
"wallLubrication")
245 ? blendingMethods_[
"wallLubrication"]
246 : blendingMethods_[
"default"]
254 turbulentDispersion_.set
256 new BlendedInterfacialModel<turbulentDispersionModel>
258 lookup(
"turbulentDispersion"),
260 blendingMethods_.found(
"turbulentDispersion")
261 ? blendingMethods_[
"turbulentDispersion"]
262 : blendingMethods_[
"default"]
282 return phase1_*phase1_.thermo().rho() + phase2_*phase2_.thermo().rho();
288 return phase1_*phase1_.U() + phase2_*phase2_.U();
314 return virtualMass_->K();
320 return virtualMass_->Kf();
326 return heatTransfer_->K();
332 return lift_->F<
vector>() + wallLubrication_->F<
vector>();
338 return lift_->Ff() + wallLubrication_->Ff();
344 return turbulentDispersion_->D();
350 const Time& runTime = mesh_.time();
358 const dictionary& alphaControls = mesh_.solverDict
366 word alphaScheme(
"div(phi," + alpha1.name() +
')');
369 alpha1.correctBoundaryConditions();
375 tmp<surfaceScalarField> alpha1alpha2f;
377 if (pPrimeByA_.valid())
385 pPrimeByA_()*
fvc::snGrad(alpha1,
"bounded")*mesh_.magSf()
420 if (dgdt_[celli] > 0.0)
422 Sp[celli] -= dgdt_[celli]/
max(1.0 - alpha1[celli], 1
e-4);
423 Su[celli] += dgdt_[celli]/
max(1.0 - alpha1[celli], 1
e-4);
425 else if (dgdt_[celli] < 0.0)
427 Sp[celli] += dgdt_[celli]/
max(alpha1[celli], 1
e-4);
447 phase1_.correctInflowOutflow(alphaPhic1);
454 !(++alphaSubCycle).end();
465 (alphaSubCycle.index()*
Sp)(),
466 (
Su - (alphaSubCycle.index() - 1)*
Sp*alpha1)(),
471 if (alphaSubCycle.index() == 1)
473 phase1_.alphaPhi() = alphaPhic10;
477 phase1_.alphaPhi() += alphaPhic10;
497 phase1_.alphaPhi() = alphaPhic1;
500 if (pPrimeByA_.valid())
511 phase1_.alphaPhi() += alpha1Eqn.flux();
514 phase1_.alphaRhoPhi() =
517 phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
518 phase2_.correctInflowOutflow(phase2_.alphaPhi());
519 phase2_.alphaRhoPhi() =
522 Info<< alpha1.name() <<
" volume fraction = " 523 << alpha1.weightedAverage(mesh_.V()).value()
524 <<
" Min(" << alpha1.name() <<
") = " <<
min(alpha1).value()
525 <<
" Max(" << alpha1.name() <<
") = " <<
max(alpha1).value()
532 alpha2 = scalar(1) -
alpha1;
546 phase1_.turbulence().correct();
547 phase2_.turbulence().correct();
557 readOK &= phase1_.read(*
this);
558 readOK &= phase2_.read(*
this);
573 return drag_->phaseModel(phase);
580 return virtualMass_->phaseModel(phase);
586 return pair_->sigma();
tmp< volVectorField > F() const
Return the combined force (lift + wall-lubrication)
HashTable< dictionary, phasePairKey, phasePairKey::hash > dictTable
Dictionary hash table.
fvMatrix< scalar > fvScalarMatrix
#define forAll(list, i)
Loop across all elements in list.
tmp< volScalarField > Kh() const
Return the heat transfer coefficient.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void correct()
Correct two-phase properties other than turbulence.
const double e
Elementary charge.
virtual bool read()
Read object.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
word alpharScheme("div(phirb,alpha)")
tmp< volScalarField > sigma() const
Return the surface tension coefficient.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Calculate the matrix for the laplacian of the field.
Calculate the snGrad of the given volField.
Vector< scalar > vector
A scalar version of the templated Vector.
Generic dimensioned Type class.
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
tmp< volScalarField > Kd() const
Return the drag coefficient.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Calculate the first temporal derivative.
stressControl lookup("compactNormalStress") >> compactNormalStress
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
Calculate the curl of the given volField by constructing the Hodge-dual of the symmetric part of the ...
Calculate the face-flux of the given field.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calulate the matrix for the first temporal derivative.
twoPhaseSystem(const fvMesh &)
Construct from fvMesh.
const word dictName("particleTrackDict")
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label readLabel(Istream &is)
static autoPtr< blendingMethod > New(const dictionary &dict, const wordList &phaseNames)
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
tmp< volScalarField > D() const
Return the turbulent diffusivity.
bool read()
Read base phaseProperties dictionary.
Calculate the divergence of the given field.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
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.
tmp< volVectorField > U() const
Return the mixture velocity.
void correctTurbulence()
Correct two-phase turbulence.
List< word > wordList
A List of words.
virtual void solve()
Solve for the phase fractions.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
surfaceScalarField phic(mixture.cAlpha() *mag(phi/mesh.magSf()))
virtual ~twoPhaseSystem()
Destructor.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
tmp< surfaceScalarField > Vmf() const
Return the face virtual mass coefficient.
tmp< surfaceScalarField > Ff() const
Return the combined face-force (lift + wall-lubrication)
const dragModel & drag(const phaseModel &phase) const
Return the drag model for the given phase.
const virtualMassModel & virtualMass(const phaseModel &phase) const
Return the virtual mass model for the given phase.
MULES: Multidimensional universal limiter for explicit solution.
HashTable< scalar, phasePairKey, phasePairKey::hash > scalarTable
Scalar hash table.
A class for managing temporary objects.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< volScalarField > rho() const
Return the mixture density.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.