diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C index 2801ea3e4e..9b9acc6793 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/multiphaseCompressibleTurbulenceModels.C @@ -77,6 +77,9 @@ makeRASModel(kEpsilon); #include "kOmegaSST.H" makeRASModel(kOmegaSST); +#include "kOmegaSSTSato.H" +makeRASModel(kOmegaSSTSato); + #include "Smagorinsky.H" makeLESModel(Smagorinsky); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C index 9f0236f3ee..894a572fcd 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,9 +79,6 @@ makeRASModel(kEpsilon); #include "kOmegaSST.H" makeRASModel(kOmegaSST); -#include "kOmegaSSTSato.H" -makeRASModel(kOmegaSSTSato); - #include "mixtureKEpsilon.H" makeRASModel(mixtureKEpsilon); diff --git a/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C b/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C index 92b44ced99..62ee62fb22 100644 --- a/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C +++ b/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,8 @@ License #include "kOmegaSSTSato.H" #include "fvOptions.H" -#include "twoPhaseSystem.H" +#include "phaseSystem.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -61,7 +62,14 @@ kOmegaSSTSato::kOmegaSSTSato type ), - gasTurbulencePtr_(nullptr), + phase_(transport), + + hasDispersedPhaseNames_(this->coeffDict_.found("dispersedPhases")), + + dispersedPhaseNames_ + ( + this->coeffDict_.lookupOrDefault("dispersedPhases", hashedWordList()) + ), Cmub_ ( @@ -97,35 +105,50 @@ bool kOmegaSSTSato::read() } } + template -const PhaseCompressibleTurbulenceModel -< - typename BasicTurbulenceModel::transportModel ->& -kOmegaSSTSato::gasTurbulence() const +UPtrList +kOmegaSSTSato::getDispersedPhases() const { - if (!gasTurbulencePtr_) + UPtrList dispersedPhases; + + const phaseSystem& fluid = phase_.fluid(); + + if (hasDispersedPhaseNames_) { - const volVectorField& U = this->U_; + dispersedPhases.resize(dispersedPhaseNames_.size()); - const transportModel& liquid = this->transport(); - const twoPhaseSystem& fluid = - refCast(liquid.fluid()); - const transportModel& gas = fluid.otherPhase(liquid); - - gasTurbulencePtr_ = - &U.db() - .lookupObject> + forAll(dispersedPhaseNames_, dispersedPhasei) + { + dispersedPhases.set ( - IOobject::groupName - ( - turbulenceModel::propertiesName, - gas.name() - ) + dispersedPhasei, + &fluid.phases()[dispersedPhaseNames_[dispersedPhasei]] ); + } + } + else + { + dispersedPhases.resize(fluid.movingPhases().size() - 1); + + label dispersedPhasei = 0; + + forAll(fluid.movingPhases(), movingPhasei) + { + const phaseModel& otherPhase = fluid.movingPhases()[movingPhasei]; + + if (&otherPhase != &phase_) + { + dispersedPhases.set + ( + dispersedPhasei ++, + &otherPhase + ); + } + } } - return *gasTurbulencePtr_; + return dispersedPhases; } @@ -136,19 +159,22 @@ void kOmegaSSTSato::correctNut const volScalarField& F2 ) { - const PhaseCompressibleTurbulenceModel& gasTurbulence = - this->gasTurbulence(); - volScalarField yPlus ( pow(this->betaStar_, 0.25)*this->y_*sqrt(this->k_)/this->nu() ); this->nut_ = - this->a1_*this->k_/max(this->a1_*this->omega_, this->b1_*F2*sqrt(S2)) - + sqr(1 - exp(-yPlus/16.0)) - *Cmub_*gasTurbulence.transport().d()*gasTurbulence.alpha() - *(mag(this->U_ - gasTurbulence.U())); + this->a1_*this->k_/max(this->a1_*this->omega_, this->b1_*F2*sqrt(S2)); + + UPtrList dispersedPhases(getDispersedPhases()); + forAllIter(UPtrList, dispersedPhases, phaseIter) + { + this->nut_ += + sqr(1 - exp(-yPlus/16.0)) + *Cmub_*phaseIter().d()*phaseIter() + *(mag(this->U_ - phaseIter().U())); + } this->nut_.correctBoundaryConditions(); fv::options::New(this->mesh_).correct(this->nut_); diff --git a/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.H b/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.H index 9348a294b0..c2d6b60e4b 100644 --- a/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.H +++ b/src/TurbulenceModels/phaseCompressible/RAS/kOmegaSSTSato/kOmegaSSTSato.H @@ -54,7 +54,7 @@ Description Note that this implementation is written in terms of alpha diffusion coefficients rather than the more traditional sigma (alpha = 1/sigma) so - that the blending can be applied to all coefficuients in a consistent + that the blending can be applied to all coefficients in a consistent manner. The paper suggests that sigma is blended but this would not be consistent with the blending of the k-epsilon and k-omega models. @@ -90,9 +90,6 @@ Description } \endverbatim -SourceFiles - kOmegaSST.C - SourceFiles kOmegaSSTSato.C @@ -102,6 +99,8 @@ SourceFiles #define kOmegaSSTSato_H #include "kOmegaSST.H" +#include "phaseSystem.H" +#include "hashedWordList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -121,20 +120,19 @@ class kOmegaSSTSato { // Private Data - mutable const PhaseCompressibleTurbulenceModel - < - typename BasicTurbulenceModel::transportModel - > *gasTurbulencePtr_; + //- The phase to which the turbulent model is applied to + const phaseModel& phase_; + //- True if a list of dispersed phases is specified in the dictionary + bool hasDispersedPhaseNames_; + + //- Optional list of names of dispersed phases + hashedWordList dispersedPhaseNames_; // Private Member Functions - //- Return the turbulence model for the gas phase - const PhaseCompressibleTurbulenceModel - < - typename BasicTurbulenceModel::transportModel - >& - gasTurbulence() const; + //- Return the dispersed phase models + UPtrList getDispersedPhases() const; protected: diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/turbulenceProperties.liquid b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/turbulenceProperties.liquid index 5a55c4a527..00fba92ab3 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/turbulenceProperties.liquid +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/turbulenceProperties.liquid @@ -19,7 +19,7 @@ simulationType RAS; RAS { - RASModel kOmegaSST; + RASModel kOmegaSSTSato; turbulence on; printCoeffs on; diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/controlDict.orig b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/controlDict.orig index 237d4c343e..3c3c3695ac 100644 --- a/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/controlDict.orig +++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/controlDict.orig @@ -114,6 +114,7 @@ functions operation sum; fields ( alphaRhoPhi.gas alphaRhoPhi.gas2 alphaRhoPhi.liquid ); } + #includeFunc writeObjects(d.gas, d.gas2) } diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingPolydisperse/system/controlDict.orig b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingPolydisperse/system/controlDict.orig index 11f80d6be2..8fbfdc32e9 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingPolydisperse/system/controlDict.orig +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingPolydisperse/system/controlDict.orig @@ -114,6 +114,7 @@ functions operation sum; fields ( alphaRhoPhi.gas alphaRhoPhi.liquid ); } + #includeFunc writeObjects(d.gas) }