diff --git a/applications/solvers/heatTransfer/thermoFoam/EEqn.H b/applications/solvers/heatTransfer/thermoFoam/EEqn.H index 98a248ac35ae47bada3bbca30859ae9dfbeb616f..55088296638aa3b3f7901de2f977452df00b4e90 100644 --- a/applications/solvers/heatTransfer/thermoFoam/EEqn.H +++ b/applications/solvers/heatTransfer/thermoFoam/EEqn.H @@ -15,12 +15,16 @@ ) : -dpdt ) - - fvm::laplacian(alphaEff, he) == radiation->Sh(thermo, he) + fvOptions(rho, he) ); + if (turbulence.valid()) + { + EEqn -= fvm::laplacian(turbulence->alphaEff(), he); + } + EEqn.relax(); fvOptions.constrain(EEqn); diff --git a/applications/solvers/heatTransfer/thermoFoam/createFields.H b/applications/solvers/heatTransfer/thermoFoam/createFields.H index 90f25a89a3a930a0e416c19e586d7fcb48511ea9..2e09b43e59592c7db3fce6343e576173bbcbde9c 100644 --- a/applications/solvers/heatTransfer/thermoFoam/createFields.H +++ b/applications/solvers/heatTransfer/thermoFoam/createFields.H @@ -35,7 +35,31 @@ volVectorField U #include "compressibleCreatePhi.H" -#include "setAlphaEff.H" +autoPtr<compressible::turbulenceModel> turbulence; + +IOobject turbulencePropertiesHeader +( + "turbulenceProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false +); + +if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false)) +{ + Info<< "Creating turbulence model\n" << endl; + + turbulence = + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo + ); +} #include "createDpdt.H" diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H deleted file mode 100644 index c760349a6eb0efa409467f47e21c735a82a7d3af..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H +++ /dev/null @@ -1,47 +0,0 @@ -Info<< "Creating turbulence model\n" << endl; -tmp<volScalarField> talphaEff; - -IOobject turbulencePropertiesHeader -( - "turbulenceProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false -); - -if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false)) -{ - autoPtr<compressible::turbulenceModel> turbulence - ( - compressible::turbulenceModel::New - ( - rho, - U, - phi, - thermo - ) - ); - - talphaEff = turbulence->alphaEff(); -} -else -{ - talphaEff = tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "alphaEff", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionedScalar("0", dimMass/dimLength/dimTime, 0.0) - ) - ); -} diff --git a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C index a8cbdf9f7e6188ae65d58031c3648aeaca54c42b..ea5012e72eaba0a28bb8aa7d81f713842da475ac 100644 --- a/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C +++ b/applications/solvers/heatTransfer/thermoFoam/thermoFoam.C @@ -54,8 +54,6 @@ int main(int argc, char *argv[]) #include "createFields.H" #include "createFvOptions.H" - const volScalarField& alphaEff = talphaEff(); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nEvolving thermodynamics\n" << endl;