phaseModels: Buried turbulence modelling

This commit is contained in:
Will Bainbridge
2018-02-15 16:22:00 +00:00
parent adb1a08168
commit be02e72220
21 changed files with 241 additions and 70 deletions

View File

@ -132,7 +132,11 @@ alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat
const label patchi = patch().index();
// Retrieve turbulence properties from model
const phaseCompressibleTurbulenceModel& turbModel = phase.turbulence();
const phaseCompressibleTurbulenceModel& turbModel =
db().lookupObject<phaseCompressibleTurbulenceModel>
(
IOobject::groupName(turbulenceModel::propertiesName, phase.name())
);
const scalar Cmu25 = pow025(Cmu_);

View File

@ -408,9 +408,25 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
const phaseModel& vapor(fluid.phases()[otherPhaseName_]);
// Retrieve turbulence properties from model
// Retrieve turbulence properties from models
const phaseCompressibleTurbulenceModel& turbModel =
liquid.turbulence();
db().lookupObject<phaseCompressibleTurbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
liquid.name()
)
);
const phaseCompressibleTurbulenceModel& vaporTurbModel =
db().lookupObject<phaseCompressibleTurbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
vapor.name()
)
);
const tmp<scalarField> tnutw = turbModel.nut(patchi);
@ -457,10 +473,10 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs()
const scalarField yPlusTherm(this->yPlusTherm(P, Prat));
const fvPatchScalarField& rhoLiquidw =
liquid.turbulence().rho().boundaryField()[patchi];
turbModel.rho().boundaryField()[patchi];
const fvPatchScalarField& rhoVaporw =
vapor.turbulence().rho().boundaryField()[patchi];
vaporTurbModel.rho().boundaryField()[patchi];
tmp<volScalarField> tCp = liquid.thermo().Cp();
const volScalarField& Cp = tCp();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -139,14 +139,7 @@ void Foam::fixedMultiPhaseHeatFluxFvPatchScalarField::updateCoeffs()
const fvPatchScalarField& T =
thermo.T().boundaryField()[patch().index()];
const scalarField kappaEff
(
thermo.kappaEff
(
phase.turbulence().alphat(patch().index()),
patch().index()
)
);
const scalarField kappaEff(phase.kappaEff(patch().index()));
if (debug)
{

View File

@ -89,11 +89,8 @@ KocamustafaogullariIshii::dDeparture
const uniformDimensionedVectorField& g =
liquid.mesh().lookupObject<uniformDimensionedVectorField>("g");
const fvPatchScalarField& rhoLiquid =
liquid.turbulence().rho().boundaryField()[patchi];
const fvPatchScalarField& rhoVapor =
vapor.turbulence().rho().boundaryField()[patchi];
const scalarField rhoLiquid(liquid.thermo().rho(patchi));
const scalarField rhoVapor(vapor.thermo().rho(patchi));
const scalarField rhoM((rhoLiquid - rhoVapor)/rhoVapor);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -82,11 +82,8 @@ Cole::fDeparture
const uniformDimensionedVectorField& g =
liquid.mesh().lookupObject<uniformDimensionedVectorField>("g");
const fvPatchScalarField& rhoLiquid =
liquid.turbulence().rho().boundaryField()[patchi];
const fvPatchScalarField& rhoVapor =
vapor.turbulence().rho().boundaryField()[patchi];
const scalarField rhoLiquid(liquid.thermo().rho(patchi));
const scalarField rhoVapor(vapor.thermo().rho(patchi));
return sqrt
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -82,20 +82,17 @@ Foam::tmp<Foam::volScalarField>
Foam::turbulentDispersionModels::Burns::D() const
{
const fvMesh& mesh(pair_.phase1().mesh());
const dragModel&
drag
(
const dragModel& drag =
mesh.lookupObject<dragModel>
(
IOobject::groupName(dragModel::typeName, pair_.name())
)
);
return
0.75
*drag.CdRe()
*pair_.continuous().nu()
*pair_.continuous().turbulence().nut()
*continuousTurbulence().nut()
/(
sigma_
*sqr(pair_.dispersed().d())

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,7 +27,6 @@ License
#include "phasePair.H"
#include "phaseCompressibleTurbulenceModel.H"
#include "addToRunTimeSelectionTable.H"
#include "dragModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -86,7 +85,7 @@ Foam::turbulentDispersionModels::Gosman::D() const
*drag.CdRe()
*pair_.dispersed()
*pair_.continuous().nu()
*pair_.continuous().turbulence().nut()
*continuousTurbulence().nut()
/(
sigma_
*sqr(pair_.dispersed().d())

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -72,7 +72,7 @@ Foam::turbulentDispersionModels::LopezDeBertodano::D() const
return
Ctd_
*pair_.continuous().rho()
*pair_.continuous().turbulence().k();
*continuousTurbulence().k();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,7 +76,7 @@ D() const
Ctd_
*pair_.dispersed()
*pair_.continuous().rho()
*pair_.continuous().turbulence().k();
*continuousTurbulence().k();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -28,6 +28,7 @@ License
#include "fvcGrad.H"
#include "surfaceInterpolate.H"
#include "fvcSnGrad.H"
#include "phaseCompressibleTurbulenceModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -61,6 +62,21 @@ Foam::turbulentDispersionModel::~turbulentDispersionModel()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::phaseCompressibleTurbulenceModel&
Foam::turbulentDispersionModel::continuousTurbulence() const
{
return
pair_.phase1().mesh().lookupObject<phaseCompressibleTurbulenceModel>
(
IOobject::groupName
(
turbulenceModel::propertiesName,
pair_.continuous().name()
)
);
}
Foam::tmp<Foam::volVectorField>
Foam::turbulentDispersionModel::F() const
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,6 +40,7 @@ SourceFiles
#include "volFields.H"
#include "dictionary.H"
#include "runTimeSelectionTables.H"
#include "phaseCompressibleTurbulenceModelFwd.H"
namespace Foam
{
@ -114,6 +115,9 @@ public:
// Member Functions
//- Return a reference to the turbulence model for the continuous phase
const phaseCompressibleTurbulenceModel& continuousTurbulence() const;
//- Turbulent diffusivity
// multiplying the gradient of the phase-fraction
virtual tmp<volScalarField> D() const = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -122,7 +122,7 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::heEqn()
const volScalarField& contErr(this->continuityError());
const volScalarField alphaEff(this->turbulence().alphaEff());
const volScalarField alphaEff(this->alphaEff());
volScalarField& he = this->thermo_->he();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -251,6 +251,7 @@ template<class BasePhaseModel>
void Foam::MovingPhaseModel<BasePhaseModel>::correctEnergyTransport()
{
BasePhaseModel::correctEnergyTransport();
turbulence_->correctEnergyTransport();
}
@ -395,10 +396,90 @@ Foam::MovingPhaseModel<BasePhaseModel>::alphaRhoPhi()
template<class BasePhaseModel>
const Foam::phaseCompressibleTurbulenceModel&
Foam::MovingPhaseModel<BasePhaseModel>::turbulence() const
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::mut() const
{
return turbulence_;
return turbulence_->mut();
}
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::muEff() const
{
return turbulence_->muEff();
}
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::nut() const
{
return turbulence_->nut();
}
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::nuEff() const
{
return turbulence_->nuEff();
}
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::kappaEff() const
{
return turbulence_->kappaEff();
}
template<class BasePhaseModel>
Foam::tmp<Foam::scalarField>
Foam::MovingPhaseModel<BasePhaseModel>::kappaEff(const label patchi) const
{
return turbulence_->kappaEff(patchi);
}
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::alphaEff() const
{
return turbulence_->alphaEff();
}
template<class BasePhaseModel>
Foam::tmp<Foam::scalarField>
Foam::MovingPhaseModel<BasePhaseModel>::alphaEff(const label patchi) const
{
return turbulence_->alphaEff(patchi);
}
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::k() const
{
return turbulence_->k();
}
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::MovingPhaseModel<BasePhaseModel>::pPrime() const
{
return turbulence_->pPrime();
}
template<class BasePhaseModel>
Foam::tmp<Foam::fvVectorMatrix>
Foam::MovingPhaseModel<BasePhaseModel>::divDevRhoReff()
{
return turbulence_->divDevRhoReff(U_);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -186,10 +186,42 @@ public:
virtual surfaceScalarField& alphaRhoPhi();
// Turbulence
// Transport
//- Return the turbulence model
virtual const phaseCompressibleTurbulenceModel& turbulence() const;
//- Return the turbulent dynamic viscosity
virtual tmp<volScalarField> mut() const;
//- Return the effective dynamic viscosity
virtual tmp<volScalarField> muEff() const;
//- Return the turbulent kinematic viscosity
virtual tmp<volScalarField> nut() const;
//- Return the effective kinematic viscosity
virtual tmp<volScalarField> nuEff() const;
//- Return the effective thermal conductivity
virtual tmp<volScalarField> kappaEff() const;
//- Return the effective thermal conductivity on a patch
virtual tmp<scalarField> kappaEff(const label patchi) const;
//- Return the effective thermal diffusivity for enthalpy
virtual tmp<volScalarField> alphaEff() const;
//- Return the effective thermal conductivity for enthalpy on a
// patch
virtual tmp<scalarField> alphaEff(const label patchi) const;
//- Return the turbulent kinetic energy
virtual tmp<volScalarField> k() const;
//- Return the phase-pressure'
// (derivative of phase-pressure w.r.t. phase-fraction)
virtual tmp<volScalarField> pPrime() const;
//- Return the turbulent term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff();
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -168,7 +168,7 @@ Foam::MultiComponentPhaseModel<BasePhaseModel>::YiEqn
- fvm::laplacian
(
fvc::interpolate(alpha)
*fvc::interpolate(this->turbulence().muEff()/Sc_),
*fvc::interpolate(this->muEff()/Sc_),
Yi
)
==

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -310,13 +310,15 @@ public:
//- Return the laminar thermal conductivity on a patch
virtual tmp<scalarField> kappa(const label patchi) const = 0;
//- Return the effective thermal conductivity
//- Return the effective thermal conductivity, given the turbulent
// thermal diffusivity
virtual tmp<volScalarField> kappaEff
(
const volScalarField& alphat
) const = 0;
//- Access the effective thermal conductivity
//- Return the effective thermal conductivity on a patch, given the
// turbulent thermal diffusivity
virtual tmp<scalarField> kappaEff
(
const scalarField& alphat,
@ -329,13 +331,15 @@ public:
//- Return the laminar thermal diffusivity for enthalpy on a patch
virtual tmp<scalarField> alpha(const label patchi) const = 0;
//- Return the effective thermal diffusivity for enthalpy
//- Return the effective thermal diffusivity for enthalpy, given the
// turbulent thermal diffusivity
virtual tmp<volScalarField> alphaEff
(
const volScalarField& alphat
) const = 0;
//- Return the effective thermal diffusivity for enthalpy on a patch
//- Return the effective thermal diffusivity for enthalpy on a
// patch, given the turbulent thermal diffusivity
virtual tmp<scalarField> alphaEff
(
const scalarField& alphat,
@ -345,9 +349,40 @@ public:
// Turbulence
//- Return the turbulence model
virtual const phaseCompressibleTurbulenceModel&
turbulence() const = 0;
//- Return the turbulent dynamic viscosity
virtual tmp<volScalarField> mut() const = 0;
//- Return the effective dynamic viscosity
virtual tmp<volScalarField> muEff() const = 0;
//- Return the turbulent kinematic viscosity
virtual tmp<volScalarField> nut() const = 0;
//- Return the effective kinematic viscosity
virtual tmp<volScalarField> nuEff() const = 0;
//- Return the effective thermal conductivity
virtual tmp<volScalarField> kappaEff() const = 0;
//- Return the effective thermal conductivity on a patch
virtual tmp<scalarField> kappaEff(const label patchi) const = 0;
//- Return the effective thermal diffusivity for enthalpy
virtual tmp<volScalarField> alphaEff() const = 0;
//- Return the effective thermal conductivity for enthalpy on a
// patch
virtual tmp<scalarField> alphaEff(const label patchi) const = 0;
//- Return the turbulent kinetic energy
virtual tmp<volScalarField> k() const = 0;
//- Return the phase-pressure'
// (derivative of phase-pressure w.r.t. phase-fraction)
virtual tmp<volScalarField> pPrime() const = 0;
//- Return the turbulent term for the momentum equation
virtual tmp<fvVectorMatrix> divDevRhoReff() = 0;
};

View File

@ -41,7 +41,7 @@ PtrList<fvVectorMatrix> UEqns(phases.size());
(
fvm::div(alphaRhoPhi, U) - fvm::Sp(fvc::div(alphaRhoPhi), U)
+ MRF.DDt(alpha*rho, U)
+ phase.turbulence().divDevRhoReff(U)
+ phase.divDevRhoReff()
+ fvm::SuSp(fvOptions(alpha, rho)&rho, U)
==
fvOptions(alpha, rho, U)

View File

@ -44,7 +44,7 @@ tmp<surfaceScalarField> phiF2;
(
fvc::interpolate
(
rAU1*(D + phase1.turbulence().pPrime())
rAU1*(D + phase1.pPrime())
)
);
@ -53,7 +53,7 @@ tmp<surfaceScalarField> phiF2;
(
fvc::interpolate
(
rAU2*(D + phase2.turbulence().pPrime())
rAU2*(D + phase2.pPrime())
)
);

View File

@ -27,7 +27,7 @@ fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime);
fvm::div(alphaRhoPhi1, U1) - fvm::Sp(fvc::div(alphaRhoPhi1), U1)
+ fvm::Sp(dmdt21, U1) - dmdt21*U2
+ MRF.DDt(alpha1*rho1, U1)
+ phase1.turbulence().divDevRhoReff(U1)
+ phase1.divDevRhoReff()
+ Vm*(UgradU1 - (UgradU2 & U2))
- fvOptions(alpha1, rho1, U1)
+ fvm::SuSp(fvOptions(alpha1, rho1)&rho1, U1)
@ -44,7 +44,7 @@ fvVectorMatrix U2Eqn(U2, rho2.dimensions()*U2.dimensions()*dimVol/dimTime);
fvm::div(alphaRhoPhi2, U2) - fvm::Sp(fvc::div(alphaRhoPhi2), U2)
- fvm::Sp(dmdt12, U2) + dmdt12*U1
+ MRF.DDt(alpha2*rho2, U2)
+ phase2.turbulence().divDevRhoReff(U2)
+ phase2.divDevRhoReff()
+ Vm*(UgradU2 - (UgradU1 & U1))
- fvOptions(alpha2, rho2, U2)
+ fvm::SuSp(fvOptions(alpha2, rho2)&rho2, U2)

View File

@ -60,13 +60,13 @@ tmp<surfaceScalarField> Ff2;
// Phase-1 turbulent dispersion and particle-pressure diffusivity
surfaceScalarField Df1
(
fvc::interpolate(D + phase1.turbulence().pPrime())
fvc::interpolate(D + phase1.pPrime())
);
// Phase-2 turbulent dispersion and particle-pressure diffusivity
surfaceScalarField Df2
(
fvc::interpolate(D + phase2.turbulence().pPrime())
fvc::interpolate(D + phase2.pPrime())
);
// Cache the phase diffusivities for implicit treatment in the

View File

@ -87,7 +87,7 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Ur() const
Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Ut() const
{
return sqrt(2*otherPhase().turbulence().k());
return sqrt(2*otherPhase().k());
}
Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsource::Re() const