29 #include "twoPhaseSystem.H" 30 #include "virtualMassModel.H" 44 template<
class BasicTurbulenceModel>
45 mixtureKEpsilon<BasicTurbulenceModel>::mixtureKEpsilon
53 const word& propertiesName,
69 liquidTurbulencePtr_(NULL),
140 this->runTime_.timeName(),
152 this->runTime_.timeName(),
160 bound(k_, this->kMin_);
161 bound(epsilon_, this->epsilonMin_);
163 if (type == typeName)
165 this->printCoeffs(type);
170 template<
class BasicTurbulenceModel>
176 const volScalarField::Boundary& ebf = epsilon.
boundaryField();
182 if (isA<fixedValueFvPatchScalarField>(ebf[
patchi]))
184 ebt[
patchi] = fixedValueFvPatchScalarField::typeName;
192 template<
class BasicTurbulenceModel>
200 const volScalarField::Boundary& refBf =
207 isA<inletOutletFvPatchScalarField>(bf[
patchi])
208 && isA<inletOutletFvPatchScalarField>(refBf[patchi])
211 refCast<inletOutletFvPatchScalarField>
213 refCast<const inletOutletFvPatchScalarField>
214 (refBf[
patchi]).refValue();
220 template<
class BasicTurbulenceModel>
223 if (rhom_.valid())
return;
236 this->runTime_.timeName(this->runTime_.startTime().value())
287 correctInletOutlet(km_(), kl);
301 mix(epsilonl, epsilong),
302 epsilonBoundaryTypes(epsilonl)
305 correctInletOutlet(epsilonm_(), epsilonl);
311 template<
class BasicTurbulenceModel>
316 Cmu_.readIfPresent(this->coeffDict());
317 C1_.readIfPresent(this->coeffDict());
318 C2_.readIfPresent(this->coeffDict());
319 C3_.readIfPresent(this->coeffDict());
320 Cp_.readIfPresent(this->coeffDict());
321 sigmak_.readIfPresent(this->coeffDict());
322 sigmaEps_.readIfPresent(this->coeffDict());
333 template<
class BasicTurbulenceModel>
336 this->nut_ = Cmu_*
sqr(k_)/epsilon_;
337 this->nut_.correctBoundaryConditions();
340 BasicTurbulenceModel::correctNut();
344 template<
class BasicTurbulenceModel>
348 if (!liquidTurbulencePtr_)
354 refCast<const twoPhaseSystem>(gas.fluid());
357 liquidTurbulencePtr_ =
371 return *liquidTurbulencePtr_;
375 template<
class BasicTurbulenceModel>
379 this->liquidTurbulence();
391 (6*this->Cmu_/(4*
sqrt(3.0/2.0)))
392 *fluid.
drag(gas).
K()/liquid.rho()
393 *(liquidTurbulence.
k_/liquidTurbulence.
epsilon_)
395 volScalarField Ct0((3 + beta)/(1 + beta + 2*gas.rho()/liquid.rho()));
396 volScalarField fAlphad((180 + (-4.71e3 + 4.26e4*alphag)*alphag)*alphag);
398 return sqr(1 + (Ct0 - 1)*
exp(-fAlphad));
402 template<
class BasicTurbulenceModel>
411 template<
class BasicTurbulenceModel>
422 template<
class BasicTurbulenceModel>
428 return alphal*rholEff() + alphag*rhogEff();
432 template<
class BasicTurbulenceModel>
442 return (alphal*rholEff()*fc + alphag*rhogEff()*fd)/rhom_();
446 template<
class BasicTurbulenceModel>
457 (alphal*rholEff()*fc + alphag*rhogEff()*Ct2_()*fd)
458 /(alphal*rholEff() + alphag*rhogEff()*Ct2_());
462 template<
class BasicTurbulenceModel>
484 template<
class BasicTurbulenceModel>
488 this->liquidTurbulence();
503 +
pow(fluid.
drag(gas).
CdRe()*liquid.nu()/gas.d(), 4.0/3.0)
520 template<
class BasicTurbulenceModel>
523 return fvm::Su(bubbleG()/rhom_(), km_());
527 template<
class BasicTurbulenceModel>
530 return fvm::Su(C3_*epsilonm_()*bubbleG()/(rhom_()*km_()), epsilonm_());
534 template<
class BasicTurbulenceModel>
541 if (&gas != &fluid.
phase1())
545 this->liquidTurbulence();
550 if (!this->turbulence_)
568 this->liquidTurbulence();
649 bound(km, this->kMin_);
650 epsilonm == mix(epsilonl, epsilong);
651 bound(epsilonm, this->epsilonMin_);
662 -
fvm::SuSp(((2.0/3.0)*C1_)*divUm, epsilonm)
663 -
fvm::Sp(C2_*epsilonm/km, epsilonm)
668 epsEqn.
ref().relax();
673 bound(epsilonm, this->epsilonMin_);
695 bound(km, this->kMin_);
698 volScalarField Cc2(rhom/(alphal*rholEff() + alphag*rhogEff()*Ct2_()));
701 epsilonl = Cc2*epsilonm;
708 epsilong = Ct2_()*epsilonl;
710 nutg = Ct2_()*(liquidTurbulence.nu()/this->
nu())*nutl;
BasicTurbulenceModel::alphaField alphaField
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
#define forAll(list, i)
Loop across all elements in list.
const virtualMassModel & virtualMass(const phaseModel &phase) const
Return the virtual mass model for the given phase.
BasicTurbulenceModel::rhoField rhoField
tmp< volScalarField > rhogEff() const
const objectRegistry & db() const
Return the local objectRegistry.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
tmp< fvMatrix< Type > > Sp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
BasicTurbulenceModel::transportModel transportModel
void correct(GeometricField< Type, fvPatchField, volMesh > &field)
Apply correction to field.
tmp< fvMatrix< Type > > Su(const DimensionedField< Type, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< volScalarField > mix(const volScalarField &fc, const volScalarField &fd) const
tmp< volScalarField > mixU(const volScalarField &fc, const volScalarField &fd) const
Generic dimensioned Type class.
virtual tmp< fvScalarMatrix > epsilonSource() const
Eddy viscosity turbulence model base class.
tmp< volScalarField > rholEff() const
virtual tmp< fvScalarMatrix > kSource() const
tmp< volScalarField > Ct2() const
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
Class which solves the volume fraction equations for two phases.
Templated abstract base class for RAS turbulence models.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
void clear() const
If object pointer points to valid object:
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
bool read(const char *, int32_t &)
virtual void correctNut()
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar exp(const dimensionedScalar &ds)
const Boundary & boundaryField() const
Return const-reference to the boundary field.
tmp< surfaceScalarField > mixFlux(const surfaceScalarField &fc, const surfaceScalarField &fd) const
tmp< fvMatrix< Type > > SuSp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from string.
SolverPerformance< Type > solve(fvMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
static word groupName(Name name, const word &group)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
virtual bool read()
Re-read model coefficients if they have changed.
const dimensionedScalar & rho() const
surfaceScalarField phig("phig",-rhorAUf *ghf *fvc::snGrad(rho)*mesh.magSf())
const phaseModel & otherPhase(const phaseModel &phase) const
Constant access the phase not given as an argument.
void constrain(fvMatrix< Type > &eqn)
Apply constraints to equation.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Bound the given scalar field if it has gone unbounded.
Info<< "Predicted p max-min : "<< max(p).value()<< " "<< min(p).value()<< endl;rho==max(psi *p+alphal *rhol0+((alphav *psiv+alphal *psil)-psi)*pSat, rhoMin);#1"/home/ubuntu/OpenFOAM-4.1/applications/solvers/multiphase/cavitatingFoam/alphavPsi.H"1{alphav=max(min((rho-rholSat)/(rhovSat-rholSat), scalar(1)), scalar(0));alphal=1.0-alphav;Info<< "max-min alphav: "<< max(alphav).value()<< " "<< min(alphav).value()<< endl;psiModel-> correct()
tmp< volScalarField > bubbleG() const
virtual tmp< volScalarField > Cvm() const =0
Return the virtual mass 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.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
wordList epsilonBoundaryTypes(const volScalarField &epsilon) const
dimensionedScalar pow3(const dimensionedScalar &ds)
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
volScalarField & bound(volScalarField &, const dimensionedScalar &lowerBound)
Bound the given scalar field if it has gone unbounded.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
Mixture k-epsilon turbulence model for two-phase gas-liquid systems.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
void correctBoundaryConditions()
Correct boundary field.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
dimensioned< scalar > mag(const dimensioned< Type > &)
const dragModel & drag(const phaseModel &phase) const
Return the drag model for the given phase.
const phaseModel & phase1() const
Constant access phase model 1.
A class for managing temporary objects.
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
static options & New(const fvMesh &mesh)
Construct fvOptions and register to datbase if not present.
T & ref() const
Return non-const reference or generate a fatal error.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
virtual tmp< volScalarField > K(const volScalarField &Ur) const =0
The dragfunction K used in the momentum eq.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
tmp< volScalarField > rhom() const
void correctInletOutlet(volScalarField &vsf, const volScalarField &refVsf) const
Calculate the matrix for implicit and explicit sources.