From 3d3c95a37a413a4639387f54bf04b0baff47ce20 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 17 Dec 2010 17:32:10 +0100 Subject: [PATCH] COMP: avoid ambiguous construct from tmp - turbulenceModels/incompressible/RAS --- .../incompressible/RAS/LRR/LRR.C | 4 +- .../RAS/LamBremhorstKE/LamBremhorstKE.C | 6 +-- .../RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C | 9 +++-- .../RAS/LaunderSharmaKE/LaunderSharmaKE.C | 6 +-- .../RAS/LienCubicKE/LienCubicKE.C | 2 +- .../RAS/LienCubicKELowRe/LienCubicKELowRe.C | 22 +++++++---- .../LienLeschzinerLowRe/LienLeschzinerLowRe.C | 16 ++++---- .../RAS/NonlinearKEShih/NonlinearKEShih.C | 6 +-- .../RAS/RNGkEpsilon/RNGkEpsilon.C | 11 +++--- .../RAS/SpalartAllmaras/SpalartAllmaras.C | 39 ++++++++++++------- ...ndaryLayerInletEpsilonFvPatchScalarField.C | 2 +- ...daryLayerInletVelocityFvPatchVectorField.C | 4 +- .../fixedShearStressFvPatchVectorField.C | 10 ++--- .../epsilonWallFunctionFvPatchScalarField.C | 2 +- .../nutURoughWallFunctionFvPatchScalarField.C | 6 +-- ...tUSpaldingWallFunctionFvPatchScalarField.C | 4 +- ...UTabulatedWallFunctionFvPatchScalarField.C | 8 ++-- .../nutUWallFunctionFvPatchScalarField.C | 4 +- .../nutkWallFunctionFvPatchScalarField.C | 2 +- .../omegaWallFunctionFvPatchScalarField.C | 2 +- .../RAS/include/nonLinearWallFunctionsI.H | 5 ++- .../incompressible/RAS/kOmegaSST/kOmegaSST.C | 16 ++++---- .../incompressible/RAS/qZeta/qZeta.C | 8 ++-- .../RAS/realizableKE/realizableKE.C | 30 +++++++------- 24 files changed, 126 insertions(+), 98 deletions(-) diff --git a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C index 3950df0e8c..0a834017dc 100644 --- a/src/turbulenceModels/incompressible/RAS/LRR/LRR.C +++ b/src/turbulenceModels/incompressible/RAS/LRR/LRR.C @@ -300,7 +300,7 @@ void LRR::correct() return; } - volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); volScalarField G("RASModel::G", 0.5*mag(tr(P))); // Update epsilon and G at the wall @@ -403,7 +403,7 @@ void LRR::correct() const scalarField& nutw = nut_.boundaryField()[patchi]; - vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + const vectorField snGradU(U_.boundaryField()[patchi].snGrad()); const vectorField& faceAreas = mesh_.Sf().boundaryField()[patchi]; diff --git a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C index 46fc6a8863..3a8919038a 100644 --- a/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C +++ b/src/turbulenceModels/incompressible/RAS/LamBremhorstKE/LamBremhorstKE.C @@ -242,12 +242,12 @@ void LamBremhorstKE::correct() // Calculate parameters and coefficients for low-Reynolds number model Rt_ = sqr(k_)/(nu()*epsilon_); - volScalarField Ry = sqrt(k_)*y_/nu(); + tmp Ry = sqrt(k_)*y_/nu(); fMu_ = sqr(scalar(1) - exp(-0.0165*Ry))*(scalar(1) + 20.5/(Rt_ + SMALL)); - volScalarField f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3); - volScalarField f2 = scalar(1) - exp(-sqr(Rt_)); + tmp f1 = scalar(1) + pow(0.05/(fMu_ + SMALL), 3); + tmp f2 = scalar(1) - exp(-sqr(Rt_)); // Dissipation equation diff --git a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C index a72babb1a0..bdac848e51 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.C @@ -342,7 +342,7 @@ void LaunderGibsonRSTM::correct() yr_.correct(); } - volSymmTensorField P = -twoSymm(R_ & fvc::grad(U_)); + volSymmTensorField P(-twoSymm(R_ & fvc::grad(U_))); volScalarField G("RASModel::G", 0.5*mag(tr(P))); // Update epsilon and G at the wall @@ -388,7 +388,10 @@ void LaunderGibsonRSTM::correct() } } - volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P); + const volSymmTensorField reflect + ( + C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P) + ); tmp REqn ( @@ -451,7 +454,7 @@ void LaunderGibsonRSTM::correct() const scalarField& nutw = nut_.boundaryField()[patchi]; - vectorField snGradU = U_.boundaryField()[patchi].snGrad(); + const vectorField snGradU(U_.boundaryField()[patchi].snGrad()); const vectorField& faceAreas = mesh_.Sf().boundaryField()[patchi]; diff --git a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C index ee34ef8be7..5ee3e2f081 100644 --- a/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C +++ b/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.C @@ -237,12 +237,12 @@ void LaunderSharmaKE::correct() return; } - volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); + tmp S2 = 2*magSqr(symm(fvc::grad(U_))); volScalarField G("RASModel::G", nut_*S2); - volScalarField E = 2.0*nu()*nut_*fvc::magSqrGradGrad(U_); - volScalarField D = 2.0*nu()*magSqr(fvc::grad(sqrt(k_))); + const volScalarField E(2.0*nu()*nut_*fvc::magSqrGradGrad(U_)); + const volScalarField D(2.0*nu()*magSqr(fvc::grad(sqrt(k_)))); // Dissipation rate equation diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C index 0154cf2c8b..f8abb0fd17 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKE/LienCubicKE.C @@ -335,7 +335,7 @@ void LienCubicKE::correct() gradU_ = fvc::grad(U_); // generation term - volScalarField S2 = symm(gradU_) && gradU_; + tmp S2 = symm(gradU_) && gradU_; volScalarField G ( diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C index b961771ea2..91f55f0531 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -409,19 +409,25 @@ void LienCubicKELowRe::correct() gradU_ = fvc::grad(U_); // generation term - volScalarField S2 = symm(gradU_) && gradU_; + tmp S2 = symm(gradU_) && gradU_; yStar_ = sqrt(k_)*y_/nu() + SMALL; - volScalarField Rt = sqr(k_)/(nu()*epsilon_); + tmp Rt = sqr(k_)/(nu()*epsilon_); - volScalarField fMu = + const volScalarField fMu + ( (scalar(1) - exp(-Am_*yStar_)) - /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL); + /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL) + ); + const volScalarField f2 + ( + scalar(1) - 0.3*exp(-sqr(Rt)) + ); - volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt)); - - volScalarField G = - Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_); + volScalarField G + ( + Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_) + ); // Dissipation equation tmp epsEqn diff --git a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C index 4a76228d23..8ab01799de 100644 --- a/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienLeschzinerLowRe/LienLeschzinerLowRe.C @@ -197,7 +197,7 @@ LienLeschzinerLowRe::LienLeschzinerLowRe tmp LienLeschzinerLowRe::R() const { - volTensorField gradU = fvc::grad(U_); + tmp gradU = fvc::grad(U_); return tmp ( @@ -288,19 +288,21 @@ void LienLeschzinerLowRe::correct() scalar Cmu75 = pow(Cmu_.value(), 0.75); - volTensorField gradU = fvc::grad(U_); + const volTensorField gradU(fvc::grad(U_)); // generation term - volScalarField S2 = symm(gradU) && gradU; + tmp S2 = symm(gradU) && gradU; yStar_ = sqrt(k_)*y_/nu() + SMALL; - volScalarField Rt = sqr(k_)/(nu()*epsilon_); + tmp Rt = sqr(k_)/(nu()*epsilon_); - volScalarField fMu = + volScalarField fMu + ( (scalar(1) - exp(-Am_*yStar_)) - /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL); + /(scalar(1) - exp(-Aepsilon_*yStar_) + SMALL) + ); - volScalarField f2 = scalar(1) - 0.3*exp(-sqr(Rt)); + const volScalarField f2(scalar(1) - 0.3*exp(-sqr(Rt))); volScalarField G("RASModel::G", Cmu_*fMu*sqr(k_)/epsilon_*S2); diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C index facd5b4453..41e9a0553e 100644 --- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C @@ -237,8 +237,6 @@ NonlinearKEShih::NonlinearKEShih tmp NonlinearKEShih::R() const { - volTensorField gradU_ = fvc::grad(U_); - return tmp ( new volSymmTensorField @@ -251,7 +249,7 @@ tmp NonlinearKEShih::R() const IOobject::NO_READ, IOobject::NO_WRITE ), - ((2.0/3.0)*I)*k_ - nut_*twoSymm(gradU_) + nonlinearStress_, + ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)) + nonlinearStress_, k_.boundaryField().types() ) ); @@ -328,7 +326,7 @@ void NonlinearKEShih::correct() gradU_ = fvc::grad(U_); // generation term - volScalarField S2 = symm(gradU_) && gradU_; + tmp S2 = symm(gradU_) && gradU_; volScalarField G ( diff --git a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C index b7ecd85483..b8729c00cf 100644 --- a/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/turbulenceModels/incompressible/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -250,13 +250,14 @@ void RNGkEpsilon::correct() return; } - volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); - + const volScalarField S2(2*magSqr(symm(fvc::grad(U_)))); volScalarField G("RASModel::G", nut_*S2); - volScalarField eta = sqrt(S2)*k_/epsilon_; - volScalarField R = - ((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta))); + const volScalarField eta(sqrt(S2)*k_/epsilon_); + volScalarField R + ( + ((eta*(scalar(1) - eta/eta0_))/(scalar(1) + beta_*eta*sqr(eta))) + ); // Update epsilon and G at the wall epsilon_.boundaryField().updateCoeffs(); diff --git a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C index c8d51febd2..a22086cfc9 100644 --- a/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C +++ b/src/turbulenceModels/incompressible/RAS/SpalartAllmaras/SpalartAllmaras.C @@ -50,7 +50,7 @@ tmp SpalartAllmaras::chi() const tmp SpalartAllmaras::fv1(const volScalarField& chi) const { - volScalarField chi3 = pow3(chi); + const volScalarField chi3(pow3(chi)); return chi3/(chi3 + pow3(Cv1_)); } @@ -71,7 +71,7 @@ tmp SpalartAllmaras::fv3 const volScalarField& fv1 ) const { - volScalarField chiByCv2 = (1/Cv2_)*chi; + const volScalarField chiByCv2((1/Cv2_)*chi); return (scalar(1) + chi*fv1) @@ -83,18 +83,25 @@ tmp SpalartAllmaras::fv3 tmp SpalartAllmaras::fw(const volScalarField& Stilda) const { - volScalarField r = min + volScalarField r ( - nuTilda_ - /( - max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL)) - *sqr(kappa_*d_) - ), - scalar(10.0) + min + ( + nuTilda_ + /( + max + ( + Stilda, + dimensionedScalar("SMALL", Stilda.dimensions(), SMALL) + ) + *sqr(kappa_*d_) + ), + scalar(10.0) + ) ); r.boundaryField() == 0.0; - volScalarField g = r + Cw2_*(pow6(r) - r); + const volScalarField g(r + Cw2_*(pow6(r) - r)); return g*pow((1.0 + pow6(Cw3_))/(pow6(g) + pow6(Cw3_)), 1.0/6.0); } @@ -320,7 +327,7 @@ tmp SpalartAllmaras::devReff() const tmp SpalartAllmaras::divDevReff(volVectorField& U) const { - volScalarField nuEff_ = nuEff(); + const volScalarField nuEff_(nuEff()); return ( @@ -368,12 +375,14 @@ void SpalartAllmaras::correct() d_.correct(); } - volScalarField chi = this->chi(); - volScalarField fv1 = this->fv1(chi); + const volScalarField chi(this->chi()); + const volScalarField fv1(this->fv1(chi)); - volScalarField Stilda = + const volScalarField Stilda + ( fv3(chi, fv1)*::sqrt(2.0)*mag(skew(fvc::grad(U_))) - + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_); + + fv2(chi, fv1)*nuTilda_/sqr(kappa_*d_) + ); tmp nuTildaEqn ( diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C index 8e0a748eb9..2a1e75d2e7 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C @@ -130,7 +130,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField void atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs() { const vectorField& c = patch().Cf(); - scalarField coord = (c & z_); + tmp coord = (c & z_); scalarField::operator=(pow3(Ustar_)/(kappa_*(coord - zGround_ + z0_))); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C index f84c650652..c31daa7cb3 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C @@ -145,12 +145,12 @@ atmBoundaryLayerInletVelocityFvPatchVectorField void atmBoundaryLayerInletVelocityFvPatchVectorField::updateCoeffs() { const vectorField& c = patch().Cf(); - scalarField coord = (c & z_); + const scalarField coord(c & z_); scalarField Un(coord.size()); forAll(coord, i) { - if((coord[i] - zGround_) < Href_) + if ((coord[i] - zGround_) < Href_) { Un[i] = (Ustar_/kappa_)*log((coord[i] - zGround_ + z0_)/z0_); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C index 51cc4bf259..993673a4fe 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C @@ -112,23 +112,23 @@ void fixedShearStressFvPatchVectorField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const vectorField Ui = Uw.patchInternalField(); + const vectorField Ui(Uw.patchInternalField()); vector tauHat = tau0_/(mag(tau0_) + ROOTVSMALL); const scalarField& ry = patch().deltaCoeffs(); - scalarField nuEffw = rasModel.nuEff()().boundaryField()[patchI]; + tmp nuEffw = rasModel.nuEff()().boundaryField()[patchI]; - vectorField UwUpdated = + tmp UwUpdated = tauHat*(tauHat & (tau0_*(1.0/(ry*nuEffw)) + Ui)); operator==(UwUpdated); if (debug) { - vectorField nHat = this->patch().nf(); - volSymmTensorField Reff = rasModel.devReff(); + tmp nHat = this->patch().nf(); + volSymmTensorField Reff(rasModel.devReff()); Info << "tau : " << (nHat & Reff.boundaryField()[patchI])() << endl; } 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 79c71668db..8362785332 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -207,7 +207,7 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magGradUw(mag(Uw.snGrad())); // Set epsilon and G forAll(nutw, faceI) 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 af75e4e86c..df297ab9ce 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C @@ -50,7 +50,7 @@ tmp nutURoughWallFunctionFvPatchScalarField::calcNut() const const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; // The flow velocity at the adjacent cell centre - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); tmp tyPlus = calcYPlus(magUp); scalarField& yPlus = tyPlus(); @@ -272,9 +272,9 @@ tmp nutURoughWallFunctionFvPatchScalarField::yPlus() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + tmp magUp = mag(Uw.patchInternalField() - Uw); - return calcYPlus(magUp); + return calcYPlus(magUp()); } 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 75d74dda88..37a0d4b277 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -46,7 +46,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magGradU(mag(Uw.snGrad())); const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; return max @@ -67,7 +67,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patch().index()]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const scalarField& nuw = rasModel.nu().boundaryField()[patch().index()]; const scalarField& nutw = *this; 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 7b2aaae294..9c4e390d9d 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -47,8 +47,8 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField magGradU = mag(Uw.snGrad()); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); + const scalarField magGradU(mag(Uw.snGrad())); const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; return @@ -181,9 +181,9 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const const RASModel& rasModel = db().lookupObject("RASProperties"); const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - const scalarField Rey = magUp*y/nuw; + const scalarField Rey(magUp*y/nuw); return Rey/(calcUPlus(Rey) + ROOTVSMALL); } 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 c37730d697..df736990b8 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C @@ -46,7 +46,7 @@ tmp nutUWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; tmp tyPlus = calcYPlus(magUp); @@ -167,7 +167,7 @@ tmp nutUWallFunctionFvPatchScalarField::yPlus() const const label patchI = patch().index(); const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magUp = mag(Uw.patchInternalField() - Uw); + const scalarField magUp(mag(Uw.patchInternalField() - Uw)); return calcYPlus(magUp); } 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 cc92624701..cc9dd91761 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C @@ -219,7 +219,7 @@ tmp nutkWallFunctionFvPatchScalarField::yPlus() const const tmp tk = rasModel.k(); const volScalarField& k = tk(); - const scalarField kwc = k.boundaryField()[patchI].patchInternalField(); + tmp kwc = k.boundaryField()[patchI].patchInternalField(); const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; return pow025(Cmu_)*y*sqrt(kwc)/nuw; 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 161237264e..4bcac12985 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -212,7 +212,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradUw = mag(Uw.snGrad()); + const scalarField magGradUw(mag(Uw.snGrad())); // Set omega and G forAll(nutw, faceI) diff --git a/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H index 76ef430618..eb49fe0fde 100644 --- a/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H +++ b/src/turbulenceModels/incompressible/RAS/include/nonLinearWallFunctionsI.H @@ -67,7 +67,10 @@ Description const scalarField& nuw = nu().boundaryField()[patchi]; const scalarField& nutw = nut_.boundaryField()[patchi]; - scalarField magFaceGradU = mag(U_.boundaryField()[patchi].snGrad()); + const scalarField magFaceGradU + ( + mag(U_.boundaryField()[patchi].snGrad()) + ); forAll(curPatch, facei) { diff --git a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C index 6dbebeb0d7..b5a1f4317f 100644 --- a/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C +++ b/src/turbulenceModels/incompressible/RAS/kOmegaSST/kOmegaSST.C @@ -46,13 +46,13 @@ addToRunTimeSelectionTable(RASModel, kOmegaSST, dictionary); tmp kOmegaSST::F1(const volScalarField& CDkOmega) const { - volScalarField CDkOmegaPlus = max + tmp CDkOmegaPlus = max ( CDkOmega, dimensionedScalar("1.0e-10", dimless/sqr(dimTime), 1.0e-10) ); - volScalarField arg1 = min + tmp arg1 = min ( min ( @@ -71,7 +71,7 @@ tmp kOmegaSST::F1(const volScalarField& CDkOmega) const tmp kOmegaSST::F2() const { - volScalarField arg2 = min + tmp arg2 = min ( max ( @@ -347,16 +347,18 @@ void kOmegaSST::correct() y_.correct(); } - volScalarField S2 = magSqr(symm(fvc::grad(U_))); + const 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 CDkOmega = - (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_; + const volScalarField CDkOmega + ( + (2*alphaOmega2_)*(fvc::grad(k_) & fvc::grad(omega_))/omega_ + ); - volScalarField F1 = this->F1(CDkOmega); + const volScalarField F1(this->F1(CDkOmega)); // Turbulent frequency equation tmp omegaEqn diff --git a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C index 41929db9fe..547a120e39 100644 --- a/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C +++ b/src/turbulenceModels/incompressible/RAS/qZeta/qZeta.C @@ -46,7 +46,7 @@ addToRunTimeSelectionTable(RASModel, qZeta, dictionary); tmp qZeta::fMu() const { - volScalarField Rt = q_*k_/(2.0*nu()*zeta_); + const volScalarField Rt(q_*k_/(2.0*nu()*zeta_)); if (anisotropic_) { @@ -63,7 +63,7 @@ tmp qZeta::fMu() const tmp qZeta::f2() const { - volScalarField Rt = q_*k_/(2.0*nu()*zeta_); + tmp Rt = q_*k_/(2.0*nu()*zeta_); return scalar(1) - 0.3*exp(-sqr(Rt)); } @@ -293,10 +293,10 @@ void qZeta::correct() return; } - volScalarField S2 = 2*magSqr(symm(fvc::grad(U_))); + tmp S2 = 2*magSqr(symm(fvc::grad(U_))); volScalarField G("RASModel::G", nut_/(2.0*q_)*S2); - volScalarField E = nu()*nut_/q_*fvc::magSqrGradGrad(U_); + const volScalarField E(nu()*nut_/q_*fvc::magSqrGradGrad(U_)); // Zeta equation diff --git a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C index 5f870de0a7..dd44980aaa 100644 --- a/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C +++ b/src/turbulenceModels/incompressible/RAS/realizableKE/realizableKE.C @@ -54,19 +54,23 @@ tmp realizableKE::rCmu tmp tS = dev(symm(gradU)); const volSymmTensorField& S = tS(); - volScalarField W = + tmp W + ( (2*sqrt(2.0))*((S&S)&&S) /( magS*S2 + dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL) - ); + ) + ); tS.clear(); - volScalarField phis = - (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))); - volScalarField As = sqrt(6.0)*cos(phis); - volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU))); + tmp phis + ( + (1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1))) + ); + tmp As = sqrt(6.0)*cos(phis); + tmp Us = sqrt(S2/2.0 + magSqr(skew(gradU))); return 1.0/(A0_ + As*Us*k_/epsilon_); } @@ -77,8 +81,8 @@ tmp realizableKE::rCmu const volTensorField& gradU ) { - volScalarField S2 = 2*magSqr(dev(symm(gradU))); - volScalarField magS = sqrt(S2); + const volScalarField S2(2*magSqr(dev(symm(gradU)))); + tmp magS = sqrt(S2); return rCmu(gradU, S2, magS); } @@ -270,12 +274,12 @@ void realizableKE::correct() return; } - volTensorField gradU = fvc::grad(U_); - volScalarField S2 = 2*magSqr(dev(symm(gradU))); - volScalarField magS = sqrt(S2); + const volTensorField gradU(fvc::grad(U_)); + const volScalarField S2(2*magSqr(dev(symm(gradU)))); + const volScalarField magS(sqrt(S2)); - volScalarField eta = magS*k_/epsilon_; - volScalarField C1 = max(eta/(scalar(5) + eta), scalar(0.43)); + const volScalarField eta(magS*k_/epsilon_); + tmp C1 = max(eta/(scalar(5) + eta), scalar(0.43)); volScalarField G("RASModel::G", nut_*S2);