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" 63 mesh.time().constant(),
65 IOobject::MUST_READ_IF_MODIFIED,
106 IOobject::READ_IF_PRESENT,
113 phase2_.volScalarField::operator=(scalar(1) - phase1_);
119 blendingMethods_.insert
176 new BlendedInterfacialModel<dragModel>
180 blendingMethods_.found(
"drag")
181 ? blendingMethods_[
"drag"]
182 : blendingMethods_[
"default"]
193 new BlendedInterfacialModel<virtualMassModel>
197 blendingMethods_.found(
"virtualMass")
198 ? blendingMethods_[
"virtualMass"]
199 : blendingMethods_[
"default"]
209 new BlendedInterfacialModel<heatTransferModel>
213 blendingMethods_.found(
"heatTransfer")
214 ? blendingMethods_[
"heatTransfer"]
215 : blendingMethods_[
"default"]
225 new BlendedInterfacialModel<liftModel>
229 blendingMethods_.found(
"lift")
230 ? blendingMethods_[
"lift"]
231 : blendingMethods_[
"default"]
241 new BlendedInterfacialModel<wallLubricationModel>
243 lookup(
"wallLubrication"),
245 blendingMethods_.found(
"wallLubrication")
246 ? blendingMethods_[
"wallLubrication"]
247 : blendingMethods_[
"default"]
255 turbulentDispersion_.set
257 new BlendedInterfacialModel<turbulentDispersionModel>
259 lookup(
"turbulentDispersion"),
261 blendingMethods_.found(
"turbulentDispersion")
262 ? blendingMethods_[
"turbulentDispersion"]
263 : blendingMethods_[
"default"]
283 return phase1_*phase1_.thermo().rho() + phase2_*phase2_.thermo().rho();
289 return phase1_*phase1_.U() + phase2_*phase2_.U();
315 return virtualMass_->K();
321 return virtualMass_->Kf();
327 return heatTransfer_->K();
333 return lift_->F<
vector>() + wallLubrication_->F<
vector>();
339 return lift_->Ff() + wallLubrication_->Ff();
345 return turbulentDispersion_->D();
351 const Time& runTime = mesh_.time();
359 const dictionary& alphaControls = mesh_.solverDict
367 word alphaScheme(
"div(phi," + alpha1.name() +
')');
370 alpha1.correctBoundaryConditions();
376 tmp<surfaceScalarField> alpha1alpha2f;
378 if (pPrimeByA_.valid())
386 pPrimeByA_()*
fvc::snGrad(alpha1,
"bounded")*mesh_.magSf()
421 if (dgdt_[celli] > 0.0)
423 Sp[celli] -= dgdt_[celli]/
max(1.0 - alpha1[celli], 1
e-4);
424 Su[celli] += dgdt_[celli]/
max(1.0 - alpha1[celli], 1
e-4);
426 else if (dgdt_[celli] < 0.0)
428 Sp[celli] += dgdt_[celli]/
max(alpha1[celli], 1
e-4);
448 phase1_.correctInflowOutflow(alphaPhic1);
455 !(++alphaSubCycle).end();
466 (alphaSubCycle.index()*
Sp)(),
467 (
Su - (alphaSubCycle.index() - 1)*
Sp*alpha1)(),
468 UniformField<scalar>(phase1_.alphaMax()),
472 if (alphaSubCycle.index() == 1)
474 phase1_.alphaPhi() = alphaPhic10;
478 phase1_.alphaPhi() += alphaPhic10;
494 UniformField<scalar>(phase1_.alphaMax()),
498 phase1_.alphaPhi() = alphaPhic1;
501 if (pPrimeByA_.valid())
512 phase1_.alphaPhi() += alpha1Eqn.flux();
515 phase1_.alphaRhoPhi() =
518 phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
519 phase2_.correctInflowOutflow(phase2_.alphaPhi());
520 phase2_.alphaRhoPhi() =
523 Info<< alpha1.name() <<
" volume fraction = " 524 << alpha1.weightedAverage(mesh_.V()).value()
525 <<
" Min(" << alpha1.name() <<
") = " <<
min(alpha1).value()
526 <<
" Max(" << alpha1.name() <<
") = " <<
max(alpha1).value()
533 alpha2 = scalar(1) -
alpha1;
547 phase1_.turbulence().correct();
548 phase2_.turbulence().correct();
558 readOK &= phase1_.read(*
this);
559 readOK &= phase2_.read(*
this);
574 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.
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.
static autoPtr< blendingMethod > New(const word &modelName, const dictionary &dict, const wordList &phaseNames)
const volScalarField & alpha1
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
Calculate 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)
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)
MULES: Multidimensional universal limiter for explicit solution.
const doubleScalar e
Elementary charge.
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.