diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C index 7301318b160fa59f9107660b2d1964e21fed38f4..1bf5cc2b5237783077a9520f3a6db55069d10786 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.C @@ -76,6 +76,7 @@ LESModel::LESModel ) ), + turbulence_(true), // TODO: turbulence_(lookup("turbulence")), printCoeffs_(lookupOrDefault<Switch>("printCoeffs", false)), coeffDict_(subDictPtr(type + "Coeffs")), @@ -180,6 +181,55 @@ autoPtr<LESModel> LESModel::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +tmp<volScalarField> LESModel::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + ( this->mu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + this->rho() * this->epsilon() + ) + ); +} + + +tmp<volScalarField> LESModel::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + this->muEff()*dev(twoSymm(tgradU())) + - ((2.0/3.0)*I) * this->rho() * this->k() + ) && tgradU() + ) + ); +} + + void LESModel::correct(const tmp<volTensorField>&) { delta_().correct(); diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index ca87dd64ed8c3c333f58b968d1052db02857240c..7a87a71315f19e8ea0d8bc4660b08cf1d30125f5 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -33,13 +33,13 @@ Class Foam::compressible::LESModel Description - Class for all compressible flow LES SGS models. + Base class for all compressible flow LES SGS models. - This class defines the basic interface for a compressible flow SGS model, - and encapsulates data of value to all possible models. In particular - this includes references to all the dependent fields (rho, U, phi), - the physical viscosity mu, and the LESProperties dictionary, - which contains the model selection and model coefficients. + This class defines the basic interface for a compressible flow SGS + model, and encapsulates data of value to all possible models. + In particular this includes references to all the dependent fields + (rho, U, phi), the physical viscosity mu, and the LESProperties + dictionary, which contains the model selection and model coefficients. SourceFiles LESModel.C @@ -80,6 +80,7 @@ protected: // Protected data + Switch turbulence_; Switch printCoeffs_; dictionary coeffDict_; @@ -292,6 +293,15 @@ public: } + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; + //- Correct Eddy-Viscosity and related properties. // This calls correct(const tmp<volTensorField>& gradU) by supplying // gradU calculated locally. diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C index 5d46b78788d576a907edea39f713cc43abdb88f2..849f25f01aff42515c4dce3977fae896e2069325 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.C @@ -191,6 +191,55 @@ autoPtr<RASModel> RASModel::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +tmp<volScalarField> RASModel::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + ( this->mu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + this->rho() * this->epsilon() + ) + ); +} + + +tmp<volScalarField> RASModel::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + this->muEff()*dev(twoSymm(tgradU())) + - ((2.0/3.0)*I) * this->rho() * this->k() + ) && tgradU() + ) + ); +} + + scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const { scalar ypl = 11.0; diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index 7c787d8ceb6406a3cc67b6eb112830f97d423077..22295848d44cc58a4f05a7e0022d30248a6a50c6 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -345,6 +345,15 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; + //- Return yPlus for the given patch virtual tmp<scalarField> yPlus(const label patchI) const; diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.C b/src/turbulenceModels/compressible/RAS/laminar/laminar.C index 415dedee72b21dfb14b39157875dbb71ba9cc983..2f55ecdee509d9b2581e1d77cba3d0fd8437b6b1 100644 --- a/src/turbulenceModels/compressible/RAS/laminar/laminar.C +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.C @@ -177,6 +177,50 @@ tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const } +tmp<volScalarField> laminar::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->mu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + +tmp<volScalarField> laminar::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->mu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + bool laminar::read() { return RASModel::read(); diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.H b/src/turbulenceModels/compressible/RAS/laminar/laminar.H index cfd5e5735276f84af02eaf8a25791b589a4e674a..1e26261da777aebd0f550528cdc191d4c59e5aeb 100644 --- a/src/turbulenceModels/compressible/RAS/laminar/laminar.H +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.H @@ -30,7 +30,6 @@ Description SourceFiles laminar.C - laminarCorrect.C \*---------------------------------------------------------------------------*/ @@ -82,42 +81,51 @@ public: // Member Functions //- Return the turbulence viscosity, i.e. 0 for laminar flow - tmp<volScalarField> mut() const; + virtual tmp<volScalarField> mut() const; //- Return the effective viscosity, i.e. the laminar viscosity - tmp<volScalarField> muEff() const + virtual tmp<volScalarField> muEff() const { return tmp<volScalarField>(new volScalarField("muEff", mu())); } //- Return the effective turbulent thermal diffusivity, // i.e. the laminar thermal diffusivity - tmp<volScalarField> alphaEff() const + virtual tmp<volScalarField> alphaEff() const { return tmp<volScalarField>(new volScalarField("alphaEff", alpha())); } //- Return the turbulence kinetic energy, i.e. 0 for laminar flow - tmp<volScalarField> k() const; + virtual tmp<volScalarField> k() const; //- Return the turbulence kinetic energy dissipation rate, // i.e. 0 for laminar flow - tmp<volScalarField> epsilon() const; + virtual tmp<volScalarField> epsilon() const; //- Return the Reynolds stress tensor, i.e. 0 for laminar flow - tmp<volSymmTensorField> R() const; + virtual tmp<volSymmTensorField> R() const; //- Return the effective stress tensor, i.e. the laminar stress - tmp<volSymmTensorField> devRhoReff() const; + virtual tmp<volSymmTensorField> devRhoReff() const; //- Return the source term for the momentum equation - tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; //- Correct the laminar viscosity - void correct(); + virtual void correct(); //- Read RASProperties dictionary - bool read(); + virtual bool read(); }; diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C index c4213fdd8a6f9e4d06a1d00f4980a169ee31726e..be8e2f1da648d1f0d2c77da83619c19cce7a48c1 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C @@ -52,10 +52,10 @@ laminar::laminar const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermoPhysicalModel + const basicThermo& thermophysicalModel ) : - turbulenceModel(rho, U, phi, thermoPhysicalModel) + turbulenceModel(rho, U, phi, thermophysicalModel) {} @@ -66,10 +66,10 @@ autoPtr<laminar> laminar::New const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermoPhysicalModel + const basicThermo& thermophysicalModel ) { - return autoPtr<laminar>(new laminar(rho, U, phi, thermoPhysicalModel)); + return autoPtr<laminar>(new laminar(rho, U, phi, thermophysicalModel)); } @@ -96,18 +96,6 @@ tmp<volScalarField> laminar::mut() const } -tmp<volScalarField> laminar::muEff() const -{ - return tmp<volScalarField>(new volScalarField("muEff", mu())); -} - - -tmp<volScalarField> laminar::alphaEff() const -{ - return tmp<volScalarField>(new volScalarField("alphaEff", alpha())); -} - - tmp<volScalarField> laminar::k() const { return tmp<volScalarField> @@ -207,6 +195,50 @@ tmp<fvVectorMatrix> laminar::divDevRhoReff(volVectorField& U) const } +tmp<volScalarField> laminar::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->mu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + +tmp<volScalarField> laminar::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->mu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + bool laminar::read() { return true; diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H index 7931e45bee44fa4e36cbe71be44c6caccb659038..3b9b4d8fbd8be010acffb5854cb17b3ca6c12293 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H @@ -67,7 +67,7 @@ public: const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermoPhysicalModel + const basicThermo& thermophysicalModel ); @@ -79,7 +79,7 @@ public: const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermoPhysicalModel + const basicThermo& thermophysicalModel ); @@ -94,10 +94,17 @@ public: virtual tmp<volScalarField> mut() const; //- Return the effective viscosity, i.e. the laminar viscosity - virtual tmp<volScalarField> muEff() const; - - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const; + virtual tmp<volScalarField> muEff() const + { + return tmp<volScalarField>(new volScalarField("muEff", mu())); + } + + //- Return the effective turbulent thermal diffusivity, + // i.e. the laminar thermal diffusivity + virtual tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField>(new volScalarField("alphaEff", alpha())); + } //- Return the turbulence kinetic energy, i.e. 0 for laminar flow virtual tmp<volScalarField> k() const; @@ -109,12 +116,21 @@ public: //- Return the Reynolds stress tensor, i.e. 0 for laminar flow virtual tmp<volSymmTensorField> R() const; - //- Return the effective stress tensor including the laminar stress + //- Return the effective stress tensor, i.e. the laminar stress virtual tmp<volSymmTensorField> devRhoReff() const; //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; + //- Correct the laminar viscosity virtual void correct(); diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C index 18f61ea28643c2d697d95596771b068f64dff3a5..15cce81cc148cbf2baa07613a4c8d7520e909309 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.C @@ -117,12 +117,6 @@ autoPtr<turbulenceModel> turbulenceModel::New } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -turbulenceModel::~turbulenceModel() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void turbulenceModel::correct() diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H index a3cce25b515befec425ba74113336c4c92b59395..3e4ff24e43cc4f959562774b4211d37bb3ddc69c 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H @@ -65,7 +65,7 @@ namespace compressible { /*---------------------------------------------------------------------------*\ - Class turbulenceModel Declaration + Class turbulenceModel Declaration \*---------------------------------------------------------------------------*/ class turbulenceModel @@ -144,7 +144,8 @@ public: //- Destructor - virtual ~turbulenceModel(); + virtual ~turbulenceModel() + {} // Member Functions @@ -209,6 +210,15 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const = 0; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const = 0; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct() = 0; diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C index 3ee9619340d662e792c9bb5bfa0920efe34723d5..62f18f3981615931d36a7ca0f3822ae6e3d2aae4 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.C @@ -125,8 +125,8 @@ autoPtr<LESModel> LESModel::New { FatalErrorIn ( - "LESModel::select(const volVectorField&, const " - "surfaceScalarField&, transportModel&)" + "LESModel::New(const volVectorField& U, const " + "surfaceScalarField& phi, transportModel&)" ) << "Unknown LESModel type " << modelName << endl << endl << "Valid LESModel types are :" << endl @@ -138,13 +138,56 @@ autoPtr<LESModel> LESModel::New } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp<volScalarField> LESModel::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); -LESModel::~LESModel() -{} + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + ( this->nu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + this->epsilon() + ) + ); +} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +tmp<volScalarField> LESModel::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + this->nuEff()*dev(twoSymm(tgradU())) + - ((2.0/3.0)*I) * this->k() + ) && tgradU() + ) + ); +} + void LESModel::correct(const tmp<volTensorField>&) { diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H index 766cc63fc0506f329ddd8eac1327f99c2acd087d..5c0c615eb6a01918973ac7b21a74264c6cb297db 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H @@ -35,10 +35,10 @@ Description Base class for all incompressible flow LES SGS models. This class defines the basic interface for an incompressible flow SGS - model, and encapsulates data of value to all possible models. In - particular this includes references to all the dependent fields (U, - phi), the physical viscosity nu, and the LESProperties - dictionary which contains the model selection and model coefficients. + model, and encapsulates data of value to all possible models. + In particular this includes references to all the dependent fields + (U, phi), the physical viscosity nu, and the LESProperties + dictionary, which contains the model selection and model coefficients. SourceFiles LESModel.C @@ -152,7 +152,8 @@ public: //- Destructor - virtual ~LESModel(); + virtual ~LESModel() + {} // Member Functions @@ -241,14 +242,23 @@ public: } - //- Correct Eddy-Viscosity and related properties - virtual void correct(const tmp<volTensorField>& gradU); + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; //- Correct Eddy-Viscosity and related properties. // This calls correct(const tmp<volTensorField>& gradU) by supplying // gradU calculated locally. void correct(); + //- Correct Eddy-Viscosity and related properties + virtual void correct(const tmp<volTensorField>& gradU); + //- Read LESProperties dictionary virtual bool read() = 0; }; diff --git a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C index 4342712d806132771a79c7763b7ce5aeb0291147..4aadf02bf2ea098f7521c95f826768894638bae5 100644 --- a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.C @@ -133,12 +133,6 @@ dynOneEqEddy::dynOneEqEddy } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -dynOneEqEddy::~dynOneEqEddy() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void dynOneEqEddy::correct(const tmp<volTensorField>& gradU) diff --git a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H index 15f0ac56d10e93a7858cc73ec75b22a374345848..9b1a4064d6dff440439f45939eb2eb802257d653 100644 --- a/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H +++ b/src/turbulenceModels/incompressible/LES/dynOneEqEddy/dynOneEqEddy.H @@ -116,7 +116,8 @@ public: //- Destructor - virtual ~dynOneEqEddy(); + virtual ~dynOneEqEddy() + {} // Member Functions diff --git a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C index e260a6d16d81154d59b53d18934e44895ab6ae83..fedd18ee7d169d5fcb7f2741dc1e05f82f78db2a 100644 --- a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C +++ b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.C @@ -124,12 +124,6 @@ dynSmagorinsky::dynSmagorinsky } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -dynSmagorinsky::~dynSmagorinsky() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void dynSmagorinsky::correct(const tmp<volTensorField>& gradU) diff --git a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H index 93e85a808b151e0869fc37bd20b95ba63efd9912..b0bd7868f086a2ae63969680fb03fdb115c9bb3c 100644 --- a/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H +++ b/src/turbulenceModels/incompressible/LES/dynSmagorinsky/dynSmagorinsky.H @@ -125,7 +125,8 @@ public: //- Destructor - virtual ~dynSmagorinsky(); + virtual ~dynSmagorinsky() + {} // Member Functions diff --git a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C index 7d34bbb981fca78aeb8e459390139fe5c403592d..f463e3f2082aad874af2ce36dfd8def76e93ed75 100644 --- a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C +++ b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.C @@ -126,12 +126,6 @@ locDynOneEqEddy::locDynOneEqEddy } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -locDynOneEqEddy::~locDynOneEqEddy() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void locDynOneEqEddy::correct(const tmp<volTensorField>& gradU) diff --git a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H index 1ff8fc07dd926fc8417357a967df71b277ebedab..ef6a9edcfffdc6b728486c920a5fbe33a531f571 100644 --- a/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H +++ b/src/turbulenceModels/incompressible/LES/locDynOneEqEddy/locDynOneEqEddy.H @@ -138,7 +138,8 @@ public: //- Destructor - virtual ~locDynOneEqEddy(); + virtual ~locDynOneEqEddy() + {} // Member Functions diff --git a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C index 0499ffca6871658f560a9d876a18753929c8bf93..226054bf14249f098907145421fffa0c9b41d6cd 100644 --- a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C +++ b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.C @@ -56,12 +56,6 @@ scaleSimilarity::scaleSimilarity } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -scaleSimilarity::~scaleSimilarity() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // tmp<volScalarField> scaleSimilarity::k() const diff --git a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H index 3f4f55535f2b9044c45e6a5cee24eac4a0d2ca49..69d06a892c2990077ef10cb562bc195b5577dd57 100644 --- a/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H +++ b/src/turbulenceModels/incompressible/LES/scaleSimilarity/scaleSimilarity.H @@ -90,7 +90,8 @@ public: //- Destructor - virtual ~scaleSimilarity(); + virtual ~scaleSimilarity() + {} // Member Functions diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C index 272d0f60feb054d0a01be8374c569b77809f6a7a..4cc9fd07b95f94934f543d11c2e12dc7d5dd7384 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.C @@ -174,13 +174,56 @@ autoPtr<RASModel> RASModel::New } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -RASModel::~RASModel() -{} +tmp<volScalarField> RASModel::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + ( this->nu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + this->epsilon() + ) + ); +} + + +tmp<volScalarField> RASModel::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( + this->nuEff()*dev(twoSymm(tgradU())) + - ((2.0/3.0)*I) * this->k() + ) && tgradU() + ) + ); +} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // scalar RASModel::yPlusLam(const scalar kappa, const scalar E) const { diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H index c934488bb38b1b8abef4ba4e38137754a6d22a48..3a2f0aa7e90c8bf21ac0212b49c5ae88809f1ec4 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H @@ -182,7 +182,8 @@ public: //- Destructor - virtual ~RASModel(); + virtual ~RASModel() + {} // Member Functions @@ -310,9 +311,6 @@ public: ); } - //- Return yPlus for the given patch - virtual tmp<scalarField> yPlus(const label patchI) const; - //- Return the turbulence kinetic energy virtual tmp<volScalarField> k() const = 0; @@ -328,6 +326,18 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0; + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; + + //- Return yPlus for the given patch + virtual tmp<scalarField> yPlus(const label patchI) const; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct() = 0; diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C index a88b319268c8780622828150204337bc64f83c76..83e89135258ea85812552344f84467abd18db5bd 100644 --- a/src/turbulenceModels/incompressible/RAS/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.C @@ -77,12 +77,6 @@ tmp<volScalarField> laminar::nut() const } -tmp<volScalarField> laminar::nuEff() const -{ - return tmp<volScalarField>(new volScalarField("nuEff", nu())); -} - - tmp<volScalarField> laminar::k() const { return tmp<volScalarField> @@ -182,6 +176,50 @@ tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const } +tmp<volScalarField> laminar::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->nu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + +tmp<volScalarField> laminar::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->nu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + bool laminar::read() { return RASModel::read(); diff --git a/src/turbulenceModels/incompressible/RAS/laminar/laminar.H b/src/turbulenceModels/incompressible/RAS/laminar/laminar.H index b139f0fad3fbe3b46377c7528325ee5f3a2e05ee..1617d60064accb35bcaa27bfb4cdeaa104894db7 100644 --- a/src/turbulenceModels/incompressible/RAS/laminar/laminar.H +++ b/src/turbulenceModels/incompressible/RAS/laminar/laminar.H @@ -83,7 +83,10 @@ public: virtual tmp<volScalarField> nut() const; //- Return the effective viscosity, i.e. the laminar viscosity - virtual tmp<volScalarField> nuEff() const; + virtual tmp<volScalarField> nuEff() const + { + return tmp<volScalarField>(new volScalarField("nuEff", nu())); + } //- Return the turbulence kinetic energy, i.e. 0 for laminar flow virtual tmp<volScalarField> k() const; @@ -95,12 +98,21 @@ public: //- Return the Reynolds stress tensor, i.e. 0 for laminar flow virtual tmp<volSymmTensorField> R() const; - //- Return the effective stress tensor including the laminar stress + //- Return the effective stress tensor, i.e. the laminar stress virtual tmp<volSymmTensorField> devReff() const; //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; + //- Correct the laminar viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C index f1dca5b4add73c2b9d1ad04f49966ac1c6f9e178..e3a9c30fd77efd2abe8c08e96206366e44195229 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C @@ -199,6 +199,50 @@ tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const } +tmp<volScalarField> laminar::thermalDissipation() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipation", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->nu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + +tmp<volScalarField> laminar::thermalDissipationEff() const +{ + tmp<volTensorField> tgradU = fvc::grad(this->U()); + + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "thermalDissipationEff", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + ( this->nu()*dev(twoSymm(tgradU())) ) && tgradU() + ) + ); +} + + bool laminar::read() { return true; diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H index a64884da91c37f62edd938235b6c14ba5ac9f64f..aa83346820fccd17fdcebefcac315718b8ab583d 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H @@ -104,12 +104,21 @@ public: //- Return the Reynolds stress tensor, i.e. 0 for laminar flow virtual tmp<volSymmTensorField> R() const; - //- Return the effective stress tensor including the laminar stress + //- Return the effective stress tensor, i.e. the laminar stress virtual tmp<volSymmTensorField> devReff() const; //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const; + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const; + //- Correct the laminar viscosity virtual void correct(); diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C index da4c39dcaa5b378ed86ab566b70100285d48452c..cdbb61fa7062dff384144ae916df3aa804243e7f 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.C @@ -110,12 +110,6 @@ autoPtr<turbulenceModel> turbulenceModel::New } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -turbulenceModel::~turbulenceModel() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void turbulenceModel::correct() diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H index 4399e85120120cd1fac68bc6cd89d7a8683dce66..a9d1465e772740353a7e7724f3c26715c9c0efe4 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H @@ -139,7 +139,8 @@ public: //- Destructor - virtual ~turbulenceModel(); + virtual ~turbulenceModel() + {} // Member Functions @@ -189,6 +190,15 @@ public: //- Return the source term for the momentum equation virtual tmp<fvVectorMatrix> divDevReff(volVectorField& U) const = 0; + //- The source for the enthalpy equation resulting from + // viscous and turbulent dissipation + virtual tmp<volScalarField> thermalDissipation() const = 0; + + //- The source for the enthalpy equation resulting from + // the effective viscous dissipation + // (ie, when turbulent production and dissipation are in equilibrium) + virtual tmp<volScalarField> thermalDissipationEff() const = 0; + //- Solve the turbulence equations and correct the turbulence viscosity virtual void correct() = 0; diff --git a/tutorials/combustion/XiFoam/les/pitzDaily/constant/LESProperties b/tutorials/combustion/XiFoam/les/pitzDaily/constant/LESProperties index 56c915c9248767858ba422364230811ed44db542..5e1ce2213aeb68185daee5258bedfe1352e6ed9c 100644 --- a/tutorials/combustion/XiFoam/les/pitzDaily/constant/LESProperties +++ b/tutorials/combustion/XiFoam/les/pitzDaily/constant/LESProperties @@ -19,6 +19,8 @@ LESModel oneEqEddy; delta cubeRootVol; +turbulence on; + printCoeffs on; laminarCoeffs diff --git a/tutorials/combustion/XiFoam/les/pitzDaily3D/constant/LESProperties b/tutorials/combustion/XiFoam/les/pitzDaily3D/constant/LESProperties index 95bb1c14f8c2d1a80c01f98d2d8b11202218d7b3..a051384982e8fa71198099e562f058415667f9a5 100644 --- a/tutorials/combustion/XiFoam/les/pitzDaily3D/constant/LESProperties +++ b/tutorials/combustion/XiFoam/les/pitzDaily3D/constant/LESProperties @@ -19,6 +19,8 @@ LESModel oneEqEddy; delta cubeRootVol; +turbulence on; + printCoeffs on; laminarCoeffs diff --git a/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/LESProperties b/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/LESProperties index 25be4174a3fc504065d9065a7ebaf9762690ace8..251fe1ae80b2be0a6a9e6faa697aceab16a3bbfd 100644 --- a/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/LESProperties +++ b/tutorials/compressible/rhoPisoFoam/les/pitzDaily/constant/LESProperties @@ -17,6 +17,8 @@ FoamFile LESModel oneEqEddy; +turbulence on; + printCoeffs on; delta cubeRootVol;