From 9a5ca74a535a869cdbf20d08df2fea80994b0798 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 10:26:54 +0000 Subject: [PATCH 01/37] ENH: Added region option to setFields --- applications/utilities/preProcessing/setFields/setFields.C | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index ebc43d84f2..3f1f628a75 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.C @@ -359,9 +359,10 @@ public: int main(int argc, char *argv[]) { -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" + #include "addRegionOption.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createNamedMesh.H" Info<< "Reading setFieldsDict\n" << endl; From dbe246adc682793074ef4fef16bd9b367d407dee Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 10:33:46 +0000 Subject: [PATCH 02/37] BUG: Corrected mask field in film radiation model --- .../filmRadiationModel/constantRadiation/constantRadiation.C | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.C index ac0358f141..bb1b6c294f 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmRadiationModel/constantRadiation/constantRadiation.C @@ -80,8 +80,7 @@ constantRadiation::constantRadiation IOobject::AUTO_WRITE ), owner.regionMesh(), - dimensionedScalar("one", dimless, 1.0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar("one", dimless, 1.0) ), timeStart_(readScalar(coeffs_.lookup("timeStart"))), duration_(readScalar(coeffs_.lookup("duration"))) From d8a6fbad414d794f0a2b4802dc0347094cac90bb Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 15:30:09 +0000 Subject: [PATCH 03/37] ENH: Removed old/unused file --- .../RAS/kOmegaSST/kOmegaSST.C.new | 419 ------------------ 1 file changed, 419 deletions(-) delete mode 100644 src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new deleted file mode 100644 index b28e14bce9..0000000000 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C.new +++ /dev/null @@ -1,419 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "kOmegaSST.H" -#include "addToRunTimeSelectionTable.H" - -#include "backwardsCompatibilityWallFunctions.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace incompressible -{ -namespace RASModels -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(kOmegaSST, 0); -addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary); - -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - -tmp kOmegaSST::F1(const volScalarField& CDkOmega) const -{ - volScalarField CDkOmegaPlus = max - ( - CDkOmega, - dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) - ); - - volScalarField arg1 = min - ( - min - ( - max - ( - (scalar(1)/betaStar_)*sqrt(k_)/(omega_*y_), - scalar(500)*nu()/(sqr(y_)*omega_) - ), - (4*alphaOmega2_)*k_/(CDkOmegaPlus*sqr(y_)) - ), - scalar(10) - ); - - return tanh(pow4(arg1)); -} - -tmp kOmegaSST::F2() const -{ - volScalarField arg2 = min - ( - max - ( - (scalar(2)/betaStar_)*sqrt(k_)/(omega_*y_), - scalar(500)*nu()/(sqr(y_)*omega_) - ), - scalar(100) - ); - - return tanh(sqr(arg2)); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -kOmegaSST::kOmegaSST -( - const volVectorField& U, - const surfaceScalarField& phi, - transportModel& lamTransportModel -) -: - RASModel(typeName, U, phi, lamTransportModel), - - alphaK1_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaK1", - coeffDict_, - 0.85034 - ) - ), - alphaK2_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaK2", - coeffDict_, - 1.0 - ) - ), - alphaOmega1_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaOmega1", - coeffDict_, - 0.5 - ) - ), - alphaOmega2_ - ( - dimensioned::lookupOrAddToDict - ( - "alphaOmega2", - coeffDict_, - 0.85616 - ) - ), - gamma1_ - ( - dimensioned::lookupOrAddToDict - ( - "gamma1", - coeffDict_, - 0.5532 - ) - ), - gamma2_ - ( - dimensioned::lookupOrAddToDict - ( - "gamma2", - coeffDict_, - 0.4403 - ) - ), - beta1_ - ( - dimensioned::lookupOrAddToDict - ( - "beta1", - coeffDict_, - 0.075 - ) - ), - beta2_ - ( - dimensioned::lookupOrAddToDict - ( - "beta2", - coeffDict_, - 0.0828 - ) - ), - betaStar_ - ( - dimensioned::lookupOrAddToDict - ( - "betaStar", - coeffDict_, - 0.09 - ) - ), - a1_ - ( - dimensioned::lookupOrAddToDict - ( - "a1", - coeffDict_, - 0.31 - ) - ), - c1_ - ( - dimensioned::lookupOrAddToDict - ( - "c1", - coeffDict_, - 10.0 - ) - ), - - y_(mesh_), - - k_ - ( - IOobject - ( - "k", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - autoCreateK("k", mesh_) - ), - omega_ - ( - IOobject - ( - "omega", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - autoCreateOmega("omega", mesh_) - ), - nut_ - ( - IOobject - ( - "nut", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - autoCreateNut("nut", mesh_) - ) -{ - nut_ = - a1_*k_ - /max - ( - a1_*(omega_ + omegaSmall_), - F2()*mag(symm(fvc::grad(U_))) - ); - nut_.correctBoundaryConditions(); - - printCoeffs(); -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -tmp kOmegaSST::R() const -{ - return tmp - ( - new volSymmTensorField - ( - IOobject - ( - "R", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)), - k_.boundaryField().types() - ) - ); -} - - -tmp kOmegaSST::devReff() const -{ - return tmp - ( - new volSymmTensorField - ( - IOobject - ( - "devRhoReff", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - -nuEff()*dev(twoSymm(fvc::grad(U_))) - ) - ); -} - - -tmp kOmegaSST::divDevReff(volVectorField& U) const -{ - return - ( - - fvm::laplacian(nuEff(), U) - - fvc::div(nuEff()*dev(fvc::grad(U)().T())) - ); -} - - -bool kOmegaSST::read() -{ - if (RASModel::read()) - { - alphaK1_.readIfPresent(coeffDict()); - alphaK2_.readIfPresent(coeffDict()); - alphaOmega1_.readIfPresent(coeffDict()); - alphaOmega2_.readIfPresent(coeffDict()); - gamma1_.readIfPresent(coeffDict()); - gamma2_.readIfPresent(coeffDict()); - beta1_.readIfPresent(coeffDict()); - beta2_.readIfPresent(coeffDict()); - betaStar_.readIfPresent(coeffDict()); - a1_.readIfPresent(coeffDict()); - c1_.readIfPresent(coeffDict()); - - return true; - } - else - { - return false; - } -} - - -void kOmegaSST::correct() -{ - RASModel::correct(); - - if (!turbulence_) - { - return; - } - - if (mesh_.changing()) - { - y_.correct(); - } - - volScalarField S2 = magSqr(symm(fvc::grad(U_))); - volScalarField G("RASModel.G", nut_*2*S2); - - // Update omega and G at the wall - omega_.boundaryField().updateCoeffs(); - - volScalarField F1 = this->F1 - ( - (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_ - ); - - // Epsilon diffusion correction - surfaceScalarField CDkPhiOmega - ( - "CDkPhiOmega", - (2*alphaOmega2_) - *fvc::interpolate(F1 - scalar(1)) - /fvc::interpolate(omega_) - *fvc::snGrad(k_)*mesh_.magSf() - ); - - forAll (CDkPhiOmega.boundaryField(), patchi) - { - if (!CDkPhiOmega.boundaryField()[patchi].coupled()) - { - CDkPhiOmega.boundaryField()[patchi] = 0.0; - } - } - - // Turbulent frequency equation - tmp omegaEqn - ( - fvm::ddt(omega_) - + fvm::div(phi_, omega_) - - fvm::laplacian(DomegaEff(F1), omega_) - + fvm::div(CDkPhiOmega, omega_) - == - gamma(F1)*2*S2 - - fvm::Sp(beta(F1)*omega_, omega_) - ); - - omegaEqn().relax(); - - omegaEqn().boundaryManipulate(omega_.boundaryField()); - - solve(omegaEqn); - bound(omega_, omega0_); - - // Turbulent kinetic energy equation - tmp kEqn - ( - fvm::ddt(k_) - + fvm::div(phi_, k_) - - fvm::laplacian(DkEff(F1), k_) - == - min(G, c1_*betaStar_*k_*omega_) - - fvm::Sp(betaStar_*omega_, k_) - ); - - kEqn().relax(); - solve(kEqn); - bound(k_, k0_); - - - // Re-calculate viscosity - nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(S2)); - nut_.correctBoundaryConditions(); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace RASModels -} // End namespace incompressible -} // End namespace Foam - -// ************************************************************************* // From 11012eb09e145db0b26f3ec2d10bf855285002a6 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 17:09:55 +0000 Subject: [PATCH 04/37] ENH: Updated incompressible RAS boundary conditions to use generic turbulence model --- ...entHeatFluxTemperatureFvPatchScalarField.C | 9 +++--- ...thDissipationRateInletFvPatchScalarField.C | 7 ++-- ...ngLengthFrequencyInletFvPatchScalarField.C | 9 +++--- ...silonLowReWallFunctionFvPatchScalarField.C | 26 ++++++++------- ...silonLowReWallFunctionFvPatchScalarField.H | 5 +-- .../epsilonWallFunctionFvPatchScalarField.C | 32 +++++++++---------- .../epsilonWallFunctionFvPatchScalarField.H | 9 +----- .../fWallFunctionFvPatchScalarField.C | 5 +-- ...ayatillekeWallFunctionFvPatchScalarField.C | 5 +-- ...ayatillekeWallFunctionFvPatchScalarField.H | 6 +--- .../kLowReWallFunctionFvPatchScalarField.C | 14 ++++---- .../kLowReWallFunctionFvPatchScalarField.H | 5 +-- .../kqRWallFunctionFvPatchField.C | 5 +-- .../kqRWallFunctionFvPatchField.H | 5 +-- .../kqRWallFunctionFvPatchFields.C | 5 +-- .../kqRWallFunctionFvPatchFields.H | 5 +-- .../nutLowReWallFunctionFvPatchScalarField.C | 5 +-- .../nutLowReWallFunctionFvPatchScalarField.H | 5 +-- .../nutURoughWallFunctionFvPatchScalarField.C | 5 +-- .../nutURoughWallFunctionFvPatchScalarField.H | 5 +-- ...tUSpaldingWallFunctionFvPatchScalarField.C | 5 +-- ...tUSpaldingWallFunctionFvPatchScalarField.H | 5 +-- ...UTabulatedWallFunctionFvPatchScalarField.C | 5 +-- ...UTabulatedWallFunctionFvPatchScalarField.H | 5 +-- .../nutUWallFunctionFvPatchScalarField.C | 5 +-- .../nutUWallFunctionFvPatchScalarField.H | 5 +-- .../nutWallFunctionFvPatchScalarField.C | 4 --- .../nutWallFunctionFvPatchScalarField.H | 5 +-- ...tkAtmRoughWallFunctionFvPatchScalarField.C | 14 ++++---- ...tkAtmRoughWallFunctionFvPatchScalarField.H | 6 +--- .../nutkRoughWallFunctionFvPatchScalarField.C | 5 +-- .../nutkRoughWallFunctionFvPatchScalarField.H | 5 +-- .../nutkWallFunctionFvPatchScalarField.C | 5 +-- .../nutkWallFunctionFvPatchScalarField.H | 5 +-- .../omegaWallFunctionFvPatchScalarField.C | 32 +++++++++---------- .../omegaWallFunctionFvPatchScalarField.H | 9 +----- .../v2WallFunctionFvPatchScalarField.C | 9 +++--- 37 files changed, 105 insertions(+), 196 deletions(-) diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C index b65b1cde9e..52d39a366f 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,7 +27,7 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -184,8 +184,9 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() patch().lookupPatchField(alphaEffName_); // retrieve (constant) specific heat capacity from transport dictionary - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalar Cp0(readScalar(rasModel.transport().lookup("Cp0"))); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalar Cp0(readScalar(turbulence.transport().lookup("Cp0"))); switch (heatSource_) { diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index f0e9d5bdfe..a756341744 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -28,7 +28,7 @@ License #include "fvPatchFieldMapper.H" #include "surfaceFields.H" #include "volFields.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -131,10 +131,11 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() } // Lookup Cmu corresponding to the turbulence model selected - const RASModel& rasModel = db().lookupObject("RASProperties"); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); const scalar Cmu = - rasModel.coeffDict().lookupOrDefault("Cmu", 0.09); + turbulence.coeffDict().lookupOrDefault("Cmu", 0.09); const scalar Cmu75 = pow(Cmu, 0.75); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 1a9c4ae29a..bf9f904f7a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,7 @@ License #include "fvPatchFieldMapper.H" #include "surfaceFields.H" #include "volFields.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -127,10 +127,11 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() } // Lookup Cmu corresponding to the turbulence model selected - const RASModel& rasModel = db().lookupObject("RASProperties"); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); const scalar Cmu = - rasModel.coeffDict().lookupOrDefault("Cmu", 0.09); + turbulence.coeffDict().lookupOrDefault("Cmu", 0.09); const scalar Cmu25 = pow(Cmu, 0.25); diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C index 1a67d2329f..895b32e05e 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "epsilonLowReWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -132,11 +130,18 @@ void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; volScalarField& G = - const_cast(db().lookupObject(GName_)); + const_cast + ( + db().lookupObject + ( + turbulence.type() + ".G" + ) + ); DimensionedField& epsilon = const_cast&> @@ -144,17 +149,17 @@ void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs() dimensionedInternalField() ); - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tnu = rasModel.nu(); + const tmp tnu = turbulence.nu(); const scalarField& nuw = tnu().boundaryField()[patchI]; - const tmp tnut = rasModel.nut(); + const tmp tnut = turbulence.nut(); const volScalarField& nut = tnut(); const scalarField& nutw = nut.boundaryField()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchI]; const scalarField magGradUw(mag(Uw.snGrad())); const scalar Cmu25 = pow025(Cmu_); @@ -199,7 +204,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H index 9191a584b4..b8cf09f0b7 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::epsilonLowReWallFunctionFvPatchScalarField + Foam::incompressible::epsilonLowReWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -74,8 +74,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class epsilonLowReWallFunctionFvPatchScalarField Declaration @@ -180,7 +178,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 3fcb175fb3..518bb38f47 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "epsilonWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -38,8 +38,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -59,7 +57,6 @@ void epsilonWallFunctionFvPatchScalarField::checkType() void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - writeEntryIfDifferent(os, "G", "RASModel.G", GName_); os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; @@ -75,7 +72,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF), - GName_("RASModel.G"), Cmu_(0.09), kappa_(0.41), E_(9.8) @@ -93,7 +89,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ptf, p, iF, mapper), - GName_(ptf.GName_), Cmu_(ptf.Cmu_), kappa_(ptf.kappa_), E_(ptf.E_) @@ -110,7 +105,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF, dict), - GName_(dict.lookupOrDefault("G", "RASModel.G")), Cmu_(dict.lookupOrDefault("Cmu", 0.09)), kappa_(dict.lookupOrDefault("kappa", 0.41)), E_(dict.lookupOrDefault("E", 9.8)) @@ -125,7 +119,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ewfpsf), - GName_(ewfpsf.GName_), Cmu_(ewfpsf.Cmu_), kappa_(ewfpsf.kappa_), E_(ewfpsf.E_) @@ -141,7 +134,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ewfpsf, iF), - GName_(ewfpsf.GName_), Cmu_(ewfpsf.Cmu_), kappa_(ewfpsf.kappa_), E_(ewfpsf.E_) @@ -161,14 +153,21 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; const scalar Cmu25 = pow025(Cmu_); const scalar Cmu75 = pow(Cmu_, 0.75); volScalarField& G = - const_cast(db().lookupObject(GName_)); + const_cast + ( + db().lookupObject + ( + turbulence.type() + ".G" + ) + ); DimensionedField& epsilon = const_cast&> @@ -176,17 +175,17 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() dimensionedInternalField() ); - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tnu = rasModel.nu(); + const tmp tnu = turbulence.nu(); const scalarField& nuw = tnu().boundaryField()[patchI]; - const tmp tnut = rasModel.nut(); + const tmp tnut = turbulence.nut(); const volScalarField& nut = tnut(); const scalarField& nutw = nut.boundaryField()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchI]; const scalarField magGradUw(mag(Uw.snGrad())); @@ -237,7 +236,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H index e988f05aff..9ff7b7acb5 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::epsilonWallFunctionFvPatchScalarField + Foam::incompressible::epsilonWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -47,7 +47,6 @@ Description \table Property | Description | Required | Default value - G | turbulence generation field name | no | G Cmu | model coefficient | no | 0.09 kappa | Von Karman constant | no | 0.41 E | model coefficient | no | 9.8 @@ -80,8 +79,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class epsilonWallFunctionFvPatchScalarField Declaration @@ -95,9 +92,6 @@ protected: // Protected data - //- Name of turbulence generation field - word GName_; - //- Cmu coefficient scalar Cmu_; @@ -206,7 +200,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C index 2fae43e161..cb905c80e2 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -168,8 +168,9 @@ void fWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const v2f& v2fModel = refCast(rasModel); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const v2f& v2fModel = refCast(turbulence); const scalarField& y = v2fModel.y()[patchI]; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C index a87f311441..ac3855632a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "kappatJayatillekeWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "wallFvPatch.H" @@ -36,8 +36,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -272,7 +270,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H index c26d9a41ec..d4e0af5dd8 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.H @@ -22,8 +22,7 @@ License OpenFOAM. If not, see . Class - Foam::incompressible::RASModels:: - kappatJayatillekeWallFunctionFvPatchScalarField + Foam::incompressible::kappatJayatillekeWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -72,8 +71,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class kappatJayatillekeWallFunctionFvPatchScalarField Declaration @@ -208,7 +205,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C index a7da31f471..a53c5e0697 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "kLowReWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -36,8 +36,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -174,13 +172,14 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tnu = rasModel.nu(); + const tmp tnu = turbulence.nu(); const scalarField& nuw = tnu().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); @@ -248,7 +247,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H index 72c077d33e..db99287eaa 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::kLowReWallFunctionFvPatchScalarField + Foam::incompressible::kLowReWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -71,8 +71,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class kLowReWallFunctionFvPatchScalarField Declaration @@ -199,7 +197,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C index 8861be642e..9ff2371a62 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,8 +34,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -146,7 +144,6 @@ void kqRWallFunctionFvPatchField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H index c63821fe9a..e9b3731deb 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::kqRWallFunctionFvPatchField + Foam::incompressible::kqRWallFunctionFvPatchField Group grpIcoWallFunctions @@ -63,8 +63,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class kqRWallFunctionFvPatchField Declaration @@ -171,7 +169,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C index 0ecaa87a5d..9465bdf18c 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,8 +34,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -43,7 +41,6 @@ makePatchFields(kqRWallFunction); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H index fe76853910..b9a2727f34 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,7 +42,6 @@ makePatchTypeFieldTypedefs(kqRWallFunction); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C index c23e832c5c..a0e340bf4d 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutLowReWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -127,7 +125,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H index 008fe9c96c..f79533c204 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutLowReWallFunctionFvPatchScalarField + Foam::incompressible::nutLowReWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -61,8 +61,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutLowReWallFunctionFvPatchScalarField Declaration @@ -158,7 +156,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C index 4be408474d..9ec799e353 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutURoughWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -302,7 +300,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H index 881752d9f5..17adf6f909 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutURoughWallFunctionFvPatchScalarField + Foam::incompressible::nutURoughWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -70,8 +70,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutURoughWallFunctionFvPatchScalarField Declaration @@ -233,7 +231,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index dd33fec1f4..7dca54b3e5 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutUSpaldingWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -216,7 +214,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H index b9f75ed1b1..210de45837 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutUSpaldingWallFunctionFvPatchScalarField + Foam::incompressible::nutUSpaldingWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -74,8 +74,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutUSpaldingWallFunctionFvPatchScalarField Declaration @@ -182,7 +180,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C index 1cbc8971f7..63bab81471 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutUTabulatedWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -214,7 +212,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H index 95bde3ba03..dbc1a75ab7 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutUTabulatedWallFunctionFvPatchScalarField + Foam::incompressible::nutUTabulatedWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -73,8 +73,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutUTabulatedWallFunctionFvPatchScalarField Declaration @@ -190,7 +188,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C index 5ba0a0ef34..3b34b46df1 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutUWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -198,7 +196,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H index 6f32734149..0a34ad6fac 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutUWallFunctionFvPatchScalarField + Foam::incompressible::nutUWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -60,8 +60,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutUWallFunctionFvPatchScalarField Declaration @@ -168,7 +166,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C index c23aea5551..3b8749974d 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "nutWallFunctionFvPatchScalarField.H" -#include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "wallFvPatch.H" @@ -36,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -194,7 +191,6 @@ void nutWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H index 01355ec454..de68000bd9 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutWallFunction/nutWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutWallFunctionFvPatchScalarField + Foam::incompressible::nutWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -61,8 +61,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutWallFunctionFvPatchScalarField Declaration @@ -173,7 +171,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C index b00e9f0bf9..2406f30d0a 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutkAtmRoughWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -44,11 +42,12 @@ tmp nutkAtmRoughWallFunctionFvPatchScalarField::calcNut() const { const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; - const tmp tk = rasModel.k(); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tnu = rasModel.nu(); + const tmp tnu = turbulence.nu(); const volScalarField& nu = tnu(); const scalarField& nuw = nu.boundaryField()[patchI]; @@ -192,7 +191,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H index 3e0f67a4fc..3767de1fc0 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkAtmRoughWallFunction/nutkAtmRoughWallFunctionFvPatchScalarField.H @@ -22,8 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels:: - nutkAtmRoughWallFunctionFvPatchScalarField + Foam::incompressible::nutkAtmRoughWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -82,8 +81,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutkAtmRoughWallFunctionFvPatchScalarField Declaration @@ -210,7 +207,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C index df8480da00..61d8068826 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutkRoughWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -237,7 +235,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H index 50d24a3ebd..4a8d812ad5 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutkRoughWallFunctionFvPatchScalarField + Foam::incompressible::nutkRoughWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -74,8 +74,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutkRoughWallFunctionFvPatchScalarField Declaration @@ -213,7 +211,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C index afbd1548d1..bfc542434f 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "nutkWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "wallFvPatch.H" @@ -36,8 +36,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -160,7 +158,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H index 49a2257e09..ef0a3066db 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::nutkWallFunctionFvPatchScalarField + Foam::incompressible::nutkWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -61,8 +61,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class nutkWallFunctionFvPatchScalarField Declaration @@ -158,7 +156,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 0ad2595c7c..83444c5d40 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "omegaWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -38,8 +38,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -59,7 +57,6 @@ void omegaWallFunctionFvPatchScalarField::checkType() void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - writeEntryIfDifferent(os, "G", "RASModel.G", GName_); os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; @@ -76,7 +73,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF), - GName_("RASModel.G"), Cmu_(0.09), kappa_(0.41), E_(9.8), @@ -96,7 +92,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ptf, p, iF, mapper), - GName_(ptf.GName_), Cmu_(ptf.Cmu_), kappa_(ptf.kappa_), E_(ptf.E_), @@ -115,7 +110,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF, dict), - GName_(dict.lookupOrDefault("G", "RASModel.G")), Cmu_(dict.lookupOrDefault("Cmu", 0.09)), kappa_(dict.lookupOrDefault("kappa", 0.41)), E_(dict.lookupOrDefault("E", 9.8)), @@ -132,7 +126,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(owfpsf), - GName_(owfpsf.GName_), Cmu_(owfpsf.Cmu_), kappa_(owfpsf.kappa_), E_(owfpsf.E_), @@ -150,7 +143,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(owfpsf, iF), - GName_(owfpsf.GName_), Cmu_(owfpsf.Cmu_), kappa_(owfpsf.kappa_), E_(owfpsf.E_), @@ -172,13 +164,20 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; const scalar Cmu25 = pow025(Cmu_); volScalarField& G = - const_cast(db().lookupObject(GName_)); + const_cast + ( + db().lookupObject + ( + turbulence.type() + ".G" + ) + ); DimensionedField& omega = const_cast&> @@ -186,17 +185,17 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() dimensionedInternalField() ); - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tnu = rasModel.nu(); + const tmp tnu = turbulence.nu(); const scalarField& nuw = tnu().boundaryField()[patchI]; - const tmp tnut = rasModel.nut(); + const tmp tnut = turbulence.nut(); const volScalarField& nut = tnut(); const scalarField& nutw = nut.boundaryField()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchI]; const scalarField magGradUw(mag(Uw.snGrad())); @@ -242,7 +241,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H index 9c03a85f25..9ee99bd6c6 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::incompressible::RASModels::omegaWallFunctionFvPatchScalarField + Foam::incompressible::omegaWallFunctionFvPatchScalarField Group grpIcoWallFunctions @@ -54,7 +54,6 @@ Description \table Property | Description | Required | Default value - G | turbulence generation field name | no | G Cmu | model coefficient | no | 0.09 kappa | Von Karman constant | no | 0.41 E | model coefficient | no | 9.8 @@ -85,8 +84,6 @@ namespace Foam { namespace incompressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class omegaWallFunctionFvPatchScalarField Declaration @@ -100,9 +97,6 @@ protected: // Protected data - //- Name of turbulence generation field - word GName_; - //- Cmu coefficient scalar Cmu_; @@ -214,7 +208,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace incompressible } // End namespace Foam diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C index d896d4d08b..b2a3e38ded 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -167,13 +167,14 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tnu = rasModel.nu(); + const tmp tnu = turbulence.nu(); const scalarField& nuw = tnu().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); From 2ea19490038813efc154990e6c03aa49336a3674 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 17:10:05 +0000 Subject: [PATCH 05/37] ENH: Updated compressible RAS boundary conditions to use generic turbulence model --- ...convectiveHeatTransferFvPatchScalarField.C | 5 +-- ...convectiveHeatTransferFvPatchScalarField.H | 5 +-- ...thDissipationRateInletFvPatchScalarField.C | 7 ++-- ...ngLengthFrequencyInletFvPatchScalarField.C | 5 +-- ...ayatillekeWallFunctionFvPatchScalarField.C | 5 +-- ...ayatillekeWallFunctionFvPatchScalarField.H | 5 +-- .../alphatWallFunctionFvPatchScalarField.C | 20 ++++------- .../alphatWallFunctionFvPatchScalarField.H | 5 +-- ...silonLowReWallFunctionFvPatchScalarField.C | 28 +++++++++------- ...silonLowReWallFunctionFvPatchScalarField.H | 5 +-- .../epsilonWallFunctionFvPatchScalarField.C | 32 +++++++++--------- .../epsilonWallFunctionFvPatchScalarField.H | 9 +---- .../fWallFunctionFvPatchScalarField.C | 6 ++-- .../kLowReWallFunctionFvPatchScalarField.C | 16 ++++----- .../kLowReWallFunctionFvPatchScalarField.H | 5 +-- .../kqRWallFunctionFvPatchField.C | 5 +-- .../kqRWallFunctionFvPatchField.H | 7 ++-- .../kqRWallFunctionFvPatchFields.C | 5 +-- .../kqRWallFunctionFvPatchFields.H | 5 +-- .../mutLowReWallFunctionFvPatchScalarField.C | 5 +-- .../mutLowReWallFunctionFvPatchScalarField.H | 7 ++-- .../mutURoughWallFunctionFvPatchScalarField.C | 5 +-- .../mutURoughWallFunctionFvPatchScalarField.H | 7 ++-- ...tUSpaldingWallFunctionFvPatchScalarField.C | 5 +-- ...tUSpaldingWallFunctionFvPatchScalarField.H | 7 ++-- .../mutUWallFunctionFvPatchScalarField.C | 5 +-- .../mutUWallFunctionFvPatchScalarField.H | 7 ++-- .../mutWallFunctionFvPatchScalarField.C | 4 --- .../mutWallFunctionFvPatchScalarField.H | 5 +-- .../mutkRoughWallFunctionFvPatchScalarField.C | 5 +-- .../mutkRoughWallFunctionFvPatchScalarField.H | 7 ++-- .../mutkWallFunctionFvPatchScalarField.C | 5 +-- .../mutkWallFunctionFvPatchScalarField.H | 7 ++-- .../omegaWallFunctionFvPatchScalarField.C | 33 +++++++++---------- .../omegaWallFunctionFvPatchScalarField.H | 9 +---- .../v2WallFunctionFvPatchScalarField.C | 11 ++++--- 36 files changed, 108 insertions(+), 206 deletions(-) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C index 116bfc9c25..6540544562 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "convectiveHeatTransferFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "addToRunTimeSelectionTable.H" @@ -34,8 +34,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -167,7 +165,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H index 2bc06bb0e4..cbbd7869be 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/convectiveHeatTransfer/convectiveHeatTransferFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::convectiveHeatTransferFvPatchScalarField + Foam::compressible::convectiveHeatTransferFvPatchScalarField Group grpCmpRASBoundaryConditions @@ -85,8 +85,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class convectiveHeatTransferFvPatchScalarField Declaration @@ -190,7 +188,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index 2811ea2579..e7003426be 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -28,7 +28,7 @@ License #include "fvPatchFieldMapper.H" #include "surfaceFields.H" #include "volFields.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -131,10 +131,11 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() } // Lookup Cmu corresponding to the turbulence model selected - const RASModel& rasModel = db().lookupObject("RASProperties"); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); const scalar Cmu = - rasModel.coeffDict().lookupOrDefault("Cmu", 0.09); + turbulence.coeffDict().lookupOrDefault("Cmu", 0.09); const scalar Cmu75 = pow(Cmu, 0.75); diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index eda8faf324..de7c947a9f 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -131,10 +131,11 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() } // Lookup Cmu corresponding to the turbulence model selected - const RASModel& rasModel = db().lookupObject("RASProperties"); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); const scalar Cmu = - rasModel.coeffDict().lookupOrDefault("Cmu", 0.09); + turbulence.coeffDict().lookupOrDefault("Cmu", 0.09); const scalar Cmu25 = pow(Cmu, 0.25); diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 5db232e85e..16b69874f0 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "alphatJayatillekeWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -36,8 +36,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -312,7 +310,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H index 60271aae48..455041334e 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - alphatJayatillekeWallFunctionFvPatchScalarField + Foam::compressible::alphatJayatillekeWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -72,8 +72,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class alphatJayatillekeWallFunctionFvPatchScalarField Declaration @@ -211,7 +209,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C index c8051bb451..dcf694ad1a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,13 +34,10 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -alphatWallFunctionFvPatchScalarField:: -alphatWallFunctionFvPatchScalarField +alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -52,8 +49,7 @@ alphatWallFunctionFvPatchScalarField {} -alphatWallFunctionFvPatchScalarField:: -alphatWallFunctionFvPatchScalarField +alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField ( const alphatWallFunctionFvPatchScalarField& ptf, const fvPatch& p, @@ -67,8 +63,7 @@ alphatWallFunctionFvPatchScalarField {} -alphatWallFunctionFvPatchScalarField:: -alphatWallFunctionFvPatchScalarField +alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -81,8 +76,7 @@ alphatWallFunctionFvPatchScalarField {} -alphatWallFunctionFvPatchScalarField:: -alphatWallFunctionFvPatchScalarField +alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField ( const alphatWallFunctionFvPatchScalarField& awfpsf ) @@ -93,8 +87,7 @@ alphatWallFunctionFvPatchScalarField {} -alphatWallFunctionFvPatchScalarField:: -alphatWallFunctionFvPatchScalarField +alphatWallFunctionFvPatchScalarField::alphatWallFunctionFvPatchScalarField ( const alphatWallFunctionFvPatchScalarField& awfpsf, const DimensionedField& iF @@ -143,7 +136,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H index c9031e53ed..011d17f958 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::alphatWallFunctionFvPatchScalarField + Foam::compressible::alphatWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -84,8 +84,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class alphatWallFunctionFvPatchScalarField Declaration @@ -190,7 +188,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C index c9d824287d..f5201711e6 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "epsilonLowReWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -132,11 +130,18 @@ void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; volScalarField& G = - const_cast(db().lookupObject(GName_)); + const_cast + ( + db().lookupObject + ( + turbulence.type() + ".G" + ) + ); DimensionedField& epsilon = const_cast&> @@ -144,19 +149,19 @@ void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs() dimensionedInternalField() ); - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tmu = rasModel.mu(); + const tmp tmu = turbulence.mu(); const scalarField& muw = tmu().boundaryField()[patchI]; - const tmp tmut = rasModel.mut(); + const tmp tmut = turbulence.mut(); const volScalarField& mut = tmut(); const scalarField& mutw = mut.boundaryField()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const scalarField& rhow = turbulence.rho().boundaryField()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchI]; const scalarField magGradUw(mag(Uw.snGrad())); const scalar Cmu25 = pow025(Cmu_); @@ -201,7 +206,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H index 825adbf2c5..61434c29b5 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::iompressible::RASModels::epsilonLowReWallFunctionFvPatchScalarField + Foam::iompressible::epsilonLowReWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -74,8 +74,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class epsilonLowReWallFunctionFvPatchScalarField Declaration @@ -180,7 +178,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index c2cce3febd..88b91c0513 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "epsilonWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -37,8 +37,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -58,7 +56,6 @@ void epsilonWallFunctionFvPatchScalarField::checkType() void epsilonWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - writeEntryIfDifferent(os, "G", "RASModel.G", GName_); os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; @@ -74,7 +71,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF), - GName_("RASModel.G"), Cmu_(0.09), kappa_(0.41), E_(9.8) @@ -92,7 +88,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ptf, p, iF, mapper), - GName_(ptf.GName_), Cmu_(ptf.Cmu_), kappa_(ptf.kappa_), E_(ptf.E_) @@ -109,7 +104,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF, dict), - GName_(dict.lookupOrDefault("G", "RASModel.G")), Cmu_(dict.lookupOrDefault("Cmu", 0.09)), kappa_(dict.lookupOrDefault("kappa", 0.41)), E_(dict.lookupOrDefault("E", 9.8)) @@ -124,7 +118,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ewfpsf), - GName_(ewfpsf.GName_), Cmu_(ewfpsf.Cmu_), kappa_(ewfpsf.kappa_), E_(ewfpsf.E_) @@ -140,7 +133,6 @@ epsilonWallFunctionFvPatchScalarField::epsilonWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ewfpsf, iF), - GName_(ewfpsf.GName_), Cmu_(ewfpsf.Cmu_), kappa_(ewfpsf.kappa_), E_(ewfpsf.E_) @@ -160,15 +152,22 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); const scalar Cmu25 = pow025(Cmu_); const scalar Cmu75 = pow(Cmu_, 0.75); - const scalarField& y = rasModel.y()[patchI]; + const scalarField& y = turbulence.y()[patchI]; volScalarField& G = - const_cast(db().lookupObject(GName_)); + const_cast + ( + db().lookupObject + ( + turbulence.type() + ".G" + ) + ); DimensionedField& epsilon = const_cast&> @@ -176,16 +175,16 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() dimensionedInternalField() ); - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + const scalarField& muw = turbulence.mu().boundaryField()[patchI]; - const tmp tmut = rasModel.mut(); + const tmp tmut = turbulence.mut(); const volScalarField& mut = tmut(); const scalarField& mutw = mut.boundaryField()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchI]; const scalarField magGradUw(mag(Uw.snGrad())); @@ -236,7 +235,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H index 486b7fb707..9975348d0b 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::epsilonWallFunctionFvPatchScalarField + Foam::compressible::epsilonWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -47,7 +47,6 @@ Description \table Property | Description | Required | Default value - G | turbulence generation field name | no | G Cmu | model coefficient | no | 0.09 kappa | Von Karman constant | no | 0.41 E | model coefficient | no | 9.8 @@ -80,8 +79,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class epsilonWallFunctionFvPatchScalarField Declaration @@ -95,9 +92,6 @@ protected: // Protected data - //- Name of turbulence generation field - word GName_; - //- Cmu coefficient scalar Cmu_; @@ -206,7 +200,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C index 07ea00c1b0..abb969914b 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction/fWallFunctionFvPatchScalarField.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "fWallFunctionFvPatchScalarField.H" -#include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "wallFvPatch.H" @@ -168,8 +167,9 @@ void fWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const v2f& v2fModel = refCast(rasModel); + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const v2f& v2fModel = refCast(turbulence); const scalarField& y = v2fModel.y()[patchI]; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C index 5f10ea4f22..5e403ab932 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "kLowReWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -36,8 +36,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -174,16 +172,17 @@ void kLowReWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tmu = rasModel.mu(); + const tmp tmu = turbulence.mu(); const scalarField& muw = tmu().boundaryField()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const scalarField& rhow = turbulence.rho().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); @@ -250,7 +249,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H index d70f288653..511bc19b6c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kLowReWallFunction/kLowReWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::kLowReWallFunctionFvPatchScalarField + Foam::compressible::kLowReWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -71,8 +71,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class kLowReWallFunctionFvPatchScalarField Declaration @@ -199,7 +197,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C index 6cabd2171a..0d0fc61381 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,8 +34,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -146,7 +144,6 @@ void kqRWallFunctionFvPatchField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H index d525d80b56..e96076fbc7 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::kqRWallFunctionFvPatchField + Foam::compressible::kqRWallFunctionFvPatchField Group grpCmpWallFunctions @@ -60,8 +60,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class kqRWallFunctionFvPatchField Declaration @@ -168,7 +166,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C index cd4eb03ec6..249b99ba3d 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,8 +34,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -43,7 +41,6 @@ makePatchFields(kqRWallFunction); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H index 95e36995dd..a62cd0806e 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/kqRWallFunctions/kqRWallFunction/kqRWallFunctionFvPatchFields.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,7 +42,6 @@ makePatchTypeFieldTypedefs(kqRWallFunction); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C index 5eee5c2702..269f9698a9 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "mutLowReWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -129,7 +127,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H index 2cbbef359c..75f751288b 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::mutLowReWallFunctionFvPatchScalarField + Foam::compressible::mutLowReWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -43,7 +43,7 @@ Description \endverbatim SeeAlso - Foam::mutWallFunctionFvPatchScalarField + Foam::compressible::mutWallFunctionFvPatchScalarField SourceFiles mutLowReWallFunctionFvPatchScalarField.C @@ -61,8 +61,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class mutLowReWallFunctionFvPatchScalarField Declaration @@ -160,7 +158,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C index f5571451a1..5591904c9e 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C @@ -26,7 +26,7 @@ License #include "mutURoughWallFunctionFvPatchScalarField.H" #include "fvPatchFieldMapper.H" #include "volFields.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -35,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -311,7 +309,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H index 479cb18b40..12beef6338 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::mutURoughWallFunctionFvPatchScalarField + Foam::compressible:::mutURoughWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -52,7 +52,7 @@ Description \endverbatim SeeAlso - Foam::mutWallFunctionFvPatchScalarField + Foam::compressible::mutWallFunctionFvPatchScalarField SourceFiles mutURoughWallFunctionFvPatchScalarField.C @@ -70,8 +70,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class mutURoughWallFunctionFvPatchScalarField Declaration @@ -232,7 +230,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C index 4a4691c12c..64bb1238ec 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C @@ -26,7 +26,7 @@ License #include "mutUSpaldingWallFunctionFvPatchScalarField.H" #include "fvPatchFieldMapper.H" #include "volFields.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -35,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -219,7 +217,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H index 2501fa5b71..a0322dbeb2 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::mutUSpaldingWallFunctionFvPatchScalarField + Foam::compressible::mutUSpaldingWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -56,7 +56,7 @@ Description \endverbatim SeeAlso - Foam::mutWallFunctionFvPatchScalarField + Foam::compressible::mutWallFunctionFvPatchScalarField SourceFiles mutUSpaldingWallFunctionFvPatchScalarField.C @@ -74,8 +74,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class mutUSpaldingWallFunctionFvPatchScalarField Declaration @@ -182,7 +180,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C index 85efec0327..3148119dcf 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "mutUWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -197,7 +195,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H index 08a938b52c..1c6ed4f7d6 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::mutUWallFunctionFvPatchScalarField + Foam::compressible::mutUWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -42,7 +42,7 @@ Description \endverbatim SeeAlso - Foam::mutWallFunctionFvPatchScalarField + Foam::compressible::mutWallFunctionFvPatchScalarField SourceFiles mutUWallFunctionFvPatchScalarField.C @@ -60,8 +60,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class mutUWallFunctionFvPatchScalarField Declaration @@ -168,7 +166,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C index 6f0dbb1a9f..f4a6476be6 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "mutWallFunctionFvPatchScalarField.H" -#include "RASModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "wallFvPatch.H" @@ -36,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -184,7 +181,6 @@ void mutWallFunctionFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H index 9228b60924..29bc406aa1 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutWallFunction/mutWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::mutWallFunctionFvPatchScalarField + Foam::compressible::mutWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -61,8 +61,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class mutWallFunctionFvPatchScalarField Declaration @@ -173,7 +171,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C index cc04471f4f..e634b89acc 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "mutkRoughWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -35,8 +35,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -237,7 +235,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.H index fdf5a0a7d6..6ff72c42d3 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::mutkRoughWallFunctionFvPatchScalarField + Foam::compressible::mutkRoughWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -56,7 +56,7 @@ Description \endverbatim SeeAlso - Foam::mutkRoughWallFunctionFvPatchScalarField + Foam::compressible::mutkRoughWallFunctionFvPatchScalarField SourceFiles mutkRoughWallFunctionFvPatchScalarField.C @@ -74,8 +74,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class mutkRoughWallFunctionFvPatchScalarField Declaration @@ -198,7 +196,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C index 9aeb96b297..72b010d55d 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "mutkWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "wallFvPatch.H" @@ -36,8 +36,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -159,7 +157,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H index 8d952a6428..f81625627c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::mutkWallFunctionFvPatchScalarField + Foam::compressible::mutkWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -43,7 +43,7 @@ Description \endverbatim SeeAlso - Foam::mutWallFunctionFvPatchScalarField + Foam::compressible::mutWallFunctionFvPatchScalarField SourceFiles mutkWallFunctionFvPatchScalarField.C @@ -61,8 +61,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class mutkWallFunctionFvPatchScalarField Declaration @@ -160,7 +158,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index d7f2f4fa5e..e95a4d9bf7 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "omegaWallFunctionFvPatchScalarField.H" -#include "RASModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "addToRunTimeSelectionTable.H" @@ -37,8 +37,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -58,7 +56,6 @@ void omegaWallFunctionFvPatchScalarField::checkType() void omegaWallFunctionFvPatchScalarField::writeLocalEntries(Ostream& os) const { - writeEntryIfDifferent(os, "G", "RASModel.G", GName_); os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; os.writeKeyword("E") << E_ << token::END_STATEMENT << nl; @@ -75,7 +72,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF), - GName_("RASModel.G"), Cmu_(0.09), kappa_(0.41), E_(9.8), @@ -96,7 +92,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(ptf, p, iF, mapper), - GName_(ptf.GName_), Cmu_(ptf.Cmu_), kappa_(ptf.kappa_), E_(ptf.E_), @@ -115,7 +110,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(p, iF, dict), - GName_(dict.lookupOrDefault("G", "RASModel.G")), Cmu_(dict.lookupOrDefault("Cmu", 0.09)), kappa_(dict.lookupOrDefault("kappa", 0.41)), E_(dict.lookupOrDefault("E", 9.8)), @@ -132,7 +126,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(owfpsf), - GName_(owfpsf.GName_), Cmu_(owfpsf.Cmu_), kappa_(owfpsf.kappa_), E_(owfpsf.E_), @@ -150,7 +143,6 @@ omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField ) : fixedInternalValueFvPatchField(owfpsf, iF), - GName_(owfpsf.GName_), Cmu_(owfpsf.Cmu_), kappa_(owfpsf.kappa_), E_(owfpsf.E_), @@ -173,13 +165,19 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patch().index()]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patch().index()]; const scalar Cmu25 = pow025(Cmu_); volScalarField& G = const_cast - (db().lookupObject(GName_)); + ( + db().lookupObject + ( + turbulence.type() + ".G" + ) + ); DimensionedField& omega = const_cast&> @@ -187,18 +185,18 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() dimensionedInternalField() ); - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const scalarField& rhow = turbulence.rho().boundaryField()[patchI]; - const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + const scalarField& muw = turbulence.mu().boundaryField()[patchI]; - const tmp tmut = rasModel.mut(); + const tmp tmut = turbulence.mut(); const volScalarField& mut = tmut(); const scalarField& mutw = mut.boundaryField()[patchI]; - const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const fvPatchVectorField& Uw = turbulence.U().boundaryField()[patchI]; const scalarField magGradUw(mag(Uw.snGrad())); @@ -242,7 +240,6 @@ makePatchTypeField // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H index d6516c5449..69fa8ee9cd 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::RASModels::omegaWallFunctionFvPatchScalarField + Foam::compressible::omegaWallFunctionFvPatchScalarField Group grpCmpWallFunctions @@ -54,7 +54,6 @@ Description \table Property | Description | Required | Default value - G | turbulence generation field name | no | G Cmu | model coefficient | no | 0.09 kappa | Von Karman constant | no | 0.41 E | model coefficient | no | 9.8 @@ -85,8 +84,6 @@ namespace Foam { namespace compressible { -namespace RASModels -{ /*---------------------------------------------------------------------------*\ Class omegaWallFunctionFvPatchScalarField Declaration @@ -100,9 +97,6 @@ protected: // Protected data - //- Name of turbulence generation field - word GName_; - //- Cmu coefficient scalar Cmu_; @@ -214,7 +208,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace RASModels } // End namespace compressible } // End namespace Foam diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C index f7c8643bae..8c30e82d00 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction/v2WallFunctionFvPatchScalarField.C @@ -167,16 +167,17 @@ void v2WallFunctionFvPatchScalarField::updateCoeffs() const label patchI = patch().index(); - const RASModel& rasModel = db().lookupObject("RASProperties"); - const scalarField& y = rasModel.y()[patchI]; + const turbulenceModel& turbulence = + db().lookupObject("turbulenceModel"); + const scalarField& y = turbulence.y()[patchI]; - const tmp tk = rasModel.k(); + const tmp tk = turbulence.k(); const volScalarField& k = tk(); - const tmp tmu = rasModel.mu(); + const tmp tmu = turbulence.mu(); const scalarField& muw = tmu().boundaryField()[patchI]; - const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const scalarField& rhow = turbulence.rho().boundaryField()[patchI]; const scalar Cmu25 = pow025(Cmu_); From 1e7035b32dccd90c11dcd38ba7dcddf4a0830cab Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 17:10:55 +0000 Subject: [PATCH 06/37] ENH: Updated compressible turbulence models --- .../compressible/LES/LESModel/LESModel.H | 2 +- src/turbulenceModels/compressible/RAS/LRR/LRR.C | 2 +- .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C | 2 +- .../RAS/LaunderSharmaKE/LaunderSharmaKE.C | 2 +- .../compressible/RAS/RASModel/RASModel.H | 2 +- .../compressible/RAS/RNGkEpsilon/RNGkEpsilon.C | 2 +- .../backwardsCompatibilityWallFunctions.C | 16 ++++++++-------- .../compressible/RAS/kEpsilon/kEpsilon.C | 2 +- .../compressible/RAS/kOmegaSST/kOmegaSST.C | 2 +- .../compressible/RAS/realizableKE/realizableKE.C | 2 +- src/turbulenceModels/compressible/RAS/v2f/v2f.C | 2 +- .../turbulenceModel/laminar/laminar.C | 6 ++++++ .../turbulenceModel/laminar/laminar.H | 3 +++ .../turbulenceModel/turbulenceModel.H | 3 +++ 14 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index 1f514840ae..5b4cc39fca 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -169,7 +169,7 @@ public: //- Const access to the coefficients dictionary, // which provides info. about choice of models, // and all related data (particularly model coefficients). - inline const dictionary& coeffDict() const + virtual const dictionary& coeffDict() const { return coeffDict_; } diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.C b/src/turbulenceModels/compressible/RAS/LRR/LRR.C index 1528ba2aff..0a36879bc4 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.C @@ -342,7 +342,7 @@ void LRR::correct() RASModel::correct(); volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); - volScalarField G("RASModel.G", 0.5*mag(tr(P))); + volScalarField G(type() + ".G", 0.5*mag(tr(P))); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index 7273efc82c..dafa58ebb3 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -379,7 +379,7 @@ void LaunderGibsonRSTM::correct() } volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); - volScalarField G("RASModel.G", 0.5*mag(tr(P))); + volScalarField G(type() + ".G", 0.5*mag(tr(P))); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index 048f15eec6..8a1073e354 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -304,7 +304,7 @@ void LaunderSharmaKE::correct() } tmp tgradU = fvc::grad(U_); - volScalarField G("RASModel.G", mut_*(tgradU() && dev(twoSymm(tgradU())))); + volScalarField G(type() + ".G", mut_*(tgradU() && dev(twoSymm(tgradU())))); tgradU.clear(); diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index 1efe2cd08d..8bfa031882 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -209,7 +209,7 @@ public: } //- Const access to the coefficients dictionary - const dictionary& coeffDict() const + virtual const dictionary& coeffDict() const { return coeffDict_; } diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C index 70094c353b..5619278009 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -303,7 +303,7 @@ void RNGkEpsilon::correct() volScalarField S2((tgradU() && dev(twoSymm(tgradU())))); tgradU.clear(); - volScalarField G("RASModel.G", mut_*S2); + volScalarField G(type() + ".G", mut_*S2); volScalarField eta(sqrt(mag(S2))*k_/epsilon_); volScalarField eta3(eta*sqr(eta)); diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C index 52c5a2ed4f..5252784047 100644 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C +++ b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C @@ -76,7 +76,7 @@ tmp autoCreateAlphat if (isA(bm[patchI])) { alphatBoundaryTypes[patchI] = - RASModels::alphatWallFunctionFvPatchScalarField::typeName; + alphatWallFunctionFvPatchScalarField::typeName; } else { @@ -146,7 +146,7 @@ tmp autoCreateMut if (isA(bm[patchI])) { mutBoundaryTypes[patchI] = - RASModels::mutkWallFunctionFvPatchScalarField::typeName; + mutkWallFunctionFvPatchScalarField::typeName; } else { @@ -216,7 +216,7 @@ tmp autoCreateLowReMut if (isA(bm[patchI])) { mutBoundaryTypes[patchI] = - RASModels::mutLowReWallFunctionFvPatchScalarField::typeName; + mutLowReWallFunctionFvPatchScalarField::typeName; } else { @@ -262,7 +262,7 @@ tmp autoCreateEpsilon autoCreateWallFunctionField < scalar, - RASModels::epsilonWallFunctionFvPatchScalarField + epsilonWallFunctionFvPatchScalarField > ( fieldName, @@ -281,7 +281,7 @@ tmp autoCreateOmega autoCreateWallFunctionField < scalar, - RASModels::omegaWallFunctionFvPatchScalarField + omegaWallFunctionFvPatchScalarField > ( fieldName, @@ -300,7 +300,7 @@ tmp autoCreateK autoCreateWallFunctionField < scalar, - RASModels::kqRWallFunctionFvPatchField + kqRWallFunctionFvPatchField > ( fieldName, @@ -319,7 +319,7 @@ tmp autoCreateQ autoCreateWallFunctionField < scalar, - RASModels::kqRWallFunctionFvPatchField + kqRWallFunctionFvPatchField > ( fieldName, @@ -338,7 +338,7 @@ tmp autoCreateR autoCreateWallFunctionField < symmTensor, - RASModels::kqRWallFunctionFvPatchField + kqRWallFunctionFvPatchField > ( fieldName, diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C index 7475a39f5b..93e902cfe4 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.C @@ -281,7 +281,7 @@ void kEpsilon::correct() } tmp tgradU = fvc::grad(U_); - volScalarField G("RASModel.G", mut_*(tgradU() && dev(twoSymm(tgradU())))); + volScalarField G(type() + ".G", mut_*(tgradU() && dev(twoSymm(tgradU())))); tgradU.clear(); // Update epsilon and G at the wall diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C index 066e427741..bcaf62d57b 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -392,7 +392,7 @@ void kOmegaSST::correct() tmp tgradU = fvc::grad(U_); volScalarField S2(2*magSqr(symm(tgradU()))); volScalarField GbyMu((tgradU() && dev(twoSymm(tgradU())))); - volScalarField G("RASModel.G", mut_*GbyMu); + volScalarField G(type() + ".G", mut_*GbyMu); tgradU.clear(); // Update omega and G at the wall diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C index 537a2c8e44..4d3e8cf94b 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.C @@ -321,7 +321,7 @@ void realizableKE::correct() volScalarField eta(magS*k_/epsilon_); volScalarField C1(max(eta/(scalar(5) + eta), scalar(0.43))); - volScalarField G("RASModel.G", mut_*(gradU && dev(twoSymm(gradU)))); + volScalarField G(type() + ".G", mut_*(gradU && dev(twoSymm(gradU)))); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/compressible/RAS/v2f/v2f.C b/src/turbulenceModels/compressible/RAS/v2f/v2f.C index fa5c19503e..0fb834ac49 100644 --- a/src/turbulenceModels/compressible/RAS/v2f/v2f.C +++ b/src/turbulenceModels/compressible/RAS/v2f/v2f.C @@ -398,7 +398,7 @@ void v2f::correct() const volTensorField gradU(fvc::grad(U_)); const volScalarField S2(2*magSqr(dev(symm(gradU)))); - const volScalarField G("RASModel.G", mut_*S2); + const volScalarField G(type() + ".G", mut_*S2); const volScalarField T(Ts()); const volScalarField L2("v2f.L2", sqr(Ls())); const volScalarField alpha diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C index aa56d7cfdd..a7188c5eeb 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C @@ -79,6 +79,12 @@ autoPtr laminar::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const dictionary& laminar::coeffDict() const +{ + return dictionary::null; +} + + tmp laminar::mut() const { return tmp diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H index bead5d06de..b1de35154e 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H @@ -91,6 +91,9 @@ public: // Member Functions + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const; + //- Return the turbulence viscosity, i.e. 0 for laminar flow virtual tmp mut() const; diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H index e6d8bf290f..87d283b29a 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H @@ -158,6 +158,9 @@ public: // Member Functions + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const = 0; + //- Access function to density field const volScalarField& rho() const { From 74aec19f79800b49808995406b771316a5157e05 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 17:11:01 +0000 Subject: [PATCH 07/37] ENH: Updated incompressible turbulence models --- .../incompressible/LES/LESModel/LESModel.H | 2 +- .../incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C | 2 +- src/turbulenceModels/incompressible/RAS/LRR/LRR.C | 2 +- .../RAS/LamBremhorstKE/LamBremhorstKE.C | 2 +- .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C | 2 +- .../RAS/LaunderSharmaKE/LaunderSharmaKE.C | 2 +- .../incompressible/RAS/LienCubicKE/LienCubicKE.C | 2 +- .../RAS/LienCubicKELowRe/LienCubicKELowRe.C | 2 +- .../RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C | 2 +- .../RAS/NonlinearKEShih/NonlinearKEShih.C | 5 ++--- .../incompressible/RAS/RASModel/RASModel.H | 2 +- .../incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C | 2 +- .../backwardsCompatibilityWallFunctions.C | 14 +++++++------- .../incompressible/RAS/kEpsilon/kEpsilon.C | 2 +- .../incompressible/RAS/kOmega/kOmega.C | 2 +- .../incompressible/RAS/kOmegaSST/kOmegaSST.C | 2 +- .../incompressible/RAS/qZeta/qZeta.C | 2 +- .../incompressible/RAS/realizableKE/realizableKE.C | 2 +- src/turbulenceModels/incompressible/RAS/v2f/v2f.C | 4 ++-- .../turbulenceModel/laminar/laminar.C | 6 ++++++ .../turbulenceModel/laminar/laminar.H | 3 +++ .../turbulenceModel/turbulenceModel.H | 3 +++ 22 files changed, 39 insertions(+), 28 deletions(-) diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H index c790bb5871..d08086234b 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H @@ -166,7 +166,7 @@ public: //- Const access to the coefficients dictionary, // which provides info. about choice of models, // and all related data (particularly model coefficients). - inline const dictionary& coeffDict() const + virtual const dictionary& coeffDict() const { return coeffDict_; } diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C index 2b54d0ef09..acb34537c7 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C @@ -353,7 +353,7 @@ void kOmegaSSTSAS::correct(const tmp& gradU) volScalarField L(sqrt(k_)/(pow025(Cmu_)*omega_)); volScalarField CDkOmega((2.0*alphaOmega2_)*(gradK & gradOmega)/omega_); volScalarField F1(this->F1(CDkOmega)); - volScalarField G(nuSgs_*S2); + volScalarField G(type() + ".G", nuSgs_*S2); // Turbulent kinetic energy equation { diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C index 68f0d2b2b0..49b0bd0a17 100644 --- a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C @@ -339,7 +339,7 @@ void LRR::correct() } volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); - volScalarField G("RASModel.G", 0.5*mag(tr(P))); + volScalarField G(type() + ".G", 0.5*mag(tr(P))); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C index 17d9157c90..576d830421 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -252,7 +252,7 @@ void LamBremhorstKE::correct() y_.correct(); } - volScalarField G("RASModel.G", nut_*2*magSqr(symm(fvc::grad(U_)))); + volScalarField G(type() + ".G", nut_*2*magSqr(symm(fvc::grad(U_)))); // Calculate parameters and coefficients for low-Reynolds number model diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index c6ee7a7d44..2f8ff3b7ea 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -386,7 +386,7 @@ void LaunderGibsonRSTM::correct() } volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); - volScalarField G("RASModel.G", 0.5*mag(tr(P))); + volScalarField G(type() + ".G", 0.5*mag(tr(P))); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index 53cc490f29..c6854e7cba 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -255,7 +255,7 @@ void LaunderSharmaKE::correct() tmp S2 = 2*magSqr(symm(fvc::grad(U_))); - volScalarField G("RASModel.G", nut_*S2); + volScalarField G(type() + ".G", nut_*S2); const volScalarField E(2.0*nu()*nut_*fvc::magSqrGradGrad(U_)); const volScalarField D(2.0*nu()*magSqr(fvc::grad(sqrt(k_)))); diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C index 8eb972dcfb..dbecdb2dc8 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C @@ -356,7 +356,7 @@ void LienCubicKE::correct() volScalarField G ( - "RASModel.G", + type() + ".G", Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU) ); diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C index 5162fa78bd..9c5d561998 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -446,7 +446,7 @@ void LienCubicKELowRe::correct() volScalarField G ( - "RASModel.G", + type() + ".G", Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU) ); diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C index 6daecaae6b..faf5c125e4 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -319,7 +319,7 @@ void LienLeschzinerLowRe::correct() const volScalarField f2(scalar(1) - 0.3*exp(-sqr(Rt))); - volScalarField G("RASModel.G", Cmu_*fMu*sqr(k_)/epsilon_*S2); + volScalarField G(type() + ".G", Cmu_*fMu*sqr(k_)/epsilon_*S2); // Dissipation equation diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C index 750a4dc15b..b33c0cd3a8 100644 --- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C @@ -348,9 +348,8 @@ void NonlinearKEShih::correct() volScalarField G ( - "RASModel.G", - Cmu_*sqr(k_)/epsilon_*S2 - - (nonlinearStress_ && gradU) + type() + ".G", + Cmu_*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU) ); #include "nonLinearWallFunctionsI.H" diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H index b1a97681c2..4e890bb205 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H @@ -208,7 +208,7 @@ public: } //- Const access to the coefficients dictionary - const dictionary& coeffDict() const + virtual const dictionary& coeffDict() const { return coeffDict_; } diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C index 20ed988ca7..b82719f221 100644 --- a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -267,7 +267,7 @@ void RNGkEpsilon::correct() } const volScalarField S2(2*magSqr(symm(fvc::grad(U_)))); - volScalarField G("RASModel.G", nut_*S2); + volScalarField G(type() + ".G", nut_*S2); const volScalarField eta(sqrt(S2)*k_/epsilon_); volScalarField R diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C index 3940b067a4..e76ab69399 100644 --- a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C +++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C @@ -75,7 +75,7 @@ tmp autoCreateNut if (isA(bm[patchI])) { nutBoundaryTypes[patchI] = - RASModels::nutkWallFunctionFvPatchScalarField::typeName; + nutkWallFunctionFvPatchScalarField::typeName; } else { @@ -145,7 +145,7 @@ tmp autoCreateLowReNut if (isA(bm[patchI])) { nutBoundaryTypes[patchI] = - RASModels::nutLowReWallFunctionFvPatchScalarField::typeName; + nutLowReWallFunctionFvPatchScalarField::typeName; } else { @@ -191,7 +191,7 @@ tmp autoCreateEpsilon autoCreateWallFunctionField < scalar, - RASModels::epsilonWallFunctionFvPatchScalarField + epsilonWallFunctionFvPatchScalarField > ( fieldName, @@ -210,7 +210,7 @@ tmp autoCreateOmega autoCreateWallFunctionField < scalar, - RASModels::omegaWallFunctionFvPatchScalarField + omegaWallFunctionFvPatchScalarField > ( fieldName, @@ -229,7 +229,7 @@ tmp autoCreateK autoCreateWallFunctionField < scalar, - RASModels::kqRWallFunctionFvPatchField + kqRWallFunctionFvPatchField > ( fieldName, @@ -248,7 +248,7 @@ tmp autoCreateQ autoCreateWallFunctionField < scalar, - RASModels::kqRWallFunctionFvPatchField + kqRWallFunctionFvPatchField > ( fieldName, @@ -267,7 +267,7 @@ tmp autoCreateR autoCreateWallFunctionField < symmTensor, - RASModels::kqRWallFunctionFvPatchField + kqRWallFunctionFvPatchField > ( fieldName, diff --git a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C index c12783bcdb..48ccd699c7 100644 --- a/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C @@ -235,7 +235,7 @@ void kEpsilon::correct() return; } - volScalarField G("RASModel.G", nut_*2*magSqr(symm(fvc::grad(U_)))); + volScalarField G(type() + ".G", nut_*2*magSqr(symm(fvc::grad(U_)))); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C index f2faf19966..497fbed7c6 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C +++ b/src/turbulenceModels/incompressible/RAS/kOmega/kOmega.C @@ -244,7 +244,7 @@ void kOmega::correct() return; } - volScalarField G("RASModel.G", nut_*2*magSqr(symm(fvc::grad(U_)))); + volScalarField G(type() + ".G", nut_*2*magSqr(symm(fvc::grad(U_)))); // Update omega and G at the wall omega_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index 02899ec4c9..3758a1e907 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -364,7 +364,7 @@ void kOmegaSST::correct() } const volScalarField S2(2*magSqr(symm(fvc::grad(U_)))); - volScalarField G("RASModel.G", nut_*S2); + volScalarField G(type() + ".G", nut_*S2); // Update omega and G at the wall omega_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C index 03a3b8a5a6..8803807bbe 100644 --- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C +++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C @@ -311,7 +311,7 @@ void qZeta::correct() tmp S2 = 2*magSqr(symm(fvc::grad(U_))); - volScalarField G("RASModel.G", nut_/(2.0*q_)*S2); + volScalarField G(type() + ".G", nut_/(2.0*q_)*S2); const volScalarField E(nu()*nut_/q_*fvc::magSqrGradGrad(U_)); diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C index 3161d16371..d106180142 100644 --- a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C @@ -297,7 +297,7 @@ void realizableKE::correct() const volScalarField eta(magS*k_/epsilon_); tmp C1 = max(eta/(scalar(5) + eta), scalar(0.43)); - volScalarField G("RASModel.G", nut_*S2); + volScalarField G(type() + ".G", nut_*S2); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/v2f/v2f.C b/src/turbulenceModels/incompressible/RAS/v2f/v2f.C index d7304617ac..b8d20d2624 100644 --- a/src/turbulenceModels/incompressible/RAS/v2f/v2f.C +++ b/src/turbulenceModels/incompressible/RAS/v2f/v2f.C @@ -364,9 +364,9 @@ void v2f::correct() const volTensorField gradU(fvc::grad(U_)); const volScalarField S2(2*magSqr(dev(symm(gradU)))); - const volScalarField G("RASModel.G", nut_*S2); + const volScalarField G(type() + ".G", nut_*S2); const volScalarField T(Ts()); - const volScalarField L2("v2f.L2", sqr(Ls())); + const volScalarField L2(type() + ".L2", sqr(Ls())); const volScalarField alpha ( "v2f::alpha", diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C index a633c7a70e..65a6e2e685 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.C @@ -77,6 +77,12 @@ autoPtr laminar::New // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const dictionary& laminar::coeffDict() const +{ + return dictionary::null; +} + + tmp laminar::nut() const { return tmp diff --git a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H index 5b79ecd485..9c8588015f 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/laminar/laminar.H @@ -89,6 +89,9 @@ public: // Member Functions + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const; + //- Return the turbulence viscosity, i.e. 0 for laminar flow virtual tmp nut() const; diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H index c2eacdaf39..91eef14ad7 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H @@ -153,6 +153,9 @@ public: // Member Functions + //- Const access to the coefficients dictionary + virtual const dictionary& coeffDict() const = 0; + //- Access function to velocity field inline const volVectorField& U() const { From aa5a119be61bc5cfe653e5a7db592d7f54f817fb Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 17:11:56 +0000 Subject: [PATCH 08/37] ENH: Updated turbulence code/utilities affected by updates to turbulence model behaviour --- .../turbulence/PDRkEpsilon/PDRkEpsilon.C | 2 +- .../postProcessing/wall/yPlusRAS/yPlusRAS.C | 4 +-- .../applyBoundaryLayer/applyBoundaryLayer.C | 2 +- .../applyWallFunctionBoundaryConditions.C | 28 ++++++++----------- .../utilities/yPlusRAS/yPlusRAS.C | 4 +-- .../fixedShearStressFvPatchVectorField.C | 5 ++-- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index 44c4f6052f..fb61460fac 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -116,7 +116,7 @@ void PDRkEpsilon::correct() } tmp tgradU = fvc::grad(U_); - volScalarField G("RASModel.G", mut_*(tgradU() && dev(twoSymm(tgradU())))); + volScalarField G(type() + ".G", mut_*(tgradU() && dev(twoSymm(tgradU())))); tgradU.clear(); // Update espsilon and G at the wall diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C index 2f8b150341..58f6a7b063 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C +++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C @@ -55,7 +55,7 @@ void calcIncompressibleYPlus volScalarField& yPlus ) { - typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField + typedef incompressible::nutWallFunctionFvPatchScalarField wallFunctionPatchField; #include "createPhi.H" @@ -107,7 +107,7 @@ void calcCompressibleYPlus volScalarField& yPlus ) { - typedef compressible::RASModels::mutWallFunctionFvPatchScalarField + typedef compressible::mutWallFunctionFvPatchScalarField wallFunctionPatchField; IOobject rhoHeader diff --git a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C index 13c5841c3a..b4a83722e6 100644 --- a/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C +++ b/applications/utilities/preProcessing/applyBoundaryLayer/applyBoundaryLayer.C @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) } // Create G field - used by RAS wall functions - volScalarField G("RASModel.G", nut*2*sqr(S)); + volScalarField G(turbulence().type() + ".G", nut*2*sqr(S)); //--- Read and modify turbulence fields diff --git a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C index 9b89af1c4d..1e15f00c5a 100644 --- a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C +++ b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C @@ -232,43 +232,42 @@ void updateCompressibleCase(const fvMesh& mesh) ( mesh, "mut", - compressible::RASModels::mutkWallFunctionFvPatchScalarField::typeName, + compressible::mutkWallFunctionFvPatchScalarField::typeName, "0" ); replaceBoundaryType ( mesh, "epsilon", - compressible::RASModels::epsilonWallFunctionFvPatchScalarField:: - typeName, + compressible::epsilonWallFunctionFvPatchScalarField::typeName, "0" ); replaceBoundaryType ( mesh, "omega", - compressible::RASModels::omegaWallFunctionFvPatchScalarField::typeName, + compressible::omegaWallFunctionFvPatchScalarField::typeName, "0" ); replaceBoundaryType ( mesh, "k", - compressible::RASModels::kqRWallFunctionFvPatchField::typeName, + compressible::kqRWallFunctionFvPatchField::typeName, "0" ); replaceBoundaryType ( mesh, "q", - compressible::RASModels::kqRWallFunctionFvPatchField::typeName, + compressible::kqRWallFunctionFvPatchField::typeName, "0" ); replaceBoundaryType ( mesh, "R", - compressible::RASModels::kqRWallFunctionFvPatchField:: + compressible::kqRWallFunctionFvPatchField:: typeName, "(0 0 0 0 0 0)" ); @@ -284,14 +283,14 @@ void updateIncompressibleCase(const fvMesh& mesh) ( mesh, "nut", - incompressible::RASModels::nutkWallFunctionFvPatchScalarField::typeName, + incompressible::nutkWallFunctionFvPatchScalarField::typeName, "0" ); replaceBoundaryType ( mesh, "epsilon", - incompressible::RASModels::epsilonWallFunctionFvPatchScalarField:: + incompressible::epsilonWallFunctionFvPatchScalarField:: typeName, "0" ); @@ -299,7 +298,7 @@ void updateIncompressibleCase(const fvMesh& mesh) ( mesh, "omega", - incompressible::RASModels::omegaWallFunctionFvPatchScalarField:: + incompressible::omegaWallFunctionFvPatchScalarField:: typeName, "0" ); @@ -307,24 +306,21 @@ void updateIncompressibleCase(const fvMesh& mesh) ( mesh, "k", - incompressible::RASModels::kqRWallFunctionFvPatchField:: - typeName, + incompressible::kqRWallFunctionFvPatchField::typeName, "0" ); replaceBoundaryType ( mesh, "q", - incompressible::RASModels::kqRWallFunctionFvPatchField:: - typeName, + incompressible::kqRWallFunctionFvPatchField::typeName, "0" ); replaceBoundaryType ( mesh, "R", - incompressible::RASModels::kqRWallFunctionFvPatchField:: - typeName, + incompressible::kqRWallFunctionFvPatchField::typeName, "(0 0 0 0 0 0)" ); } diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C index 8d81c05bfe..de584f6105 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C @@ -56,7 +56,7 @@ void Foam::yPlusRAS::calcIncompressibleYPlus volScalarField& yPlus ) { - typedef incompressible::RASModels::nutWallFunctionFvPatchScalarField + typedef incompressible::nutWallFunctionFvPatchScalarField wallFunctionPatchField; const incompressible::RASModel& model = @@ -114,7 +114,7 @@ void Foam::yPlusRAS::calcCompressibleYPlus volScalarField& yPlus ) { - typedef compressible::RASModels::mutWallFunctionFvPatchScalarField + typedef compressible::mutWallFunctionFvPatchScalarField wallFunctionPatchField; const compressible::RASModel& model = diff --git a/src/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index 0f1d19bb2e..7afc74c400 100644 --- a/src/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/turbulenceModels/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -28,8 +28,9 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" -#include "incompressible/RAS/RASModel/RASModel.H" -#include "compressible/RAS/RASModel/RASModel.H" +#include "surfaceFields.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // From 687ecdc559b15045160221d3b0f9b5c9d4e301c2 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 17:24:20 +0000 Subject: [PATCH 09/37] STYLE: Updated copyright year --- .../applyWallFunctionBoundaryConditions.C | 2 +- .../wallFunctions/backwardsCompatibilityWallFunctions.C | 2 +- .../wallFunctions/backwardsCompatibilityWallFunctions.C | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C index 1e15f00c5a..38b0bf0eb7 100644 --- a/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C +++ b/applications/utilities/preProcessing/applyWallFunctionBoundaryConditions/applyWallFunctionBoundaryConditions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C index 5252784047..55434df625 100644 --- a/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C +++ b/src/turbulenceModels/compressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C index e76ab69399..98514bb5be 100644 --- a/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C +++ b/src/turbulenceModels/incompressible/RAS/backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License From d32702c23308f064646b6e142b0b970bc97be8dd Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Nov 2012 17:28:59 +0000 Subject: [PATCH 10/37] ENH: Tutorial update --- tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/U | 1 + tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon | 1 + tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k | 1 + 3 files changed, 3 insertions(+) diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/U b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/U index c261ab16ba..bb861bfc6d 100644 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/U +++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/U @@ -23,6 +23,7 @@ boundaryField inlet { type timeVaryingMappedFixedValue; + offset (0 0 0); setAverage off; } diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon index 28ff270cc2..b70f15f119 100644 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon +++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/epsilon @@ -25,6 +25,7 @@ boundaryField { type timeVaryingMappedFixedValue; setAverage 0; + offset 0; value nonuniform List 30 ( diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k index 3d54d8e097..f5f11a1aed 100644 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k +++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/0/k @@ -25,6 +25,7 @@ boundaryField { type timeVaryingMappedFixedValue; setAverage 0; + offset 0; value nonuniform List 30 ( From f2ed4b279effbf441d3d71f2e9c5a2d4433b1814 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 10:49:10 +0000 Subject: [PATCH 11/37] ENH: Added NO_WRITE io flags for CourantNo function object --- .../functionObjects/utilities/CourantNo/CourantNo.C | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index 0e15ead796..b76cdeb206 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -58,7 +58,9 @@ Foam::tmp Foam::CourantNo::rho ( "rho", mesh.time().timeName(), - mesh + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE ), mesh, dimensionedScalar("rho", dimless, 1.0) @@ -116,7 +118,8 @@ Foam::CourantNo::CourantNo type(), mesh.time().timeName(), mesh, - IOobject::NO_READ + IOobject::NO_READ, + IOobject::NO_WRITE ), mesh, dimensionedScalar("0", dimless, 0.0), From 8a692d187c0d0d20c731b49dc1a4fe69eb44aa71 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 10:49:34 +0000 Subject: [PATCH 12/37] ENH: Added dixygen tags to function objects --- .../functionObjects/utilities/CourantNo/CourantNo.H | 3 +++ .../utilities/scalarTransport/scalarTransport.H | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H index d1235f446f..319de39c16 100644 --- a/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H @@ -24,6 +24,9 @@ License Class Foam::CourantNo +Group + grpUtilitiesFunctionObjects + Description This function object calculates and outputs the Courant number as a volScalarField. The field is stored on the mesh database so that it can diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H index e08e40943a..35a872f59e 100644 --- a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -24,6 +24,9 @@ License Class Foam::scalarTransport +Group + grpUtilitiesFunctionObjects + Description This function object evolves a passive scalar transport equation. The field in ininitially zero, to which sources are added. The field name From 81b79ba2912fac78d90a0a1b608119e04568a6b4 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 10:50:12 +0000 Subject: [PATCH 13/37] ENH: Added new Lambda2 function object --- .../utilities/Lambda2/IOLambda2.H | 49 ++++++ .../utilities/Lambda2/Lambda2.C | 164 ++++++++++++++++++ .../utilities/Lambda2/Lambda2.H | 151 ++++++++++++++++ .../utilities/Lambda2/Lambda2FunctionObject.C | 42 +++++ .../utilities/Lambda2/Lambda2FunctionObject.H | 53 ++++++ .../functionObjects/utilities/Make/files | 3 + 6 files changed, 462 insertions(+) create mode 100644 src/postProcessing/functionObjects/utilities/Lambda2/IOLambda2.H create mode 100644 src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C create mode 100644 src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H create mode 100644 src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.C create mode 100644 src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.H diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/IOLambda2.H b/src/postProcessing/functionObjects/utilities/Lambda2/IOLambda2.H new file mode 100644 index 0000000000..0aacf47e94 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Lambda2/IOLambda2.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::IOLambda2 + +Description + Instance of the generic IOOutputFilter for Lambda2. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOLambda2_H +#define IOLambda2_H + +#include "Lambda2.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOLambda2; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C new file mode 100644 index 0000000000..e898a66d18 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "Lambda2.H" +#include "volFields.H" +#include "dictionary.H" +#include "zeroGradientFvPatchFields.H" +#include "fvcGrad.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::Lambda2, 0); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::Lambda2::Lambda2 +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + UName_("U") +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA(obr_)) + { + active_ = false; + WarningIn + ( + "Lambda2::Lambda2" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." << nl + << endl; + } + + read(dict); + + if (active_) + { + const fvMesh& mesh = refCast(obr_); + + volScalarField* Lambda2Ptr + ( + new volScalarField + ( + IOobject + ( + type(), + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("0", dimless, 0.0), + zeroGradientFvPatchScalarField::typeName + ) + ); + + mesh.objectRegistry::store(Lambda2Ptr); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::Lambda2::~Lambda2() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::Lambda2::read(const dictionary& dict) +{ + if (active_) + { + UName_ = dict.lookupOrDefault("UName", "U"); + } +} + + +void Foam::Lambda2::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::Lambda2::end() +{ + // Do nothing - only valid on write +} + + +void Foam::Lambda2::write() +{ + if (active_) + { + const fvMesh& mesh = refCast(obr_); + + const volVectorField& U = + mesh.lookupObject(UName_); + + const volTensorField gradU(fvc::grad(U)); + + const volTensorField SSplusWW + ( + (symm(gradU) & symm(gradU)) + + (skew(gradU) & skew(gradU)) + ); + + volScalarField& Lambda2 = + const_cast + ( + mesh.lookupObject(type()) + ); + + scalarField& iField = Lambda2.internalField(); + + iField = -eigenValues(SSplusWW)().component(vector::Y); + + Lambda2.correctBoundaryConditions(); + + Lambda2.write(); + + Info<< type() << " output:" << nl + << " writing " << Lambda2.name() << " field" << nl << endl; + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H new file mode 100644 index 0000000000..d1865c7cfe --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.H @@ -0,0 +1,151 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::Lambda2 + +Group + grpUtilitiesFunctionObjects + +Description + This function object calculates and outputs the second largest eigenvalue + of the sum of the square of the symmetrical and anti-symmetrical parts of + the velocity gradient tensor. + +SourceFiles + Lambda2.C + IOLambda2.H + +\*---------------------------------------------------------------------------*/ + +#ifndef Lambda2_H +#define Lambda2_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "pointFieldFwd.H" +#include "OFstream.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class Lambda2 Declaration +\*---------------------------------------------------------------------------*/ + +class Lambda2 +{ + // Private data + + //- Name of this set of Lambda2 objects + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Name of velocity field, default is "U" + word UName_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + Lambda2(const Lambda2&); + + //- Disallow default bitwise assignment + void operator=(const Lambda2&); + + +public: + + //- Runtime type information + TypeName("Lambda2"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + Lambda2 + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~Lambda2(); + + + // Member Functions + + //- Return name of the set of Lambda2 + virtual const word& name() const + { + return name_; + } + + //- Read the Lambda2 data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Calculate the Lambda2 and write + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.C new file mode 100644 index 0000000000..ced087ce9b --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "Lambda2FunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(Lambda2FunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + Lambda2FunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.H b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.H new file mode 100644 index 0000000000..e63d04a721 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2FunctionObject.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::Lambda2FunctionObject + +Description + FunctionObject wrapper around Lambda2 to allow it to be created + via the functions entry within controlDict. + +SourceFiles + Lambda2FunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Lambda2FunctionObject_H +#define Lambda2FunctionObject_H + +#include "Lambda2.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject Lambda2FunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Make/files b/src/postProcessing/functionObjects/utilities/Make/files index 362f24a0e7..b6a74ce14d 100644 --- a/src/postProcessing/functionObjects/utilities/Make/files +++ b/src/postProcessing/functionObjects/utilities/Make/files @@ -3,6 +3,9 @@ codedFunctionObject/codedFunctionObject.C CourantNo/CourantNo.C CourantNo/CourantNoFunctionObject.C +Lambda2/Lambda2.C +Lambda2/Lambda2FunctionObject.C + DESModelRegions/DESModelRegions.C DESModelRegions/DESModelRegionsFunctionObject.C From b0598526a4ee95efbba72c6e9f73de7c4864ce95 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 11:03:06 +0000 Subject: [PATCH 14/37] ENH: Simplified the wallShearStress function object --- .../wallShearStress/wallShearStress.C | 29 +++++-------------- .../wallShearStress/wallShearStress.H | 3 -- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C index 9544c8799b..7e096c6a70 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C @@ -99,7 +99,6 @@ Foam::wallShearStress::wallShearStress obr_(obr), active_(true), log_(false), - phiName_("phi"), patchSet_() { // Check if the available mesh is an fvMesh, otherwise deactivate @@ -136,7 +135,6 @@ void Foam::wallShearStress::read(const dictionary& dict) if (active_) { log_ = dict.lookupOrDefault("log", false); - phiName_ = dict.lookupOrDefault("phiName", "phi"); const fvMesh& mesh = refCast(obr_); const polyBoundaryMesh& pbm = mesh.boundaryMesh(); @@ -231,38 +229,27 @@ void Foam::wallShearStress::write() } - const surfaceScalarField& phi = - obr_.lookupObject(phiName_); - tmp Reff; - if (phi.dimensions() == dimMass/dimTime) + if (mesh.foundObject("turbulenceModel")) { - if (!mesh.foundObject("turbulenceModel")) - { - FatalErrorIn("void Foam::wallShearStress::write()") - << "Unable to find compressible turbulence model in the " - << "database" << exit(FatalError); - } - const cmpModel& model = mesh.lookupObject("turbulenceModel"); Reff = model.devRhoReff(); } - else + else if (mesh.foundObject("turbulenceModel")) { - if (!mesh.foundObject("turbulenceModel")) - { - FatalErrorIn("void Foam::wallShearStress::write()") - << "Unable to find incompressible turbulence model in the " - << "database" << exit(FatalError); - } - const icoModel& model = mesh.lookupObject("turbulenceModel"); Reff = model.devReff(); } + else + { + FatalErrorIn("void Foam::wallShearStress::write()") + << "Unable to find incompressible turbulence model in the " + << "database" << exit(FatalError); + } calcShearStress(mesh, Reff(), wallShearStress); diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H index ac16eca594..6b31c9f612 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H @@ -113,9 +113,6 @@ protected: //- Switch to send output to Info as well as to file Switch log_; - //- Name of mass/volume flux field (optional, default = phi) - word phiName_; - //- Optional list of patches to process labelHashSet patchSet_; From 04d80067b7af4ba81b3a544c60c224c23505c63d Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 11:27:14 +0000 Subject: [PATCH 15/37] ENH: Added new Peclet function object --- .../functionObjects/utilities/Make/files | 3 + .../utilities/Peclet/IOPeclet.H | 49 +++++ .../functionObjects/utilities/Peclet/Peclet.C | 196 ++++++++++++++++++ .../functionObjects/utilities/Peclet/Peclet.H | 153 ++++++++++++++ .../utilities/Peclet/PecletFunctionObject.C | 42 ++++ .../utilities/Peclet/PecletFunctionObject.H | 53 +++++ 6 files changed, 496 insertions(+) create mode 100644 src/postProcessing/functionObjects/utilities/Peclet/IOPeclet.H create mode 100644 src/postProcessing/functionObjects/utilities/Peclet/Peclet.C create mode 100644 src/postProcessing/functionObjects/utilities/Peclet/Peclet.H create mode 100644 src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.C create mode 100644 src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.H diff --git a/src/postProcessing/functionObjects/utilities/Make/files b/src/postProcessing/functionObjects/utilities/Make/files index b6a74ce14d..4f132af3fa 100644 --- a/src/postProcessing/functionObjects/utilities/Make/files +++ b/src/postProcessing/functionObjects/utilities/Make/files @@ -6,6 +6,9 @@ CourantNo/CourantNoFunctionObject.C Lambda2/Lambda2.C Lambda2/Lambda2FunctionObject.C +Peclet/Peclet.C +Peclet/PecletFunctionObject.C + DESModelRegions/DESModelRegions.C DESModelRegions/DESModelRegionsFunctionObject.C diff --git a/src/postProcessing/functionObjects/utilities/Peclet/IOPeclet.H b/src/postProcessing/functionObjects/utilities/Peclet/IOPeclet.H new file mode 100644 index 0000000000..ea49009d55 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Peclet/IOPeclet.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::IOPeclet + +Description + Instance of the generic IOOutputFilter for Peclet. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOPeclet_H +#define IOPeclet_H + +#include "Peclet.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOPeclet; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C new file mode 100644 index 0000000000..3c6731babd --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -0,0 +1,196 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "Peclet.H" +#include "volFields.H" +#include "dictionary.H" +#include "surfaceFields.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" +#include "surfaceInterpolate.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::Peclet, 0); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::Peclet::Peclet +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + phiName_("phi"), + rhoName_("rho") +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA(obr_)) + { + active_ = false; + WarningIn + ( + "Peclet::Peclet" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." << nl + << endl; + } + + read(dict); + + if (active_) + { + const fvMesh& mesh = refCast(obr_); + + surfaceScalarField* PecletPtr + ( + new surfaceScalarField + ( + IOobject + ( + type(), + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("0", dimless, 0.0) + ) + ); + + mesh.objectRegistry::store(PecletPtr); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::Peclet::~Peclet() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::Peclet::read(const dictionary& dict) +{ + if (active_) + { + phiName_ = dict.lookupOrDefault("phiName", "phi"); + rhoName_ = dict.lookupOrDefault("rhoName", "rho"); + } +} + + +void Foam::Peclet::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::Peclet::end() +{ + // Do nothing - only valid on write +} + + +void Foam::Peclet::write() +{ + typedef compressible::turbulenceModel cmpTurbModel; + typedef incompressible::turbulenceModel icoTurbModel; + + if (active_) + { + const fvMesh& mesh = refCast(obr_); + + tmp nuEff; + if (mesh.foundObject("turbulenceModel")) + { + const cmpTurbModel& model = + mesh.lookupObject("turbulenceModel"); + + const volScalarField& rho = + mesh.lookupObject(rhoName_); + + nuEff = model.muEff()/rho; + } + else if (mesh.foundObject("turbulenceModel")) + { + const icoTurbModel& model = + mesh.lookupObject("turbulenceModel"); + + nuEff = model.nuEff(); + } + else if (mesh.foundObject("transportProperties")) + { + const transportModel& model = + mesh.lookupObject("transportProperties"); + + nuEff = model.nu(); + } + else + { + FatalErrorIn("void Foam::wallShearStress::write()") + << "Unable to determine the viscosity" + << exit(FatalError); + } + + const surfaceScalarField& phi = + mesh.lookupObject(phiName_); + + surfaceScalarField& Peclet = + const_cast + ( + mesh.lookupObject(type()) + ); + + Peclet = + mag(phi) + /( + mesh.magSf() + *mesh.surfaceInterpolation::deltaCoeffs() + *fvc::interpolate(nuEff) + ); + + Peclet.write(); + + Info<< type() << " output:" << nl + << " writing " << Peclet.name() << " field" << nl << endl; + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H new file mode 100644 index 0000000000..1445e8377b --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::Peclet + +Group + grpUtilitiesFunctionObjects + +Description + This function object calculates and outputs the Peclet number as a + surfaceScalarField. + +SourceFiles + Peclet.C + IOPeclet.H + +\*---------------------------------------------------------------------------*/ + +#ifndef Peclet_H +#define Peclet_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "pointFieldFwd.H" +#include "OFstream.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class Peclet Declaration +\*---------------------------------------------------------------------------*/ + +class Peclet +{ + // Private data + + //- Name of this set of Peclet objects + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Name of flux field, default is "phi" + word phiName_; + + //- Name of density field (compressible cases only), default is "rho" + word rhoName_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + Peclet(const Peclet&); + + //- Disallow default bitwise assignment + void operator=(const Peclet&); + + +public: + + //- Runtime type information + TypeName("Peclet"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + Peclet + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~Peclet(); + + + // Member Functions + + //- Return name of the set of Peclet + virtual const word& name() const + { + return name_; + } + + //- Read the Peclet data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Calculate the Peclet and write + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.C b/src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.C new file mode 100644 index 0000000000..fdb247703c --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "PecletFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(PecletFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + PecletFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.H b/src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.H new file mode 100644 index 0000000000..fdeca7e571 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Peclet/PecletFunctionObject.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::PecletFunctionObject + +Description + FunctionObject wrapper around Peclet to allow it to be created + via the functions entry within controlDict. + +SourceFiles + PecletFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PecletFunctionObject_H +#define PecletFunctionObject_H + +#include "Peclet.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject PecletFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From e002f91a019e52883188d10f8071fde7e5d87eac Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 11:33:31 +0000 Subject: [PATCH 16/37] ENH: Added new Q function object --- .../functionObjects/utilities/Make/files | 3 + .../functionObjects/utilities/Q/IOQ.H | 49 ++++++ .../functionObjects/utilities/Q/Q.C | 154 ++++++++++++++++++ .../functionObjects/utilities/Q/Q.H | 154 ++++++++++++++++++ .../utilities/Q/QFunctionObject.C | 42 +++++ .../utilities/Q/QFunctionObject.H | 53 ++++++ 6 files changed, 455 insertions(+) create mode 100644 src/postProcessing/functionObjects/utilities/Q/IOQ.H create mode 100644 src/postProcessing/functionObjects/utilities/Q/Q.C create mode 100644 src/postProcessing/functionObjects/utilities/Q/Q.H create mode 100644 src/postProcessing/functionObjects/utilities/Q/QFunctionObject.C create mode 100644 src/postProcessing/functionObjects/utilities/Q/QFunctionObject.H diff --git a/src/postProcessing/functionObjects/utilities/Make/files b/src/postProcessing/functionObjects/utilities/Make/files index 4f132af3fa..01b4d0c4c9 100644 --- a/src/postProcessing/functionObjects/utilities/Make/files +++ b/src/postProcessing/functionObjects/utilities/Make/files @@ -9,6 +9,9 @@ Lambda2/Lambda2FunctionObject.C Peclet/Peclet.C Peclet/PecletFunctionObject.C +Q/Q.C +Q/QFunctionObject.C + DESModelRegions/DESModelRegions.C DESModelRegions/DESModelRegionsFunctionObject.C diff --git a/src/postProcessing/functionObjects/utilities/Q/IOQ.H b/src/postProcessing/functionObjects/utilities/Q/IOQ.H new file mode 100644 index 0000000000..f4739a0876 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Q/IOQ.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::IOQ + +Description + Instance of the generic IOOutputFilter for Q. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOQ_H +#define IOQ_H + +#include "Q.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOQ; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C new file mode 100644 index 0000000000..3cfb670b6b --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "Q.H" +#include "volFields.H" +#include "dictionary.H" +#include "fvcGrad.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::Q, 0); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::Q::Q +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + UName_("U") +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA(obr_)) + { + active_ = false; + WarningIn + ( + "Q::Q" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." << nl + << endl; + } + + read(dict); + + if (active_) + { + const fvMesh& mesh = refCast(obr_); + + volScalarField* QPtr + ( + new volScalarField + ( + IOobject + ( + type(), + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("0", dimless, 0.0) + ) + ); + + mesh.objectRegistry::store(QPtr); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::Q::~Q() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::Q::read(const dictionary& dict) +{ + if (active_) + { + UName_ = dict.lookupOrDefault("UName", "U"); + } +} + + +void Foam::Q::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::Q::end() +{ + // Do nothing - only valid on write +} + + +void Foam::Q::write() +{ + if (active_) + { + const fvMesh& mesh = refCast(obr_); + + const volVectorField& U = + mesh.lookupObject(UName_); + + const volTensorField gradU(fvc::grad(U)); + + volScalarField& Q = + const_cast + ( + mesh.lookupObject(type()) + ); + + Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU)))); + + Q.correctBoundaryConditions(); + + Q.write(); + + Info<< type() << " output:" << nl + << " writing " << Q.name() << " field" << nl << endl; + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.H b/src/postProcessing/functionObjects/utilities/Q/Q.H new file mode 100644 index 0000000000..c42099dac7 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Q/Q.H @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::Q + +Group + grpUtilitiesFunctionObjects + +Description + This function object calculates and outputs the second invariant of the + velocity gradient tensor [1/s^2]. + + \f[ + Q = 0.5(sqr(tr(\nabla U)) - tr(((\nabla U) \cdot (\nabla U)))) + \f] + +SourceFiles + Q.C + IOQ.H + +\*---------------------------------------------------------------------------*/ + +#ifndef Q_H +#define Q_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "pointFieldFwd.H" +#include "OFstream.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class Q Declaration +\*---------------------------------------------------------------------------*/ + +class Q +{ + // Private data + + //- Name of this set of Q objects + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Name of velocity field, default is "U" + word UName_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + Q(const Q&); + + //- Disallow default bitwise assignment + void operator=(const Q&); + + +public: + + //- Runtime type information + TypeName("Q"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + Q + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~Q(); + + + // Member Functions + + //- Return name of the set of Q + virtual const word& name() const + { + return name_; + } + + //- Read the Q data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Calculate the Q and write + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Q/QFunctionObject.C b/src/postProcessing/functionObjects/utilities/Q/QFunctionObject.C new file mode 100644 index 0000000000..0fa525f0b6 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Q/QFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "QFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(QFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + QFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Q/QFunctionObject.H b/src/postProcessing/functionObjects/utilities/Q/QFunctionObject.H new file mode 100644 index 0000000000..4c96aac505 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/Q/QFunctionObject.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::QFunctionObject + +Description + FunctionObject wrapper around Q to allow it to be created + via the functions entry within controlDict. + +SourceFiles + QFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef QFunctionObject_H +#define QFunctionObject_H + +#include "Q.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject QFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From e9b31afd52d8aa0965136f385038157b06bf067a Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 28 Nov 2012 14:29:42 +0000 Subject: [PATCH 17/37] applications/test/reconstruct: new test application for reconstruction --- applications/test/reconstruct/Make/files | 3 + applications/test/reconstruct/Make/options | 4 ++ .../test/reconstruct/Test-reconstruct.C | 61 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 applications/test/reconstruct/Make/files create mode 100644 applications/test/reconstruct/Make/options create mode 100644 applications/test/reconstruct/Test-reconstruct.C diff --git a/applications/test/reconstruct/Make/files b/applications/test/reconstruct/Make/files new file mode 100644 index 0000000000..5dd557e6f8 --- /dev/null +++ b/applications/test/reconstruct/Make/files @@ -0,0 +1,3 @@ +Test-reconstruct.C + +EXE = $(FOAM_USER_APPBIN)/Test-reconstruct diff --git a/applications/test/reconstruct/Make/options b/applications/test/reconstruct/Make/options new file mode 100644 index 0000000000..1a8bb54992 --- /dev/null +++ b/applications/test/reconstruct/Make/options @@ -0,0 +1,4 @@ +EXE_INC = -g \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = -lfiniteVolume diff --git a/applications/test/reconstruct/Test-reconstruct.C b/applications/test/reconstruct/Test-reconstruct.C new file mode 100644 index 0000000000..59e9a03bb6 --- /dev/null +++ b/applications/test/reconstruct/Test-reconstruct.C @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + Test-reconstruct + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + + surfaceScalarField phi(vector(1, 0, 0) & mesh.Sf()); + + volVectorField Uphi + ( + IOobject + ( + "Uphi", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + fvc::reconstruct(phi) + ); + + Uphi.write(); + + return 0; +} + + +// ************************************************************************* // From 75741d23f309f1e84d624cc01e11ccfc37b816ff Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 28 Nov 2012 14:31:00 +0000 Subject: [PATCH 18/37] =?UTF-8?q?RAS/kOmegaSST:=20Added=20F3=20coefficient?= =?UTF-8?q?=20for=20rough-walls=20from=20=20=20=20=20Hellsten,=20A.=20=20?= =?UTF-8?q?=20=20=20"Some=20Improvements=20in=20Menter=E2=80=99s=20k-omega?= =?UTF-8?q?-SST=20turbulence=20model"=20=20=20=20=2029th=20AIAA=20Fluid=20?= =?UTF-8?q?Dynamics=20Conference,=20=20=20=20=20AIAA-98-2554,=20=20=20=20?= =?UTF-8?q?=20June=201998.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compressible/RAS/kOmegaSST/kOmegaSST.C | 26 ++++++++++++++++-- .../compressible/RAS/kOmegaSST/kOmegaSST.H | 12 +++++++++ .../incompressible/RAS/kOmegaSST/kOmegaSST.C | 27 +++++++++++++++++-- .../incompressible/RAS/kOmegaSST/kOmegaSST.H | 18 ++++++++++--- 4 files changed, 76 insertions(+), 7 deletions(-) diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C index 066e427741..dd34c6ddae 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.C @@ -85,6 +85,18 @@ tmp kOmegaSST::F2() const } +tmp kOmegaSST::F3() const +{ + tmp arg3 = min + ( + 150*(mu()/rho_)/(omega_*sqr(y_)), + scalar(10) + ); + + return 1 - tanh(pow4(arg3)); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // kOmegaSST::kOmegaSST @@ -198,6 +210,15 @@ kOmegaSST::kOmegaSST 0.31 ) ), + b1_ + ( + dimensioned::lookupOrAddToDict + ( + "b1", + coeffDict_, + 1.0 + ) + ), c1_ ( dimensioned::lookupOrAddToDict @@ -268,7 +289,7 @@ kOmegaSST::kOmegaSST / max ( a1_*omega_, - F2()*sqrt(2.0)*mag(symm(fvc::grad(U_))) + b1_*F2()*F3()*sqrt(2.0)*mag(symm(fvc::grad(U_))) ) ); mut_.correctBoundaryConditions(); @@ -347,6 +368,7 @@ bool kOmegaSST::read() beta2_.readIfPresent(coeffDict()); betaStar_.readIfPresent(coeffDict()); a1_.readIfPresent(coeffDict()); + b1_.readIfPresent(coeffDict()); c1_.readIfPresent(coeffDict()); return true; @@ -448,7 +470,7 @@ void kOmegaSST::correct() // Re-calculate viscosity - mut_ = a1_*rho_*k_/max(a1_*omega_, F2()*sqrt(S2)); + mut_ = a1_*rho_*k_/max(a1_*omega_, b1_*F2()*F3()*sqrt(S2)); mut_.correctBoundaryConditions(); // Re-calculate thermal diffusivity diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H index d498a9a1f1..6cc40f6b68 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -38,6 +38,15 @@ Description Nov. 2001 \endverbatim + with the addition of the F3 term for rough walls from + \verbatim + Hellsten, A. + "Some Improvements in Menter’s k-omega-SST turbulence model" + 29th AIAA Fluid Dynamics Conference, + AIAA-98-2554, + June 1998. + \endverbatim + 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 @@ -69,6 +78,7 @@ Description gamma1 0.5532; gamma2 0.4403; a1 0.31; + b1 1.0; c1 10.0; } \endverbatim @@ -125,6 +135,7 @@ protected: dimensionedScalar betaStar_; dimensionedScalar a1_; + dimensionedScalar b1_; dimensionedScalar c1_; @@ -144,6 +155,7 @@ protected: tmp F1(const volScalarField& CDkOmega) const; tmp F2() const; + tmp F3() const; tmp blend ( diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index 02899ec4c9..cd1fd278e1 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -69,6 +69,7 @@ tmp kOmegaSST::F1(const volScalarField& CDkOmega) const return tanh(pow4(arg1)); } + tmp kOmegaSST::F2() const { tmp arg2 = min @@ -85,6 +86,18 @@ tmp kOmegaSST::F2() const } +tmp kOmegaSST::F3() const +{ + tmp arg3 = min + ( + 150*nu()/(omega_*sqr(y_)), + scalar(10) + ); + + return 1 - tanh(pow4(arg3)); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // kOmegaSST::kOmegaSST @@ -188,6 +201,15 @@ kOmegaSST::kOmegaSST 0.31 ) ), + b1_ + ( + dimensioned::lookupOrAddToDict + ( + "b1", + coeffDict_, + 1.0 + ) + ), c1_ ( dimensioned::lookupOrAddToDict @@ -246,7 +268,7 @@ kOmegaSST::kOmegaSST / max ( a1_*omega_, - F2()*sqrt(2.0)*mag(symm(fvc::grad(U_))) + b1_*F2()*F3()*sqrt(2.0)*mag(symm(fvc::grad(U_))) ) ); nut_.correctBoundaryConditions(); @@ -338,6 +360,7 @@ bool kOmegaSST::read() beta2_.readIfPresent(coeffDict()); betaStar_.readIfPresent(coeffDict()); a1_.readIfPresent(coeffDict()); + b1_.readIfPresent(coeffDict()); c1_.readIfPresent(coeffDict()); return true; @@ -416,7 +439,7 @@ void kOmegaSST::correct() // Re-calculate viscosity - nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(S2)); + nut_ = a1_*k_/max(a1_*omega_, b1_*F2()*F3()*sqrt(S2)); nut_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H index 7b2580094e..91c281bf4e 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H @@ -33,10 +33,19 @@ Description Turbulence model described in: \verbatim - Menter, F., Esch, T. - "Elements of Industrial Heat Transfer Prediction" + Menter, F., Esch, T., + "Elements of Industrial Heat Transfer Prediction", 16th Brazilian Congress of Mechanical Engineering (COBEM), - Nov. 2001 + Nov. 2001. + \endverbatim + + with the addition of the F3 term for rough walls from + \verbatim + Hellsten, A. + "Some Improvements in Menter’s k-omega-SST turbulence model" + 29th AIAA Fluid Dynamics Conference, + AIAA-98-2554, + June 1998. \endverbatim Note that this implementation is written in terms of alpha diffusion @@ -69,6 +78,7 @@ Description gamma1 0.5532; gamma2 0.4403; a1 0.31; + b1 1.0; c1 10.0; } \endverbatim @@ -122,6 +132,7 @@ protected: dimensionedScalar betaStar_; dimensionedScalar a1_; + dimensionedScalar b1_; dimensionedScalar c1_; //- Wall distance field @@ -139,6 +150,7 @@ protected: tmp F1(const volScalarField& CDkOmega) const; tmp F2() const; + tmp F3() const; tmp blend ( From f34970eb87d470d4a917d8bbcf8220865becb9ac Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 28 Nov 2012 15:10:41 +0000 Subject: [PATCH 19/37] tutorials/incompressible/pisoFoam/ras/cavityCoupledU: Simple demonstration of the vector-coupled solver --- .../ras/cavity/constant/polyMesh/boundary | 1 + .../pisoFoam/ras/cavityCoupledU/0/U | 41 +++++++++ .../pisoFoam/ras/cavityCoupledU/0/epsilon | 41 +++++++++ .../pisoFoam/ras/cavityCoupledU/0/k | 41 +++++++++ .../pisoFoam/ras/cavityCoupledU/0/nuTilda | 39 +++++++++ .../pisoFoam/ras/cavityCoupledU/0/nut | 41 +++++++++ .../pisoFoam/ras/cavityCoupledU/0/p | 39 +++++++++ .../ras/cavityCoupledU/constant/RASProperties | 25 ++++++ .../constant/polyMesh/blockMeshDict | 75 ++++++++++++++++ .../cavityCoupledU/constant/polyMesh/boundary | 41 +++++++++ .../constant/transportProperties | 39 +++++++++ .../constant/turbulenceProperties | 21 +++++ .../ras/cavityCoupledU/system/controlDict | 49 +++++++++++ .../ras/cavityCoupledU/system/fvSchemes | 71 +++++++++++++++ .../ras/cavityCoupledU/system/fvSolution | 87 +++++++++++++++++++ 15 files changed, 651 insertions(+) create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/U create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/epsilon create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/k create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nuTilda create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nut create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/p create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/RASProperties create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/blockMeshDict create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/boundary create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/transportProperties create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/turbulenceProperties create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/controlDict create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes create mode 100644 tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSolution diff --git a/tutorials/incompressible/pisoFoam/ras/cavity/constant/polyMesh/boundary b/tutorials/incompressible/pisoFoam/ras/cavity/constant/polyMesh/boundary index 61feadd974..9294a31266 100644 --- a/tutorials/incompressible/pisoFoam/ras/cavity/constant/polyMesh/boundary +++ b/tutorials/incompressible/pisoFoam/ras/cavity/constant/polyMesh/boundary @@ -32,6 +32,7 @@ FoamFile frontAndBack { type empty; + inGroups 1(empty); nFaces 800; startFace 840; } diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/U b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/U new file mode 100644 index 0000000000..711702f987 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/U @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + movingWall + { + type fixedValue; + value uniform (1 0 0); + } + + fixedWalls + { + type fixedValue; + value uniform (0 0 0); + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/epsilon b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/epsilon new file mode 100644 index 0000000000..6b009c939a --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/epsilon @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.000765; + +boundaryField +{ + movingWall + { + type epsilonWallFunction; + value uniform 0.000765; + } + fixedWalls + { + type epsilonWallFunction; + value uniform 0.000765; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/k b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/k new file mode 100644 index 0000000000..72d1287df1 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/k @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.00325; + +boundaryField +{ + movingWall + { + type kqRWallFunction; + value uniform 0.00325; + } + fixedWalls + { + type kqRWallFunction; + value uniform 0.00325; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nuTilda b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nuTilda new file mode 100644 index 0000000000..36021c60af --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nuTilda @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuTilda; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + movingWall + { + type zeroGradient; + } + + fixedWalls + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nut b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nut new file mode 100644 index 0000000000..2a9a9727fc --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/nut @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + movingWall + { + type nutkWallFunction; + value uniform 0; + } + fixedWalls + { + type nutkWallFunction; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/p b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/p new file mode 100644 index 0000000000..3e00d9eb31 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/0/p @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + movingWall + { + type zeroGradient; + } + + fixedWalls + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/RASProperties b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/RASProperties new file mode 100644 index 0000000000..a4937b503a --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..165a600c7b --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/blockMeshDict @@ -0,0 +1,75 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 0.1) + (1 0 0.1) + (1 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + movingWall + { + type wall; + faces + ( + (3 7 6 2) + ); + } + fixedWalls + { + type wall; + faces + ( + (0 4 7 3) + (2 6 5 1) + (1 5 4 0) + ); + } + frontAndBack + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/boundary b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/boundary new file mode 100644 index 0000000000..9294a31266 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/polyMesh/boundary @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +3 +( + movingWall + { + type wall; + nFaces 20; + startFace 760; + } + fixedWalls + { + type wall; + nFaces 60; + startFace 780; + } + frontAndBack + { + type empty; + inGroups 1(empty); + nFaces 800; + startFace 840; + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/transportProperties b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/transportProperties new file mode 100644 index 0000000000..b40b7d66cd --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/transportProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1e-05; + +CrossPowerLawCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + m m [ 0 0 1 0 0 0 0 ] 1; + n n [ 0 0 0 0 0 0 0 ] 1; +} + +BirdCarreauCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + k k [ 0 0 1 0 0 0 0 ] 0; + n n [ 0 0 0 0 0 0 0 ] 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/turbulenceProperties b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/turbulenceProperties new file mode 100644 index 0000000000..3721a46a2e --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/controlDict b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/controlDict new file mode 100644 index 0000000000..15396ddf40 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/controlDict @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pisoFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10; + +deltaT 0.005; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes new file mode 100644 index 0000000000..6a9eea83dd --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSchemes @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; + grad(U) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss limitedLinearV 1; + div(phi,k) Gauss limitedLinear 1; + div(phi,epsilon) Gauss limitedLinear 1; + div(phi,R) Gauss limitedLinear 1; + div(R) Gauss linear; + div(phi,nuTilda) Gauss limitedLinear 1; + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,U) Gauss linear corrected; + laplacian((1|A(U)),p) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(U) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSolution b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSolution new file mode 100644 index 0000000000..dc8a5f5eb6 --- /dev/null +++ b/tutorials/incompressible/pisoFoam/ras/cavityCoupledU/system/fvSolution @@ -0,0 +1,87 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + pFinal + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0; + } + + U + { + type coupled; + solver PBiCCG; + preconditioner DILU; + tolerance (1e-05 1e-05 1e-05); + relTol (0 0 0); + } + + k + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + epsilon + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + nuTilda + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } +} + +PISO +{ + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + + +// ************************************************************************* // From e2dc793da0a63a437f0feb9139adb7b2ddb97b73 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 15:42:07 +0000 Subject: [PATCH 20/37] ENH: Added new calcFvcGrad function object to calculate fvc::grad --- .../fvTools/calcFvcGrad/IOcalcFvcGrad.H | 49 +++++ .../fvTools/calcFvcGrad/calcFvcGrad.C | 121 ++++++++++++ .../fvTools/calcFvcGrad/calcFvcGrad.H | 180 ++++++++++++++++++ .../calcFvcGrad/calcFvcGradFunctionObject.C | 42 ++++ .../calcFvcGrad/calcFvcGradFunctionObject.H | 53 ++++++ .../calcFvcGrad/calcFvcGradTemplates.C | 133 +++++++++++++ 6 files changed, 578 insertions(+) create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcGrad/IOcalcFvcGrad.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.C create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/IOcalcFvcGrad.H b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/IOcalcFvcGrad.H new file mode 100644 index 0000000000..2e97ac6459 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/IOcalcFvcGrad.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::IOcalcFvcGrad + +Description + Instance of the generic IOOutputFilter for calcFvcGrad. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOcalcFvcGrad_H +#define IOcalcFvcGrad_H + +#include "calcFvcGrad.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOcalcFvcGrad; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C new file mode 100644 index 0000000000..de97652e5e --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.C @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calcFvcGrad.H" +#include "volFields.H" +#include "dictionary.H" +#include "calcFvcGrad.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::calcFvcGrad, 0); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::calcFvcGrad::calcFvcGrad +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + fieldName_("undefined-fieldName"), + resultName_("undefined-resultName") +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA(obr_)) + { + active_ = false; + WarningIn + ( + "calcFvcGrad::calcFvcGrad" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." << nl + << endl; + } + + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::calcFvcGrad::~calcFvcGrad() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::calcFvcGrad::read(const dictionary& dict) +{ + if (active_) + { + dict.lookup("fieldName") >> fieldName_; + dict.lookup("resultName") >> resultName_; + } +} + + +void Foam::calcFvcGrad::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::calcFvcGrad::end() +{ + // Do nothing - only valid on write +} + + +void Foam::calcFvcGrad::write() +{ + if (active_) + { + bool processed = false; + + calcGrad(fieldName_, resultName_, processed); + calcGrad(fieldName_, resultName_, processed); + + if (!processed) + { + WarningIn("void Foam::calcFvcGrad::write()") + << "Unprocessed field " << fieldName_ << endl; + } + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H new file mode 100644 index 0000000000..c7422eca4b --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGrad.H @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::calcFvcGrad + +Group + grpFVFunctionObjects + +Description + This function object calculates the gradient of a field. The operation is + limited to scalar and vector volume or surface fields, and the output is a + volume vector or tensor field. + +SourceFiles + calcFvcGrad.C + IOcalcFvcGrad.H + +\*---------------------------------------------------------------------------*/ + +#ifndef calcFvcGrad_H +#define calcFvcGrad_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "pointFieldFwd.H" +#include "OFstream.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; +class dimensionSet; + +/*---------------------------------------------------------------------------*\ + Class calcFvcGrad Declaration +\*---------------------------------------------------------------------------*/ + +class calcFvcGrad +{ + // Private data + + //- Name of this calcFvcGrad object + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Name of field to process + word fieldName_; + + //- Name of result field + word resultName_; + + + // Private Member Functions + + //- Helper function to create/store/return the gradient field + template + GeometricField + < + typename outerProduct::type, + fvPatchField, + volMesh + >& + gradField(const word& gradName, const dimensionSet& dims); + + //- Helper function to calculate the gradient of different field types + template + void calcGrad + ( + const word& fieldName, + const word& resultName, + bool& processed + ); + + //- Disallow default bitwise copy construct + calcFvcGrad(const calcFvcGrad&); + + //- Disallow default bitwise assignment + void operator=(const calcFvcGrad&); + + +public: + + //- Runtime type information + TypeName("calcFvcGrad"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + calcFvcGrad + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~calcFvcGrad(); + + + // Member Functions + + //- Return name of the set of calcFvcGrad + virtual const word& name() const + { + return name_; + } + + //- Read the calcFvcGrad data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Calculate the calcFvcGrad and write + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "calcFvcGradTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.C new file mode 100644 index 0000000000..3e2d1e6698 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calcFvcGradFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(calcFvcGradFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + calcFvcGradFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.H b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.H new file mode 100644 index 0000000000..0c3f580697 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradFunctionObject.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::calcFvcGradFunctionObject + +Description + FunctionObject wrapper around calcFvcGrad to allow it to be created + via the functions entry within controlDict. + +SourceFiles + calcFvcGradFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef calcFvcGradFunctionObject_H +#define calcFvcGradFunctionObject_H + +#include "calcFvcGrad.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject calcFvcGradFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C new file mode 100644 index 0000000000..3e95bbd424 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcGrad/calcFvcGradTemplates.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "fvMesh.H" +#include "fvcGrad.H" + +template +Foam::GeometricField +< + typename Foam::outerProduct::type, + Foam::fvPatchField, + Foam::volMesh +>& +Foam::calcFvcGrad::gradField(const word& gradName, const dimensionSet& dims) +{ + typedef typename outerProduct::type gradType; + typedef GeometricField vfGradType; + + const fvMesh& mesh = refCast(obr_); + + if (!mesh.foundObject(gradName)) + { + vfGradType* gradFieldPtr + ( + new vfGradType + ( + IOobject + ( + gradName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensioned + ( + "zero", + dims/dimLength, + pTraits::zero + ) + ) + ); + + mesh.objectRegistry::store(gradFieldPtr); + } + + const vfGradType& field = mesh.lookupObject(gradName); + + return const_cast(field); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::calcFvcGrad::calcGrad +( + const word& fieldName, + const word& resultName, + bool& processed +) +{ + typedef GeometricField vfType; + typedef GeometricField sfType; + + typedef typename outerProduct::type gradType; + typedef GeometricField vfGradType; + + const fvMesh& mesh = refCast(obr_); + + word gradName = resultName; + if (gradName == "none") + { + gradName = "fvc::grad(" + fieldName + ")"; + } + + if (mesh.foundObject(fieldName)) + { + const vfType& vf = mesh.lookupObject(fieldName); + + vfGradType& field = gradField(gradName, vf.dimensions()); + + field = fvc::grad(vf); + + Info<< type() << " output:" << nl + << " writing " << field.name() << " field" << nl << endl; + + field.write(); + + processed = true; + } + else if (mesh.foundObject(fieldName)) + { + const sfType& sf = mesh.lookupObject(fieldName); + + vfGradType& field = gradField(gradName, sf.dimensions()); + + field = fvc::grad(sf); + + Info<< type() << " output:" << nl + << " writing " << field.name() << " field" << nl << endl; + + field.write(); + + processed = true; + } +} + + +// ************************************************************************* // From 7e2368524fb6e622d916bc7a6cbdf42d911e7fae Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 15:42:28 +0000 Subject: [PATCH 21/37] ENH: Added new calcMag function object to calculate mag(field) --- .../fvTools/calcMag/IOcalcMag.H | 49 +++++ .../functionObjects/fvTools/calcMag/calcMag.C | 126 +++++++++++++ .../functionObjects/fvTools/calcMag/calcMag.H | 174 ++++++++++++++++++ .../fvTools/calcMag/calcMagFunctionObject.C | 42 +++++ .../fvTools/calcMag/calcMagFunctionObject.H | 53 ++++++ .../fvTools/calcMag/calcMagTemplates.C | 124 +++++++++++++ 6 files changed, 568 insertions(+) create mode 100644 src/postProcessing/functionObjects/fvTools/calcMag/IOcalcMag.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C create mode 100644 src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.C create mode 100644 src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/IOcalcMag.H b/src/postProcessing/functionObjects/fvTools/calcMag/IOcalcMag.H new file mode 100644 index 0000000000..3f0a584d14 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcMag/IOcalcMag.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::IOcalcMag + +Description + Instance of the generic IOOutputFilter for calcMag. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOcalcMag_H +#define IOcalcMag_H + +#include "calcMag.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOcalcMag; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C new file mode 100644 index 0000000000..c883911430 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calcMag.H" +#include "volFields.H" +#include "dictionary.H" +#include "calcMag.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::calcMag, 0); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::calcMag::calcMag +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + fieldName_("undefined-fieldName"), + resultName_("undefined-resultName") +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA(obr_)) + { + active_ = false; + WarningIn + ( + "calcMag::calcMag" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." << nl + << endl; + } + + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::calcMag::~calcMag() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::calcMag::read(const dictionary& dict) +{ + if (active_) + { + dict.lookup("fieldName") >> fieldName_; + dict.lookup("resultName") >> resultName_; + } +} + + +void Foam::calcMag::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::calcMag::end() +{ + // Do nothing - only valid on write +} + + +void Foam::calcMag::write() +{ + if (active_) + { + bool processed = false; + + + + calc(fieldName_, resultName_, processed); + calc(fieldName_, resultName_, processed); + calc(fieldName_, resultName_, processed); + calc(fieldName_, resultName_, processed); + calc(fieldName_, resultName_, processed); + + if (!processed) + { + WarningIn("void Foam::calcMag::write()") + << "Unprocessed field " << fieldName_ << endl; + } + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H new file mode 100644 index 0000000000..08d2bf4b7e --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H @@ -0,0 +1,174 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::calcMag + +Group + grpFVFunctionObjects + +Description + This function object calculates the magnitude of a field. The operation + can be applied to any volume or surface fieldsm and the output is a + volume or surface scalar field. + +SourceFiles + calcMag.C + IOcalcMag.H + +\*---------------------------------------------------------------------------*/ + +#ifndef calcMag_H +#define calcMag_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "pointFieldFwd.H" +#include "OFstream.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; +class dimensionSet; + +/*---------------------------------------------------------------------------*\ + Class calcMag Declaration +\*---------------------------------------------------------------------------*/ + +class calcMag +{ + // Private data + + //- Name of this calcMag object + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Name of field to process + word fieldName_; + + //- Name of result field + word resultName_; + + + // Private Member Functions + + //- Helper function to create/store/return the mag field + template + FieldType& magField(const word& magName, const dimensionSet& dims); + + //- Helper function to calculate the gradient of different field types + template + void calc + ( + const word& fieldName, + const word& resultName, + bool& processed + ); + + //- Disallow default bitwise copy construct + calcMag(const calcMag&); + + //- Disallow default bitwise assignment + void operator=(const calcMag&); + + +public: + + //- Runtime type information + TypeName("calcMag"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + calcMag + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~calcMag(); + + + // Member Functions + + //- Return name of the set of calcMag + virtual const word& name() const + { + return name_; + } + + //- Read the calcMag data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Calculate the calcMag and write + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "calcMagTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.C new file mode 100644 index 0000000000..61aded1e61 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calcMagFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(calcMagFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + calcMagFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.H b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.H new file mode 100644 index 0000000000..ea143666e1 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagFunctionObject.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::calcMagFunctionObject + +Description + FunctionObject wrapper around calcMag to allow it to be created + via the functions entry within controlDict. + +SourceFiles + calcMagFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef calcMagFunctionObject_H +#define calcMagFunctionObject_H + +#include "calcMag.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject calcMagFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C new file mode 100644 index 0000000000..4435b64f1b --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMagTemplates.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "fvMesh.H" +#include "Time.H" +#include "volFields.H" +#include "surfaceFields.H" + +template +FieldType& Foam::calcMag::magField +( + const word& magName, + const dimensionSet& dims +) +{ + const fvMesh& mesh = refCast(obr_); + + if (!mesh.foundObject(magName)) + { + FieldType* magFieldPtr + ( + new FieldType + ( + IOobject + ( + magName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dims, 0.0) + ) + ); + + mesh.objectRegistry::store(magFieldPtr); + } + + const FieldType& f = mesh.lookupObject(magName); + + return const_cast(f); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::calcMag::calc +( + const word& fieldName, + const word& resultName, + bool& processed +) +{ + typedef GeometricField vfType; + typedef GeometricField sfType; + + const fvMesh& mesh = refCast(obr_); + + word magName = resultName; + if (magName == "none") + { + magName = "mag(" + fieldName + ")"; + } + + if (mesh.foundObject(fieldName)) + { + const vfType& vf = mesh.lookupObject(fieldName); + + volScalarField& field = + magField(magName, vf.dimensions()); + + field = mag(vf); + + Info<< type() << " output:" << nl + << " writing " << field.name() << " field" << nl << endl; + + field.write(); + + processed = true; + } + else if (mesh.foundObject(fieldName)) + { + const sfType& sf = mesh.lookupObject(fieldName); + + surfaceScalarField& field = + magField(magName, sf.dimensions()); + + field = mag(sf); + + Info<< type() << " output:" << nl + << " writing " << field.name() << " field" << nl << endl; + + field.write(); + + processed = true; + } +} + + +// ************************************************************************* // From c3f22240dea734e9f295ca7e550f32dee208ad71 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 15:43:38 +0000 Subject: [PATCH 22/37] ENH: Added Make/[files|options] for new fv-based function objects --- src/postProcessing/functionObjects/fvTools/Make/files | 7 +++++++ src/postProcessing/functionObjects/fvTools/Make/options | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 src/postProcessing/functionObjects/fvTools/Make/files create mode 100644 src/postProcessing/functionObjects/fvTools/Make/options diff --git a/src/postProcessing/functionObjects/fvTools/Make/files b/src/postProcessing/functionObjects/fvTools/Make/files new file mode 100644 index 0000000000..e19fc236db --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/Make/files @@ -0,0 +1,7 @@ +calcFvcGrad/calcFvcGrad.C +calcFvcGrad/calcFvcGradFunctionObject.C + +calcMag/calcMag.C +calcMag/calcMagFunctionObject.C + +LIB = $(FOAM_LIBBIN)/libFVFunctionObjects diff --git a/src/postProcessing/functionObjects/fvTools/Make/options b/src/postProcessing/functionObjects/fvTools/Make/options new file mode 100644 index 0000000000..71b7873964 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +LIB_LIBS = \ + -lfiniteVolume From cfaa27a7022438812e6c8cd6567393ba9c438069 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 15:56:24 +0000 Subject: [PATCH 23/37] STYLE: Updated header comment --- src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H index 08d2bf4b7e..1360e303cd 100644 --- a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.H @@ -88,7 +88,7 @@ class calcMag template FieldType& magField(const word& magName, const dimensionSet& dims); - //- Helper function to calculate the gradient of different field types + //- Helper function to calculate the magnitude of different field types template void calc ( From 1f864599cde6e962b3516810e8636bb1557a8bab Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 15:56:49 +0000 Subject: [PATCH 24/37] ENH: Added new function object doxy group for FV tools --- src/postProcessing/functionObjects/doc/functionObjects.dox | 1 + 1 file changed, 1 insertion(+) diff --git a/src/postProcessing/functionObjects/doc/functionObjects.dox b/src/postProcessing/functionObjects/doc/functionObjects.dox index 098b7ae12d..64073c2a3f 100644 --- a/src/postProcessing/functionObjects/doc/functionObjects.dox +++ b/src/postProcessing/functionObjects/doc/functionObjects.dox @@ -39,6 +39,7 @@ The current range of features comprises of: - \ref grpCloudFunctionObjects - \ref grpFieldFunctionObjects - \ref grpForcesFunctionObjects +- \ref grpFVFunctionObjects - \ref grpIOFunctionObjects - \ref grpJobControlFunctionObjects - \ref grpUtilitiesFunctionObjects From a65254af4bab9b3a9b3531b75edbd70d71cb6789 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 16:07:24 +0000 Subject: [PATCH 25/37] ENH: Added new calcFvcDiv function object to calculate fvc::div --- .../functionObjects/fvTools/Make/files | 3 + .../fvTools/calcFvcDiv/IOcalcFvcDiv.H | 49 +++++ .../fvTools/calcFvcDiv/calcFvcDiv.C | 158 ++++++++++++++++ .../fvTools/calcFvcDiv/calcFvcDiv.H | 177 ++++++++++++++++++ .../calcFvcDiv/calcFvcDivFunctionObject.C | 42 +++++ .../calcFvcDiv/calcFvcDivFunctionObject.H | 53 ++++++ .../fvTools/calcFvcDiv/calcFvcDivTemplates.C | 65 +++++++ 7 files changed, 547 insertions(+) create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcDiv/IOcalcFvcDiv.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.C create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.H create mode 100644 src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C diff --git a/src/postProcessing/functionObjects/fvTools/Make/files b/src/postProcessing/functionObjects/fvTools/Make/files index e19fc236db..f5940e8ce3 100644 --- a/src/postProcessing/functionObjects/fvTools/Make/files +++ b/src/postProcessing/functionObjects/fvTools/Make/files @@ -1,3 +1,6 @@ +calcFvcDiv/calcFvcDiv.C +calcFvcDiv/calcFvcDivFunctionObject.C + calcFvcGrad/calcFvcGrad.C calcFvcGrad/calcFvcGradFunctionObject.C diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/IOcalcFvcDiv.H b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/IOcalcFvcDiv.H new file mode 100644 index 0000000000..245aae6e2b --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/IOcalcFvcDiv.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::IOcalcFvcDiv + +Description + Instance of the generic IOOutputFilter for calcFvcDiv. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOcalcFvcDiv_H +#define IOcalcFvcDiv_H + +#include "calcFvcDiv.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOcalcFvcDiv; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C new file mode 100644 index 0000000000..934fb58d75 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calcFvcDiv.H" +#include "volFields.H" +#include "dictionary.H" +#include "calcFvcDiv.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::calcFvcDiv, 0); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::volScalarField& Foam::calcFvcDiv::divField +( + const word& divName, + const dimensionSet& dims +) +{ + const fvMesh& mesh = refCast(obr_); + + if (!mesh.foundObject(divName)) + { + volScalarField* divFieldPtr + ( + new volScalarField + ( + IOobject + ( + divName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dims/dimLength, 0.0) + ) + ); + + mesh.objectRegistry::store(divFieldPtr); + } + + const volScalarField& field = mesh.lookupObject(divName); + + return const_cast(field); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::calcFvcDiv::calcFvcDiv +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + fieldName_("undefined-fieldName"), + resultName_("undefined-resultName") +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA(obr_)) + { + active_ = false; + WarningIn + ( + "calcFvcDiv::calcFvcDiv" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." << nl + << endl; + } + + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::calcFvcDiv::~calcFvcDiv() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::calcFvcDiv::read(const dictionary& dict) +{ + if (active_) + { + dict.lookup("fieldName") >> fieldName_; + dict.lookup("resultName") >> resultName_; + } +} + + +void Foam::calcFvcDiv::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::calcFvcDiv::end() +{ + // Do nothing - only valid on write +} + + +void Foam::calcFvcDiv::write() +{ + if (active_) + { + bool processed = false; + + calcDiv(fieldName_, resultName_, processed); + calcDiv(fieldName_, resultName_, processed); + + if (!processed) + { + WarningIn("void Foam::calcFvcDiv::write()") + << "Unprocessed field " << fieldName_ << endl; + } + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H new file mode 100644 index 0000000000..bc07e0fab0 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDiv.H @@ -0,0 +1,177 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::calcFvcDiv + +Group + grpFVFunctionObjects + +Description + This function object calculates the divergence of a field. The operation is + limited to surfaceScalarFields and volumeVector fields, and the output is a + volume scalar field. + +SourceFiles + calcFvcDiv.C + IOcalcFvcDiv.H + +\*---------------------------------------------------------------------------*/ + +#ifndef calcFvcDiv_H +#define calcFvcDiv_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "pointFieldFwd.H" +#include "OFstream.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; +class dimensionSet; + +/*---------------------------------------------------------------------------*\ + Class calcFvcDiv Declaration +\*---------------------------------------------------------------------------*/ + +class calcFvcDiv +{ + // Private data + + //- Name of this calcFvcDiv object + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Name of field to process + word fieldName_; + + //- Name of result field + word resultName_; + + + // Private Member Functions + + //- Helper function to create/store/return the divergence field + volScalarField& divField + ( + const word& gradName, + const dimensionSet& dims + ); + + //- Helper function to calculate the divergence of different field types + template + void calcDiv + ( + const word& fieldName, + const word& resultName, + bool& processed + ); + + //- Disallow default bitwise copy construct + calcFvcDiv(const calcFvcDiv&); + + //- Disallow default bitwise assignment + void operator=(const calcFvcDiv&); + + +public: + + //- Runtime type information + TypeName("calcFvcDiv"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + calcFvcDiv + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~calcFvcDiv(); + + + // Member Functions + + //- Return name of the set of calcFvcDiv + virtual const word& name() const + { + return name_; + } + + //- Read the calcFvcDiv data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Calculate the calcFvcDiv and write + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "calcFvcDivTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.C new file mode 100644 index 0000000000..32f990ec09 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "calcFvcDivFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(calcFvcDivFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + calcFvcDivFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.H b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.H new file mode 100644 index 0000000000..5cc8af7332 --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivFunctionObject.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Typedef + Foam::calcFvcDivFunctionObject + +Description + FunctionObject wrapper around calcFvcDiv to allow it to be created + via the functions entry within controlDict. + +SourceFiles + calcFvcDivFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef calcFvcDivFunctionObject_H +#define calcFvcDivFunctionObject_H + +#include "calcFvcDiv.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject calcFvcDivFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C new file mode 100644 index 0000000000..cfdf55f1bf --- /dev/null +++ b/src/postProcessing/functionObjects/fvTools/calcFvcDiv/calcFvcDivTemplates.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "fvMesh.H" +#include "fvcDiv.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::calcFvcDiv::calcDiv +( + const word& fieldName, + const word& resultName, + bool& processed +) +{ + const fvMesh& mesh = refCast(obr_); + + word divName = resultName; + if (divName == "none") + { + divName = "fvc::div(" + fieldName + ")"; + } + + if (mesh.foundObject(fieldName)) + { + const FieldType& vf = mesh.lookupObject(fieldName); + + volScalarField& field = divField(divName, vf.dimensions()); + + field = fvc::div(vf); + + Info<< type() << " output:" << nl + << " writing " << field.name() << " field" << nl << endl; + + field.write(); + + processed = true; + } +} + + +// ************************************************************************* // From 0f3fc4457a916e6566fe53c6e1853615133f0e8f Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 17:09:43 +0000 Subject: [PATCH 26/37] ENH: Updates to Lambda2 and Q function objects --- .../functionObjects/utilities/Lambda2/Lambda2.C | 9 ++------- src/postProcessing/functionObjects/utilities/Q/Q.C | 4 +--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C index e898a66d18..04c8ddefb9 100644 --- a/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/utilities/Lambda2/Lambda2.C @@ -85,8 +85,7 @@ Foam::Lambda2::Lambda2 IOobject::NO_WRITE ), mesh, - dimensionedScalar("0", dimless, 0.0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar("0", dimless/sqr(dimTime), 0.0) ) ); @@ -147,11 +146,7 @@ void Foam::Lambda2::write() mesh.lookupObject(type()) ); - scalarField& iField = Lambda2.internalField(); - - iField = -eigenValues(SSplusWW)().component(vector::Y); - - Lambda2.correctBoundaryConditions(); + Lambda2 = -eigenValues(SSplusWW)().component(vector::Y); Lambda2.write(); diff --git a/src/postProcessing/functionObjects/utilities/Q/Q.C b/src/postProcessing/functionObjects/utilities/Q/Q.C index 3cfb670b6b..ffce5efc56 100644 --- a/src/postProcessing/functionObjects/utilities/Q/Q.C +++ b/src/postProcessing/functionObjects/utilities/Q/Q.C @@ -84,7 +84,7 @@ Foam::Q::Q IOobject::NO_WRITE ), mesh, - dimensionedScalar("0", dimless, 0.0) + dimensionedScalar("0", dimless/sqr(dimTime), 0.0) ) ); @@ -141,8 +141,6 @@ void Foam::Q::write() Q = 0.5*(sqr(tr(gradU)) - tr(((gradU) & (gradU)))); - Q.correctBoundaryConditions(); - Q.write(); Info<< type() << " output:" << nl From 6f5a54aac142ce2c3d5a54baf9c8969916f18632 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Nov 2012 17:18:13 +0000 Subject: [PATCH 27/37] STYLE: Minor comment correction --- .../ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H index 867951946c..52401609fa 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CoEulerDdtScheme/CoEulerDdtScheme.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ Description does not exceed the specified value. This scheme should only be used for steady-state computations - using transient codes where local time-stepping is preferably to + using transient codes where local time-stepping is preferable to under-relaxation for transport consistency reasons. SourceFiles From f46234ba220921b0b99a7c7752d70b6da5e94715 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Nov 2012 10:34:01 +0000 Subject: [PATCH 28/37] BUG: Corrected offset data entry for timeVaryMappedFixedValue BC --- .../timeVaryingMappedFixedValueFvPatchField.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C index 29590cc051..f613a7e6a2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C @@ -79,7 +79,7 @@ timeVaryingMappedFixedValueFvPatchField endSampleTime_(-1), endSampledValues_(0), endAverage_(pTraits::zero), - offset_() + offset_(ptf.offset_().clone().ptr()) {} From a1b4534b3bef08fa78bf19ca0b91fab8ba07030e Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Nov 2012 15:35:06 +0000 Subject: [PATCH 29/37] STYLE: Minor code formatting --- src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C index c883911430..47705025de 100644 --- a/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C +++ b/src/postProcessing/functionObjects/fvTools/calcMag/calcMag.C @@ -106,8 +106,6 @@ void Foam::calcMag::write() { bool processed = false; - - calc(fieldName_, resultName_, processed); calc(fieldName_, resultName_, processed); calc(fieldName_, resultName_, processed); From f5d95cd553ded4159aff4a2c22edcf6903df9c09 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Nov 2012 15:37:12 +0000 Subject: [PATCH 30/37] BUG: Corrected epsilon low-Re wall functions --- .../epsilonLowReWallFunctionFvPatchScalarField.C | 2 +- .../epsilonLowReWallFunctionFvPatchScalarField.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C index f5201711e6..df6e47c0da 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C @@ -180,7 +180,7 @@ void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs() } else { - epsilon[faceCellI] = 2.0*Cmu25*pow(k[faceCellI], 1.5)/y[faceI]; + epsilon[faceCellI] = 2.0*k[faceCellI]*muw[faceI]/rhow[faceI]/sqr(y[faceI]); } G[faceCellI] = diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C index 895b32e05e..df52c7373e 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C @@ -178,7 +178,7 @@ void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs() } else { - epsilon[faceCellI] = 2.0*Cmu25*pow(k[faceCellI], 1.5)/y[faceI]; + epsilon[faceCellI] = 2.0*k[faceCellI]*nuw[faceI]/sqr(y[faceI]); } G[faceCellI] = From ef95b084edb5ec74cf9e198d3186787f59855c6e Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Nov 2012 16:37:12 +0000 Subject: [PATCH 31/37] ENH: Added MRF and porosity functionality to pimpleFoam --- applications/solvers/incompressible/pimpleFoam/UEqn.H | 4 ++++ .../solvers/incompressible/pimpleFoam/createZones.H | 4 ++++ applications/solvers/incompressible/pimpleFoam/pEqn.H | 2 ++ .../solvers/incompressible/pimpleFoam/pimpleFoam.C | 10 ++++++++-- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 applications/solvers/incompressible/pimpleFoam/createZones.H diff --git a/applications/solvers/incompressible/pimpleFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/UEqn.H index a6aef51daf..c274f6a2e8 100644 --- a/applications/solvers/incompressible/pimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/UEqn.H @@ -7,6 +7,10 @@ tmp UEqn + turbulence->divDevReff(U) ); +mrfZones.addCoriolis(UEqn()); + +pZones.addResistance(UEqn()); + UEqn().relax(); sources.constrain(UEqn()); diff --git a/applications/solvers/incompressible/pimpleFoam/createZones.H b/applications/solvers/incompressible/pimpleFoam/createZones.H new file mode 100644 index 0000000000..fcd02024d5 --- /dev/null +++ b/applications/solvers/incompressible/pimpleFoam/createZones.H @@ -0,0 +1,4 @@ + IOMRFZoneList mrfZones(mesh); + mrfZones.correctBoundaryVelocity(U); + + IOporosityModelList pZones(mesh); diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index 444ad44503..1eb8590552 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -15,6 +15,8 @@ surfaceScalarField phiHbyA adjustPhi(phiHbyA, U, p); +mrfZones.relativeFlux(phiHbyA); + // Non-orthogonal pressure corrector loop while (pimple.correctNonOrthogonal()) { diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index 8d581934fb..d55af57e34 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,10 @@ Description Large time-step transient solver for incompressible, flow using the PIMPLE (merged PISO-SIMPLE) algorithm. - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + Sub-models include: + - turbulence modelling, i.e. laminar, RAS or LES + - porosity (explicit treatment) + - Multiple Reference Frame (MRF) \*---------------------------------------------------------------------------*/ @@ -37,6 +40,8 @@ Description #include "turbulenceModel.H" #include "pimpleControl.H" #include "IObasicSourceList.H" +#include "IOporosityModelList.H" +#include "IOMRFZoneList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,6 +51,7 @@ int main(int argc, char *argv[]) #include "createTime.H" #include "createMesh.H" #include "createFields.H" + #include "createZones.H" #include "initContinuityErrs.H" pimpleControl pimple(mesh); From 044280e4acedb2aeb7c42adb74eb456ce023e5eb Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Nov 2012 18:15:12 +0000 Subject: [PATCH 32/37] ENH: Moved call to constrain to after equation relaxation --- .../solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H index 8c39a839f7..d595a64c8f 100644 --- a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H @@ -10,8 +10,8 @@ mrfZones.addCoriolis(UEqn()); - sources.constrain(UEqn()); - UEqn().relax(); + sources.constrain(UEqn()); + solve(UEqn() == -fvc::grad(p)); From 479b4f3014376a06d16c0ef1550bd77fd92d34ef Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Nov 2012 18:19:14 +0000 Subject: [PATCH 33/37] STYLE: Limit to 80 chars --- .../epsilonLowReWallFunctionFvPatchScalarField.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C index df6e47c0da..279897e833 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonLowReWallFunction/epsilonLowReWallFunctionFvPatchScalarField.C @@ -180,7 +180,8 @@ void epsilonLowReWallFunctionFvPatchScalarField::updateCoeffs() } else { - epsilon[faceCellI] = 2.0*k[faceCellI]*muw[faceI]/rhow[faceI]/sqr(y[faceI]); + epsilon[faceCellI] = + 2.0*k[faceCellI]*muw[faceI]/rhow[faceI]/sqr(y[faceI]); } G[faceCellI] = From 5629516cd2d13a31ac74243014a8a2874d0f2a80 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 30 Nov 2012 13:01:06 +0000 Subject: [PATCH 34/37] BUG: Initialised weightFieldName_ to none --- .../functionObjects/field/fieldValues/cellSource/cellSource.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 799273b4ff..3d7977c488 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -181,7 +181,8 @@ Foam::fieldValues::cellSource::cellSource source_(sourceTypeNames_.read(dict.lookup("source"))), operation_(operationTypeNames_.read(dict.lookup("operation"))), nCells_(0), - cellId_() + cellId_(), + weightFieldName_("none") { read(dict); } From a1af190a995949d4749b46c8787d56447ad2ba3f Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 30 Nov 2012 13:23:33 +0000 Subject: [PATCH 35/37] CoBlended: New surfaceInterpolation scheme which blends any two schemes based on the local Courant number --- src/finiteVolume/Make/files | 1 + .../schemes/CoBlended/CoBlended.C | 36 +++ .../schemes/CoBlended/CoBlended.H | 275 ++++++++++++++++++ 3 files changed, 312 insertions(+) create mode 100644 src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.C create mode 100644 src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 0d510f9019..cdd6a18573 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -243,6 +243,7 @@ $(schemes)/harmonic/harmonic.C $(schemes)/fixedBlended/fixedBlended.C $(schemes)/localBlended/localBlended.C $(schemes)/limiterBlended/limiterBlended.C +$(schemes)/CoBlended/CoBlended.C $(schemes)/localMax/localMax.C $(schemes)/localMin/localMin.C diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.C new file mode 100644 index 0000000000..93a5405206 --- /dev/null +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.C @@ -0,0 +1,36 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "fvMesh.H" +#include "CoBlended.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makeSurfaceInterpolationScheme(CoBlended); +} + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H new file mode 100644 index 0000000000..559853a780 --- /dev/null +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H @@ -0,0 +1,275 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::CoBlended + +Description + Two-scheme Courant number based blending differencing scheme. + + Similar to localBlended but uses a blending factor computed from the + face-based Courant number and the alpha factor supplied: + + weight = 1 - Co/alpha + + The weight applies to the first scheme and 1-factor to the second scheme. + +SourceFiles + CoBlended.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CoBlended_H +#define CoBlended_H + +#include "surfaceInterpolationScheme.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class CoBlended Declaration +\*---------------------------------------------------------------------------*/ + +template +class CoBlended +: + public surfaceInterpolationScheme +{ + // Private data + + const scalar alpha_; + + // Private Member Functions + + //- Scheme 1 + tmp > tScheme1_; + + //- Scheme 2 + tmp > tScheme2_; + + //- The face-flux used to compute the face Courant number + const surfaceScalarField& faceFlux_; + + + //- Disallow default bitwise copy construct + CoBlended(const CoBlended&); + + //- Disallow default bitwise assignment + void operator=(const CoBlended&); + + +public: + + //- Runtime type information + TypeName("CoBlended"); + + + // Constructors + + //- Construct from mesh and Istream. + // The name of the flux field is read from the Istream and looked-up + // from the mesh objectRegistry + CoBlended + ( + const fvMesh& mesh, + Istream& is + ) + : + surfaceInterpolationScheme(mesh), + alpha_(readScalar(is)), + tScheme1_ + ( + surfaceInterpolationScheme::New(mesh, is) + ), + tScheme2_ + ( + surfaceInterpolationScheme::New(mesh, is) + ), + faceFlux_ + ( + mesh.lookupObject + ( + word(is) + ) + ) + { + if (alpha_ <= 0 ) + { + FatalIOErrorIn("CoBlended(const fvMesh&, Istream&)", is) + << "coefficient = " << alpha_ + << " should be > 0" + << exit(FatalIOError); + } + } + + + //- Construct from mesh, faceFlux and Istream + CoBlended + ( + const fvMesh& mesh, + const surfaceScalarField& faceFlux, + Istream& is + ) + : + surfaceInterpolationScheme(mesh), + alpha_(readScalar(is)), + tScheme1_ + ( + surfaceInterpolationScheme::New(mesh, faceFlux, is) + ), + tScheme2_ + ( + surfaceInterpolationScheme::New(mesh, faceFlux, is) + ), + faceFlux_(faceFlux) + { + if (alpha_ <= 0) + { + FatalIOErrorIn("CoBlended(const fvMesh&, Istream&)", is) + << "coefficient = " << alpha_ + << " should be > 0" + << exit(FatalIOError); + } + } + + + // Member Functions + + //- Return the face-based Courant number blending factor + tmp blendingFactor() const + { + const fvMesh& mesh = faceFlux_.mesh(); + + return + ( + max + ( + scalar(1) + - mesh.time().deltaT()*mesh.deltaCoeffs()*faceFlux_ + /(mesh.magSf()*alpha_), + scalar(0) + ) + ); + } + + + //- Return the interpolation weighting factors + tmp + weights + ( + const GeometricField& vf + ) const + { + surfaceScalarField bf(blendingFactor()); + + return + bf*tScheme1_().weights(vf) + + (scalar(1.0) - bf)*tScheme2_().weights(vf); + } + + + //- Return the face-interpolate of the given cell field + // with explicit correction + tmp > + interpolate + ( + const GeometricField& vf + ) const + { + surfaceScalarField bf(blendingFactor()); + + return + bf*tScheme1_().interpolate(vf) + + (scalar(1.0) - bf)*tScheme2_().interpolate(vf); + } + + + //- Return true if this scheme uses an explicit correction + virtual bool corrected() const + { + return tScheme1_().corrected() || tScheme2_().corrected(); + } + + + //- Return the explicit correction to the face-interpolate + // for the given field + virtual tmp > + correction + ( + const GeometricField& vf + ) const + { + surfaceScalarField bf(blendingFactor()); + + if (tScheme1_().corrected()) + { + if (tScheme2_().corrected()) + { + return + ( + bf + * tScheme1_().correction(vf) + + (scalar(1.0) - bf) + * tScheme2_().correction(vf) + ); + } + else + { + return + ( + bf + * tScheme1_().correction(vf) + ); + } + } + else if (tScheme2_().corrected()) + { + return + ( + (scalar(1.0) - bf) + * tScheme2_().correction(vf) + ); + } + else + { + return tmp > + ( + NULL + ); + } + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 1a1c6d392c867575b7303e5c9e8783cf522f1cc8 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 30 Nov 2012 13:24:52 +0000 Subject: [PATCH 36/37] =?UTF-8?q?RAS/kOmegaSST:=20Added=20F3=20coefficient?= =?UTF-8?q?=20for=20rough-walls=20from=20=20=20=20=20=20=20=20=20Hellsten,?= =?UTF-8?q?=20A.=20=20=20=20=20=20=20=20=20"Some=20Improvements=20in=20Men?= =?UTF-8?q?ter=E2=80=99s=20k-omega-SST=20turbulence=20model"=20=20=20=20?= =?UTF-8?q?=20=20=20=20=2029th=20AIAA=20Fluid=20Dynamics=20Conference,=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20AIAA-98-2554,=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20June=201998.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../incompressible/RAS/kOmegaSST/kOmegaSST.C | 25 +++++++++++++++++-- .../incompressible/RAS/kOmegaSST/kOmegaSST.H | 21 +++++++++++----- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index 02899ec4c9..e48bc0ae45 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -85,6 +85,18 @@ tmp kOmegaSST::F2() const } +tmp kOmegaSST::F3() const +{ + tmp arg3 = min + ( + 150*nu()/(omega_*sqr(y_)), + scalar(10) + ); + + return 1 - tanh(pow4(arg3)); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // kOmegaSST::kOmegaSST @@ -188,6 +200,15 @@ kOmegaSST::kOmegaSST 0.31 ) ), + b1_ + ( + dimensioned::lookupOrAddToDict + ( + "b1", + coeffDict_, + 1.0 + ) + ), c1_ ( dimensioned::lookupOrAddToDict @@ -246,7 +267,7 @@ kOmegaSST::kOmegaSST / max ( a1_*omega_, - F2()*sqrt(2.0)*mag(symm(fvc::grad(U_))) + b1_*F2()*F3()*sqrt(2.0)*mag(symm(fvc::grad(U_))) ) ); nut_.correctBoundaryConditions(); @@ -416,7 +437,7 @@ void kOmegaSST::correct() // Re-calculate viscosity - nut_ = a1_*k_/max(a1_*omega_, F2()*sqrt(S2)); + nut_ = a1_*k_/max(a1_*omega_, b1_*F2()*F3()*sqrt(S2)); nut_.correctBoundaryConditions(); } diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H index 7b2580094e..88feb733bc 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.H @@ -24,19 +24,25 @@ License Class Foam::incompressible::RASModels::kOmegaSST -Group - grpIcoRASTurbulence - Description Implementation of the k-omega-SST turbulence model for incompressible flows. Turbulence model described in: \verbatim - Menter, F., Esch, T. - "Elements of Industrial Heat Transfer Prediction" + Menter, F., Esch, T., + "Elements of Industrial Heat Transfer Prediction", 16th Brazilian Congress of Mechanical Engineering (COBEM), - Nov. 2001 + Nov. 2001. + \endverbatim + + with the addition of the F3 term for rough walls from + \verbatim + Hellsten, A. + "Some Improvements in Menter’s k-omega-SST turbulence model" + 29th AIAA Fluid Dynamics Conference, + AIAA-98-2554, + June 1998. \endverbatim Note that this implementation is written in terms of alpha diffusion @@ -69,6 +75,7 @@ Description gamma1 0.5532; gamma2 0.4403; a1 0.31; + b1 1.0; c1 10.0; } \endverbatim @@ -122,6 +129,7 @@ protected: dimensionedScalar betaStar_; dimensionedScalar a1_; + dimensionedScalar b1_; dimensionedScalar c1_; //- Wall distance field @@ -139,6 +147,7 @@ protected: tmp F1(const volScalarField& CDkOmega) const; tmp F2() const; + tmp F3() const; tmp blend ( From 346a4be1b96f4393c95562893aaa573e1d6b1a6e Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 30 Nov 2012 14:22:36 +0000 Subject: [PATCH 37/37] CoBlended: corrected expressions for sign of flux --- .../surfaceInterpolation/schemes/CoBlended/CoBlended.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H index 559853a780..9be5cd0420 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H @@ -168,7 +168,7 @@ public: max ( scalar(1) - - mesh.time().deltaT()*mesh.deltaCoeffs()*faceFlux_ + - mesh.time().deltaT()*mesh.deltaCoeffs()*mag(faceFlux_) /(mesh.magSf()*alpha_), scalar(0) )