Go to the documentation of this file.
31 #include "BlendedInterfacialModel.H"
32 #include "dragModel.H"
33 #include "virtualMassModel.H"
34 #include "liftModel.H"
35 #include "wallLubricationModel.H"
36 #include "turbulentDispersionModel.H"
53 template<
class BasePhaseSystem>
57 const phasePairKey& key
60 if (dragModels_.found(key))
62 return dragModels_[key]->K();
68 dragModel::typeName +
":K",
76 template<
class BasePhaseSystem>
80 const phasePairKey& key
83 if (dragModels_.found(key))
85 return dragModels_[key]->Kf();
91 dragModel::typeName +
":K",
99 template<
class BasePhaseSystem>
103 const phasePairKey& key
106 if (virtualMassModels_.found(key))
108 return virtualMassModels_[key]->K();
114 virtualMassModel::typeName +
":K",
122 template<
class BasePhaseSystem>
128 phaseSystem::phasePairTable,
133 const phasePair& pair(phasePairIter());
146 if (!pair.phase1().stationary())
151 eqn += dmdt21*pair.phase2().U() -
fvm::Sp(dmdt21, eqn.psi());
154 if (!pair.phase2().stationary())
159 eqn -= dmdt12*pair.phase1().U() -
fvm::Sp(dmdt12, eqn.psi());
167 template<
class BasePhaseSystem>
174 BasePhaseSystem(
mesh)
176 this->generatePairsAndSubModels
182 this->generatePairsAndSubModels
188 this->generatePairsAndSubModels
194 this->generatePairsAndSubModels
197 wallLubricationModels_
200 this->generatePairsAndSubModels
202 "turbulentDispersion",
203 turbulentDispersionModels_
213 const phasePair& pair(this->phasePairs_[dragModelIter.key()]);
220 IOobject::groupName(
"Kd", pair.name()),
230 IOobject::groupName(
"Kdf", pair.name()),
231 dragModelIter()->Kf()
243 const phasePair& pair(this->phasePairs_[virtualMassModelIter.key()]);
250 IOobject::groupName(
"Vm", pair.name()),
251 virtualMassModelIter()->K()
260 IOobject::groupName(
"Vmf", pair.name()),
261 virtualMassModelIter()->Kf()
270 template<
class BasePhaseSystem>
278 template<
class BasePhaseSystem>
290 forAll(this->movingPhases(), movingPhasei)
309 *Kds_[dragModelIter.key()] = dragModelIter()->K();
310 *Kdfs_[dragModelIter.key()] = dragModelIter()->Kf();
317 const phasePair& pair(this->phasePairs_[KdIter.key()]);
321 if (!iter().stationary())
338 *Vms_[virtualMassModelIter.key()] = virtualMassModelIter()->K();
339 *Vmfs_[virtualMassModelIter.key()] = virtualMassModelIter()->Kf();
346 const phasePair& pair(this->phasePairs_[VmIter.key()]);
353 if (!
phase.stationary())
368 + this->MRF_.DDt(Vm,
U - otherPhase.
U());
374 addMassTransferMomentumTransfer(eqns);
380 template<
class BasePhaseSystem>
392 forAll(this->movingPhases(), movingPhasei)
409 if (!
phase.stationary())
430 const phasePair& pair(this->phasePairs_[VmIter.key()]);
437 if (!
phase.stationary())
442 UgradUs[
phase.index()]
443 - (UgradUs[otherPhase.
index()] & otherPhase.
U())
450 addMassTransferMomentumTransfer(eqns);
456 template<
class BasePhaseSystem>
466 const phasePair& pair(this->phasePairs_[KdfIter.key()]);
470 this->addField(iter(),
"AFf", Kf,
AFfs);
478 const phasePair& pair(this->phasePairs_[VmfIter.key()]);
486 if (this->fillFields_)
495 template<
class BasePhaseSystem>
513 const phasePair& pair(this->phasePairs_[liftModelIter.key()]);
535 wallLubricationModels_,
536 wallLubricationModelIter
541 pair(this->phasePairs_[wallLubricationModelIter.key()]);
577 const bool implicitPhasePressure =
578 this->mesh_.solverDict(
phase.volScalarField::name()).
579 template getOrDefault<Switch>
581 "implicitPhasePressure",
585 if (implicitPhasePressure)
587 this->addField(
phase,
"DByAf", pPrimeByAf, DByAfs_);
595 turbulentDispersionModels_,
596 turbulentDispersionModelIter
600 pair(this->phasePairs_[turbulentDispersionModelIter.key()]);
621 if (DByAfs_.found(pair.phase1().name()))
623 this->addField(pair.phase1(),
"DByAf", DByA1f, DByAfs_);
627 if (this->fillFields_)
636 template<
class BasePhaseSystem>
649 const phasePair& pair(this->phasePairs_[VmfIter.key()]);
660 + iter.otherPhase().DUDtf()
676 const phasePair& pair(this->phasePairs_[liftModelIter.key()]);
682 rAUfs[pair.phase1().index()]*
Ff,
689 -
rAUfs[pair.phase2().index()]*
Ff,
698 wallLubricationModels_,
699 wallLubricationModelIter
704 pair(this->phasePairs_[wallLubricationModelIter.key()]);
710 rAUfs[pair.phase1().index()]*
Ff,
717 -
rAUfs[pair.phase2().index()]*
Ff,
740 const bool implicitPhasePressure =
741 this->mesh_.solverDict(
phase.volScalarField::name()).
742 template getOrDefault<Switch>
744 "implicitPhasePressure",
748 if (implicitPhasePressure)
750 this->addField(
phase,
"DByAf", pPrimeByAf, DByAfs_);
758 turbulentDispersionModels_,
759 turbulentDispersionModelIter
763 pair(this->phasePairs_[turbulentDispersionModelIter.key()]);
784 if (DByAfs_.found(pair.phase1().name()))
786 this->addField(pair.phase1(),
"DByAf", DByAf1, DByAfs_);
790 if (this->fillFields_)
799 template<
class BasePhaseSystem>
812 const phasePair& pair(this->phasePairs_[KdIter.key()]);
827 if (this->fillFields_)
841 template<
class BasePhaseSystem>
854 const phasePair& pair(this->phasePairs_[KdfIter.key()]);
862 -
rAUfs[iter().index()]*Kf
869 if (this->fillFields_)
883 template<
class BasePhaseSystem>
896 const phasePair& pair(this->phasePairs_[KdIter.key()]);
904 -
rAUs[iter().index()]*
K*iter.otherPhase().U(),
910 if (this->fillFields_)
919 template<
class BasePhaseSystem>
924 const bool includeVirtualMass
957 surfaceScalarField::Boundary& phiCorrCoeffBf =
958 phiCorrCoeff.
ref().boundaryFieldRef();
960 forAll(this->mesh_.boundary(), patchi)
965 !this->mesh_.boundary()[patchi].coupled()
966 || isA<cyclicAMIFvPatch>(this->mesh_.boundary()[patchi])
969 phiCorrCoeffBf[patchi] = 0;
986 if (includeVirtualMass)
991 const phasePair& pair(this->phasePairs_[VmIter.key()]);
1004 phiCorrs[
phase.index()]
1005 + this->
MRF().absolute(otherPhase.
phi())
1007 - phiCorrs[otherPhase.
index()]
1019 template<
class BasePhaseSystem>
1025 Info<<
"Inverting drag systems: ";
1051 const phasePair& pair(this->phasePairs_[KdIter.key()]);
1054 const label phase2i = pair.phase2().index();
1097 for (label i = 0; i <
phases.size(); ++ i)
1099 for (label j = i + 1; j <
phases.size(); ++ j)
1101 KdByAs[i][j] /= KdByAs[i][i];
1102 phiKds[i][j] /= phiKds[i][i];
1103 for (label
k = i + 1;
k <
phases.size(); ++
k)
1105 KdByAs[j][
k] -= KdByAs[j][i]*KdByAs[i][
k];
1106 phiKds[j][
k] -= phiKds[j][i]*phiKds[i][
k];
1113 for (label i = 1; i <
phases.size(); ++ i)
1115 detKdByAs *= KdByAs[i][i];
1116 detPhiKdfs *= phiKds[i][i];
1123 for (label i = 1; i <
phases.size(); ++ i)
1125 if (!
phases[i].stationary())
1127 for (label j = 0; j < i; j ++)
1134 for (label i =
phases.size() - 1; i >= 0; i --)
1136 if (!
phases[i].stationary())
1138 for (label j =
phases.size() - 1; j > i; j --)
1143 phases[i].URef() /= KdByAs[i][i];
1144 phases[i].phiRef() /= phiKds[i][i];
1150 template<
class BasePhaseSystem>
1156 Info<<
"Inverting drag system: ";
1175 const phasePair& pair(this->phasePairs_[KdfIter.key()]);
1178 const label phase2i = pair.phase2().index();
1204 for (label i = 0; i <
phases.size(); ++ i)
1206 for (label j = i + 1; j <
phases.size(); ++ j)
1208 phiKdfs[i][j] /= phiKdfs[i][i];
1209 for (label
k = i + 1;
k <
phases.size(); ++
k)
1211 phiKdfs[j][
k] -= phiKdfs[j][i]*phiKdfs[i][
k];
1217 for (label i = 1; i <
phases.size(); ++ i)
1219 detPhiKdfs *= phiKdfs[i][i];
1225 for (label i = 1; i <
phases.size(); ++ i)
1227 if (!
phases[i].stationary())
1229 for (label j = 0; j < i; j ++)
1235 for (label i =
phases.size() - 1; i >= 0; i --)
1237 if (!
phases[i].stationary())
1239 for (label j =
phases.size() - 1; j > i; j --)
1243 phases[i].phiRef() /= phiKdfs[i][i];
1249 template<
class BasePhaseSystem>
1257 template<
class BasePhaseSystem>
virtual PtrList< surfaceScalarField > phiFfs(const PtrList< surfaceScalarField > &rAUfs)
As phiFs, but for the face-based algorithm.
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Description for mass transfer between a pair of phases. The direction of the mass transfer is from th...
label index() const
Return the index of the phase.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Dimensionless.
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
virtual ~MomentumTransferPhaseSystem()
Destructor.
PtrList< volScalarField > rAUs
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
A class for managing temporary objects.
const dimensionSet dimVelocity
const dimensionSet dimDensity
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
dimensionedScalar posPart(const dimensionedScalar &ds)
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Calculate the snGrad of the given volField.
virtual PtrList< volVectorField > KdUByAs(const PtrList< volScalarField > &rAUs) const
Return the explicit part of the drag force for the cell-based.
Info<< "Creating field kinetic energy K\n"<< endl;volScalarField K("K", 0.5 *magSqr(U));if(U.nOldTimes()){ volVectorField *Uold=&U.oldTime();volScalarField *Kold=&K.oldTime();*Kold==0.5 *magSqr(*Uold);while(Uold->nOldTimes()) { Uold=&Uold-> oldTime()
Calculate the divergence of the given field.
const phaseModel & otherPhase() const
Return the other phase in this two-phase system.
surfaceScalarField Ff(fluid.Ff())
volVectorField F(fluid.F())
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pos0(const dimensionedScalar &ds)
const dimensionSet dimForce
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
const GeometricField< Type, fvPatchField, volMesh > & psi() const
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object.
Calculate the matrix for the divergence of the given field and flux.
#define forAll(list, i)
Loop across all elements in list.
CGAL::Exact_predicates_exact_constructions_kernel K
surfaceScalarField Vmf("Vmf", fluid.Vmf())
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
fvMatrix< vector > fvVectorMatrix
bool set(const Key &key, T *ptr)
Assign a new entry, overwriting existing entries.
tmp< GeometricField< Type, faPatchField, areaMesh > > average(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Area-weighted average a edgeField creating a areaField.
PtrList< surfaceScalarField > AFfs(fluid.AFfs())
messageStream Info
Information stream (uses stdout - output is on the master only)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void partialElimination(const PtrList< volScalarField > &rAUs)
Solve the drag system for the velocities and fluxes.
virtual PtrList< surfaceScalarField > phiKdPhis(const PtrList< volScalarField > &rAUs) const
Return the explicit drag force fluxes for the cell-based algorithm.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransferf()
As momentumTransfer, but for the face-based algorithm.
MomentumTransferPhaseSystem(const fvMesh &)
Construct from fvMesh.
PtrList< surfaceScalarField > phiFfs(fluid.phiFfs(rAUfs))
Mesh data needed to do the Finite Volume discretisation.
virtual PtrList< surfaceScalarField > phiKdPhifs(const PtrList< surfaceScalarField > &rAUfs) const
As phiKdPhis, but for the face-based algorithm.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
PtrList< surfaceScalarField > phiFs(fluid.phiFs(rAUs))
surfaceScalarField snGradAlpha1(fvc::snGrad(alpha1) *mesh.magSf())
Calculate the matrix for implicit and explicit sources.
const word & name() const
virtual tmp< surfaceScalarField > phi() const =0
Return the volumetric flux.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
fluid fillFields("rAU", dimTime/dimDensity, rAUs)
virtual bool read()
Read base phaseProperties dictionary.
virtual PtrList< surfaceScalarField > phiFs(const PtrList< volScalarField > &rAUs)
Return the explicit force fluxes for the cell-based algorithm, that.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
dimensionedScalar negPart(const dimensionedScalar &ds)
PtrList< surfaceScalarField > rAUfs
A HashTable of pointers to objects of type <T>.
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Calculate the face-flux of the given field.
multiphaseSystem::phaseModelList & phases
label k
Boltzmann constant.
const dimensionedScalar & D
A special matrix type and solver, designed for finite volume solutions of scalar equations....
virtual tmp< volVectorField > U() const =0
Return the velocity.
virtual void partialEliminationf(const PtrList< surfaceScalarField > &rAUfs)
As partialElimination, but for the face-based algorithm. Only solves.
Calculate the first temporal derivative.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransfer()
Return the momentum transfer matrices for the cell-based algorithm.
virtual PtrList< surfaceScalarField > AFfs() const
Return implicit force coefficients on the faces, for the face-based.
Type gMin(const FieldField< Field, Type > &f)
tmp< volScalarField > byDt(const volScalarField &vf)
const phaseModel & phase1() const
Return phase 1.
Area-weighted average a surfaceField creating a volField.
Class which models interfacial momenum transfer between a number of phases. Drag, virtual mass,...
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
virtual PtrList< surfaceScalarField > ddtCorrByAs(const PtrList< volScalarField > &rAUs, const bool includeVirtualMass=false) const
Return the flux corrections for the cell-based algorithm. These.
Calculate the matrix for the first temporal derivative.
virtual const HashPtrTable< surfaceScalarField > & DByAfs() const
Return the phase diffusivities divided by the momentum coefficients.
virtual tmp< volVectorField > DUDt() const =0
Return the substantive acceleration.
const dimensionedScalar & rho() const
Return const-access to phase1 density.