diff --git a/applications/solvers/compressible/rhoSimpleFoam/createFields.H b/applications/solvers/compressible/rhoSimpleFoam/createFields.H index 80f317cd855641711eae395a84020177dd58266c..61cea5c2e51fc4269ca40a742fc26b0ccf71dc89 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoSimpleFoam/createFields.H @@ -69,9 +69,9 @@ dimensionedScalar rhoMin ); Info<< "Creating turbulence model\n" << endl; -autoPtr<compressible::RASModel> turbulence +autoPtr<compressible::turbulenceModel> turbulence ( - compressible::New<compressible::RASModel> + compressible::turbulenceModel::New ( rho, U, diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H index a5847f74ee9b4e1dc78f342b98771feef3afaa6d..0adeb49b7203e4262e129b0d4f7b4cef754b37e5 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H +++ b/applications/utilities/preProcessing/applyBoundaryLayer/createFields.H @@ -38,7 +38,23 @@ volVectorField U ); Info<< "Calculating wall distance field" << endl; -const volScalarField& y(wallDist::New(mesh).y()); +volScalarField y +( + IOobject + ( + "y", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dimLength, 0.0), + zeroGradientFvPatchScalarField::typeName +); +y.internalField() = wallDist::New(mesh).y().internalField(); +y.correctBoundaryConditions(); + // Set the mean boundary-layer thickness dimensionedScalar ybl("ybl", dimLength, 0); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H index 18d1d4cb4a0844f7eed72c43a365c55124b59834..1b6668977c93437f7a3421256e6af34698e223ff 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H @@ -62,9 +62,9 @@ Description type compressible::turbulentTemperatureCoupledBaffleMixed; Tnbr T; kappa lookup; - KappaName kappa; + kappaName kappa; thicknessLayers (0.1 0.2 0.3 0.4); - kappaLayers (1 2 3 4) + kappaLayers (1 2 3 4); value uniform 300; } \endverbatim diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H index 6bd2aaa6e9959c3ff56023a30c1dc4b88e6cd911..77365b2aa612ab114e576e095df135aa627d6ea0 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H @@ -55,7 +55,7 @@ Description type compressible::turbulentTemperatureRadCoupledMixed; Tnbr T; kappa lookup; - KappaName kappa; + kappaName kappa; QrNbr Qr; // or none. Name of Qr field on neighbour region Qr Qr; // or none. Name of Qr field on local region thicknessLayers (0.1 0.2 0.3 0.4); diff --git a/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasDES/SpalartAllmarasDES.C b/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasDES/SpalartAllmarasDES.C index f5dce6ab61c73a7266cf267be4fc6affff923d34..3767153d7805508a13449bc8867e8e85853a8067 100644 --- a/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasDES/SpalartAllmarasDES.C +++ b/src/TurbulenceModels/turbulenceModels/DES/SpalartAllmarasDES/SpalartAllmarasDES.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -457,7 +457,29 @@ tmp<volScalarField> SpalartAllmarasDES<BasicTurbulenceModel>::k() const { const volScalarField chi(this->chi()); const volScalarField fv1(this->fv1(chi)); - return sqr(this->nut()/ck_/dTilda(chi, fv1, fvc::grad(this->U_))); + + tmp<volScalarField> tdTilda + ( + new volScalarField + ( + IOobject + ( + "dTilda", + this->mesh_.time().timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + this->mesh_, + dimensionedScalar("0", dimLength, 0.0), + zeroGradientFvPatchField<vector>::typeName + ) + ); + volScalarField& dTildaF = tdTilda(); + dTildaF = dTilda(chi, fv1, fvc::grad(this->U_)); + dTildaF.correctBoundaryConditions(); + + return sqr(this->nut()/ck_/dTildaF); } diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESeddyViscosity/LESeddyViscosity.C b/src/TurbulenceModels/turbulenceModels/LES/LESeddyViscosity/LESeddyViscosity.C index 2a58c71e3588f4473d817b5aa724a84df9bb0dbb..d867084917bca73dd54a771be4825a885e7eb7f2 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESeddyViscosity/LESeddyViscosity.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESeddyViscosity/LESeddyViscosity.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -94,7 +94,7 @@ tmp<volScalarField> LESeddyViscosity<BasicTurbulenceModel>::epsilon() const { tmp<volScalarField> tk(this->k()); - return tmp<volScalarField> + tmp<volScalarField> tepsilon ( new volScalarField ( @@ -106,9 +106,14 @@ tmp<volScalarField> LESeddyViscosity<BasicTurbulenceModel>::epsilon() const IOobject::NO_READ, IOobject::NO_WRITE ), - Ce_*tk()*sqrt(tk())/this->delta() + Ce_*tk()*sqrt(tk())/this->delta(), + zeroGradientFvPatchScalarField::typeName ) ); + volScalarField& epsilon = tepsilon(); + epsilon.correctBoundaryConditions(); + + return tepsilon; } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C index a029db7ad39da7cea715558a54d5e3a4ba92ccb4..59a8ca1af341aff9ba1a1d6b7bbf4256fc234cde 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -300,6 +300,11 @@ tmp<volScalarField> SpalartAllmaras<BasicTurbulenceModel>::DnuTildaEff() const template<class BasicTurbulenceModel> tmp<volScalarField> SpalartAllmaras<BasicTurbulenceModel>::k() const { + WarningInFunction + << "Turbulence kinetic energy not defined for " + << "Spalart-Allmaras model. Returning zero field" + << endl; + return tmp<volScalarField> ( new volScalarField @@ -311,7 +316,8 @@ tmp<volScalarField> SpalartAllmaras<BasicTurbulenceModel>::k() const this->mesh_ ), this->mesh_, - dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0) + dimensionedScalar("0", dimensionSet(0, 2, -2, 0, 0), 0), + zeroGradientFvPatchField<vector>::typeName ) ); } @@ -336,7 +342,8 @@ tmp<volScalarField> SpalartAllmaras<BasicTurbulenceModel>::epsilon() const this->mesh_ ), this->mesh_, - dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0) + dimensionedScalar("0", dimensionSet(0, 2, -3, 0, 0), 0), + zeroGradientFvPatchField<vector>::typeName ) ); }