diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options index ac52ae02ae..e178081548 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ -IphaseIncompressibleTurbulenceModels/lnInclude \ diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options index 8608cd8610..2563e4ed94 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/Make/options @@ -3,7 +3,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ -I../twoPhaseSystem/lnInclude \ diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 3af90199a6..4e5686f3c3 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -24,14 +24,12 @@ License \*---------------------------------------------------------------------------*/ #include "kineticTheoryModel.H" -#include "surfaceInterpolate.H" #include "mathematicalConstants.H" #include "twoPhaseSystem.H" -#include "fvcDiv.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::kineticTheoryModel::kineticTheoryModel +Foam::RASModels::kineticTheoryModel::kineticTheoryModel ( const volScalarField& alpha, const geometricOneField& rho, @@ -43,7 +41,7 @@ Foam::kineticTheoryModel::kineticTheoryModel const word& type ) : - RASModels::eddyViscosity > + eddyViscosity > > ( type, alpha, @@ -131,18 +129,224 @@ Foam::kineticTheoryModel::kineticTheoryModel U.mesh(), dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0) ) -{} +{ + if (type == typeName) + { + this->printCoeffs(type); + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::kineticTheoryModel::~kineticTheoryModel() +Foam::RASModels::kineticTheoryModel::~kineticTheoryModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::kineticTheoryModel::correct() +bool Foam::RASModels::kineticTheoryModel::read() +{ + if + ( + eddyViscosity + < + RASModel > + >::read() + ) + { + this->coeffDict().lookup("equilibrium") >> equilibrium_; + e_.readIfPresent(this->coeffDict()); + alphaMax_.readIfPresent(this->coeffDict()); + alphaMinFriction_.readIfPresent(this->coeffDict()); + + viscosityModel_->read(); + conductivityModel_->read(); + radialModel_->read(); + granularPressureModel_->read(); + frictionalStressModel_->read(); + + return true; + } + else + { + return false; + } +} + + +Foam::tmp +Foam::RASModels::kineticTheoryModel::k() const +{ + notImplemented("kineticTheoryModel::k()"); + return nut_; +} + + +Foam::tmp +Foam::RASModels::kineticTheoryModel::epsilon() const +{ + notImplemented("kineticTheoryModel::epsilon()"); + return nut_; +} + + +Foam::tmp +Foam::RASModels::kineticTheoryModel::R() const +{ + return tmp + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("R", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + - (this->nut_)*dev(twoSymm(fvc::grad(this->U_))) + - (lambda_*fvc::div(this->phi_))*symmTensor::I + ) + ); +} + + +/* +Foam::tmp +Foam::RASModels::kineticTheoryModel::pp() const +{ + + // Particle pressure coefficient + // Coefficient in front of Theta (Eq. 3.22, p. 45) + volScalarField PsCoeff + ( + granularPressureModel_->granularPressureCoeff + ( + alpha, + gs0, + rho, + e_ + ) + ); + + // Frictional pressure + volScalarField pf + ( + frictionalStressModel_->frictionalPressure + ( + alpha, + alphaMinFriction_, + alphaMax_ + ) + ); + + // Return total particle pressure + return PsCoeff*Theta_ + pf; +} +*/ + + +Foam::tmp +Foam::RASModels::kineticTheoryModel::pPrime() const +{ + // Local references + const volScalarField& alpha = this->alpha_; + const volScalarField& rho = phase_.rho(); + + return + ( + Theta_ + *granularPressureModel_->granularPressureCoeffPrime + ( + alpha, + radialModel_->g0(alpha, alphaMinFriction_, alphaMax_), + radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_), + rho, + e_ + ) + + frictionalStressModel_->frictionalPressurePrime + ( + alpha, + alphaMinFriction_, + alphaMax_ + ) + ); +} + + +Foam::tmp +Foam::RASModels::kineticTheoryModel::pPrimef() const +{ + // Local references + const volScalarField& alpha = this->alpha_; + const volScalarField& rho = phase_.rho(); + + return fvc::interpolate + ( + Theta_ + *granularPressureModel_->granularPressureCoeffPrime + ( + alpha, + radialModel_->g0(alpha, alphaMinFriction_, alphaMax_), + radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_), + rho, + e_ + ) + + frictionalStressModel_->frictionalPressurePrime + ( + alpha, + alphaMinFriction_, + alphaMax_ + ) + ); +} + + +Foam::tmp +Foam::RASModels::kineticTheoryModel::devRhoReff() const +{ + return tmp + ( + new volSymmTensorField + ( + IOobject + ( + IOobject::groupName("devRhoReff", this->U_.group()), + this->runTime_.timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + - (this->rho_*this->nut_) + *dev(twoSymm(fvc::grad(this->U_))) + - ((this->rho_*lambda_)*fvc::div(this->phi_))*symmTensor::I + ) + ); +} + + +Foam::tmp +Foam::RASModels::kineticTheoryModel::divDevRhoReff +( + volVectorField& U +) const +{ + return + ( + - fvm::laplacian(this->rho_*this->nut_, U) + - fvc::div + ( + (this->rho_*this->nut_)*dev2(T(fvc::grad(U))) + + ((this->rho_*lambda_)*fvc::div(this->phi_)) + *dimensioned("I", dimless, symmTensor::I) + ) + ); +} + + +void Foam::RASModels::kineticTheoryModel::correct() { // Local references volScalarField alpha(max(this->alpha_, 0.0)); @@ -345,202 +549,4 @@ void Foam::kineticTheoryModel::correct() } } - -/* -Foam::tmp Foam::kineticTheoryModel::pp() const -{ - - // Particle pressure coefficient - // Coefficient in front of Theta (Eq. 3.22, p. 45) - volScalarField PsCoeff - ( - granularPressureModel_->granularPressureCoeff - ( - alpha, - gs0, - rho, - e_ - ) - ); - - // Frictional pressure - volScalarField pf - ( - frictionalStressModel_->frictionalPressure - ( - alpha, - alphaMinFriction_, - alphaMax_ - ) - ); - - // Return total particle pressure - return PsCoeff*Theta_ + pf; -} -*/ - - -Foam::tmp Foam::kineticTheoryModel::pPrime() const -{ - // Local references - const volScalarField& alpha = this->alpha_; - const volScalarField& rho = phase_.rho(); - - return - ( - Theta_ - *granularPressureModel_->granularPressureCoeffPrime - ( - alpha, - radialModel_->g0(alpha, alphaMinFriction_, alphaMax_), - radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_), - rho, - e_ - ) - + frictionalStressModel_->frictionalPressurePrime - ( - alpha, - alphaMinFriction_, - alphaMax_ - ) - ); -} - - -Foam::tmp Foam::kineticTheoryModel::pPrimef() const -{ - // Local references - const volScalarField& alpha = this->alpha_; - const volScalarField& rho = phase_.rho(); - - return fvc::interpolate - ( - Theta_ - *granularPressureModel_->granularPressureCoeffPrime - ( - alpha, - radialModel_->g0(alpha, alphaMinFriction_, alphaMax_), - radialModel_->g0prime(alpha, alphaMinFriction_, alphaMax_), - rho, - e_ - ) - + frictionalStressModel_->frictionalPressurePrime - ( - alpha, - alphaMinFriction_, - alphaMax_ - ) - ); -} - - -void Foam::kineticTheoryModel::correctNut() -{} - - -Foam::tmp Foam::kineticTheoryModel::k() const -{ - notImplemented("kineticTheoryModel::k()"); - return nut_; -} - - -Foam::tmp Foam::kineticTheoryModel::epsilon() const -{ - notImplemented("kineticTheoryModel::epsilon()"); - return nut_; -} - - -Foam::tmp Foam::kineticTheoryModel::R() const -{ - return tmp - ( - new volSymmTensorField - ( - IOobject - ( - IOobject::groupName("R", this->U_.group()), - this->runTime_.timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - - (this->nut_)*dev(twoSymm(fvc::grad(this->U_))) - - (lambda_*fvc::div(this->phi_))*symmTensor::I - ) - ); -} - - -Foam::tmp Foam::kineticTheoryModel::devRhoReff() const -{ - return tmp - ( - new volSymmTensorField - ( - IOobject - ( - IOobject::groupName("devRhoReff", this->U_.group()), - this->runTime_.timeName(), - this->mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - - (this->rho_*this->nut_) - *dev(twoSymm(fvc::grad(this->U_))) - - ((this->rho_*lambda_)*fvc::div(this->phi_))*symmTensor::I - ) - ); -} - - -Foam::tmp Foam::kineticTheoryModel::divDevRhoReff -( - volVectorField& U -) const -{ - return - ( - - fvm::laplacian(this->rho_*this->nut_, U) - - fvc::div - ( - (this->rho_*this->nut_)*dev2(T(fvc::grad(U))) - + ((this->rho_*lambda_)*fvc::div(this->phi_)) - *dimensioned("I", dimless, symmTensor::I) - ) - ); -} - - -bool Foam::kineticTheoryModel::read() -{ - if - ( - RASModels::eddyViscosity - < - PhaseIncompressibleTurbulenceModel - >::read() - ) - { - this->coeffDict().lookup("equilibrium") >> equilibrium_; - e_.readIfPresent(this->coeffDict()); - alphaMax_.readIfPresent(this->coeffDict()); - alphaMinFriction_.readIfPresent(this->coeffDict()); - - viscosityModel_->read(); - conductivityModel_->read(); - radialModel_->read(); - granularPressureModel_->read(); - frictionalStressModel_->read(); - - return true; - } - else - { - return false; - } -} - - // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index e7146f8e62..776b523f56 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -25,6 +25,17 @@ Class Foam::kineticTheoryModel Description + Kinetic theory particle phase RAS model + + Reference: + \verbatim + "Derivation, implementation, and validation of computer simulation + models for gas-solid fluidized beds", + B.G.M. van Wachem, + Ph.D. Thesis, Delft University of Technology, Amsterdam, 2000. + \endverbatim + + There are no default model coefficients. SourceFiles kineticTheoryModel.C @@ -34,11 +45,11 @@ SourceFiles #ifndef kineticTheoryModel_H #define kineticTheoryModel_H +#include "RASModel.H" #include "eddyViscosity.H" #include "PhaseIncompressibleTurbulenceModel.H" -#include "dragModel.H" #include "phaseModel.H" -#include "autoPtr.H" +#include "dragModel.H" #include "viscosityModel.H" #include "conductivityModel.H" #include "radialModel.H" @@ -50,6 +61,8 @@ SourceFiles namespace Foam { +namespace RASModels +{ /*---------------------------------------------------------------------------*\ Class kineticTheoryModel Declaration @@ -57,9 +70,9 @@ namespace Foam class kineticTheoryModel : - public RASModels::eddyViscosity + public eddyViscosity < - PhaseIncompressibleTurbulenceModel + RASModel > > { // Private data @@ -118,6 +131,9 @@ class kineticTheoryModel // Private Member Functions + void correctNut() + {} + //- Disallow default bitwise copy construct kineticTheoryModel(const kineticTheoryModel&); @@ -125,13 +141,6 @@ class kineticTheoryModel void operator=(const kineticTheoryModel&); -protected: - - // Protected member functions - - virtual void correctNut(); - - public: //- Runtime type information @@ -160,6 +169,9 @@ public: // Member Functions + //- Re-read model coefficients if they have changed + virtual bool read(); + //- Return the effective viscosity virtual tmp nuEff() const { @@ -197,14 +209,12 @@ public: //- Solve the kinetic theory equations and correct the viscosity virtual void correct(); - - //- Re-read model coefficients if they have changed - virtual bool read(); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace RASModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C index f47e3943a1..2cf5da4021 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C @@ -24,149 +24,64 @@ License \*---------------------------------------------------------------------------*/ #include "PhaseIncompressibleTurbulenceModel.H" -#include "laminar.H" -#include "RASModel.H" -#include "kEpsilon.H" -#include "LaheyKEpsilon.H" -#include "continuousGasKEpsilon.H" -#include "kineticTheoryModel.H" -#include "phasePressureModel.H" #include "phaseModel.H" #include "addToRunTimeSelectionTable.H" +#include "makeTurbulenceModel.H" -namespace Foam -{ - typedef TurbulenceModel - < - volScalarField, - geometricOneField, - incompressibleTurbulenceModel, - phaseModel - > basePhaseIncompressibleTransportTurbulenceModel; +#include "laminar.H" +#include "RASModel.H" +#include "LESModel.H" - defineTemplateRunTimeSelectionTable - ( - basePhaseIncompressibleTransportTurbulenceModel, - dictionary - ); +makeBaseTurbulenceModel +( + volScalarField, + geometricOneField, + incompressibleTurbulenceModel, + PhaseIncompressibleTurbulenceModel, + phaseModel +); - typedef PhaseIncompressibleTurbulenceModel - incompressibleTransportTurbulenceModel; +#define makeRASModel(Type) \ + makeTemplatedTurbulenceModel \ + (phaseModelPhaseIncompressibleTurbulenceModel, RAS, Type) - typedef laminar - incompressibleLaminar; +#define makeLESModel(Type) \ + makeTemplatedTurbulenceModel \ + (phaseModelPhaseIncompressibleTurbulenceModel, LES, Type) - defineNamedTemplateTypeNameAndDebug(incompressibleLaminar, 0); +#include "kEpsilon.H" +makeRASModel(kEpsilon); - addToRunTimeSelectionTable - ( - basePhaseIncompressibleTransportTurbulenceModel, - incompressibleLaminar, - dictionary - ); +#include "LaheyKEpsilon.H" +makeRASModel(LaheyKEpsilon); + +#include "continuousGasKEpsilon.H" +makeRASModel(continuousGasKEpsilon); + +#include "Smagorinsky.H" +makeLESModel(Smagorinsky); + +#include "kEqn.H" +makeLESModel(kEqn); + +#include "SmagorinskyZhang.H" +makeLESModel(SmagorinskyZhang); + +#include "NicenoKEqn.H" +makeLESModel(NicenoKEqn); + +#include "continuousGasKEqn.H" +makeLESModel(continuousGasKEqn); - typedef RASModel - incompressibleRASModel; - - defineNamedTemplateTypeNameAndDebug(incompressibleRASModel, 0); - - defineTemplateRunTimeSelectionTable(incompressibleRASModel, dictionary); - - addToRunTimeSelectionTable - ( - basePhaseIncompressibleTransportTurbulenceModel, - incompressibleRASModel, - dictionary - ); - - namespace RASModels - { - typedef kEpsilon - incompressiblekEpsilon; - - defineNamedTemplateTypeNameAndDebug(incompressiblekEpsilon, 0); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - incompressiblekEpsilon, - dictionary - ); - } - - namespace RASModels - { - typedef LaheyKEpsilon - incompressibleLaheyKEpsilon; - - defineNamedTemplateTypeNameAndDebug(incompressibleLaheyKEpsilon, 0); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - incompressibleLaheyKEpsilon, - dictionary - ); - } - - namespace RASModels - { - typedef continuousGasKEpsilon - incompressiblecontinuousGasKEpsilon; - - defineNamedTemplateTypeNameAndDebug - ( - incompressiblecontinuousGasKEpsilon, - 0 - ); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - incompressiblecontinuousGasKEpsilon, - dictionary - ); - } -} +#include "kineticTheoryModel.H" +makeTurbulenceModel +(phaseModelPhaseIncompressibleTurbulenceModel, RAS, kineticTheoryModel); -namespace Foam -{ - typedef PhaseIncompressibleTurbulenceModel - incompressibleTransportTurbulenceModel; - - typedef RASModel - incompressibleRASModel; - - defineTypeNameAndDebug(kineticTheoryModel, 0); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - kineticTheoryModel, - dictionary - ); -} - - -namespace Foam -{ - typedef PhaseIncompressibleTurbulenceModel - incompressibleTransportTurbulenceModel; - - typedef RASModel - incompressibleRASModel; - - defineTypeNameAndDebug(phasePressureModel, 0); - - addToRunTimeSelectionTable - ( - incompressibleRASModel, - phasePressureModel, - dictionary - ); -} +#include "phasePressureModel.H" +makeTurbulenceModel +(phaseModelPhaseIncompressibleTurbulenceModel, RAS, phasePressureModel); // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 99cc91994c..182515d71e 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -24,13 +24,11 @@ License \*---------------------------------------------------------------------------*/ #include "phasePressureModel.H" -#include "surfaceInterpolate.H" #include "twoPhaseSystem.H" -#include "dimensionedType.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::phasePressureModel::phasePressureModel +Foam::RASModels::phasePressureModel::phasePressureModel ( const volScalarField& alpha, const geometricOneField& rho, @@ -42,7 +40,7 @@ Foam::phasePressureModel::phasePressureModel const word& type ) : - RASModels::eddyViscosity > + eddyViscosity > > ( type, alpha, @@ -67,64 +65,64 @@ Foam::phasePressureModel::phasePressureModel ) { this->nut_ == dimensionedScalar("zero", this->nut_.dimensions(), 0.0); + + if (type == typeName) + { + this->printCoeffs(type); + } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::phasePressureModel::~phasePressureModel() +Foam::RASModels::phasePressureModel::~phasePressureModel() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::phasePressureModel::correct() -{} - - -void Foam::phasePressureModel::correctNut() -{} - - -Foam::tmp Foam::phasePressureModel::pPrime() const +bool Foam::RASModels::phasePressureModel::read() { - return - g0_ - *min - ( - exp(preAlphaExp_*(this->alpha_ - alphaMax_)), - expMax_ - ); + if + ( + eddyViscosity + < + RASModel > + >::read() + ) + { + this->coeffDict().lookup("alphaMax") >> alphaMax_; + this->coeffDict().lookup("preAlphaExp") >> preAlphaExp_; + this->coeffDict().lookup("expMax") >> expMax_; + g0_.readIfPresent(this->coeffDict()); + + return true; + } + else + { + return false; + } } -Foam::tmp Foam::phasePressureModel::pPrimef() const -{ - return - g0_ - *min - ( - exp(preAlphaExp_*(fvc::interpolate(this->alpha_) - alphaMax_)), - expMax_ - ); -} - - -Foam::tmp Foam::phasePressureModel::k() const +Foam::tmp +Foam::RASModels::phasePressureModel::k() const { notImplemented("phasePressureModel::k()"); return nut_; } -Foam::tmp Foam::phasePressureModel::epsilon() const +Foam::tmp +Foam::RASModels::phasePressureModel::epsilon() const { notImplemented("phasePressureModel::epsilon()"); return nut_; } -Foam::tmp Foam::phasePressureModel::R() const +Foam::tmp +Foam::RASModels::phasePressureModel::R() const { return tmp ( @@ -150,7 +148,34 @@ Foam::tmp Foam::phasePressureModel::R() const } -Foam::tmp Foam::phasePressureModel::devRhoReff() const +Foam::tmp +Foam::RASModels::phasePressureModel::pPrime() const +{ + return + g0_ + *min + ( + exp(preAlphaExp_*(this->alpha_ - alphaMax_)), + expMax_ + ); +} + + +Foam::tmp +Foam::RASModels::phasePressureModel::pPrimef() const +{ + return + g0_ + *min + ( + exp(preAlphaExp_*(fvc::interpolate(this->alpha_) - alphaMax_)), + expMax_ + ); +} + + +Foam::tmp +Foam::RASModels::phasePressureModel::devRhoReff() const { return tmp ( @@ -176,7 +201,8 @@ Foam::tmp Foam::phasePressureModel::devRhoReff() const } -Foam::tmp Foam::phasePressureModel::divDevRhoReff +Foam::tmp +Foam::RASModels::phasePressureModel::divDevRhoReff ( volVectorField& U ) const @@ -192,28 +218,8 @@ Foam::tmp Foam::phasePressureModel::divDevRhoReff } -bool Foam::phasePressureModel::read() -{ - if - ( - RASModels::eddyViscosity - < - PhaseIncompressibleTurbulenceModel - >::read() - ) - { - this->coeffDict().lookup("alphaMax") >> alphaMax_; - this->coeffDict().lookup("preAlphaExp") >> preAlphaExp_; - this->coeffDict().lookup("expMax") >> expMax_; - g0_.readIfPresent(this->coeffDict()); - - return true; - } - else - { - return false; - } -} +void Foam::RASModels::phasePressureModel::correct() +{} // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H index 1c4028f16a..6d85be7b65 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phasePressureModel/phasePressureModel.H @@ -25,6 +25,23 @@ Class Foam::phasePressureModel Description + Particle-particle phase-pressure RAS model + + The derivative of the phase-pressure with respect to the phase-fraction + is evaluated as + + g0*min(exp(preAlphaExp*(alpha - alphaMax)), expMax) + + The default model coefficients correspond to the following: + \verbatim + phasePressureCoeffs + { + preAlphaExp 500; + expMax 1000; + alphaMax 0.62; + g0 1000; + } + \endverbatim SourceFiles phasePressureModel.C @@ -34,22 +51,17 @@ SourceFiles #ifndef phasePressureModel_H #define phasePressureModel_H +#include "RASModel.H" #include "eddyViscosity.H" #include "PhaseIncompressibleTurbulenceModel.H" -#include "dragModel.H" #include "phaseModel.H" -#include "autoPtr.H" -#include "viscosityModel.H" -#include "conductivityModel.H" -#include "radialModel.H" -#include "granularPressureModel.H" -#include "frictionalStressModel.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +namespace RASModels +{ /*---------------------------------------------------------------------------*\ Class phasePressureModel Declaration @@ -57,9 +69,9 @@ namespace Foam class phasePressureModel : - public RASModels::eddyViscosity + public eddyViscosity < - PhaseIncompressibleTurbulenceModel + RASModel > > { // Private data @@ -86,6 +98,9 @@ class phasePressureModel // Private Member Functions + void correctNut() + {} + //- Disallow default bitwise copy construct phasePressureModel(const phasePressureModel&); @@ -93,13 +108,6 @@ class phasePressureModel void operator=(const phasePressureModel&); -protected: - - // Protected member functions - - virtual void correctNut(); - - public: //- Runtime type information @@ -128,6 +136,9 @@ public: // Member Functions + //- Re-read model coefficients if they have changed + virtual bool read(); + //- Return the effective viscosity virtual tmp nuEff() const { @@ -165,14 +176,12 @@ public: //- Solve the kinetic theory equations and correct the viscosity virtual void correct(); - - //- Re-read model coefficients if they have changed - virtual bool read(); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace RASModels } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H index 7cc250a66a..062c5523c9 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H @@ -2,6 +2,7 @@ ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) + - fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U) + turbulence->divDevRhoReff(rho, U) ); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index 9e5461614b..b6e70fc295 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -58,7 +58,6 @@ { tphiAlphaCorr() -= tphiAlpha(); - volScalarField alpha100("alpha100", alpha10); alpha10 = alpha1; diff --git a/applications/test/PisoFoam/Make/options b/applications/test/PisoFoam/Make/options index 8e32793a19..23368faba6 100644 --- a/applications/test/PisoFoam/Make/options +++ b/applications/test/PisoFoam/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ diff --git a/applications/test/RhoPimpleFoam/Make/options b/applications/test/RhoPimpleFoam/Make/options index cc667ece05..44d8f226ca 100644 --- a/applications/test/RhoPimpleFoam/Make/options +++ b/applications/test/RhoPimpleFoam/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/cfdTools \ diff --git a/applications/test/patchRegion/Make/files b/applications/test/patchRegion/Make/files new file mode 100644 index 0000000000..80ccdd7e7c --- /dev/null +++ b/applications/test/patchRegion/Make/files @@ -0,0 +1,3 @@ +Test-patchRegion.C + +EXE = $(FOAM_USER_APPBIN)/Test-patchRegion diff --git a/applications/test/patchRegion/Make/options b/applications/test/patchRegion/Make/options new file mode 100644 index 0000000000..d27c95d033 --- /dev/null +++ b/applications/test/patchRegion/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/test/patchRegion/README b/applications/test/patchRegion/README new file mode 100644 index 0000000000..64bd086d43 --- /dev/null +++ b/applications/test/patchRegion/README @@ -0,0 +1,2 @@ +2013-05-27 Detect 'pinches' in patch (i.e., non-manifold on point). Run on +cavity_pinched subdirectory. diff --git a/applications/test/patchRegion/Test-patchRegion.C b/applications/test/patchRegion/Test-patchRegion.C new file mode 100644 index 0000000000..2df8b3a8b0 --- /dev/null +++ b/applications/test/patchRegion/Test-patchRegion.C @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Description + Detect point pinches + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "PatchTools.H" +#include "Time.H" +#include "polyMesh.H" +#include "patchEdgeFaceRegions.H" +#include "PatchEdgeFaceWave.H" +#include "globalIndex.H" +#include "syncTools.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// Main program: + +int main(int argc, char *argv[]) +{ + argList::validArgs.append("patch"); + +# include "setRootCase.H" +# include "createTime.H" + + const word patchName = args[1]; + +# include "createPolyMesh.H" + + Info<< "Mesh read in = " + << runTime.cpuTimeIncrement() + << " s\n" << endl << endl; + + + const polyBoundaryMesh& pbm = mesh.boundaryMesh(); + label patchI = pbm.findPatchID(patchName); + const polyPatch& patch = pbm[patchI]; + + Info<< "Patch:" << patch.name() << endl; + + + + // Data on all edges and faces + List allEdgeInfo(patch.nEdges()); + List allFaceInfo(patch.size()); + + // Determine parallel global indexing + const globalIndex globalNumbering(patch.size()); + + DynamicList