28 #include "twoPhaseSystem.H" 29 #include "dragModel.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::GeometricBoundaryField& ebf = epsilon.
boundaryField();
182 if (isA<fixedValueFvPatchScalarField>(ebf[
patchi]))
184 ebt[
patchi] = fixedValueFvPatchScalarField::typeName;
192 template<
class BasicTurbulenceModel>
199 volScalarField::GeometricBoundaryField& bf = vsf.
boundaryField();
200 const volScalarField::GeometricBoundaryField& 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();
341 template<
class BasicTurbulenceModel>
345 if (!liquidTurbulencePtr_)
351 refCast<const twoPhaseSystem>(gas.fluid());
354 liquidTurbulencePtr_ =
368 return *liquidTurbulencePtr_;
372 template<
class BasicTurbulenceModel>
376 this->liquidTurbulence();
388 (6*this->Cmu_/(4*
sqrt(3.0/2.0)))
389 *fluid.
drag(gas).
K()/liquid.rho()
390 *(liquidTurbulence.
k_/liquidTurbulence.
epsilon_)
392 volScalarField Ct0((3 + beta)/(1 + beta + 2*gas.rho()/liquid.rho()));
393 volScalarField fAlphad((180 + (-4.71e3 + 4.26e4*alphag)*alphag)*alphag);
395 return sqr(1 + (Ct0 - 1)*
exp(-fAlphad));
399 template<
class BasicTurbulenceModel>
408 template<
class BasicTurbulenceModel>
419 template<
class BasicTurbulenceModel>
425 return alphal*rholEff() + alphag*rhogEff();
429 template<
class BasicTurbulenceModel>
439 return (alphal*rholEff()*fc + alphag*rhogEff()*fd)/rhom_();
443 template<
class BasicTurbulenceModel>
454 (alphal*rholEff()*fc + alphag*rhogEff()*Ct2_()*fd)
455 /(alphal*rholEff() + alphag*rhogEff()*Ct2_());
459 template<
class BasicTurbulenceModel>
481 template<
class BasicTurbulenceModel>
485 this->liquidTurbulence();
500 +
pow(fluid.
drag(gas).
CdRe()*liquid.nu()/gas.d(), 4.0/3.0)
517 template<
class BasicTurbulenceModel>
520 return fvm::Su(bubbleG()/rhom_(), km_());
524 template<
class BasicTurbulenceModel>
527 return fvm::Su(C3_*epsilonm_()*bubbleG()/(rhom_()*km_()), epsilonm_());
531 template<
class BasicTurbulenceModel>
538 if (&gas != &fluid.
phase1())
542 this->liquidTurbulence();
547 if (!this->turbulence_)
565 this->liquidTurbulence();
644 bound(km, this->kMin_);
645 epsilonm == mix(epsilonl, epsilong);
646 bound(epsilonm, this->epsilonMin_);
657 -
fvm::SuSp(((2.0/3.0)*C1_)*divUm, epsilonm)
658 -
fvm::Sp(C2_*epsilonm/km, epsilonm)
667 bound(epsilonm, this->epsilonMin_);
686 bound(km, this->kMin_);
689 volScalarField Cc2(rhom/(alphal*rholEff() + alphag*rhogEff()*Ct2_()));
692 epsilonl = Cc2*epsilonm;
699 epsilong = Ct2_()*epsilonl;
701 nutg = Ct2_()*(liquidTurbulence.nu()/this->
nu())*nutl;
const phaseModel & phase1() const
Constant access phase model 1.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &vf, const surfaceScalarField &faceFlux, Istream &schemeData)
dimensionedScalar sqrt(const dimensionedScalar &ds)
tmp< fvMatrix< Type > > ddt(const GeometricField< Type, fvPatchField, volMesh > &vf)
dimensionedScalar pow3(const dimensionedScalar &ds)
const virtualMassModel & virtualMass(const phaseModel &phase) const
Return the virtual mass model for the given phase.
tmp< volScalarField > rhogEff() const
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Calculate the matrix for implicit and explicit sources.
tmp< fvMatrix< Type > > div(const surfaceScalarField &flux, const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
dimensioned< scalar > mag(const dimensioned< Type > &)
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
tmp< surfaceScalarField > mixFlux(const surfaceScalarField &fc, const surfaceScalarField &fd) const
Bound the given scalar field if it has gone unbounded.
void clear() const
If object pointer points to valid object:
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
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/dm2/henry/OpenFOAM/OpenFOAM-3.0.x/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()
volScalarField & bound(volScalarField &, const dimensionedScalar &lowerBound)
Bound the given scalar field if it has gone unbounded.
A class for handling words, derived from string.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
dimensionedScalar exp(const dimensionedScalar &ds)
virtual bool read()
Re-read model coefficients if they have changed.
Templated abstract base class for RAS turbulence models.
surfaceScalarField phig(-rhorAUf *ghf *fvc::snGrad(rho)*mesh.magSf())
void correctInletOutlet(volScalarField &vsf, const volScalarField &refVsf) const
virtual tmp< fvScalarMatrix > epsilonSource() const
tmp< fvMatrix< Type > > Sp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
static word groupName(Name name, const word &group)
wordList epsilonBoundaryTypes(const volScalarField &epsilon) const
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Generic dimensioned Type class.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
BasicTurbulenceModel::rhoField rhoField
tmp< volScalarField > bubbleG() const
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
tmp< fvMatrix< Type > > SuSp(const DimensionedField< scalar, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const phaseModel & otherPhase(const phaseModel &phase) const
Constant access the phase not given as an argument.
tmp< volScalarField > mix(const volScalarField &fc, const volScalarField &fd) const
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Class which solves the volume fraction equations for two phases.
virtual tmp< fvScalarMatrix > kSource() const
Mixture k-epsilon turbulence model for two-phase gas-liquid systems.
Eddy viscosity turbulence model base class.
const Type & lookupObject(const word &name) const
Lookup and return the object of the given Type.
virtual tmp< volScalarField > Cvm() const =0
Return the virtual mass coefficient.
tmp< volScalarField > rhom() const
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
tmp< volScalarField > mixU(const volScalarField &fc, const volScalarField &fd) const
tmp< volScalarField > Ct2() const
BasicTurbulenceModel::transportModel transportModel
solverPerformance solve(fvMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
tmp< fvMatrix< Type > > Su(const DimensionedField< Type, volMesh > &, const GeometricField< Type, fvPatchField, volMesh > &)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
void correctBoundaryConditions()
Correct boundary field.
virtual tmp< volScalarField > K(const volScalarField &Ur) const =0
The dragfunction K used in the momentum eq.
BasicTurbulenceModel::alphaField alphaField
const dimensionedScalar & rho() const
static const word propertiesName
Default name of the turbulence properties dictionary.
bool read(const char *, int32_t &)
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
virtual tmp< volScalarField > CdRe() const =0
Drag coefficient.
const objectRegistry & db() const
Return the local objectRegistry.
tmp< volScalarField > rholEff() const
const dragModel & drag(const phaseModel &phase) const
Return the drag model for the given phase.
A class for managing temporary objects.
virtual void correctNut()