diff --git a/applications/solvers/DNS/dnsFoam/dnsFoam.C b/applications/solvers/DNS/dnsFoam/dnsFoam.C index 34f212bc4d..73455c005d 100644 --- a/applications/solvers/DNS/dnsFoam/dnsFoam.C +++ b/applications/solvers/DNS/dnsFoam/dnsFoam.C @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) for (int corr=1; corr<=1; corr++) { - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) diff --git a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H index ba1d5dcd80..0d6b417d5a 100644 --- a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H +++ b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H @@ -12,8 +12,10 @@ ) ); - volVectorField force = - U/dimensionedScalar("dt", dimTime, runTime.deltaTValue()); + volVectorField force + ( + U/dimensionedScalar("dt", dimTime, runTime.deltaTValue()) + ); Kmesh K(mesh); UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties); diff --git a/applications/solvers/basic/laplacianFoam/write.H b/applications/solvers/basic/laplacianFoam/write.H index a3cec5419f..47aa182c0a 100644 --- a/applications/solvers/basic/laplacianFoam/write.H +++ b/applications/solvers/basic/laplacianFoam/write.H @@ -1,6 +1,6 @@ if (runTime.outputTime()) { - volVectorField gradT = fvc::grad(T); + volVectorField gradT(fvc::grad(T)); volScalarField gradTx ( diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C index 8d1053ca1e..a8827a6e52 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(basicSubGrid, 0); addToRunTimeSelectionTable(XiEqModel, basicSubGrid, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -123,20 +123,24 @@ Foam::tmp Foam::XiEqModels::basicSubGrid::XiEq() const const objectRegistry& db = Su_.db(); const volVectorField& U = db.lookupObject("U"); - volScalarField magU = mag(U); - volVectorField Uhat = - U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4)); + volScalarField magU(mag(U)); + volVectorField Uhat + ( + U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4)) + ); - volScalarField n = max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4)); + volScalarField n(max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4))); - volScalarField b = (Uhat & B_ & Uhat)/n; + volScalarField b((Uhat & B_ & Uhat)/n); - volScalarField up = sqrt((2.0/3.0)*turbulence_.k()); + volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); - volScalarField XiSubEq = + volScalarField XiSubEq + ( scalar(1) + max(2.2*sqrt(b), min(0.34*magU/up, scalar(1.6))) - *min(0.25*n, scalar(1)); + *min(0.25*n, scalar(1)) + ); return XiSubEq*XiEqModel_->XiEq(); } diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index 8c5ec52bed..a978b12877 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -78,7 +78,7 @@ void PDRkEpsilon::correct() RASModel::correct(); - volScalarField divU = fvc::div(phi_/fvc::interpolate(rho_)); + volScalarField divU(fvc::div(phi_/fvc::interpolate(rho_))); if (mesh_.moving()) { @@ -99,7 +99,7 @@ void PDRkEpsilon::correct() const PDRDragModel& drag = U_.db().lookupObject("PDRDragModel"); - volScalarField GR = drag.Gk(); + volScalarField GR(drag.Gk()); // Dissipation equation tmp epsEqn diff --git a/applications/solvers/combustion/PDRFoam/StCourantNo.H b/applications/solvers/combustion/PDRFoam/StCourantNo.H index 8fac05d81c..f1e3dc9916 100644 --- a/applications/solvers/combustion/PDRFoam/StCourantNo.H +++ b/applications/solvers/combustion/PDRFoam/StCourantNo.H @@ -34,9 +34,11 @@ Description if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( fvc::surfaceSum(mag(phiSt))().internalField() - /rho.internalField(); + / rho.internalField() + ); StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/combustion/PDRFoam/UEqn.H b/applications/solvers/combustion/PDRFoam/UEqn.H index aea6ad9a46..deb00a3121 100644 --- a/applications/solvers/combustion/PDRFoam/UEqn.H +++ b/applications/solvers/combustion/PDRFoam/UEqn.H @@ -7,7 +7,7 @@ betav*rho*g ); - volSymmTensorField invA = inv(I*UEqn.A() + drag->Dcu()); + volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu())); if (momentumPredictor) { diff --git a/applications/solvers/combustion/PDRFoam/XiEqns b/applications/solvers/combustion/PDRFoam/XiEqns deleted file mode 100644 index 8de3bffe4b..0000000000 --- a/applications/solvers/combustion/PDRFoam/XiEqns +++ /dev/null @@ -1,91 +0,0 @@ - // Calculate Xi according to the selected flame wrinkling model - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // Calculate coefficients for Gulder's flame speed correlation - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - volScalarField up = uPrimeCoef*sqrt((2.0/3.0)*k); - volScalarField epsilonPlus = pow(uPrimeCoef, 3)*epsilon; - - volScalarField tauEta = sqrt(mag(thermo->muu()/(rhou*epsilonPlus))); - volScalarField Reta = up/ - ( - sqrt(epsilonPlus*tauEta) - + dimensionedScalar("1e-8", up.dimensions(), 1e-8) - ); - - else if (XiModel == "algebraic") - { - // Simple algebraic model for Xi based on Gulders correlation - // with a linear correction function to give a plausible profile for Xi - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField GEta = GEtaCoef/tauEta; - volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta; - - volScalarField R = - GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999); - - volScalarField XiEqStar = R/(R - GEta - GIn); - - //- Calculate the unweighted b - //volScalarField Rrho = thermo->rhou()/thermo->rhob(); - //volScalarField bbar = b/(b + (Rrho*(1.0 - b))); - - Xi == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0); - } - else if (XiModel == "transport") - { - // Calculate Xi transport coefficients based on Gulders correlation - // and DNS data for the rate of generation - // with a linear correction function to give a plausible profile for Xi - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField GEta = GEtaCoef/tauEta; - volScalarField XiEqEta = 1.0 + XiCoef*sqrt(up/(Su + SuMin))*Reta; - - volScalarField R = - GEta*XiEqEta/(XiEqEta - 0.999) + GIn*XiIn/(XiIn - 0.999); - - volScalarField XiEqStar = R/(R - GEta - GIn); - - volScalarField XiEq = - 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b))*(XiEqStar - 1.0); - - volScalarField G = R*(XiEq - 1.0)/XiEq; - - // Calculate Xi flux - // ~~~~~~~~~~~~~~~~~ - surfaceScalarField phiXi = - phiSt - + ( - - fvc::interpolate(fvc::laplacian(Dbf, b)/mgb)*nf - + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf - ); - - - // Solve for the flame wrinkling - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - solve - ( - betav*fvm::ddt(rho, Xi) - + mvConvection->fvmDiv(phi, Xi) - + fvm::div(phiXi, Xi, "div(phiXi,Xi)") - - fvm::Sp(fvc::div(phiXi), Xi) - == - betav*rho*R - - fvm::Sp(betav*rho*(R - G), Xi) - ); - - - // Correct boundedness of Xi - // ~~~~~~~~~~~~~~~~~~~~~~~~~ - Xi.max(1.0); - Xi = min(Xi, 2.0*XiEq); - Info<< "max(Xi) = " << max(Xi).value() << endl; - Info<< "max(XiEq) = " << max(XiEq).value() << endl; - } - else - { - FatalError - << args.executable() << " : Unknown Xi model " << XiModel - << abort(FatalError); - } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C index bfd6dee810..00e6e20cee 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/Gulder/Gulder.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(Gulder, 0); addToRunTimeSelectionTable(XiEqModel, Gulder, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -64,15 +64,18 @@ Foam::XiEqModels::Gulder::~Gulder() Foam::tmp Foam::XiEqModels::Gulder::XiEq() const { - volScalarField up = sqrt((2.0/3.0)*turbulence_.k()); + volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); const volScalarField& epsilon = turbulence_.epsilon(); - volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))); + volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)))); - volScalarField Reta = up/ + volScalarField Reta ( - sqrt(epsilon*tauEta) - + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + up + / ( + sqrt(epsilon*tauEta) + + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + ) ); return 1.0 + XiEqCoef*sqrt(up/(Su_ + SuMin))*Reta; diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C index a59abab698..50d2ddb8b6 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(SCOPEXiEq, 0); addToRunTimeSelectionTable(XiEqModel, SCOPEXiEq, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -83,13 +83,13 @@ Foam::tmp Foam::XiEqModels::SCOPEXiEq::XiEq() const const volScalarField& k = turbulence_.k(); const volScalarField& epsilon = turbulence_.epsilon(); - volScalarField up = sqrt((2.0/3.0)*k); - volScalarField l = (lCoef*sqrt(3.0/2.0))*up*k/epsilon; - volScalarField Rl = up*l*thermo_.rhou()/thermo_.muu(); + volScalarField up(sqrt((2.0/3.0)*k)); + volScalarField l((lCoef*sqrt(3.0/2.0))*up*k/epsilon); + volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu()); - volScalarField upBySu = up/(Su_ + SuMin); - volScalarField K = 0.157*upBySu/sqrt(Rl); - volScalarField Ma = MaModel.Ma(); + volScalarField upBySu(up/(Su_ + SuMin)); + volScalarField K(0.157*upBySu/sqrt(Rl)); + volScalarField Ma(MaModel.Ma()); tmp tXiEq ( diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C index 4fde0ef168..4129140343 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C @@ -34,8 +34,8 @@ namespace XiEqModels { defineTypeNameAndDebug(instability, 0); addToRunTimeSelectionTable(XiEqModel, instability, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -64,7 +64,7 @@ Foam::XiEqModels::instability::~instability() Foam::tmp Foam::XiEqModels::instability::XiEq() const { - volScalarField turbXiEq = XiEqModel_->XiEq(); + volScalarField turbXiEq(XiEqModel_->XiEq()); return XiEqIn/turbXiEq + turbXiEq; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C index ab94c070b1..c5c2a8b059 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/KTS/KTS.C @@ -34,8 +34,8 @@ namespace XiGModels { defineTypeNameAndDebug(KTS, 0); addToRunTimeSelectionTable(XiGModel, KTS, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -63,10 +63,11 @@ Foam::XiGModels::KTS::~KTS() Foam::tmp Foam::XiGModels::KTS::G() const { - volScalarField up = sqrt((2.0/3.0)*turbulence_.k()); + // volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); const volScalarField& epsilon = turbulence_.epsilon(); - volScalarField tauEta = sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))); + tmp tauEta = + sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))); return GEtaCoef/tauEta; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C index 33c5163056..46182d1686 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C @@ -65,7 +65,7 @@ Foam::XiGModels::instabilityG::~instabilityG() Foam::tmp Foam::XiGModels::instabilityG::G() const { - volScalarField turbXiG = XiGModel_->G(); + volScalarField turbXiG(XiGModel_->G()); return GIn*GIn/(GIn + turbXiG) + turbXiG; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C index 0beca272cc..893a6b4548 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/algebraic/algebraic.C @@ -34,8 +34,8 @@ namespace XiModels { defineTypeNameAndDebug(algebraic, 0); addToRunTimeSelectionTable(XiModel, algebraic, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -74,12 +74,12 @@ Foam::tmp Foam::XiModels::algebraic::Db() const void Foam::XiModels::algebraic::correct() { - volScalarField XiEqEta = XiEqModel_->XiEq(); - volScalarField GEta = XiGModel_->G(); + volScalarField XiEqEta(XiEqModel_->XiEq()); + volScalarField GEta(XiGModel_->G()); - volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999); + volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999)); - volScalarField XiEqStar = R/(R - GEta); + volScalarField XiEqStar(R/(R - GEta)); Xi_ == 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C index 782638ef1c..7fd6a6a334 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/transport/transport.C @@ -34,8 +34,8 @@ namespace XiModels { defineTypeNameAndDebug(transport, 0); addToRunTimeSelectionTable(XiModel, transport, dictionary); -}; -}; +} +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -77,17 +77,19 @@ void Foam::XiModels::transport::correct const fv::convectionScheme& mvConvection ) { - volScalarField XiEqEta = XiEqModel_->XiEq(); - volScalarField GEta = XiGModel_->G(); + volScalarField XiEqEta(XiEqModel_->XiEq()); + volScalarField GEta(XiGModel_->G()); - volScalarField R = GEta*XiEqEta/(XiEqEta - 0.999); + volScalarField R(GEta*XiEqEta/(XiEqEta - 0.999)); - volScalarField XiEqStar = R/(R - GEta); + volScalarField XiEqStar(R/(R - GEta)); - volScalarField XiEq = - 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0); + volScalarField XiEq + ( + 1.0 + (1.0 + (2*XiShapeCoef)*(0.5 - b_))*(XiEqStar - 1.0) + ); - volScalarField G = R*(XiEq - 1.0)/XiEq; + volScalarField G(R*(XiEq - 1.0)/XiEq); const objectRegistry& db = b_.db(); const volScalarField& betav = db.lookupObject("betav"); diff --git a/applications/solvers/combustion/PDRFoam/bEqn.H b/applications/solvers/combustion/PDRFoam/bEqn.H index cb44931540..bdc21c1bab 100644 --- a/applications/solvers/combustion/PDRFoam/bEqn.H +++ b/applications/solvers/combustion/PDRFoam/bEqn.H @@ -25,20 +25,20 @@ if (ign.ignited()) // Unburnt gas density // ~~~~~~~~~~~~~~~~~~~ - volScalarField rhou = thermo.rhou(); + volScalarField rhou(thermo.rhou()); // Calculate flame normal etc. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - //volVectorField n = fvc::grad(b); - volVectorField n = fvc::reconstruct(fvc::snGrad(b)*mesh.magSf()); + // volVectorField n(fvc::grad(b)); + volVectorField n(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf())); volScalarField mgb("mgb", mag(n)); dimensionedScalar dMgb("dMgb", mgb.dimensions(), SMALL); { - volScalarField bc = b*c; + volScalarField bc(b*c); dMgb += 1.0e-3* (bc*mgb)().weightedAverage(mesh.V()) @@ -47,8 +47,8 @@ if (ign.ignited()) mgb += dMgb; - surfaceVectorField Sfhat = mesh.Sf()/mesh.magSf(); - surfaceVectorField nfVec = fvc::interpolate(n); + surfaceVectorField Sfhat(mesh.Sf()/mesh.magSf()); + surfaceVectorField nfVec(fvc::interpolate(n)); nfVec += Sfhat*(fvc::snGrad(b) - (Sfhat & nfVec)); nfVec /= (mag(nfVec) + dMgb); surfaceScalarField nf("nf", mesh.Sf() & nfVec); diff --git a/applications/solvers/combustion/PDRFoam/pEqn.H b/applications/solvers/combustion/PDRFoam/pEqn.H index 9042837f54..9488e60e72 100644 --- a/applications/solvers/combustion/PDRFoam/pEqn.H +++ b/applications/solvers/combustion/PDRFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = invA & UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index d93311ece1..e4a2f1ac39 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -2,18 +2,18 @@ if (ign.ignited()) { // progress variable // ~~~~~~~~~~~~~~~~~ - volScalarField c = scalar(1) - b; + volScalarField c(scalar(1) - b); // Unburnt gas density // ~~~~~~~~~~~~~~~~~~~ - volScalarField rhou = thermo.rhou(); + volScalarField rhou(thermo.rhou()); // Calculate flame normal etc. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volVectorField n = fvc::grad(b); + volVectorField n(fvc::grad(b)); - volScalarField mgb = mag(n); + volScalarField mgb(mag(n)); dimensionedScalar dMgb = 1.0e-3* (b*c*mgb)().weightedAverage(mesh.V()) @@ -22,11 +22,11 @@ if (ign.ignited()) mgb += dMgb; - surfaceVectorField SfHat = mesh.Sf()/mesh.magSf(); - surfaceVectorField nfVec = fvc::interpolate(n); + surfaceVectorField SfHat(mesh.Sf()/mesh.magSf()); + surfaceVectorField nfVec(fvc::interpolate(n)); nfVec += SfHat*(fvc::snGrad(b) - (SfHat & nfVec)); nfVec /= (mag(nfVec) + dMgb); - surfaceScalarField nf = (mesh.Sf() & nfVec); + surfaceScalarField nf((mesh.Sf() & nfVec)); n /= mgb; @@ -34,7 +34,7 @@ if (ign.ignited()) // Calculate turbulent flame speed flux // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - surfaceScalarField phiSt = fvc::interpolate(rhou*StCorr*Su*Xi)*nf; + surfaceScalarField phiSt(fvc::interpolate(rhou*StCorr*Su*Xi)*nf); scalar StCoNum = max ( @@ -71,16 +71,20 @@ if (ign.ignited()) // Calculate coefficients for Gulder's flame speed correlation // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField up = uPrimeCoef*sqrt((2.0/3.0)*turbulence->k()); - //volScalarField up = sqrt(mag(diag(n * n) & diag(turbulence->r()))); + volScalarField up(uPrimeCoef*sqrt((2.0/3.0)*turbulence->k())); + //volScalarField up(sqrt(mag(diag(n * n) & diag(turbulence->r())))); - volScalarField epsilon = pow(uPrimeCoef, 3)*turbulence->epsilon(); + volScalarField epsilon(pow(uPrimeCoef, 3)*turbulence->epsilon()); - volScalarField tauEta = sqrt(thermo.muu()/(rhou*epsilon)); + volScalarField tauEta(sqrt(thermo.muu()/(rhou*epsilon))); - volScalarField Reta = up/ + volScalarField Reta ( - sqrt(epsilon*tauEta) + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + up + / ( + sqrt(epsilon*tauEta) + + dimensionedScalar("1e-8", up.dimensions(), 1e-8) + ) ); //volScalarField l = 0.337*k*sqrt(k)/epsilon; @@ -88,34 +92,38 @@ if (ign.ignited()) // Calculate Xi flux // ~~~~~~~~~~~~~~~~~ - surfaceScalarField phiXi = + surfaceScalarField phiXi + ( phiSt - fvc::interpolate(fvc::laplacian(turbulence->alphaEff(), b)/mgb)*nf - + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf; + + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf + ); // Calculate mean and turbulent strain rates // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volVectorField Ut = U + Su*Xi*n; - volScalarField sigmat = (n & n)*fvc::div(Ut) - (n & fvc::grad(Ut) & n); + volVectorField Ut(U + Su*Xi*n); + volScalarField sigmat((n & n)*fvc::div(Ut) - (n & fvc::grad(Ut) & n)); - volScalarField sigmas = + volScalarField sigmas + ( ((n & n)*fvc::div(U) - (n & fvc::grad(U) & n))/Xi + ( (n & n)*fvc::div(Su*n) - (n & fvc::grad(Su*n) & n) - )*(Xi + scalar(1))/(2*Xi); + )*(Xi + scalar(1))/(2*Xi) + ); // Calculate the unstrained laminar flame speed // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField Su0 = unstrainedLaminarFlameSpeed()(); + volScalarField Su0(unstrainedLaminarFlameSpeed()()); // Calculate the laminar flame speed in equilibrium with the applied strain // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField SuInf = Su0*max(scalar(1) - sigmas/sigmaExt, scalar(0.01)); + volScalarField SuInf(Su0*max(scalar(1) - sigmas/sigmaExt, scalar(0.01))); if (SuModel == "unstrained") { @@ -130,9 +138,11 @@ if (ign.ignited()) // Solve for the strained laminar flame speed // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField Rc = + volScalarField Rc + ( (sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt) - /(sqr(Su0 - SuInf) + sqr(SuMin)); + /(sqr(Su0 - SuInf) + sqr(SuMin)) + ); fvScalarMatrix SuEqn ( @@ -183,17 +193,21 @@ if (ign.ignited()) // with a linear correction function to give a plausible profile for Xi // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - volScalarField XiEqStar = - scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta; + volScalarField XiEqStar + ( + scalar(1.001) + XiCoef*sqrt(up/(Su + SuMin))*Reta + ); - volScalarField XiEq = + volScalarField XiEq + ( scalar(1.001) + (scalar(1) + (2*XiShapeCoef)*(scalar(0.5) - b)) - *(XiEqStar - scalar(1.001)); + *(XiEqStar - scalar(1.001)) + ); - volScalarField Gstar = 0.28/tauEta; - volScalarField R = Gstar*XiEqStar/(XiEqStar - scalar(1)); - volScalarField G = R*(XiEq - scalar(1.001))/XiEq; + volScalarField Gstar(0.28/tauEta); + volScalarField R(Gstar*XiEqStar/(XiEqStar - scalar(1))); + volScalarField G(R*(XiEq - scalar(1.001))/XiEq); //R *= (Gstar + 2*mag(dev(symm(fvc::grad(U)))))/Gstar; diff --git a/applications/solvers/combustion/XiFoam/createFields.H b/applications/solvers/combustion/XiFoam/createFields.H index ef16bd615c..7a7e796b62 100644 --- a/applications/solvers/combustion/XiFoam/createFields.H +++ b/applications/solvers/combustion/XiFoam/createFields.H @@ -61,8 +61,10 @@ ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); Info<< "Creating field Xi\n" << endl; diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index 3d414f4af6..4168eb0e34 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/coldEngineFoam/createFields.H b/applications/solvers/combustion/coldEngineFoam/createFields.H index 6bc3139ce6..9705f04525 100644 --- a/applications/solvers/combustion/coldEngineFoam/createFields.H +++ b/applications/solvers/combustion/coldEngineFoam/createFields.H @@ -55,5 +55,7 @@ ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); diff --git a/applications/solvers/combustion/dieselEngineFoam/YEqn.H b/applications/solvers/combustion/dieselEngineFoam/YEqn.H index f6251d1c30..b8d39b4f46 100644 --- a/applications/solvers/combustion/dieselEngineFoam/YEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/YEqn.H @@ -12,7 +12,7 @@ tmp > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H index 37aeca4c09..4bd9f1a916 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createFields.H +++ b/applications/solvers/combustion/dieselEngineFoam/createFields.H @@ -82,8 +82,10 @@ autoPtr turbulence ); Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); multivariateSurfaceInterpolationScheme::fieldTable fields; diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index 8ea5d32e5f..649c732810 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -94,11 +94,13 @@ int main(int argc, char *argv[]) // turbulent time scale { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc(chemistry.tc()); - //Chalmers PaSR model + // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); } diff --git a/applications/solvers/combustion/dieselEngineFoam/pEqn.H b/applications/solvers/combustion/dieselEngineFoam/pEqn.H index b68ae73296..049db9d250 100644 --- a/applications/solvers/combustion/dieselEngineFoam/pEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField A = UEqn.A(); +volScalarField A(UEqn.A()); U = UEqn.H()/A; if (transonic) diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index 3bbebfd5ff..8d9e20e623 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -85,9 +85,11 @@ int main(int argc, char *argv[]) // turbulent time scale { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc(chemistry.tc()); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT()+tc+tk); diff --git a/applications/solvers/combustion/dieselFoam/pEqn.H b/applications/solvers/combustion/dieselFoam/pEqn.H index f1b66877a0..cb9f95c03f 100644 --- a/applications/solvers/combustion/dieselFoam/pEqn.H +++ b/applications/solvers/combustion/dieselFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index 913180f794..78a90c2357 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C index ddfecc74b0..053f0511c3 100644 --- a/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C +++ b/applications/solvers/combustion/fireFoam/combustionModels/combustionModel/combustionModel.C @@ -32,7 +32,7 @@ namespace Foam { defineTypeNameAndDebug(combustionModel, 0); defineRunTimeSelectionTable(combustionModel, dictionary); -}; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -78,8 +78,8 @@ Foam::combustionModel::combustionModel::R(volScalarField& fu) const { const basicMultiComponentMixture& composition = thermo_.composition(); const volScalarField& ft = composition.Y("ft"); - volScalarField fres = composition.fres(ft, stoicRatio_.value()); - volScalarField wFuelNorm = this->wFuelNorm()*pos(fu - fres); + volScalarField fres(composition.fres(ft, stoicRatio_.value())); + volScalarField wFuelNorm(this->wFuelNorm()*pos(fu - fres)); return wFuelNorm*fres - fvm::Sp(wFuelNorm, fu); } diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 6a1a40b777..73686c5668 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -123,8 +123,10 @@ volScalarField dQ Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); dimensionedScalar initialMass = fvc::domainIntegrate(rho); diff --git a/applications/solvers/combustion/fireFoam/fuhsEqn.H b/applications/solvers/combustion/fireFoam/fuhsEqn.H index 798cee4007..6494ead4f4 100644 --- a/applications/solvers/combustion/fireFoam/fuhsEqn.H +++ b/applications/solvers/combustion/fireFoam/fuhsEqn.H @@ -1,7 +1,7 @@ { // Solve fuel equation // ~~~~~~~~~~~~~~~~~~~ - fvScalarMatrix R = combustion->R(fu); + fvScalarMatrix R(combustion->R(fu)); { fvScalarMatrix fuEqn diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 135b55d879..e0d120e9e3 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn.H(); @@ -17,7 +17,7 @@ phi = phiU - rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - surfaceScalarField rhorAUf = fvc::interpolate(rho*rAU); + surfaceScalarField rhorAUf(fvc::interpolate(rho*rAU)); fvScalarMatrix p_rghEqn ( diff --git a/applications/solvers/combustion/reactingFoam/YEqn.H b/applications/solvers/combustion/reactingFoam/YEqn.H index 76d8253795..8d63a12868 100644 --- a/applications/solvers/combustion/reactingFoam/YEqn.H +++ b/applications/solvers/combustion/reactingFoam/YEqn.H @@ -11,7 +11,7 @@ tmp > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/combustion/reactingFoam/chemistry.H b/applications/solvers/combustion/reactingFoam/chemistry.H index d7faf86b0c..3a36aaac52 100644 --- a/applications/solvers/combustion/reactingFoam/chemistry.H +++ b/applications/solvers/combustion/reactingFoam/chemistry.H @@ -10,9 +10,14 @@ // turbulent time scale if (turbulentReaction) { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc + ( + chemistry.tc() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index bd8f7ea1fb..a2f016e046 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -72,8 +72,10 @@ autoPtr turbulence ); Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); multivariateSurfaceInterpolationScheme::fieldTable fields; diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 3d414f4af6..4168eb0e34 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/combustion/rhoReactingFoam/YEqn.H b/applications/solvers/combustion/rhoReactingFoam/YEqn.H index 76d8253795..8d63a12868 100644 --- a/applications/solvers/combustion/rhoReactingFoam/YEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/YEqn.H @@ -11,7 +11,7 @@ tmp > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/combustion/rhoReactingFoam/chemistry.H b/applications/solvers/combustion/rhoReactingFoam/chemistry.H index 8bfa872d7b..841b434a71 100644 --- a/applications/solvers/combustion/rhoReactingFoam/chemistry.H +++ b/applications/solvers/combustion/rhoReactingFoam/chemistry.H @@ -10,9 +10,11 @@ // turbulent time scale if (turbulentReaction) { - volScalarField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - volScalarField tc = chemistry.tc(); + volScalarField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + volScalarField tc(chemistry.tc()); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H index d4119b8c92..d58e082f5b 100644 --- a/applications/solvers/combustion/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -73,8 +73,10 @@ autoPtr turbulence ); Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); +volScalarField DpDt +( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) +); multivariateSurfaceInterpolationScheme::fieldTable fields; diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H index 45ae3c1e5f..f11c979224 100644 --- a/applications/solvers/combustion/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -5,14 +5,16 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) { - surfaceScalarField phiv = + surfaceScalarField phiv + ( (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi); + + fvc::ddtPhiCorr(rAU, rho, U, phi) + ); phi = fvc::interpolate(rho)*phiv; diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index 08c4354c3a..92f25ca30d 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -181,13 +181,16 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs() ) ); - Field C2 = pmu/prho + Field C2 + ( + pmu/prho *sqrt(ppsi*constant::mathematical::piByTwo) *2.0*gamma_/Pr.value()/(gamma_ + 1.0) - *(2.0 - accommodationCoeff_)/accommodationCoeff_; + *(2.0 - accommodationCoeff_)/accommodationCoeff_ + ); - Field aCoeff = prho.snGrad() - prho/C2; - Field KEbyRho = 0.5*magSqr(pU); + Field aCoeff(prho.snGrad() - prho/C2); + Field KEbyRho(0.5*magSqr(pU)); valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C2)); refValue() = Twall_; @@ -214,9 +217,11 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const namespace Foam { - -makePatchTypeField(fvPatchScalarField, smoluchowskiJumpTFvPatchScalarField); - + makeNonTemplatedPatchTypeField + ( + fvPatchScalarField, + smoluchowskiJumpTFvPatchScalarField + ); } diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 4962a338a1..85f2db8d4c 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -83,8 +83,7 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField if ( mag(accommodationCoeff_) < SMALL - || - mag(accommodationCoeff_) > 2.0 + || mag(accommodationCoeff_) > 2.0 ) { FatalIOErrorIn @@ -142,10 +141,13 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() const fvPatchField& ppsi = patch().lookupPatchField("psi"); - Field C1 = sqrt(ppsi*constant::mathematical::piByTwo) - *(2.0 - accommodationCoeff_)/accommodationCoeff_; + Field C1 + ( + sqrt(ppsi*constant::mathematical::piByTwo) + * (2.0 - accommodationCoeff_)/accommodationCoeff_ + ); - Field pnu = pmu/prho; + Field pnu(pmu/prho); valueFraction() = (1.0/(1.0 + patch().deltaCoeffs()*C1*pnu)); refValue() = Uwall_; @@ -156,8 +158,8 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() this->db().objectRegistry::lookupObject("T"); label patchi = this->patch().index(); const fvPatchScalarField& pT = vsfT.boundaryField()[patchi]; - Field gradpT = fvc::grad(vsfT)().boundaryField()[patchi]; - vectorField n = patch().nf(); + Field gradpT(fvc::grad(vsfT)().boundaryField()[patchi]); + vectorField n(patch().nf()); refValue() -= 3.0*pnu/(4.0*pT)*transform(I - n*n, gradpT); } @@ -166,7 +168,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() { const fvPatchTensorField& ptauMC = patch().lookupPatchField("tauMC"); - vectorField n = patch().nf(); + vectorField n(patch().nf()); refValue() -= C1/prho*transform(I - n*n, (n & ptauMC)); } @@ -196,7 +198,11 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchVectorField, maxwellSlipUFvPatchVectorField); +makeNonTemplatedPatchTypeField +( + fvPatchVectorField, + maxwellSlipUFvPatchVectorField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C index 253b2c8af1..7383a3a585 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchField.C @@ -135,8 +135,8 @@ void mixedFixedValueSlipFvPatchField::rmap template tmp > mixedFixedValueSlipFvPatchField::snGrad() const { - vectorField nHat = this->patch().nf(); - Field pif = this->patchInternalField(); + tmp nHat = this->patch().nf(); + Field pif(this->patchInternalField()); return ( @@ -155,7 +155,7 @@ void mixedFixedValueSlipFvPatchField::evaluate(const Pstream::commsTypes) this->updateCoeffs(); } - vectorField nHat = this->patch().nf(); + vectorField nHat(this->patch().nf()); Field::operator= ( @@ -174,7 +174,7 @@ template tmp > mixedFixedValueSlipFvPatchField::snGradTransformDiag() const { - vectorField nHat = this->patch().nf(); + vectorField nHat(this->patch().nf()); vectorField diag(nHat.size()); diag.replace(vector::X, mag(nHat.component(vector::X))); diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H index 142ed89fc2..4db898b925 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.H @@ -36,7 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeFieldTypedefs(mixedFixedValueSlip) +makePatchTypeFieldTypedefs(mixedFixedValueSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H index 818cb7ecaa..00aedf3f04 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/mixedFixedValueSlip/mixedFixedValueSlipFvPatchFieldsFwd.H @@ -37,7 +37,7 @@ namespace Foam template class mixedFixedValueSlipFvPatchField; -makePatchTypeFieldTypedefs(mixedFixedValueSlip) +makePatchTypeFieldTypedefs(mixedFixedValueSlip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C index ca9e9d0158..c3340f6932 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C @@ -112,7 +112,11 @@ void fixedRhoFvPatchScalarField::updateCoeffs() // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, fixedRhoFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + fixedRhoFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H index 50d75b7855..ba404b8a73 100644 --- a/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H +++ b/applications/solvers/compressible/rhoCentralFoam/compressibleCourantNo.H @@ -34,8 +34,10 @@ scalar meanCoNum = 0.0; if (mesh.nInternalFaces()) { - surfaceScalarField amaxSfbyDelta = - mesh.surfaceInterpolation::deltaCoeffs()*amaxSf; + surfaceScalarField amaxSfbyDelta + ( + mesh.surfaceInterpolation::deltaCoeffs()*amaxSf + ); CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue(); diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C index c151f4ffcb..fd1e550668 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C @@ -62,52 +62,76 @@ int main(int argc, char *argv[]) { // --- upwind interpolation of primitive fields on faces - surfaceScalarField rho_pos = - fvc::interpolate(rho, pos, "reconstruct(rho)"); - surfaceScalarField rho_neg = - fvc::interpolate(rho, neg, "reconstruct(rho)"); + surfaceScalarField rho_pos + ( + fvc::interpolate(rho, pos, "reconstruct(rho)") + ); + surfaceScalarField rho_neg + ( + fvc::interpolate(rho, neg, "reconstruct(rho)") + ); - surfaceVectorField rhoU_pos = - fvc::interpolate(rhoU, pos, "reconstruct(U)"); - surfaceVectorField rhoU_neg = - fvc::interpolate(rhoU, neg, "reconstruct(U)"); + surfaceVectorField rhoU_pos + ( + fvc::interpolate(rhoU, pos, "reconstruct(U)") + ); + surfaceVectorField rhoU_neg + ( + fvc::interpolate(rhoU, neg, "reconstruct(U)") + ); - volScalarField rPsi = 1.0/psi; - surfaceScalarField rPsi_pos = - fvc::interpolate(rPsi, pos, "reconstruct(T)"); - surfaceScalarField rPsi_neg = - fvc::interpolate(rPsi, neg, "reconstruct(T)"); + volScalarField rPsi(1.0/psi); + surfaceScalarField rPsi_pos + ( + fvc::interpolate(rPsi, pos, "reconstruct(T)") + ); + surfaceScalarField rPsi_neg + ( + fvc::interpolate(rPsi, neg, "reconstruct(T)") + ); - surfaceScalarField e_pos = - fvc::interpolate(e, pos, "reconstruct(T)"); - surfaceScalarField e_neg = - fvc::interpolate(e, neg, "reconstruct(T)"); + surfaceScalarField e_pos + ( + fvc::interpolate(e, pos, "reconstruct(T)") + ); + surfaceScalarField e_neg + ( + fvc::interpolate(e, neg, "reconstruct(T)") + ); - surfaceVectorField U_pos = rhoU_pos/rho_pos; - surfaceVectorField U_neg = rhoU_neg/rho_neg; + surfaceVectorField U_pos(rhoU_pos/rho_pos); + surfaceVectorField U_neg(rhoU_neg/rho_neg); - surfaceScalarField p_pos = rho_pos*rPsi_pos; - surfaceScalarField p_neg = rho_neg*rPsi_neg; + surfaceScalarField p_pos(rho_pos*rPsi_pos); + surfaceScalarField p_neg(rho_neg*rPsi_neg); - surfaceScalarField phiv_pos = U_pos & mesh.Sf(); - surfaceScalarField phiv_neg = U_neg & mesh.Sf(); + surfaceScalarField phiv_pos(U_pos & mesh.Sf()); + surfaceScalarField phiv_neg(U_neg & mesh.Sf()); - volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); - surfaceScalarField cSf_pos = - fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); - surfaceScalarField cSf_neg = - fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); + volScalarField c(sqrt(thermo.Cp()/thermo.Cv()*rPsi)); + surfaceScalarField cSf_pos + ( + fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf() + ); + surfaceScalarField cSf_neg + ( + fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf() + ); - surfaceScalarField ap = - max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero); - surfaceScalarField am = - min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero); + surfaceScalarField ap + ( + max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero) + ); + surfaceScalarField am + ( + min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero) + ); - surfaceScalarField a_pos = ap/(ap - am); + surfaceScalarField a_pos(ap/(ap - am)); surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); - surfaceScalarField aSf = am*a_pos; + surfaceScalarField aSf(am*a_pos); if (fluxScheme == "Tadmor") { @@ -115,13 +139,13 @@ int main(int argc, char *argv[]) a_pos = 0.5; } - surfaceScalarField a_neg = (1.0 - a_pos); + surfaceScalarField a_neg(1.0 - a_pos); phiv_pos *= a_pos; phiv_neg *= a_neg; - surfaceScalarField aphiv_pos = phiv_pos - aSf; - surfaceScalarField aphiv_neg = phiv_neg + aSf; + surfaceScalarField aphiv_pos(phiv_pos - aSf); + surfaceScalarField aphiv_neg(phiv_neg + aSf); // Reuse amaxSf for the maximum positive and negative fluxes // estimated by the central scheme @@ -148,14 +172,18 @@ int main(int argc, char *argv[]) surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); - surfaceVectorField phiUp = + surfaceVectorField phiUp + ( (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) - + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf() + ); - surfaceScalarField phiEp = + surfaceScalarField phiEp + ( aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) - + aSf*p_pos - aSf*p_neg; + + aSf*p_pos - aSf*p_neg + ); volTensorField tauMC("tauMC", mu*dev2(Foam::T(fvc::grad(U)))); @@ -185,7 +213,7 @@ int main(int argc, char *argv[]) } // --- Solve energy - surfaceScalarField sigmaDotU = + surfaceScalarField sigmaDotU ( ( fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 42c8eb11d6..377795191c 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -59,48 +59,72 @@ int main(int argc, char *argv[]) { // --- upwind interpolation of primitive fields on faces - surfaceScalarField rho_pos = - fvc::interpolate(rho, pos, "reconstruct(rho)"); - surfaceScalarField rho_neg = - fvc::interpolate(rho, neg, "reconstruct(rho)"); + surfaceScalarField rho_pos + ( + fvc::interpolate(rho, pos, "reconstruct(rho)") + ); + surfaceScalarField rho_neg + ( + fvc::interpolate(rho, neg, "reconstruct(rho)") + ); - surfaceVectorField rhoU_pos = - fvc::interpolate(rhoU, pos, "reconstruct(U)"); - surfaceVectorField rhoU_neg = - fvc::interpolate(rhoU, neg, "reconstruct(U)"); + surfaceVectorField rhoU_pos + ( + fvc::interpolate(rhoU, pos, "reconstruct(U)") + ); + surfaceVectorField rhoU_neg + ( + fvc::interpolate(rhoU, neg, "reconstruct(U)") + ); - volScalarField rPsi = 1.0/psi; - surfaceScalarField rPsi_pos = - fvc::interpolate(rPsi, pos, "reconstruct(T)"); - surfaceScalarField rPsi_neg = - fvc::interpolate(rPsi, neg, "reconstruct(T)"); + volScalarField rPsi(1.0/psi); + surfaceScalarField rPsi_pos + ( + fvc::interpolate(rPsi, pos, "reconstruct(T)") + ); + surfaceScalarField rPsi_neg + ( + fvc::interpolate(rPsi, neg, "reconstruct(T)") + ); - surfaceScalarField e_pos = - fvc::interpolate(e, pos, "reconstruct(T)"); - surfaceScalarField e_neg = - fvc::interpolate(e, neg, "reconstruct(T)"); + surfaceScalarField e_pos + ( + fvc::interpolate(e, pos, "reconstruct(T)") + ); + surfaceScalarField e_neg + ( + fvc::interpolate(e, neg, "reconstruct(T)") + ); - surfaceVectorField U_pos = rhoU_pos/rho_pos; - surfaceVectorField U_neg = rhoU_neg/rho_neg; + surfaceVectorField U_pos(rhoU_pos/rho_pos); + surfaceVectorField U_neg(rhoU_neg/rho_neg); - surfaceScalarField p_pos = rho_pos*rPsi_pos; - surfaceScalarField p_neg = rho_neg*rPsi_neg; + surfaceScalarField p_pos(rho_pos*rPsi_pos); + surfaceScalarField p_neg(rho_neg*rPsi_neg); - surfaceScalarField phiv_pos = U_pos & mesh.Sf(); - surfaceScalarField phiv_neg = U_neg & mesh.Sf(); + surfaceScalarField phiv_pos(U_pos & mesh.Sf()); + surfaceScalarField phiv_neg(U_neg & mesh.Sf()); - volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); - surfaceScalarField cSf_pos = - fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); - surfaceScalarField cSf_neg = - fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); + volScalarField c(sqrt(thermo.Cp()/thermo.Cv()*rPsi)); + surfaceScalarField cSf_pos + ( + fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf() + ); + surfaceScalarField cSf_neg + ( + fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf() + ); - surfaceScalarField ap = - max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero); - surfaceScalarField am = - min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero); + surfaceScalarField ap + ( + max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero) + ); + surfaceScalarField am + ( + min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero) + ); - surfaceScalarField a_pos = ap/(ap - am); + surfaceScalarField a_pos(ap/(ap - am)); surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); @@ -112,7 +136,7 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - surfaceScalarField aSf = am*a_pos; + surfaceScalarField aSf(am*a_pos); if (fluxScheme == "Tadmor") { @@ -120,24 +144,28 @@ int main(int argc, char *argv[]) a_pos = 0.5; } - surfaceScalarField a_neg = (1.0 - a_pos); + surfaceScalarField a_neg(1.0 - a_pos); phiv_pos *= a_pos; phiv_neg *= a_neg; - surfaceScalarField aphiv_pos = phiv_pos - aSf; - surfaceScalarField aphiv_neg = phiv_neg + aSf; + surfaceScalarField aphiv_pos(phiv_pos - aSf); + surfaceScalarField aphiv_neg(phiv_neg + aSf); surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); - surfaceVectorField phiUp = + surfaceVectorField phiUp + ( (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) - + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf() + ); - surfaceScalarField phiEp = + surfaceScalarField phiEp + ( aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) - + aSf*p_pos - aSf*p_neg; + + aSf*p_pos - aSf*p_neg + ); volTensorField tauMC("tauMC", mu*dev2(Foam::T(fvc::grad(U)))); @@ -167,7 +195,7 @@ int main(int argc, char *argv[]) } // --- Solve energy - surfaceScalarField sigmaDotU = + surfaceScalarField sigmaDotU ( ( fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) diff --git a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H index 45aa8f7790..27b06029b8 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/UEqn.H @@ -9,7 +9,7 @@ tmp UEqn UEqn().relax(); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); if (momentumPredictor) { diff --git a/applications/solvers/compressible/rhoPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPimpleFoam/createFields.H index 4642e10ef8..3c29a987d3 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPimpleFoam/createFields.H @@ -52,5 +52,7 @@ ); Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H index 0b0364b706..faae8152ca 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/UEqn.H @@ -12,7 +12,7 @@ UEqn().relax(); mrfZones.addCoriolis(rho, UEqn()); pZones.addResistance(UEqn()); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); if (momentumPredictor) { diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H index cc8f6436a1..9dd30f53cf 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/createFields.H @@ -65,8 +65,10 @@ Info<< "Creating field DpDt\n" << endl; - volScalarField DpDt = - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + volScalarField DpDt + ( + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) + ); MRFZones mrfZones(mesh); mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H index 590a3c1950..3802c9298a 100644 --- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); if (nCorr <= 1) diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H b/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H index fd79c8400e..c600b1ca0b 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/UEqn.H @@ -22,7 +22,7 @@ trTU = inv(tTU()); trTU().rename("rAU"); - volVectorField gradp = fvc::grad(p); + volVectorField gradp(fvc::grad(p)); for (int UCorr=0; UCorr SMALL); - surfaceScalarField buoyancyPhi = rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf(); + surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); phi -= buoyancyPhi; // Solve pressure diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C index d578cc9682..93caaf34fb 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C @@ -138,7 +138,7 @@ Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const const symmTensorField& KWall = patch().lookupPatchField(KName_); - vectorField n = patch().nf(); + vectorField n(patch().nf()); return n & KWall & n; } @@ -203,7 +203,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, solidWallHeatFluxTemperatureFvPatchScalarField diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C index 606cd811ea..0af7eaa06e 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C @@ -34,9 +34,11 @@ Foam::scalar Foam::compressibleCourantNo const surfaceScalarField& phi ) { - scalarField sumPhi = + scalarField sumPhi + ( fvc::surfaceSum(mag(phi))().internalField() - /rho.internalField(); + / rho.internalField() + ); scalar CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index 854dc9e2cc..07ab9c92e8 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -5,7 +5,7 @@ rho = thermo.rho(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); U = rAU*UEqn().H(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C index 322628b9ec..bb395003a3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffNo.C @@ -39,10 +39,12 @@ Foam::scalar Foam::solidRegionDiffNo //- Take care: can have fluid domains with 0 cells so do not test for // zero internal faces. - surfaceScalarField KrhoCpbyDelta = + surfaceScalarField KrhoCpbyDelta + ( mesh.surfaceInterpolation::deltaCoeffs() * fvc::interpolate(K) - / fvc::interpolate(Cprho); + / fvc::interpolate(Cprho) + ); DiNum = gMax(KrhoCpbyDelta.internalField())*runTime.deltaT().value(); @@ -66,14 +68,16 @@ Foam::scalar Foam::solidRegionDiffNo scalar DiNum = 0.0; scalar meanDiNum = 0.0; - volScalarField K = mag(Kdirectional); + volScalarField K(mag(Kdirectional)); //- Take care: can have fluid domains with 0 cells so do not test for // zero internal faces. - surfaceScalarField KrhoCpbyDelta = + surfaceScalarField KrhoCpbyDelta + ( mesh.surfaceInterpolation::deltaCoeffs() * fvc::interpolate(K) - / fvc::interpolate(Cprho); + / fvc::interpolate(Cprho) + ); DiNum = gMax(KrhoCpbyDelta.internalField())*runTime.deltaT().value(); diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C index 5614578429..0d94768b23 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C @@ -121,7 +121,7 @@ void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchScalarField, adjointOutletPressureFvPatchScalarField diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C index 0a00076eaf..dbde31a88a 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C @@ -96,10 +96,10 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs() const fvPatchField& Up = patch().lookupPatchField("U"); - scalarField Un = mag(patch().nf() & Up); - vectorField UtHat = (Up - patch().nf()*Un)/(Un + SMALL); + scalarField Un(mag(patch().nf() & Up)); + vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL)); - vectorField Uan = patch().nf()*(patch().nf() & patchInternalField()); + vectorField Uan(patch().nf()*(patch().nf() & patchInternalField())); vectorField::operator=(phiap*patch().Sf()/sqr(patch().magSf()) + UtHat); //vectorField::operator=(Uan + UtHat); @@ -119,7 +119,7 @@ void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const namespace Foam { - makePatchTypeField + makeNonTemplatedPatchTypeField ( fvPatchVectorField, adjointOutletVelocityFvPatchVectorField diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C index a18298f826..de7a9276ae 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) solve(UEqn() == -fvc::grad(p)); p.boundaryField().updateCoeffs(); - volScalarField rAU = 1.0/UEqn().A(); + volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); @@ -153,10 +153,13 @@ int main(int argc, char *argv[]) { // Adjoint Momentum predictor - volVectorField adjointTransposeConvection = (fvc::grad(Ua) & U); - //volVectorField adjointTransposeConvection = fvc::reconstruct + volVectorField adjointTransposeConvection((fvc::grad(Ua) & U)); + //volVectorField adjointTransposeConvection //( - // mesh.magSf()*(fvc::snGrad(Ua) & fvc::interpolate(U)) + // fvc::reconstruct + // ( + // mesh.magSf()*(fvc::snGrad(Ua) & fvc::interpolate(U)) + // ) //); zeroCells(adjointTransposeConvection, inletCells); @@ -174,7 +177,7 @@ int main(int argc, char *argv[]) solve(UaEqn() == -fvc::grad(pa)); pa.boundaryField().updateCoeffs(); - volScalarField rAUa = 1.0/UaEqn().A(); + volScalarField rAUa(1.0/UaEqn().A()); Ua = rAUa*UaEqn().H(); UaEqn.clear(); phia = fvc::interpolate(Ua) & mesh.Sf(); diff --git a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C index af2798cc32..4bfdd66f46 100644 --- a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C +++ b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C @@ -60,7 +60,7 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - fvVectorMatrix divR = turbulence->divDevReff(U); + fvVectorMatrix divR(turbulence->divDevReff(U)); divR.source() = flowMask & divR.source(); fvVectorMatrix UEqn diff --git a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H index 8844f21e6e..3534caebd0 100644 --- a/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H +++ b/applications/solvers/incompressible/boundaryFoam/evaluateNearWall.H @@ -1,7 +1,7 @@ { // Evaluate near-wall behaviour - scalar nu = turbulence->nu().boundaryField()[patchId][faceId]; + scalar nu = turbulence->nu()().boundaryField()[patchId][faceId]; scalar nut = turbulence->nut()().boundaryField()[patchId][faceId]; symmTensor R = turbulence->devReff()().boundaryField()[patchId][faceId]; scalar epsilon = turbulence->epsilon()()[cellId]; @@ -31,4 +31,4 @@ << ", y+ = " << yPlus << ", u+ = " << uPlus << ", k+ = " << kPlus << ", epsilon+ = " << epsilonPlus << endl; -} \ No newline at end of file +} diff --git a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H index 6fa3a0892c..7fd01f0e9e 100644 --- a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H +++ b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H @@ -13,7 +13,7 @@ forAll(patches, patchi) if (isA(currPatch)) { - const vectorField nf = currPatch.nf(); + const vectorField nf(currPatch.nf()); forAll(nf, facei) { @@ -67,8 +67,10 @@ else label cellId = patches[patchId].faceCells()[faceId]; // create position array for graph generation -scalarField y = +scalarField y +( wallNormal - & (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]); + & (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]) +); Info<< " Height to first cell centre y0 = " << y[cellId] << endl; diff --git a/applications/solvers/incompressible/channelFoam/channelFoam.C b/applications/solvers/incompressible/channelFoam/channelFoam.C index 8918a4d8eb..6f19b96168 100644 --- a/applications/solvers/incompressible/channelFoam/channelFoam.C +++ b/applications/solvers/incompressible/channelFoam/channelFoam.C @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) // --- PISO loop - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); for (int corr=0; corr UEqn UEqn().relax(); -volScalarField rAU = 1.0/UEqn().A(); +volScalarField rAU(1.0/UEqn().A()); if (momentumPredictor) { diff --git a/applications/solvers/incompressible/pisoFoam/pisoFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C index 47414bf173..59c76c9e93 100644 --- a/applications/solvers/incompressible/pisoFoam/pisoFoam.C +++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) for (int corr=0; corr > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H index 50fc7f575b..1690487b45 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 3f007e247d..861e69bc84 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H index 0ad057e229..31be0cf8ee 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelDyMFoam/createFields.H @@ -51,7 +51,7 @@ singlePhaseTransportModel laminarTransport(U, phi); - const volScalarField nu = laminarTransport.nu(); + const volScalarField nu(laminarTransport.nu()); autoPtr turbulence ( diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H index 0ad057e229..31be0cf8ee 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H @@ -51,7 +51,7 @@ singlePhaseTransportModel laminarTransport(U, phi); - const volScalarField nu = laminarTransport.nu(); + const volScalarField nu(laminarTransport.nu()); autoPtr turbulence ( diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index ac369f3df4..e9d540f3a9 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -13,7 +13,7 @@ tmp > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H index 50fc7f575b..1690487b45 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H index 9d03624e43..4a28b0dd94 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H @@ -5,7 +5,7 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (pZones.size() > 0) diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H index da9a289d69..8526b590a2 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H @@ -12,7 +12,7 @@ tmp > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H index 12ed815d1d..5dd7ce9cb0 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H index f957ab017e..9d028d4502 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index c4a929c449..a180973321 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -12,7 +12,7 @@ tmp > mvConvection { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H index 50fc7f575b..1690487b45 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H @@ -10,10 +10,14 @@ // turbulent time scale if (turbulentReaction) { - DimensionedField tk = - Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); - DimensionedField tc = - chemistry.tc()().dimensionedInternalField(); + DimensionedField tk + ( + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()) + ); + DimensionedField tc + ( + chemistry.tc()().dimensionedInternalField() + ); // Chalmers PaSR model kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index d5de608bd2..560fbc9895 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -1,6 +1,6 @@ rho = thermo.rho(); -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (transonic) diff --git a/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H index 4e2f9766a8..53c6b25d81 100644 --- a/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/steadyReactingParcelFoam/YEqn.H @@ -14,7 +14,7 @@ tmp > mvConvection if (solveSpecies) { label inertIndex = -1; - volScalarField Yt = 0.0*Y[0]; + volScalarField Yt(0.0*Y[0]); forAll(Y, i) { diff --git a/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H index e7d7c55dbb..322289684d 100644 --- a/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/steadyReactingParcelFoam/pEqn.H @@ -5,7 +5,7 @@ // pressure solution - done in 2 parts. Part 1: thermo.rho() -= psi*p; - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); if (pZones.size() > 0) diff --git a/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H b/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H index 26ebe6fc67..0e26fcdac1 100644 --- a/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H +++ b/applications/solvers/lagrangian/steadyReactingParcelFoam/timeScales.H @@ -59,7 +59,8 @@ Info<< "Time scales min/max:" << endl; invTauFlow.max(1.0/maxDeltaT); - Info<< " Flow = " << gMin(1/invTauFlow.internalField()) << ", " + Info<< " Flow = " + << gMin(1/invTauFlow.internalField()) << ", " << gMax(1/invTauFlow.internalField()) << endl; } @@ -68,13 +69,16 @@ Info<< "Time scales min/max:" << endl; // ~~~~~~~~~~~~~~~~~~~~~~ { - scalarField tau = - runTime.deltaTValue()*mag(parcels.Srho() + massSource.SuTot()); + scalarField tau + ( + runTime.deltaTValue()*mag(parcels.Srho() + massSource.SuTot()) + ); tau = alphaTauRho*rho/(tau + ROOTVSMALL); - Info<< " Density = " << min(maxDeltaT, gMin(tau)) << ", " - << min(maxDeltaT, gMax(tau)) << endl; + Info<< " Density = " + << min(maxDeltaT, gMin(tau)) << ", " + << min(maxDeltaT, gMax(tau)) << endl; invTauFlow.internalField() = max(invTauFlow.internalField(), 1/tau); } @@ -86,7 +90,8 @@ Info<< "Time scales min/max:" << endl; { /* // Method 1 - mag(U) limit using 'small' nominal velocity - scalarField tau = + scalarField tau + ( runTime.deltaTValue() *mag ( @@ -94,7 +99,8 @@ Info<< "Time scales min/max:" << endl; + parcels.UTrans()/(mesh.V()*runTime.deltaT()) + momentumSource.Su() ) - /rho; + /rho + ); const scalar nomMagU(dimensionedScalar("1", dimVelocity, 1)); tau = alphaTauU*(nomMagU + mag(U))/(tau + ROOTVSMALL); @@ -128,13 +134,15 @@ Info<< "Time scales min/max:" << endl; fvc::interpolate(runTime.deltaT()*UEqnRhs) & mesh.Sf() ); - scalarField tau = + scalarField tau + ( alphaTauU*rho /fvc::surfaceSum ( mag(phi + phiSU)*mesh.deltaCoeffs()/mesh.magSf() + dimensionedScalar("SMALL", dimDensity/dimTime, ROOTVSMALL) - ); + ) + ); */ /* @@ -150,7 +158,8 @@ Info<< "Time scales min/max:" << endl; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { - scalarField tau = + scalarField tau + ( runTime.deltaTValue() *mag ( @@ -159,7 +168,8 @@ Info<< "Time scales min/max:" << endl; + energySource.Su() + chemistrySh ) - /rho; + /rho + ); tau = alphaTauTemp*thermo.Cp()*T/(tau + ROOTVSMALL); @@ -178,7 +188,8 @@ Info<< "Time scales min/max:" << endl; forAll(Y, fieldI) { const volScalarField& Yi = Y[fieldI]; - const scalarField deltaYi = + const scalarField deltaYi + ( runTime.deltaTValue() *mag ( @@ -186,7 +197,8 @@ Info<< "Time scales min/max:" << endl; + massSource.Su(fieldI) + parcels.Srho(fieldI) ) - /rho; + /rho + ); tau = min ( diff --git a/applications/solvers/multiphase/bubbleFoam/UEqns.H b/applications/solvers/multiphase/bubbleFoam/UEqns.H index 64cc5db462..82d53d84b0 100644 --- a/applications/solvers/multiphase/bubbleFoam/UEqns.H +++ b/applications/solvers/multiphase/bubbleFoam/UEqns.H @@ -2,12 +2,14 @@ fvVectorMatrix UaEqn(Ua, Ua.dimensions()*dimVol/dimTime); fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); { - volTensorField Rca = -nuEffa*(fvc::grad(Ua)().T()); + volTensorField Rca(-nuEffa*(fvc::grad(Ua)().T())); Rca = Rca + (2.0/3.0)*sqr(Ct)*I*k - (2.0/3.0)*I*tr(Rca); - surfaceScalarField phiRa = + surfaceScalarField phiRa + ( - fvc::interpolate(nuEffa) - *mesh.magSf()*fvc::snGrad(alpha)/fvc::interpolate(alpha + scalar(0.001)); + *mesh.magSf()*fvc::snGrad(alpha)/fvc::interpolate(alpha + scalar(0.001)) + ); UaEqn = ( @@ -34,12 +36,14 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); UaEqn.relax(); - volTensorField Rcb = -nuEffb*fvc::grad(Ub)().T(); + volTensorField Rcb(-nuEffb*fvc::grad(Ub)().T()); Rcb = Rcb + (2.0/3.0)*I*k - (2.0/3.0)*I*tr(Rcb); - surfaceScalarField phiRb = + surfaceScalarField phiRb + ( - fvc::interpolate(nuEffb) - *mesh.magSf()*fvc::snGrad(beta)/fvc::interpolate(beta + scalar(0.001)); + *mesh.magSf()*fvc::snGrad(beta)/fvc::interpolate(beta + scalar(0.001)) + ); UbEqn = ( diff --git a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H b/applications/solvers/multiphase/bubbleFoam/alphaEqn.H index db3b595625..772008bc89 100644 --- a/applications/solvers/multiphase/bubbleFoam/alphaEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/alphaEqn.H @@ -1,7 +1,7 @@ { word scheme("div(phi,alpha)"); - surfaceScalarField phir = phia - phib; + surfaceScalarField phir(phia - phib); Info<< "Max Ur Courant Number = " << ( diff --git a/applications/solvers/multiphase/bubbleFoam/createFields.H b/applications/solvers/multiphase/bubbleFoam/createFields.H index 57bb7e88d5..efb41613a6 100644 --- a/applications/solvers/multiphase/bubbleFoam/createFields.H +++ b/applications/solvers/multiphase/bubbleFoam/createFields.H @@ -171,15 +171,19 @@ Info<< "Calculating field DDtUa and DDtUb\n" << endl; - volVectorField DDtUa = + volVectorField DDtUa + ( fvc::ddt(Ua) + fvc::div(phia, Ua) - - fvc::div(phia)*Ua; + - fvc::div(phia)*Ua + ); - volVectorField DDtUb = + volVectorField DDtUb + ( fvc::ddt(Ub) + fvc::div(phib, Ub) - - fvc::div(phib)*Ub; + - fvc::div(phib)*Ub + ); Info<< "Calculating field g.h\n" << endl; diff --git a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H index 84dadd7acb..309d4eba80 100644 --- a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H +++ b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H @@ -6,7 +6,7 @@ if (turbulence) } tmp tgradUb = fvc::grad(Ub); - volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb()))); + volScalarField G(2*nutb*(tgradUb() && dev(symm(tgradUb())))); tgradUb.clear(); #include "wallFunctions.H" diff --git a/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H b/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H index f9ae6ab2ca..5d00e39820 100644 --- a/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H +++ b/applications/solvers/multiphase/bubbleFoam/liftDragCoeffs.H @@ -1,11 +1,15 @@ - volVectorField Ur = Ua - Ub; - volScalarField magUr = mag(Ur); + volVectorField Ur(Ua - Ub); + volScalarField magUr(mag(Ur)); - volScalarField CdaMagUr = - (24.0*nub/da)*(scalar(1) + 0.15*pow(da*magUr/nub, 0.687)); + volScalarField CdaMagUr + ( + (24.0*nub/da)*(scalar(1) + 0.15*pow(da*magUr/nub, 0.687)) + ); - volScalarField CdbMagUr = - (24.0*nua/db)*(scalar(1) + 0.15*pow(db*magUr/nua, 0.687)); + volScalarField CdbMagUr + ( + (24.0*nua/db)*(scalar(1) + 0.15*pow(db*magUr/nua, 0.687)) + ); volScalarField dragCoef ( @@ -13,4 +17,7 @@ 0.75*(beta*rhob*CdaMagUr/da + alpha*rhoa*CdbMagUr/db) ); - volVectorField liftCoeff = Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U)); + volVectorField liftCoeff + ( + Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U)) + ); diff --git a/applications/solvers/multiphase/bubbleFoam/pEqn.H b/applications/solvers/multiphase/bubbleFoam/pEqn.H index 8e257c8fa9..faae92d397 100644 --- a/applications/solvers/multiphase/bubbleFoam/pEqn.H +++ b/applications/solvers/multiphase/bubbleFoam/pEqn.H @@ -1,20 +1,24 @@ { - surfaceScalarField alphaf = fvc::interpolate(alpha); - surfaceScalarField betaf = scalar(1) - alphaf; + surfaceScalarField alphaf(fvc::interpolate(alpha)); + surfaceScalarField betaf(scalar(1) - alphaf); - volScalarField rUaA = 1.0/UaEqn.A(); - volScalarField rUbA = 1.0/UbEqn.A(); + volScalarField rUaA(1.0/UaEqn.A()); + volScalarField rUbA(1.0/UbEqn.A()); - surfaceScalarField rUaAf = fvc::interpolate(rUaA); - surfaceScalarField rUbAf = fvc::interpolate(rUbA); + surfaceScalarField rUaAf(fvc::interpolate(rUaA)); + surfaceScalarField rUbAf(fvc::interpolate(rUbA)); Ua = rUaA*UaEqn.H(); Ub = rUbA*UbEqn.H(); - surfaceScalarField phiDraga = - fvc::interpolate(beta/rhoa*dragCoef*rUaA)*phib + rUaAf*(g & mesh.Sf()); - surfaceScalarField phiDragb = - fvc::interpolate(alpha/rhob*dragCoef*rUbA)*phia + rUbAf*(g & mesh.Sf()); + surfaceScalarField phiDraga + ( + fvc::interpolate(beta/rhoa*dragCoef*rUaA)*phib + rUaAf*(g & mesh.Sf()) + ); + surfaceScalarField phiDragb + ( + fvc::interpolate(alpha/rhob*dragCoef*rUbA)*phia + rUbAf*(g & mesh.Sf()) + ); forAll(p.boundaryField(), patchi) { @@ -50,7 +54,7 @@ if (nonOrth == nNonOrthCorr) { - surfaceScalarField SfGradp = pEqn.flux()/Dp; + surfaceScalarField SfGradp(pEqn.flux()/Dp); phia -= rUaAf*SfGradp/rhoa; phib -= rUbAf*SfGradp/rhob; diff --git a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H index fe5d16909e..a998d4c3dd 100644 --- a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H +++ b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H @@ -34,7 +34,7 @@ { const scalarField& nuw = nutb.boundaryField()[patchi]; - scalarField magFaceGradU = mag(U.boundaryField()[patchi].snGrad()); + scalarField magFaceGradU(mag(U.boundaryField()[patchi].snGrad())); forAll(currPatch, facei) { diff --git a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H index 8b26ba033e..cb72ce18f7 100644 --- a/applications/solvers/multiphase/cavitatingFoam/CourantNo.H +++ b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H @@ -35,8 +35,10 @@ scalar acousticCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = - fvc::surfaceSum(mag(phiv))().internalField(); + scalarField sumPhi + ( + fvc::surfaceSum(mag(phiv))().internalField() + ); CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/cavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H index e6606b7b62..6b6fc73eb9 100644 --- a/applications/solvers/multiphase/cavitatingFoam/pEqn.H +++ b/applications/solvers/multiphase/cavitatingFoam/pEqn.H @@ -9,18 +9,18 @@ )/psi; } - surfaceScalarField rhof = fvc::interpolate(rho, "rhof"); + surfaceScalarField rhof(fvc::interpolate(rho, "rhof")); - volScalarField rAU = 1.0/UEqn.A(); + volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rAUf("rAUf", rhof*fvc::interpolate(rAU)); - volVectorField HbyA = rAU*UEqn.H(); + volVectorField HbyA(rAU*UEqn.H()); phiv = (fvc::interpolate(HbyA) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, rho, U, phiv); p.boundaryField().updateCoeffs(); - surfaceScalarField phiGradp = rAUf*mesh.magSf()*fvc::snGrad(p); + surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p)); phiv -= phiGradp/rhof; diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H index f545262767..f5717a654d 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H @@ -2,7 +2,7 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phir = phic*interface.nHatf(); + surfaceScalarField phir(phic*interface.nHatf()); for (int gCorr=0; gCorr 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H index e668296b6d..a973c23dfe 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H @@ -9,17 +9,17 @@ readLabel(piso.lookup("nAlphaSubCycles")) ); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); fvc::makeAbsolute(phi, U); - volScalarField divU = fvc::div(phi); + volScalarField divU(fvc::div(phi)); fvc::makeRelative(phi, U); if (nAlphaSubCycles > 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index c2f1d04706..8519d23f67 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { // Store divU from the previous mesh for the correctPhi - volScalarField divU = fvc::div(phi); + volScalarField divU(fvc::div(phi)); scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H index ace51b5d84..0c1ad0192d 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); tmp p_rghEqnComp; diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index fab0df9284..c598cb75ce 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -105,8 +105,8 @@ ) ); - volScalarField rho1 = rho10 + psi1*p; - volScalarField rho2 = rho20 + psi2*p; + volScalarField rho1(rho10 + psi1*p); + volScalarField rho2(rho20 + psi2*p); volScalarField rho ( @@ -138,8 +138,10 @@ fvc::interpolate(rho)*phi ); - volScalarField dgdt = - pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001)); + volScalarField dgdt + ( + pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001)) + ); // Construct interface from alpha1 distribution interfaceProperties interface(alpha1, U, twoPhaseProperties); diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 7054fe1d44..047f2f3c4c 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); tmp p_rghEqnComp; diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C index 280d7d6d55..d6ab8bfc3e 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/MULESTemplates.C @@ -56,7 +56,7 @@ void Foam::MULES::explicitLTSSolve const fvMesh& mesh = psi.mesh(); psi.correctBoundaryConditions(); - surfaceScalarField phiBD = upwind(psi.mesh(), phi).flux(psi); + surfaceScalarField phiBD(upwind(psi.mesh(), phi).flux(psi)); surfaceScalarField& phiCorr = phiPsi; phiCorr -= phiBD; @@ -168,9 +168,11 @@ void Foam::MULES::implicitSolve scalarField allCoLambda(mesh.nFaces()); { - surfaceScalarField Cof = + surfaceScalarField Cof + ( mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs() - *mag(phi)/mesh.magSf(); + *mag(phi)/mesh.magSf() + ); slicedSurfaceScalarField CoLambda ( @@ -226,7 +228,7 @@ void Foam::MULES::implicitSolve - Su ); - surfaceScalarField phiBD = psiConvectionDiffusion.flux(); + surfaceScalarField phiBD(psiConvectionDiffusion.flux()); surfaceScalarField& phiCorr = phiPsi; phiCorr -= phiBD; @@ -408,7 +410,7 @@ void Foam::MULES::limiter if (psiPf.coupled()) { - scalarField psiPNf = psiPf.patchNeighbourField(); + scalarField psiPNf(psiPf.patchNeighbourField()); forAll(phiCorrPf, pFacei) { diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H index a4cb6e7688..0c2cf71e4e 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H @@ -2,13 +2,14 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - surfaceScalarField phir = phic*interface.nHatf(); + surfaceScalarField phir(phic*interface.nHatf()); for (int aCorr=0; aCorr 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H index 7944df4814..e4f8247bac 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU diff --git a/applications/solvers/multiphase/interFoam/alphaCourantNo.H b/applications/solvers/multiphase/interFoam/alphaCourantNo.H index e5edfc76ca..d122753d46 100644 --- a/applications/solvers/multiphase/interFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/interFoam/alphaCourantNo.H @@ -39,9 +39,11 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( pos(alpha1 - 0.01)*pos(0.99 - alpha1) - *fvc::surfaceSum(mag(phi))().internalField(); + *fvc::surfaceSum(mag(phi))().internalField() + ); alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H index 0b2fb4ebf8..d19ae9bb70 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/alphaEqn.H @@ -2,13 +2,14 @@ word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - surfaceScalarField phir = phic*interface.nHatf(); + surfaceScalarField phir(phic*interface.nHatf()); for (int aCorr=0; aCorr 1) { dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); for ( diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H index 59c0cd1929..5bf3ca9418 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf())); diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index 6437572c3b..db1eccc5a5 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU diff --git a/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H index 105149f87e..821064fae1 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaCourantNo.H @@ -39,11 +39,14 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = max + scalarField sumPhi ( - pos(alpha1 - 0.01)*pos(0.99 - alpha1), - pos(alpha2 - 0.01)*pos(0.99 - alpha2) - )*fvc::surfaceSum(mag(phi))().internalField(); + max + ( + pos(alpha1 - 0.01)*pos(0.99 - alpha1), + pos(alpha2 - 0.01)*pos(0.99 - alpha2) + )*fvc::surfaceSum(mag(phi))().internalField() + ); alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqns.H b/applications/solvers/multiphase/interMixingFoam/alphaEqns.H index 00295354d4..15759adfe4 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaEqns.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqns.H @@ -40,7 +40,8 @@ // Create the complete convection flux for alpha1 - surfaceScalarField phiAlpha1 = + surfaceScalarField phiAlpha1 + ( fvc::flux ( phi, @@ -58,11 +59,14 @@ -fvc::flux(-phir, alpha3, alpharScheme), alpha1, alpharScheme - ); + ) + ); // Create the bounded (upwind) flux for alpha1 - surfaceScalarField phiAlpha1BD = - upwind(mesh, phi).flux(alpha1); + surfaceScalarField phiAlpha1BD + ( + upwind(mesh, phi).flux(alpha1) + ); // Calculate the flux correction for alpha1 phiAlpha1 -= phiAlpha1BD; @@ -83,7 +87,8 @@ ); // Create the complete flux for alpha2 - surfaceScalarField phiAlpha2 = + surfaceScalarField phiAlpha2 + ( fvc::flux ( phi, @@ -95,11 +100,14 @@ -fvc::flux(phir, alpha1, alpharScheme), alpha2, alpharScheme - ); + ) + ); // Create the bounded (upwind) flux for alpha2 - surfaceScalarField phiAlpha2BD = - upwind(mesh, phi).flux(alpha2); + surfaceScalarField phiAlpha2BD + ( + upwind(mesh, phi).flux(alpha2) + ); // Calculate the flux correction for alpha2 phiAlpha2 -= phiAlpha2BD; @@ -127,8 +135,8 @@ solve(fvm::ddt(alpha1) + fvc::div(phiAlpha1)); // Create the diffusion coefficients for alpha2<->alpha3 - volScalarField Dc23 = D23*max(alpha3, scalar(0))*pos(alpha2); - volScalarField Dc32 = D23*max(alpha2, scalar(0))*pos(alpha3); + volScalarField Dc23(D23*max(alpha3, scalar(0))*pos(alpha2)); + volScalarField Dc32(D23*max(alpha2, scalar(0))*pos(alpha3)); // Add the diffusive flux for alpha3->alpha2 phiAlpha2 -= fvc::interpolate(Dc32)*mesh.magSf()*fvc::snGrad(alpha1); diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H index 765087a183..81e09f9b90 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H @@ -10,7 +10,7 @@ label nAlphaSubCycles if (nAlphaSubCycles > 1) { - surfaceScalarField rhoPhiSum = 0.0*rhoPhi; + surfaceScalarField rhoPhiSum(0.0*rhoPhi); dimensionedScalar totalDeltaT = runTime.deltaT(); for @@ -33,7 +33,7 @@ else interface.correct(); { - volScalarField rhoNew = alpha1*rho1 + alpha2*rho2 + alpha3*rho3; + volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3); //solve(fvm::ddt(rho) + fvc::div(rhoPhi)); //Info<< "density error = " diff --git a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C index 4ea4c4d989..163d5a5410 100644 --- a/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C +++ b/applications/solvers/multiphase/interMixingFoam/incompressibleThreePhaseMixture/threePhaseMixture.C @@ -133,9 +133,9 @@ Foam::tmp Foam::threePhaseMixture::mu() const Foam::tmp Foam::threePhaseMixture::muf() const { - surfaceScalarField alpha1f = fvc::interpolate(alpha1_); - surfaceScalarField alpha2f = fvc::interpolate(alpha2_); - surfaceScalarField alpha3f = fvc::interpolate(alpha3_); + surfaceScalarField alpha1f(fvc::interpolate(alpha1_)); + surfaceScalarField alpha2f(fvc::interpolate(alpha2_)); + surfaceScalarField alpha3f(fvc::interpolate(alpha3_)); return tmp ( @@ -152,9 +152,9 @@ Foam::tmp Foam::threePhaseMixture::muf() const Foam::tmp Foam::threePhaseMixture::nuf() const { - surfaceScalarField alpha1f = fvc::interpolate(alpha1_); - surfaceScalarField alpha2f = fvc::interpolate(alpha2_); - surfaceScalarField alpha3f = fvc::interpolate(alpha3_); + surfaceScalarField alpha1f(fvc::interpolate(alpha1_)); + surfaceScalarField alpha2f(fvc::interpolate(alpha2_)); + surfaceScalarField alpha3f(fvc::interpolate(alpha3_)); return tmp ( diff --git a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C index 48089e7c92..ad9e9fa1c5 100644 --- a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +++ b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -81,31 +81,35 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle refCast (alpha3[patchi]); - scalarField twoPhaseAlpha2 = max(a2cap, scalar(0)); - scalarField twoPhaseAlpha3 = max(a3cap, scalar(0)); + scalarField twoPhaseAlpha2(max(a2cap, scalar(0))); + scalarField twoPhaseAlpha3(max(a3cap, scalar(0))); - scalarField sumTwoPhaseAlpha = - twoPhaseAlpha2 + twoPhaseAlpha3 + SMALL; + scalarField sumTwoPhaseAlpha + ( + twoPhaseAlpha2 + twoPhaseAlpha3 + SMALL + ); twoPhaseAlpha2 /= sumTwoPhaseAlpha; twoPhaseAlpha3 /= sumTwoPhaseAlpha; fvsPatchVectorField& nHatp = nHatb[patchi]; - scalarField theta = + scalarField theta + ( convertToRad - *( + * ( twoPhaseAlpha2*(180 - a2cap.theta(U[patchi], nHatp)) + twoPhaseAlpha3*(180 - a3cap.theta(U[patchi], nHatp)) - ); + ) + ); - vectorField nf = boundary[patchi].nf(); + vectorField nf(boundary[patchi].nf()); // Reset nHatPatch to correspond to the contact angle - scalarField a12 = nHatp & nf; + scalarField a12(nHatp & nf); - scalarField b1 = cos(theta); + scalarField b1(cos(theta)); scalarField b2(nHatp.size()); @@ -114,10 +118,10 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle b2[facei] = cos(acos(a12[facei]) - theta[facei]); } - scalarField det = 1.0 - a12*a12; + scalarField det(1.0 - a12*a12); - scalarField a = (b1 - a12*b2)/det; - scalarField b = (b2 - a12*b1)/det; + scalarField a((b1 - a12*b2)/det); + scalarField b((b2 - a12*b1)/det); nHatp = a*nf + b*nHatp; @@ -135,13 +139,13 @@ void Foam::threePhaseInterfaceProperties::calculateK() const surfaceVectorField& Sf = mesh.Sf(); // Cell gradient of alpha - volVectorField gradAlpha = fvc::grad(alpha1); + volVectorField gradAlpha(fvc::grad(alpha1)); // Interpolated face-gradient of alpha - surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha); + surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha)); // Face unit interface normal - surfaceVectorField nHatfv = gradAlphaf/(mag(gradAlphaf) + deltaN_); + surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_)); correctContactAngle(nHatfv.boundaryField()); // Face unit interface normal flux diff --git a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H index d21409408f..d136aab5c0 100644 --- a/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H +++ b/applications/solvers/multiphase/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H @@ -125,8 +125,8 @@ public: tmp sigma() const { - volScalarField limitedAlpha2 = max(mixture_.alpha2(), scalar(0)); - volScalarField limitedAlpha3 = max(mixture_.alpha3(), scalar(0)); + volScalarField limitedAlpha2(max(mixture_.alpha2(), scalar(0))); + volScalarField limitedAlpha3(max(mixture_.alpha3(), scalar(0))); return (limitedAlpha2*sigma12_ + limitedAlpha3*sigma13_) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H index 05226dc72f..9ce20db849 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H @@ -6,7 +6,8 @@ for (int gCorr=0; gCorr > vDotAlphal = twoPhaseProperties->vDotAlphal(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index df45bc6482..eea578e6e5 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -21,10 +21,10 @@ surfaceScalarField rhoPhi readLabel(piso.lookup("nAlphaSubCycles")) ); - surfaceScalarField phic = mag(phi/mesh.magSf()); + surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - volScalarField divU = fvc::div(phi); + volScalarField divU(fvc::div(phi)); dimensionedScalar totalDeltaT = runTime.deltaT(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 4f4e68cb59..925e10aad2 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C index 4075122116..1459fdc2fc 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C @@ -68,7 +68,7 @@ Foam::Pair > Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const { const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); return Pair > ( @@ -83,7 +83,7 @@ Foam::Pair > Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); return Pair > ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C index 66c279df2c..250fb00578 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C @@ -80,7 +80,7 @@ Foam::Pair > Foam::phaseChangeTwoPhaseMixtures::Merkle::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); return Pair > ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 61e57b3a5e..fb390277fb 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -97,9 +97,11 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::pCoeff const volScalarField& p ) const { - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); - volScalarField rho = - (limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2()); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); + volScalarField rho + ( + limitedAlpha1*rho1() + (scalar(1) - limitedAlpha1)*rho2() + ); return (3*rho1()*rho2())*sqrt(2/(3*rho1())) @@ -111,9 +113,9 @@ Foam::Pair > Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const { const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - volScalarField pCoeff = this->pCoeff(p); + volScalarField pCoeff(this->pCoeff(p)); return Pair > ( @@ -128,9 +130,9 @@ Foam::Pair > Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotP() const { const volScalarField& p = alpha1_.db().lookupObject("p"); - volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); + volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1))); - volScalarField apCoeff = limitedAlpha1*pCoeff(p); + volScalarField apCoeff(limitedAlpha1*pCoeff(p)); return Pair > ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index 0ae535dd51..374d61ddfa 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -54,7 +54,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture Foam::Pair > Foam::phaseChangeTwoPhaseMixture::vDotAlphal() const { - volScalarField alphalCoeff = 1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2()); + volScalarField alphalCoeff(1.0/rho1() - alpha1_*(1.0/rho1() - 1.0/rho2())); Pair > mDotAlphal = this->mDotAlphal(); return Pair > diff --git a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H index 3f59b6b3fc..8be2e12bf6 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/MRFMultiphaseInterFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H index a63ab62103..bfcb18f2c1 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/alphaCourantNo.H @@ -39,9 +39,11 @@ scalar meanAlphaCoNum = 0.0; if (mesh.nInternalFaces()) { - scalarField sumPhi = + scalarField sumPhi + ( mixture.nearInterface()().internalField() - *fvc::surfaceSum(mag(phi))().internalField(); + * fvc::surfaceSum(mag(phi))().internalField() + ); alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 6256b1cebf..9be378e5c5 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -133,7 +133,11 @@ void alphaContactAngleFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, alphaContactAngleFvPatchScalarField); +makeNonTemplatedPatchTypeField +( + fvPatchScalarField, + alphaContactAngleFvPatchScalarField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 22c45bad71..d2bb7d05b4 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -273,7 +273,7 @@ void Foam::multiphaseMixture::solve() if (nAlphaSubCycles > 1) { - surfaceScalarField rhoPhiSum = 0.0*rhoPhi_; + surfaceScalarField rhoPhiSum(0.0*rhoPhi_); dimensionedScalar totalDeltaT = runTime.deltaT(); for @@ -314,9 +314,11 @@ Foam::tmp Foam::multiphaseMixture::nHatfv surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha); */ - surfaceVectorField gradAlphaf = + surfaceVectorField gradAlphaf + ( fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1)) - - fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2)); + - fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2)) + ); // Face unit interface normal return gradAlphaf/(mag(gradAlphaf) + deltaN_); @@ -361,9 +363,11 @@ void Foam::multiphaseMixture::correctContactAngle vectorField& nHatPatch = nHatb[patchi]; - vectorField AfHatPatch = + vectorField AfHatPatch + ( mesh_.Sf().boundaryField()[patchi] - /mesh_.magSf().boundaryField()[patchi]; + /mesh_.magSf().boundaryField()[patchi] + ); alphaContactAngleFvPatchScalarField::thetaPropsTable:: const_iterator tp = @@ -396,21 +400,25 @@ void Foam::multiphaseMixture::correctContactAngle scalar thetaR = convertToRad*tp().thetaR(matched); // Calculated the component of the velocity parallel to the wall - vectorField Uwall = + vectorField Uwall + ( U_.boundaryField()[patchi].patchInternalField() - - U_.boundaryField()[patchi]; + - U_.boundaryField()[patchi] + ); Uwall -= (AfHatPatch & Uwall)*AfHatPatch; // Find the direction of the interface parallel to the wall - vectorField nWall = - nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch; + vectorField nWall + ( + nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch + ); // Normalise nWall nWall /= (mag(nWall) + SMALL); // Calculate Uwall resolved normal to the interface parallel to // the interface - scalarField uwall = nWall & Uwall; + scalarField uwall(nWall & Uwall); theta += (thetaA - thetaR)*tanh(uwall/uTheta); } @@ -418,9 +426,9 @@ void Foam::multiphaseMixture::correctContactAngle // Reset nHatPatch to correspond to the contact angle - scalarField a12 = nHatPatch & AfHatPatch; + scalarField a12(nHatPatch & AfHatPatch); - scalarField b1 = cos(theta); + scalarField b1(cos(theta)); scalarField b2(nHatPatch.size()); @@ -429,10 +437,10 @@ void Foam::multiphaseMixture::correctContactAngle b2[facei] = cos(acos(a12[facei]) - theta[facei]); } - scalarField det = 1.0 - a12*a12; + scalarField det(1.0 - a12*a12); - scalarField a = (b1 - a12*b2)/det; - scalarField b = (b2 - a12*b1)/det; + scalarField a((b1 - a12*b2)/det); + scalarField b((b2 - a12*b1)/det); nHatPatch = a*AfHatPatch + b*nHatPatch; @@ -508,7 +516,7 @@ void Foam::multiphaseMixture::solveAlphas ) ); - surfaceScalarField phic = mag(phi_/mesh_.magSf()); + surfaceScalarField phic(mag(phi_/mesh_.magSf())); phic = min(cAlpha*phic, max(phic)); for (int gCorr=0; gCorr tgradU = fvc::grad(U); - volScalarField G = 2*mut*(tgradU() && dev(symm(tgradU()))); + volScalarField G(2*mut*(tgradU() && dev(symm(tgradU())))); tgradU.clear(); - volScalarField Gcoef = - Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin); + volScalarField Gcoef + ( + Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin) + ); #include "wallFunctions.H" diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index 806909ffe7..f359e95254 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -1,4 +1,4 @@ -volScalarField rAU = 1.0/UEqn.A(); +volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rAUf ( diff --git a/applications/solvers/multiphase/settlingFoam/plasticViscosity.H b/applications/solvers/multiphase/settlingFoam/plasticViscosity.H index cbbeb7f3f5..2797205a75 100644 --- a/applications/solvers/multiphase/settlingFoam/plasticViscosity.H +++ b/applications/solvers/multiphase/settlingFoam/plasticViscosity.H @@ -5,11 +5,13 @@ volScalarField plasticViscosity const volScalarField& alpha ) { - return + tmp tfld ( plasticViscosityCoeff* ( pow(10.0, plasticViscosityExponent*alpha + SMALL) - scalar(1) ) ); + + return tfld(); } diff --git a/applications/solvers/multiphase/settlingFoam/wallFunctions.H b/applications/solvers/multiphase/settlingFoam/wallFunctions.H index decccfbff5..952d3c4591 100644 --- a/applications/solvers/multiphase/settlingFoam/wallFunctions.H +++ b/applications/solvers/multiphase/settlingFoam/wallFunctions.H @@ -34,11 +34,13 @@ { const scalarField& rhow = rho.boundaryField()[patchi]; - const scalarField muw = mul.boundaryField()[patchi]; + const scalarField muw(mul.boundaryField()[patchi]); const scalarField& mutw = mut.boundaryField()[patchi]; - scalarField magFaceGradU = - mag(U.boundaryField()[patchi].snGrad()); + scalarField magFaceGradU + ( + mag(U.boundaryField()[patchi].snGrad()) + ); forAll(curPatch, facei) { diff --git a/applications/solvers/multiphase/settlingFoam/wallViscosity.H b/applications/solvers/multiphase/settlingFoam/wallViscosity.H index 8f64c27b3c..9516bb0fea 100644 --- a/applications/solvers/multiphase/settlingFoam/wallViscosity.H +++ b/applications/solvers/multiphase/settlingFoam/wallViscosity.H @@ -13,7 +13,7 @@ { const scalarField& rhow = rho.boundaryField()[patchi]; - const scalarField muw = mul.boundaryField()[patchi]; + const scalarField muw(mul.boundaryField()[patchi]); scalarField& mutw = mut.boundaryField()[patchi]; forAll(curPatch, facei) diff --git a/applications/solvers/multiphase/settlingFoam/yieldStress.H b/applications/solvers/multiphase/settlingFoam/yieldStress.H index 6b1b734f50..cb0415c66f 100644 --- a/applications/solvers/multiphase/settlingFoam/yieldStress.H +++ b/applications/solvers/multiphase/settlingFoam/yieldStress.H @@ -6,7 +6,7 @@ volScalarField yieldStress const volScalarField& alpha ) { - return + tmp tfld ( yieldStressCoeff* ( @@ -14,4 +14,6 @@ volScalarField yieldStress - pow(10.0, yieldStressExponent*yieldStressOffset) ) ); + + return tfld(); } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index ca11063449..08f00fc185 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -1,6 +1,6 @@ { - volScalarField rAU = 1.0/UEqn.A(); - surfaceScalarField rAUf = fvc::interpolate(rAU); + volScalarField rAU(1.0/UEqn.A()); + surfaceScalarField rAUf(fvc::interpolate(rAU)); U = rAU*UEqn.H(); surfaceScalarField phiU diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H index 6eb2fe8850..b07f3e70dd 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H @@ -3,7 +3,7 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); { { - volTensorField gradUaT = fvc::grad(Ua)().T(); + volTensorField gradUaT(fvc::grad(Ua)().T()); if (kineticTheory.on()) { @@ -26,9 +26,11 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); Rca -= ((kineticTheory.lambda()/rhoa)*tr(gradUaT))*tensor(I); } - surfaceScalarField phiRa = + surfaceScalarField phiRa + ( -fvc::interpolate(nuEffa)*mesh.magSf()*fvc::snGrad(alpha) - /fvc::interpolate(alpha + scalar(0.001)); + /fvc::interpolate(alpha + scalar(0.001)) + ); UaEqn = ( @@ -56,16 +58,18 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime); } { - volTensorField gradUbT = fvc::grad(Ub)().T(); + volTensorField gradUbT(fvc::grad(Ub)().T()); volTensorField Rcb ( "Rcb", ((2.0/3.0)*I)*(k + nuEffb*tr(gradUbT)) - nuEffb*gradUbT ); - surfaceScalarField phiRb = + surfaceScalarField phiRb + ( -fvc::interpolate(nuEffb)*mesh.magSf()*fvc::snGrad(beta) - /fvc::interpolate(beta + scalar(0.001)); + /fvc::interpolate(beta + scalar(0.001)) + ); UbEqn = ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H index 47057c0efb..cac8e52a8e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/alphaEqn.H @@ -2,13 +2,13 @@ word scheme("div(phi,alpha)"); word schemer("div(phir,alpha)"); - surfaceScalarField phic = phi; - surfaceScalarField phir = phia - phib; + surfaceScalarField phic(phi); + surfaceScalarField phir(phia - phib); if (g0.value() > 0.0) { - surfaceScalarField alphaf = fvc::interpolate(alpha); - surfaceScalarField phipp = ppMagf*fvc::snGrad(alpha)*mesh.magSf(); + surfaceScalarField alphaf(fvc::interpolate(alpha)); + surfaceScalarField phipp(ppMagf*fvc::snGrad(alpha)*mesh.magSf()); phir += phipp; phic += fvc::interpolate(alpha)*phipp; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H index e422fe845b..00581cd302 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H @@ -132,15 +132,19 @@ Info<< "Calculating field DDtUa and DDtUb\n" << endl; - volVectorField DDtUa = + volVectorField DDtUa + ( fvc::ddt(Ua) + fvc::div(phia, Ua) - - fvc::div(phia)*Ua; + - fvc::div(phia)*Ua + ); - volVectorField DDtUb = + volVectorField DDtUb + ( fvc::ddt(Ub) + fvc::div(phib, Ub) - - fvc::div(phib)*Ub; + - fvc::div(phib)*Ub + ); Info<< "Calculating field g.h\n" << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C index da4c723a32..2b68640f23 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -68,7 +68,7 @@ Foam::tmp Foam::Ergun::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); return 150.0*alpha_*phaseb_.nu()*phaseb_.rho() diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C index e728d5d967..4ff7d0fc13 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -68,9 +68,9 @@ Foam::tmp Foam::Gibilaro::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); - volScalarField bp = pow(beta, -2.8); - volScalarField Re = max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); + volScalarField bp(pow(beta, -2.8)); + volScalarField Re(max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); return (17.3/Re + scalar(0.336))*phaseb_.rho()*Ur*bp/phasea_.d(); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C index da72226edb..a99f975330 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -68,12 +68,12 @@ Foam::tmp Foam::GidaspowErgunWenYu::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); - volScalarField bp = pow(beta, -2.65); - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); + volScalarField bp(pow(beta, -2.65)); + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); - volScalarField Cds = 24.0*(1.0 + 0.15*pow(Re, 0.687))/Re; + volScalarField Cds(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C index 5f9f2054db..1da8e0c547 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C @@ -68,11 +68,11 @@ Foam::tmp Foam::GidaspowSchillerNaumann::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1e-6)); - volScalarField bp = pow(beta, -2.65); + volScalarField beta(max(scalar(1) - alpha_, scalar(1e-6))); + volScalarField bp(pow(beta, -2.65)); - volScalarField Re = max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); - volScalarField Cds = 24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re; + volScalarField Re(max(beta*Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C index 1e99ae05f5..cdfaac389e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C @@ -68,8 +68,8 @@ Foam::tmp Foam::SchillerNaumann::K const volScalarField& Ur ) const { - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); - volScalarField Cds = 24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re; + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C index 517b21cfe7..45989dbf3f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C @@ -68,9 +68,9 @@ Foam::tmp Foam::SyamlalOBrien::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); - volScalarField A = pow(beta, 4.14); - volScalarField B = 0.8*pow(beta, 1.28); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); + volScalarField A(pow(beta, 4.14)); + volScalarField B(0.8*pow(beta, 1.28)); forAll (beta, celli) { @@ -80,14 +80,17 @@ Foam::tmp Foam::SyamlalOBrien::K } } - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); - volScalarField Vr = 0.5* + volScalarField Vr ( - A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) + 0.5* + ( + A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) + ) ); - volScalarField Cds = sqr(0.63 + 4.8*sqrt(Vr/Re)); + volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re))); return 0.75*Cds*phaseb_.rho()*Ur/(phasea_.d()*sqr(Vr)); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C index 164d82a4a5..bfd5eaadbd 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -68,11 +68,11 @@ Foam::tmp Foam::WenYu::K const volScalarField& Ur ) const { - volScalarField beta = max(scalar(1) - alpha_, scalar(1.0e-6)); - volScalarField bp = pow(beta, -2.65); + volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); + volScalarField bp(pow(beta, -2.65)); - volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3)); - volScalarField Cds = 24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re; + volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); forAll(Re, celli) { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H b/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H index 3d53ef8684..8f85e12052 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kEpsilon.H @@ -6,7 +6,7 @@ if (turbulence) } tmp tgradUb = fvc::grad(Ub); - volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb()))); + volScalarField G(2*nutb*(tgradUb() && dev(symm(tgradUb())))); tgradUb.clear(); #include "wallFunctions.H" diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index c1eb55e14e..d95a2d2831 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -75,8 +75,10 @@ Foam::tmp Foam::HrenyaSinclairConductivity::kappa { const scalar sqrtPi = sqrt(constant::mathematical::pi); - volScalarField lamda = - scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; + volScalarField lamda + ( + scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_ + ); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 436d373b04..6a11f86c3e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -202,16 +202,16 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) const scalar sqrtPi = sqrt(constant::mathematical::pi); - surfaceScalarField phi = 1.5*rhoa_*phia_*fvc::interpolate(alpha_); + surfaceScalarField phi(1.5*rhoa_*phia_*fvc::interpolate(alpha_)); - volTensorField dU = gradUat.T();//fvc::grad(Ua_); - volSymmTensorField D = symm(dU); + volTensorField dU(gradUat.T()); //fvc::grad(Ua_); + volSymmTensorField D(symm(dU)); // NB, drag = K*alpha*beta, // (the alpha and beta has been extracted from the drag function for // numerical reasons) - volScalarField Ur = mag(Ua_ - Ub_); - volScalarField betaPrim = alpha_*(1.0 - alpha_)*draga_.K(Ur); + volScalarField Ur(mag(Ua_ - Ub_)); + volScalarField betaPrim(alpha_*(1.0 - alpha_)*draga_.K(Ur)); // Calculating the radial distribution function (solid volume fraction is // limited close to the packing limit, but this needs improvements) @@ -223,12 +223,15 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) ); // particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45) - volScalarField PsCoeff = granularPressureModel_->granularPressureCoeff + volScalarField PsCoeff ( - alpha_, - gs0_, - rhoa_, - e_ + granularPressureModel_->granularPressureCoeff + ( + alpha_, + gs0_, + rhoa_, + e_ + ) ); // 'thermal' conductivity (Table 3.3, p. 49) @@ -245,23 +248,27 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) ); dimensionedScalar TsmallSqrt = sqrt(Tsmall); - volScalarField ThetaSqrt = sqrt(Theta_); + volScalarField ThetaSqrt(sqrt(Theta_)); // dissipation (Eq. 3.24, p.50) - volScalarField gammaCoeff = - 12.0*(1.0 - sqr(e_))*sqr(alpha_)*rhoa_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi; + volScalarField gammaCoeff + ( + 12.0*(1.0 - sqr(e_))*sqr(alpha_)*rhoa_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi + ); // Eq. 3.25, p. 50 Js = J1 - J2 - volScalarField J1 = 3.0*betaPrim; - volScalarField J2 = + volScalarField J1(3.0*betaPrim); + volScalarField J2 + ( 0.25*sqr(betaPrim)*da_*sqr(Ur) - /(max(alpha_, scalar(1e-6))*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)); + /(max(alpha_, scalar(1e-6))*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)) + ); // bulk viscosity p. 45 (Lun et al. 1984). lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi; // stress tensor, Definitions, Table 3.1, p. 43 - volSymmTensorField tau = 2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I; + volSymmTensorField tau(2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I); if (!equilibrium_) { @@ -289,31 +296,38 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) { // equilibrium => dissipation == production // Eq. 4.14, p.82 - volScalarField K1 = 2.0*(1.0 + e_)*rhoa_*gs0_; - volScalarField K3 = 0.5*da_*rhoa_* + volScalarField K1(2.0*(1.0 + e_)*rhoa_*gs0_); + volScalarField K3 + ( + 0.5*da_*rhoa_* ( (sqrtPi/(3.0*(3.0-e_))) *(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha_*gs0_) +1.6*alpha_*gs0_*(1.0 + e_)/sqrtPi - ); + ) + ); - volScalarField K2 = - 4.0*da_*rhoa_*(1.0 + e_)*alpha_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0; + volScalarField K2 + ( + 4.0*da_*rhoa_*(1.0 + e_)*alpha_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0 + ); - volScalarField K4 = 12.0*(1.0 - sqr(e_))*rhoa_*gs0_/(da_*sqrtPi); + volScalarField K4(12.0*(1.0 - sqr(e_))*rhoa_*gs0_/(da_*sqrtPi)); - volScalarField trD = tr(D); - volScalarField tr2D = sqr(trD); - volScalarField trD2 = tr(D & D); + volScalarField trD(tr(D)); + volScalarField tr2D(sqr(trD)); + volScalarField trD2(tr(D & D)); - volScalarField t1 = K1*alpha_ + rhoa_; - volScalarField l1 = -t1*trD; - volScalarField l2 = sqr(t1)*tr2D; - volScalarField l3 = + volScalarField t1(K1*alpha_ + rhoa_); + volScalarField l1(-t1*trD); + volScalarField l2(sqr(t1)*tr2D); + volScalarField l3 + ( 4.0 *K4 *max(alpha_, scalar(1e-6)) - *(2.0*K3*trD2 + K2*tr2D); + *(2.0*K3*trD2 + K2*tr2D) + ); Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha_ + 1.0e-4)*K4)); } @@ -321,14 +335,17 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) Theta_.max(1.0e-15); Theta_.min(1.0e+3); - volScalarField pf = frictionalStressModel_->frictionalPressure + volScalarField pf ( - alpha_, - alphaMinFriction_, - alphaMax_, - Fr_, - eta_, - p_ + frictionalStressModel_->frictionalPressure + ( + alpha_, + alphaMinFriction_, + alphaMax_, + Fr_, + eta_, + p_ + ) ); PsCoeff += pf/(Theta_+Tsmall); @@ -340,23 +357,26 @@ void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) pa_ = PsCoeff*Theta_; // frictional shear stress, Eq. 3.30, p. 52 - volScalarField muf = frictionalStressModel_->muf + volScalarField muf ( - alpha_, - alphaMax_, - pf, - D, - phi_ + frictionalStressModel_->muf + ( + alpha_, + alphaMax_, + pf, + D, + phi_ + ) ); - // add frictional stress + // add frictional stress mua_ += muf; mua_.min(1.0e+2); mua_.max(0.0); Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl; - volScalarField ktn = mua_/rhoa_; + volScalarField ktn(mua_/rhoa_); Info<< "kinTheory: min(nua) = " << min(ktn).value() << ", max(nua) = " << max(ktn).value() << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index e52a3b204e..620ca79b69 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -78,8 +78,10 @@ Foam::kineticTheoryModels::HrenyaSinclairViscosity::mua { const scalar sqrtPi = sqrt(constant::mathematical::pi); - volScalarField lamda = - scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_; + volScalarField lamda + ( + scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_ + ); return rhoa*da*sqrt(Theta)* ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H index 5e0caf1f09..b614a4dfbe 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H @@ -1,18 +1,18 @@ - volVectorField Ur = Ua - Ub; - volScalarField magUr = mag(Ur); + volVectorField Ur(Ua - Ub); + volScalarField magUr(mag(Ur)); - volScalarField Ka = draga->K(magUr); - volScalarField K = Ka; + volScalarField Ka(draga->K(magUr)); + volScalarField K(Ka); if (dragPhase == "b") { - volScalarField Kb = dragb->K(magUr); + volScalarField Kb(dragb->K(magUr)); K = Kb; } else if (dragPhase == "blended") { - volScalarField Kb = dragb->K(magUr); + volScalarField Kb(dragb->K(magUr)); K = (beta*Ka + alpha*Kb); } - volVectorField liftCoeff = Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U)); + volVectorField liftCoeff(Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U))); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index f92944a414..82fc1280c1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -1,21 +1,23 @@ { - surfaceScalarField alphaf = fvc::interpolate(alpha); - surfaceScalarField betaf = scalar(1) - alphaf; + surfaceScalarField alphaf(fvc::interpolate(alpha)); + surfaceScalarField betaf(scalar(1) - alphaf); - volScalarField rUaA = 1.0/UaEqn.A(); - volScalarField rUbA = 1.0/UbEqn.A(); + volScalarField rUaA(1.0/UaEqn.A()); + volScalarField rUbA(1.0/UbEqn.A()); phia == (fvc::interpolate(Ua) & mesh.Sf()); phib == (fvc::interpolate(Ub) & mesh.Sf()); rUaAf = fvc::interpolate(rUaA); - surfaceScalarField rUbAf = fvc::interpolate(rUbA); + surfaceScalarField rUbAf(fvc::interpolate(rUbA)); Ua = rUaA*UaEqn.H(); Ub = rUbA*UbEqn.H(); - surfaceScalarField phiDraga = - fvc::interpolate(beta/rhoa*K*rUaA)*phib + rUaAf*(g & mesh.Sf()); + surfaceScalarField phiDraga + ( + fvc::interpolate(beta/rhoa*K*rUaA)*phib + rUaAf*(g & mesh.Sf()) + ); if (g0.value() > 0.0) { @@ -27,8 +29,10 @@ phiDraga -= rUaAf*fvc::snGrad(kineticTheory.pa()/rhoa)*mesh.magSf(); } - surfaceScalarField phiDragb = - fvc::interpolate(alpha/rhob*K*rUbA)*phia + rUbAf*(g & mesh.Sf()); + surfaceScalarField phiDragb + ( + fvc::interpolate(alpha/rhob*K*rUbA)*phia + rUbAf*(g & mesh.Sf()) + ); // Fix for gravity on outlet boundary. forAll(p.boundaryField(), patchi) @@ -66,7 +70,7 @@ if (nonOrth == nNonOrthCorr) { - surfaceScalarField SfGradp = pEqn.flux()/Dp; + surfaceScalarField SfGradp(pEqn.flux()/Dp); phia -= rUaAf*SfGradp/rhoa; phib -= rUbAf*SfGradp/rhob; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H index ba6dcf7ce6..e5d9d86a55 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/packingLimiter.H @@ -1,11 +1,11 @@ if (packingLimiter) { // Calculating exceeding volume fractions - volScalarField alphaEx = max(alpha - alphaMax, scalar(0)); + volScalarField alphaEx(max(alpha - alphaMax, scalar(0))); // Finding neighbouring cells of the whole domain labelListList neighbour = mesh.cellCells(); - scalarField cellVolumes = mesh.cellVolumes(); + scalarField cellVolumes(mesh.cellVolumes()); forAll (alphaEx, celli) { diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C index b2b2ac9d0d..2860576939 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/solidDisplacementFoam.C @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) } { - volTensorField gradD = fvc::grad(D); + volTensorField gradD(fvc::grad(D)); sigmaD = mu*twoSymm(gradD) + (lambda*I)*tr(gradD); if (compactNormalStress) diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index a3ca61e0ff..46a947ef0b 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -168,7 +168,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() scalar twoMuLambda = (2*mu + lambda).value(); - vectorField n = patch().nf(); + vectorField n(patch().nf()); const fvPatchField& sigmaD = patch().lookupPatchField("sigmaD"); @@ -207,7 +207,11 @@ void tractionDisplacementFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchVectorField, tractionDisplacementFvPatchVectorField); +makeNonTemplatedPatchTypeField +( + fvPatchVectorField, + tractionDisplacementFvPatchVectorField +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H index e1074a3408..169c7f229f 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/kineticEnergyLimiter.H @@ -1,10 +1,10 @@ if (!(runTime.timeIndex() % 5)) { - volScalarField kineticEnergy = magSqr(Dcorr); + volScalarField kineticEnergy(magSqr(Dcorr)); dimensionedScalar intKineticEnergy = fvc::domainIntegrate(kineticEnergy); Info<< "kineticEnergy = " << intKineticEnergy.value() << endl; - volScalarField kineticPower = (Dcorr - Dcorr.oldTime()) & Dcorr; + volScalarField kineticPower((Dcorr - Dcorr.oldTime()) & Dcorr); dimensionedScalar intKineticPower = fvc::domainIntegrate(kineticPower); Info<< "kineticPower = " << intKineticPower.value() << endl; diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C index df2c3ed7f3..a44d8cb67b 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/solidEquilibriumDisplacementFoam.C @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) D += accFac*Dcorr; { - volTensorField gradDcorr = fvc::grad(Dcorr); + volTensorField gradDcorr(fvc::grad(Dcorr)); sigmaExp = (lambda - mu)*gradDcorr + mu*gradDcorr.T() diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C index b719e8af69..0bf83bcca5 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C @@ -165,7 +165,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs() lambda = nu*E/((1.0 + nu)*(1.0 - nu)); } - vectorField n = patch().nf(); + vectorField n(patch().nf()); const fvPatchField& sigmaD = patch().lookupPatchField("sigmaD"); @@ -194,7 +194,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField +makeNonTemplatedPatchTypeField ( fvPatchVectorField, tractionDisplacementCorrectionFvPatchVectorField diff --git a/applications/test/ODE/Test-ODE.C b/applications/test/ODE/Test-ODE.C index 2a3b8357b9..95af263718 100644 --- a/applications/test/ODE/Test-ODE.C +++ b/applications/test/ODE/Test-ODE.C @@ -129,8 +129,8 @@ int main(int argc, char *argv[]) scalar eps = ::Foam::exp(-scalar(i + 1)); scalar x = xStart; - scalarField y = yStart; - scalarField dydx = dyStart; + scalarField y(yStart); + scalarField dydx(dyStart); scalarField yScale(ode.nEqns(), 1.0); scalar hEst = 0.6; @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) scalar x = xStart; scalar xEnd = x + 1.0; - scalarField y = yStart; + scalarField y(yStart); scalarField yEnd(ode.nEqns()); yEnd[0] = ::Foam::j0(xEnd); diff --git a/applications/test/fvc/Test-fvc.C b/applications/test/fvc/Test-fvc.C index 70d03a692a..133884c7de 100644 --- a/applications/test/fvc/Test-fvc.C +++ b/applications/test/fvc/Test-fvc.C @@ -41,18 +41,17 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" - volScalarField fx = pow(mesh.C().component(vector::X), 2); + volScalarField fx(pow(mesh.C().component(vector::X), 2)); fx.write(); - volScalarField gradx4 = fvc::grad(fx)().component(vector::X); + volScalarField gradx4(fvc::grad(fx)().component(vector::X)); gradx4.write(); - //volVectorField curlC = fvc::curl(1.0*mesh.C()); - + //volVectorField curlC(fvc::curl(1.0*mesh.C())); //curlC.write(); /* - surfaceScalarField xf = mesh.Cf().component(vector::X); - surfaceScalarField xf4 = pow(xf, 4); + surfaceScalarField xf(mesh.Cf().component(vector::X)); + surfaceScalarField xf4(pow(xf, 4)); for (int i=1; i. + +Application + +Description + Test label ranges +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "IOobject.H" +#include "IOstreams.H" +#include "IFstream.H" +#include "IStringStream.H" +#include "labelRanges.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + argList::noParallel(); + argList::validArgs.insert("start size .. startN sizeN"); + argList::addOption("verbose"); + argList::addNote + ( + "The default is to add ranges, use 'add' and 'del' to toggle\n\n" + "Eg, 0 10 30 10 del 20 15" + ); + + argList args(argc, argv, false, true); + + if (args.optionFound("verbose")) + { + labelRange::debug = 1; + } + + + labelRanges ranges; + + bool removeMode = false; + for (label argI=1; argI < args.size()-1; ++argI) + { + if (args[argI] == "add") + { + removeMode = false; + continue; + } + else if (args[argI] == "del") + { + removeMode = true; + continue; + } + + label start = 0; + label size = 0; + + IStringStream(args[argI])() >> start; + ++argI; + IStringStream(args[argI])() >> size; + + labelRange range(start, size); + + Info<< "---------------" << nl; + if (removeMode) + { + Info<< "del " << range << " :"; + forAllConstIter(labelRange, range, iter) + { + Info<< " " << iter(); + } + Info<< nl; + + ranges.remove(range); + } + else + { + Info<< "add " << range << " :"; + forAllConstIter(labelRange, range, iter) + { + Info<< " " << iter(); + } + Info<< nl; + + ranges.add(range); + } + + Info<< "" << ranges << "" << nl; + forAllConstIter(labelRanges, ranges, iter) + { + Info<< " " << iter(); + } + Info<< nl; + } + + return 0; +} + +// ************************************************************************* // diff --git a/applications/test/lduMatrix/Test-lduMatrix3.C b/applications/test/lduMatrix/Test-lduMatrix3.C index 175cf949e9..7874c57c39 100644 --- a/applications/test/lduMatrix/Test-lduMatrix3.C +++ b/applications/test/lduMatrix/Test-lduMatrix3.C @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) for (int corr=0; corrsize() << "]\n"; DynamicList