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" 66 mesh.time().constant(),
128 this->get<wordList>(
"phases")
183 blendingMethods_.
found(
"drag")
184 ? blendingMethods_[
"drag"]
185 : blendingMethods_[
"default"]
200 blendingMethods_.
found(
"virtualMass")
201 ? blendingMethods_[
"virtualMass"]
202 : blendingMethods_[
"default"]
216 blendingMethods_.
found(
"heatTransfer")
217 ? blendingMethods_[
"heatTransfer"]
218 : blendingMethods_[
"default"]
232 blendingMethods_.
found(
"lift")
233 ? blendingMethods_[
"lift"]
234 : blendingMethods_[
"default"]
242 wallLubrication_.reset
246 lookup(
"wallLubrication"),
248 blendingMethods_.
found(
"wallLubrication")
249 ? blendingMethods_[
"wallLubrication"]
250 : blendingMethods_[
"default"]
258 turbulentDispersion_.reset
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();
368 word alphaScheme(
"div(phi," +
alpha1.
name() +
')');
377 tmp<surfaceScalarField> alpha1alpha2f;
379 if (pPrimeByA_.valid())
397 mesh_.newIOobject(
"Sp"),
404 mesh_.newIOobject(
"Su"),
412 if (dgdt_[celli] > 0.0)
414 Sp[celli] -= dgdt_[celli]/
max(1.0 -
alpha1[celli], 1
e-4);
415 Su[celli] += dgdt_[celli]/
max(1.0 -
alpha1[celli], 1
e-4);
417 else if (dgdt_[celli] < 0.0)
439 phase1_.correctInflowOutflow(alphaPhic1);
446 !(++alphaSubCycle).
end();
457 (alphaSubCycle.index()*
Sp)(),
458 (
Su - (alphaSubCycle.index() - 1)*
Sp*
alpha1)(),
459 UniformField<scalar>(phase1_.alphaMax()),
463 if (alphaSubCycle.index() == 1)
465 phase1_.alphaPhi() = alphaPhic10;
469 phase1_.alphaPhi() += alphaPhic10;
485 UniformField<scalar>(phase1_.alphaMax()),
489 phase1_.alphaPhi() = alphaPhic1;
492 if (pPrimeByA_.valid())
503 phase1_.alphaPhi() += alpha1Eqn.flux();
506 phase1_.alphaRhoPhi() =
509 phase2_.alphaPhi() = phi_ - phase1_.alphaPhi();
510 phase2_.correctInflowOutflow(phase2_.alphaPhi());
511 phase2_.alphaRhoPhi() =
537 phase1_.turbulence().correct();
538 phase2_.turbulence().correct();
548 readOK &= phase1_.read(*
this);
549 readOK &= phase2_.read(*
this);
562 return pair_->sigma();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
virtual ~twoPhaseSystem()
Destructor.
word dictName() const
The local dictionary name (final part of scoped name)
phaseModel & phase1_
Phase model 1.
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return an entry data stream. FatalIOError if not found, or not a stream. ...
void clamp_range(const dimensioned< MinMax< Type >> &range)
Clamp field values (in-place) to the specified range.
tmp< volScalarField > Kd() const
Return the drag coefficient.
fvMatrix< scalar > fvScalarMatrix
tmp< volVectorField > F() const
Return the combined force (lift + wall-lubrication)
tmp< volVectorField > U() const
Return the mixture velocity.
void correct()
Correct two-phase properties other than turbulence.
virtual bool read()
Read object.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
tmp< volScalarField > rho() const
Return the mixture density.
tmp< surfaceScalarField > Ff() const
Return the combined face-force (lift + wall-lubrication)
bool found(const Key &key) const
Same as contains()
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
const word & name() const noexcept
Return the object name.
tmp< volScalarField > sigma() const
Return the surface tension coefficient.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
word alpharScheme("div(phirb,alpha)")
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.
const volScalarField & alpha2
const dimensionSet dimless
Dimensionless.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
surfaceScalarField & phi1
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
DimensionedField< scalar, volMesh > Internal
The internal field type from which this GeometricField is derived.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
tmp< volScalarField > D() const
Return the turbulent diffusivity.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void solve()
Solve for the phase fractions.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
Calculate the first temporal derivative.
tmp< surfaceScalarField > Vmf() const
Return the face virtual mass coefficient.
const dimensionedScalar e
Elementary charge.
phaseModel & phase2_
Phase model 2.
static autoPtr< blendingMethod > New(const word &modelName, const dictionary &dict, const wordList &phaseNames)
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)
Calculate the matrix for the first temporal derivative.
tmp< volScalarField > Vm() const
Return the virtual mass coefficient.
twoPhaseSystem(const fvMesh &)
Construct from fvMesh.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
surfaceScalarField & phi2
bool read()
Read base phaseProperties dictionary.
Calculate the divergence of the given field.
const uniformDimensionedVectorField & g
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
tmp< volScalarField > Kh() const
Return the heat transfer coefficient.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
tmp< surfaceScalarField > Kdf() const
Return the face drag coefficient.
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.
void correctTurbulence()
Correct two-phase turbulence.
Represents 0/1 range or concept. Used for tagged dispatch or clamping.
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Mesh data needed to do the Finite Volume discretisation.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
void correctBoundaryConditions()
Correct boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
MULES: Multidimensional universal limiter for explicit solution.
dimensioned< Type > weightedAverage(const DimensionedField< scalar, GeoMesh > &weightField) const
Calculate and return weighted average.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
void explicitSolve(const RdeltaTType &rDeltaT, const RhoType &rho, volScalarField &psi, const surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su)
Defines the attributes of an object for which implicit objectRegistry management is supported...
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
static constexpr const zero Zero
Global zero (0)
const volScalarField & alpha1