Go to the documentation of this file.
29 #include "twoPhaseSystem.H"
31 #include "BlendedInterfacialModel.H"
32 #include "virtualMassModel.H"
33 #include "heatTransferModel.H"
34 #include "liftModel.H"
35 #include "wallLubricationModel.H"
36 #include "turbulentDispersionModel.H"
38 #include "surfaceInterpolate.H"
49 #include "blendingMethod.H"
68 IOobject::MUST_READ_IF_MODIFIED,
109 IOobject::READ_IF_PRESENT,
128 this->get<wordList>(
"phases")
179 new BlendedInterfacialModel<dragModel>
183 blendingMethods_.
found(
"drag")
184 ? blendingMethods_[
"drag"]
185 : blendingMethods_[
"default"]
196 new BlendedInterfacialModel<virtualMassModel>
200 blendingMethods_.
found(
"virtualMass")
201 ? blendingMethods_[
"virtualMass"]
202 : blendingMethods_[
"default"]
212 new BlendedInterfacialModel<heatTransferModel>
216 blendingMethods_.
found(
"heatTransfer")
217 ? blendingMethods_[
"heatTransfer"]
218 : blendingMethods_[
"default"]
228 new BlendedInterfacialModel<liftModel>
232 blendingMethods_.
found(
"lift")
233 ? blendingMethods_[
"lift"]
234 : blendingMethods_[
"default"]
244 new BlendedInterfacialModel<wallLubricationModel>
246 lookup(
"wallLubrication"),
248 blendingMethods_.
found(
"wallLubrication")
249 ? blendingMethods_[
"wallLubrication"]
250 : blendingMethods_[
"default"]
258 turbulentDispersion_.
set
260 new BlendedInterfacialModel<turbulentDispersionModel>
262 lookup(
"turbulentDispersion"),
264 blendingMethods_.
found(
"turbulentDispersion")
265 ? blendingMethods_[
"turbulentDispersion"]
266 : blendingMethods_[
"default"]
286 return phase1_*phase1_.thermo().rho() + phase2_*phase2_.thermo().rho();
292 return phase1_*phase1_.U() + phase2_*phase2_.U();
318 return virtualMass_->K();
324 return virtualMass_->Kf();
330 return heatTransfer_->K();
336 return lift_->F<
vector>() + wallLubrication_->F<
vector>();
342 return lift_->Ff() + wallLubrication_->Ff();
348 return turbulentDispersion_->D();
370 word alphaScheme(
"div(phi," +
alpha1.name() +
')');
379 tmp<surfaceScalarField> alpha1alpha2f;
381 if (pPrimeByA_.valid())
424 if (dgdt_[celli] > 0.0)
426 Sp[celli] -= dgdt_[celli]/
max(1.0 -
alpha1[celli], 1
e-4);
427 Su[celli] += dgdt_[celli]/
max(1.0 -
alpha1[celli], 1
e-4);
429 else if (dgdt_[celli] < 0.0)
451 phase1_.correctInflowOutflow(alphaPhic1);
458 !(++alphaSubCycle).
end();
469 (alphaSubCycle.index()*
Sp)(),
470 (
Su - (alphaSubCycle.index() - 1)*
Sp*
alpha1)(),
471 UniformField<scalar>(phase1_.alphaMax()),
475 if (alphaSubCycle.index() == 1)
477 phase1_.alphaPhi() = alphaPhic10;
481 phase1_.alphaPhi() += alphaPhic10;
497 UniformField<scalar>(phase1_.alphaMax()),
501 phase1_.alphaPhi() = alphaPhic1;
504 if (pPrimeByA_.valid())
515 phase1_.alphaPhi() += alpha1Eqn.flux();
518 phase1_.alphaRhoPhi() =
521 phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
522 phase2_.correctInflowOutflow(phase2_.alphaPhi());
523 phase2_.alphaRhoPhi() =
527 <<
alpha1.weightedAverage(mesh_.V()).value()
550 phase1_.turbulence().correct();
551 phase2_.turbulence().correct();
561 readOK &= phase1_.read(*
this);
562 readOK &= phase2_.read(*
this);
575 return pair_->sigma();
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
tmp< volScalarField > sigma() const
Return the surface tension coefficient.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
tmp< volScalarField > rho() const
Return the mixture density.
const volScalarField & alpha2
dictionary()
Construct top-level dictionary null.
surfaceScalarField & phi1
const Time & time() const
Return time.
Calculate the snGrad of the given volField.
void correct()
Correct two-phase properties other than turbulence.
static word timeName(const scalar t, const int precision=precision_)
virtual bool read()
Read object.
Calculate the divergence of the given field.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
tmp< volScalarField > Kh() const
Return the heat transfer coefficient.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const volScalarField & alpha1
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
word alpharScheme("div(phirb,alpha)")
surfaceScalarField & phi2
void min(const dimensioned< Type > &dt)
Use the minimum of the field and specified value.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
#define forAll(list, i)
Loop across all elements in list.
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Calculate the curl of the given volField by constructing the Hodge-dual of the symmetric part of the ...
List< word > wordList
A List of words.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void set(T *p) noexcept
Deprecated(2018-02) Identical to reset().
surfaceScalarField phir(fvc::flux(UdmModel.Udm()))
fvMatrix< scalar > fvScalarMatrix
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.
messageStream Info
Information stream (uses stdout - output is on the master only)
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
Calculate the matrix for the laplacian of the field.
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
virtual void solve()
Solve for the phase fractions.
word dictName() const
The local dictionary name (final part of scoped name)
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Generic dimensioned Type class.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
twoPhaseSystem(const fvMesh &)
Construct from fvMesh.
const uniformDimensionedVectorField & g
phaseModel & phase2_
Phase model 2.
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.
HashTable< scalar, phasePairKey, phasePairKey::hash > scalarTable
Scalar hash table.
Vector< scalar > vector
A scalar version of the templated Vector.
tmp< surfaceScalarField > Vmf() const
Return the face virtual mass coefficient.
void correctBoundaryConditions()
Correct boundary field.
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
tmp< volScalarField > D() const
Return the turbulent diffusivity.
HashTable< dictionary, phasePairKey, phasePairKey::hash > dictTable
Dictionary hash table.
bool read()
Read base phaseProperties dictionary.
Calculate the face-flux of the given field.
const dimensionedScalar e
Elementary charge.
phaseModel & phase1_
Phase model 1.
void max(const dimensioned< Type > &dt)
Use the maximum of the field and specified value.
void correctTurbulence()
Correct two-phase turbulence.
Calculate the first temporal derivative.
virtual ~twoPhaseSystem()
Destructor.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
tmp< volVectorField > F() const
Return the combined force (lift + wall-lubrication)
tmp< volVectorField > U() const
Return the mixture velocity.
bool found(const Key &key) const
Return true if hashed entry is found in table.
tmp< volScalarField > Kd() const
Return the drag coefficient.
MULES: Multidimensional universal limiter for explicit solution.
constant condensation/saturation model.
static autoPtr< blendingMethod > New(const word &modelName, const dictionary &dict, const wordList &phaseNames)
Calculate the matrix for the first temporal derivative.
tmp< surfaceScalarField > Ff() const
Return the combined face-force (lift + wall-lubrication)