From 3b2c4abd574b49077e9ff95ff340769c1ec6db2c Mon Sep 17 00:00:00 2001 From: andy <a.heather@opencfd.co.uk> Date: Mon, 11 Jan 2010 12:07:15 +0000 Subject: [PATCH] Updates to the compressible LES/RAS api - removed repeated declaration of pure abstract functions - added function to return the turbulence effective thermal diffusivity for a patch --- .../LES/GenEddyVisc/GenEddyVisc.H | 9 ----- .../LES/GenSGSStress/GenSGSStress.H | 9 ----- .../compressible/LES/LESModel/LESModel.H | 28 +++++++++------ .../LES/SpalartAllmaras/SpalartAllmaras.H | 9 ----- .../compressible/RAS/LRR/LRR.H | 9 ++--- .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H | 9 ++--- .../RAS/LaunderSharmaKE/LaunderSharmaKE.H | 9 ++--- .../compressible/RAS/RASModel/RASModel.H | 36 +++++++++---------- .../RAS/RNGkEpsilon/RNGkEpsilon.H | 9 ++--- .../RAS/SpalartAllmaras/SpalartAllmaras.H | 9 ++--- .../compressible/RAS/kEpsilon/kEpsilon.H | 9 ++--- .../compressible/RAS/kOmegaSST/kOmegaSST.H | 9 ++--- .../compressible/RAS/laminar/laminar.C | 21 +++++++++++ .../compressible/RAS/laminar/laminar.H | 3 ++ .../RAS/realizableKE/realizableKE.H | 9 ++--- .../turbulenceModel/laminar/laminar.H | 10 ++++++ .../turbulenceModel/turbulenceModel.H | 8 ++++- 17 files changed, 99 insertions(+), 106 deletions(-) diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H index 440ec71c5c9..7f2d3f1f852 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H @@ -126,15 +126,6 @@ public: return alphaSgs_; } - //- Return thermal diffusivity - virtual tmp<volScalarField> alphaEff() const - { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphaSgs_ + alpha()) - ); - } - //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const; diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H index ff71c80b798..e65495225cc 100644 --- a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H +++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H @@ -127,15 +127,6 @@ public: return alphaSgs_; } - //- Return thermal conductivity - virtual tmp<volScalarField> alphaEff() const - { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphaSgs_ + alpha()) - ); - } - //- Return the sub-grid stress tensor virtual tmp<volSymmTensorField> B() const { diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index cf019ea9a8a..2cdde6c61ed 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -189,12 +189,6 @@ public: } - //- Return the SGS turbulent kinetic energy. - virtual tmp<volScalarField> k() const = 0; - - //- Return the SGS turbulent dissipation. - virtual tmp<volScalarField> epsilon() const = 0; - //- Return the SGS turbulent viscosity virtual tmp<volScalarField> muSgs() const = 0; @@ -210,8 +204,22 @@ public: //- Return the SGS turbulent thermal diffusivity virtual tmp<volScalarField> alphaSgs() const = 0; - //- Return the SGS thermal conductivity. - virtual tmp<volScalarField> alphaEff() const = 0; + //- Return the effective thermal diffusivity + virtual tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphaSgs() + alpha()) + ); + } + + //- Return the effective turbulence thermal diffusivity for a patch + virtual tmp<scalarField> alphaEff(const label patchI) const + { + return + alphaSgs()().boundaryField()[patchI] + + alpha().boundaryField()[patchI]; + } //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const = 0; @@ -261,13 +269,13 @@ public: //- Correct Eddy-Viscosity and related properties. // This calls correct(const tmp<volTensorField>& gradU) by supplying // gradU calculated locally. - void correct(); + virtual void correct(); //- Correct Eddy-Viscosity and related properties virtual void correct(const tmp<volTensorField>& gradU); //- Read LESProperties dictionary - virtual bool read() = 0; + virtual bool read(); }; diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H index e6239ec91bc..29d53267a2e 100644 --- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -149,15 +149,6 @@ public: return alphaSgs_; } - //- Return thermal conductivity - virtual tmp<volScalarField> alphaEff() const - { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphaSgs_ + alpha()) - ); - } - //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const; diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.H b/src/turbulenceModels/compressible/RAS/LRR/LRR.H index 445faebd39e..9ce0eef7bbe 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.H +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.H @@ -153,13 +153,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H index 00db2c304f9..e8c5a331b26 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -162,13 +162,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H index b7c972a662c..f9c878607d0 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H @@ -146,13 +146,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index cc189f24c80..883fa0825a3 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -265,9 +265,6 @@ public: } - //- Return the turbulence viscosity - virtual tmp<volScalarField> mut() const = 0; - //- Return the effective viscosity virtual tmp<volScalarField> muEff() const { @@ -278,22 +275,21 @@ public: } //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const = 0; - - //- Return the turbulence kinetic energy - virtual tmp<volScalarField> k() const = 0; - - //- Return the turbulence kinetic energy dissipation rate - virtual tmp<volScalarField> epsilon() const = 0; - - //- Return the Reynolds stress tensor - virtual tmp<volSymmTensorField> R() const = 0; - - //- Return the effective stress tensor including the laminar stress - virtual tmp<volSymmTensorField> devRhoReff() const = 0; + virtual tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphat() + alpha()) + ); + } - //- Return the source term for the momentum equation - virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; + //- Return the effective turbulent thermal diffusivity for a patch + virtual tmp<scalarField> alphaEff(const label patchI) const + { + return + alphat()().boundaryField()[patchI] + + alpha().boundaryField()[patchI]; + } //- Return yPlus for the given patch virtual tmp<scalarField> yPlus @@ -303,10 +299,10 @@ public: ) const; //- Solve the turbulence equations and correct the turbulence viscosity - virtual void correct() = 0; + virtual void correct(); //- Read RASProperties dictionary - virtual bool read() = 0; + virtual bool read(); }; diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H index 1e4301adcd2..9d9601eee78 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H @@ -142,13 +142,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H index 94e736b9f8a..fdb0c675ee0 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -178,13 +178,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H index 865120d8c6c..11d8f75a058 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H @@ -138,13 +138,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H index a563557f764..9806d32493b 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -222,13 +222,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.C b/src/turbulenceModels/compressible/RAS/laminar/laminar.C index 415dedee72b..cc5666eb6cb 100644 --- a/src/turbulenceModels/compressible/RAS/laminar/laminar.C +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.C @@ -78,6 +78,27 @@ tmp<volScalarField> laminar::mut() const } +tmp<volScalarField> laminar::alphat() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("alphat", alpha().dimensions(), 0.0) + ) + ); +} + + tmp<volScalarField> laminar::k() const { return tmp<volScalarField> diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.H b/src/turbulenceModels/compressible/RAS/laminar/laminar.H index af1f5e2bb2c..506799ec983 100644 --- a/src/turbulenceModels/compressible/RAS/laminar/laminar.H +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.H @@ -89,6 +89,9 @@ public: return tmp<volScalarField>(new volScalarField("muEff", mu())); } + //- Return the turbulence thermal diffusivity, i.e. 0 for laminar flow + virtual tmp<volScalarField> alphat() const; + //- Return the effective turbulent thermal diffusivity, // i.e. the laminar thermal diffusivity virtual tmp<volScalarField> alphaEff() const diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H index 222ee733a32..1b7d51a9a97 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H @@ -159,13 +159,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H index d4379bfb2e2..7645e673794 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H @@ -99,6 +99,9 @@ public: return tmp<volScalarField>(new volScalarField("muEff", mu())); } + //- Return the turbulence thermal diffusivity, i.e. 0 for laminar flow + virtual tmp<volScalarField> alphat() const; + //- Return the effective turbulent thermal diffusivity, // i.e. the laminar thermal diffusivity virtual tmp<volScalarField> alphaEff() const @@ -106,6 +109,13 @@ public: return tmp<volScalarField>(new volScalarField("alphaEff", alpha())); } + //- Return the effective turbulent thermal diffusivity for a patch, + // i.e. the laminar thermal diffusivity + virtual tmp<scalarField> alphaEff(const label patchI) const + { + return alpha().boundaryField()[patchI]; + } + //- Return the turbulence kinetic energy, i.e. 0 for laminar flow virtual tmp<volScalarField> k() const; diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H index 97638e5e49c..9a84c01bb83 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H @@ -192,9 +192,15 @@ public: //- Return the effective viscosity virtual tmp<volScalarField> muEff() const = 0; - //- Return the effective turbulent thermal diffusivity + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const = 0; + + //- Return the effective turbulence thermal diffusivity virtual tmp<volScalarField> alphaEff() const = 0; + //- Return the effective turbulence thermal diffusivity for a patch + virtual tmp<scalarField> alphaEff(const label patchI) const = 0; + //- Return the turbulence kinetic energy virtual tmp<volScalarField> k() const = 0; -- GitLab