diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index d9fbc8f1dd..8b93ea74c3 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -165,14 +165,10 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs() return; } - const fvPatchScalarField& pmu = - patch().lookupPatchField(muName_); - const fvPatchScalarField& prho = - patch().lookupPatchField(rhoName_); - const fvPatchField& ppsi = - patch().lookupPatchField(psiName_); - const fvPatchVectorField& pU = - patch().lookupPatchField(UName_); + const auto& pmu = patch().lookupPatchField(muName_); + const auto& prho = patch().lookupPatchField(rhoName_); + const auto& ppsi = patch().lookupPatchField(psiName_); + const auto& pU = patch().lookupPatchField(UName_); // Prandtl number reading consistent with rhoCentralFoam const dictionary& thermophysicalProperties = diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 65ab5787b7..6d0bd7e488 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -155,12 +155,9 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs() return; } - const fvPatchScalarField& pmu = - patch().lookupPatchField(muName_); - const fvPatchScalarField& prho = - patch().lookupPatchField(rhoName_); - const fvPatchField& ppsi = - patch().lookupPatchField(psiName_); + const auto& pmu = patch().lookupPatchField(muName_); + const auto& prho = patch().lookupPatchField(rhoName_); + const auto& ppsi = patch().lookupPatchField(psiName_); Field C1 ( @@ -187,8 +184,8 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs() if (curvature_) { - const fvPatchTensorField& ptauMC = - patch().lookupPatchField(tauMCName_); + const auto& ptauMC = + patch().lookupPatchField(tauMCName_); vectorField n(patch().nf()); refValue() -= C1/prho*transform(I - n*n, (n & ptauMC)); diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C index 08064c0ab2..bbc871e6b8 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C @@ -104,11 +104,8 @@ void Foam::fixedRhoFvPatchScalarField::updateCoeffs() return; } - const fvPatchField& psip = - patch().lookupPatchField(psiName_); - - const fvPatchField& pp = - patch().lookupPatchField(pName_); + const auto& psip = patch().lookupPatchField(psiName_); + const auto& pp = patch().lookupPatchField(pName_); operator==(psip*pp); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C index df3a1c5020..ba6b51f3d2 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/derivedFvPatchFields/turbulentTemperatureTwoPhaseRadCoupledMixed/turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C @@ -88,26 +88,29 @@ kappa case mtLookup: { - if (mesh.foundObject(kappaName_)) { - return patch().lookupPatchField - ( - kappaName_ - ); + const auto* ptr = + mesh.cfindObject(kappaName_); + + if (ptr) + { + return patch().patchField(*ptr); + } } - else if (mesh.foundObject(kappaName_)) { - const symmTensorField& KWall = - patch().lookupPatchField - ( - kappaName_ - ); + const auto* ptr = + mesh.cfindObject(kappaName_); - const vectorField n(patch().nf()); + if (ptr) + { + const symmTensorField& KWall = patch().patchField(*ptr); - return n & KWall & n; + const vectorField n(patch().nf()); + + return n & KWall & n; + } } - else + { FatalErrorInFunction << "Did not find field " << kappaName_ @@ -117,9 +120,6 @@ kappa << " or volSymmTensorField." << exit(FatalError); } - - - break; } @@ -131,10 +131,8 @@ kappa mesh.lookupObject("phaseProperties") ); - tmp kappaEff - ( - new scalarField(patch().size(), 0.0) - ); + auto tkappaEff = tmp::New(patch().size(), Zero); + auto& kappaEff = tkappaEff.ref(); forAll(fluid.phases(), phasei) { @@ -142,10 +140,10 @@ kappa const fvPatchScalarField& alpha = phase.boundaryField()[patchi]; - kappaEff.ref() += alpha*phase.kappaEff(patchi)(); + kappaEff += alpha*phase.kappaEff(patchi)(); } - return kappaEff; + return tkappaEff; break; } @@ -161,9 +159,11 @@ kappa } } - return scalarField(0); + // Return zero-sized (not nullptr) + return tmp::New(); } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -308,12 +308,11 @@ updateCoeffs() scalarField& Tp = *this; - const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField& - nbrField = refCast - - ( - nbrPatch.lookupPatchField(TnbrName_) - ); + const auto& nbrField = + refCast + < + const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField + >(nbrPatch.lookupPatchField(TnbrName_)); // Swap to obtain full local values of neighbour internal field scalarField TcNbr(nbrField.patchInternalField()); @@ -330,13 +329,13 @@ updateCoeffs() scalarField qr(Tp.size(), 0.0); if (qrName_ != "none") { - qr = patch().lookupPatchField(qrName_); + qr = patch().lookupPatchField(qrName_); } scalarField qrNbr(Tp.size(), 0.0); if (qrNbrName_ != "none") { - qrNbr = nbrPatch.lookupPatchField(qrNbrName_); + qrNbr = nbrPatch.lookupPatchField(qrNbrName_); mpp.distribute(qrNbr); } diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C index 549223501d..83dfb3eb3b 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C @@ -89,17 +89,10 @@ void Foam::adjointOutletPressureFvPatchScalarField::updateCoeffs() return; } - const fvsPatchField& phip = - patch().lookupPatchField("phi"); - - const fvsPatchField& phiap = - patch().lookupPatchField("phia"); - - const fvPatchField& Up = - patch().lookupPatchField("U"); - - const fvPatchField& Uap = - patch().lookupPatchField("Ua"); + const auto& phip = patch().lookupPatchField("phi"); + const auto& phiap = patch().lookupPatchField("phia"); + const auto& Up = patch().lookupPatchField("U"); + const auto& Uap = patch().lookupPatchField("Ua"); operator==((phiap/patch().magSf() - 1.0)*phip/patch().magSf() + (Up & Uap)); diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C index 6b913b92df..98c1d8258b 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C @@ -90,11 +90,8 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs() return; } - const fvsPatchField& phiap = - patch().lookupPatchField("phia"); - - const fvPatchField& Up = - patch().lookupPatchField("U"); + const auto& phiap = patch().lookupPatchField("phia"); + const auto& Up = patch().lookupPatchField("U"); scalarField Un(mag(patch().nf() & Up)); vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL)); diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C index 297e5dc20c..ca656a739e 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C @@ -152,14 +152,9 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() db().lookupObject("thermalProperties"); - const fvPatchField& rho = - patch().lookupPatchField("rho"); - - const fvPatchField& rhoE = - patch().lookupPatchField("E"); - - const fvPatchField& nu = - patch().lookupPatchField("nu"); + const auto& rho = patch().lookupPatchField("rho"); + const auto& rhoE = patch().lookupPatchField("E"); + const auto& nu = patch().lookupPatchField("nu"); scalarField E(rhoE/rho); scalarField mu(E/(2.0*(1.0 + nu))); @@ -176,8 +171,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() vectorField n(patch().nf()); - const fvPatchField& sigmaD = - patch().lookupPatchField("sigmaD"); + const auto& sigmaD = patch().lookupPatchField("sigmaD"); gradient() = ( @@ -187,11 +181,10 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs() if (thermalProperties.get("thermalStress")) { - const fvPatchField& threeKalpha= - patch().lookupPatchField("threeKalpha"); + const auto& threeKalpha = + patch().lookupPatchField("threeKalpha"); - const fvPatchField& T = - patch().lookupPatchField("T"); + const auto& T = patch().lookupPatchField("T"); gradient() += n*threeKalpha*T/twoMuLambda; } diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C index 7936a80f1b..f0fdb53f43 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C @@ -152,14 +152,9 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs() "mechanicalProperties" ); - const fvPatchField& rho = - patch().lookupPatchField("rho"); - - const fvPatchField& rhoE = - patch().lookupPatchField("E"); - - const fvPatchField& nu = - patch().lookupPatchField("nu"); + const auto& rho = patch().lookupPatchField("rho"); + const auto& rhoE = patch().lookupPatchField("E"); + const auto& nu = patch().lookupPatchField("nu"); scalarField E(rhoE/rho); scalarField mu(E/(2.0*(1.0 + nu))); @@ -172,11 +167,8 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs() vectorField n(patch().nf()); - const fvPatchField& sigmaD = - patch().lookupPatchField("sigmaD"); - - const fvPatchField& sigmaExp = - patch().lookupPatchField("sigmaExp"); + const auto& sigmaD = patch().lookupPatchField("sigmaD"); + const auto& sigmaExp = patch().lookupPatchField("sigmaExp"); gradient() = ( diff --git a/etc/codeTemplates/BC/BC.C b/etc/codeTemplates/BC/BC.C index bc945fb23c..b58cadd63d 100644 --- a/etc/codeTemplates/BC/BC.C +++ b/etc/codeTemplates/BC/BC.C @@ -205,10 +205,8 @@ void Foam::CLASS::updateCoeffs() ); const scalarField& phip = - this->patch().template lookupPatchField - ( - "phi" - ); + this->patch().template lookupPatchField("phi"); + this->valueFraction() = 1.0 - pos0(phip); PARENT::updateCoeffs(); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C index 9f4f0a2a16..c4af50f5a6 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C @@ -150,11 +150,11 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs() const scalar Cmu75 = pow(Cmu_, 0.75); - const fvPatchScalarField& kp = - patch().lookupPatchField(kName_); + const auto& kp = + patch().lookupPatchField(kName_); - const fvsPatchScalarField& phip = - patch().lookupPatchField(this->phiName_); + const auto& phip = + patch().lookupPatchField(this->phiName_); this->refValue() = (Cmu75/mixingLength_)*pow(kp, 1.5); this->valueFraction() = 1.0 - pos0(phip); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C index 2cbe3bd759..fca946ff5f 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -139,11 +139,11 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() const scalar Cmu25 = pow(Cmu, 0.25); - const fvPatchScalarField& kp = - patch().lookupPatchField(kName_); + const auto& kp = + patch().lookupPatchField(kName_); - const fvsPatchScalarField& phip = - patch().lookupPatchField(this->phiName_); + const auto& phip = + patch().lookupPatchField(this->phiName_); this->refValue() = sqrt(kp)/(Cmu25*mixingLength_); this->valueFraction() = 1.0 - pos0(phip); diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C index b045715f87..0f9ee0997a 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -141,16 +141,13 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs() return; } - const auto& phi = db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); scalarField Un(phip/patch().magSf()); - if (phi.dimensions() == dimMass/dimTime) + if (phip.internalField().dimensions() == dimMass/dimTime) { - Un /= patch().lookupPatchField(rhoName_); + Un /= patch().lookupPatchField(rhoName_); } if (uniformJump_) @@ -185,7 +182,7 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs() { setJump ( - jump()*patch().lookupPatchField(rhoName_) + jump()*patch().lookupPatchField(rhoName_) ); } diff --git a/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C b/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C index 19424001cc..34c01bdc69 100644 --- a/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/atmosphericModels/derivedFvPatchFields/atmTurbulentHeatFluxTemperature/atmTurbulentHeatFluxTemperatureFvPatchScalarField.C @@ -186,7 +186,7 @@ void atmTurbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() } const scalarField& alphaEffp = - patch().lookupPatchField(alphaEffName_); + patch().lookupPatchField(alphaEffName_); const scalar t = db().time().timeOutputValue(); const scalar Cp0 = Cp0_->value(t); diff --git a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C index d69a4c89a4..361d58adb8 100644 --- a/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C +++ b/src/finiteArea/fields/faPatchFields/derived/inletOutlet/inletOutletFaPatchField.C @@ -124,10 +124,7 @@ void Foam::inletOutletFaPatchField::updateCoeffs() } const Field& phip = - this->patch(). template lookupPatchField - ( - phiName_ - ); + this->patch().template lookupPatchField(phiName_); this->valueFraction() = 1.0 - pos(phip); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index d49596d030..c3ff10de38 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -156,23 +156,13 @@ template Foam::tmp Foam::advectiveFvPatchField::advectionSpeed() const { - const surfaceScalarField& phi = - this->db().objectRegistry::template lookupObject - (phiName_); + const auto& phip = + this->patch().template lookupPatchField(phiName_); - fvsPatchField phip = - this->patch().template lookupPatchField - ( - phiName_ - ); - - if (phi.dimensions() == dimMass/dimTime) + if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchScalarField& rhop = - this->patch().template lookupPatchField - ( - rhoName_ - ); + const auto& rhop = + this->patch().template lookupPatchField(rhoName_); return phip/(rhop*this->patch().magSf()); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 2e7c25d284..6028845530 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -38,11 +38,8 @@ void Foam::fanFvPatchField::calcFanJump() { if (this->cyclicPatch().owner()) { - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = + patch().lookupPatchField(phiName_); scalarField Un(max(phip/patch().magSf(), scalar(0))); @@ -77,9 +74,9 @@ void Foam::fanFvPatchField::calcFanJump() } } - if (phi.dimensions() == dimMass/dimTime) + if (phip.internalField().dimensions() == dimMass/dimTime) { - Un /= patch().lookupPatchField(rhoName_); + Un /= patch().lookupPatchField(rhoName_); } if (nonDimensional_) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C index f339f3a854..e5d33858a1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C @@ -153,23 +153,20 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs() } // Retrieve flux field - const auto& phi = db().lookupObject(phiName()); - - const auto& phip = patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName()); const int dir = 2*direction_ - 1; // Average volumetric flow rate scalar volFlowRate = 0; - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { volFlowRate = dir*gSum(phip); } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const scalarField& rhop = - patch().lookupPatchField(rhoName()); + const auto& rhop = patch().lookupPatchField(rhoName()); volFlowRate = dir*gSum(phip/rhop); } else @@ -218,7 +215,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs() totalPressureFvPatchScalarField::updateCoeffs ( p0() - dir*pdFan, - patch().lookupPatchField(UName()) + patch().lookupPatchField(UName()) ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C index 56cf2631cb..4e559b0ca4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalInletOutletVelocity/fixedNormalInletOutletVelocityFvPatchVectorField.C @@ -166,8 +166,8 @@ void Foam::fixedNormalInletOutletVelocityFvPatchVectorField::updateCoeffs() if (fixTangentialInflow_) { - const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + const auto& phip = + patch().lookupPatchField(phiName_); valueFraction() += neg(phip)*(I - valueFraction()); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C index cc92df7021..26166054f1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C @@ -105,8 +105,7 @@ void Foam::fixedPressureCompressibleDensityFvPatchScalarField::updateCoeffs() return; } - const fvPatchField& pp = - patch().lookupPatchField(pName_); + const auto& pp = patch().lookupPatchField(pName_); const dictionary& thermoProps = db().lookupObject("thermodynamicProperties"); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index d32e3b94fd..2489daf9c4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -218,8 +218,8 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() // Mass flow-rate if (db().foundObject(rhoName_)) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = + patch().lookupPatchField(rhoName_); updateValues(rhop); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C index ac49bd1c70..eeb2d087d2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C @@ -200,8 +200,8 @@ void Foam::flowRateOutletVelocityFvPatchVectorField::updateCoeffs() // Mass flow-rate if (db().foundObject(rhoName_)) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = + patch().lookupPatchField(rhoName_); updateValues(rhop); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C index 08f995dbfe..b3909cc88f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C @@ -106,23 +106,18 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::evaluate zeroGradientFvPatchVectorField::evaluate(); - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); const vectorField n(patch().nf()); const Field& magS = patch().magSf(); - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { operator==(*this - n*(n & *this) + n*phip/magS); } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); operator==(*this - n*(n & *this) + n*phip/(rhop*magS)); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C index d42bdee751..84042e179f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C @@ -121,10 +121,7 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs() } const Field& Up = - patch().template lookupPatchField - ( - UName_ - ); + patch().template lookupPatchField(UName_); valueFraction() = 0.5 + 0.5*(Up & patch().nf())/mag(Up); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C index bd8f9a323b..9d7ba73865 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutlet/inletOutletFvPatchField.C @@ -126,10 +126,7 @@ void Foam::inletOutletFvPatchField::updateCoeffs() } const Field& phip = - this->patch().template lookupPatchField - ( - phiName_ - ); + this->patch().template lookupPatchField(phiName_); this->valueFraction() = 1.0 - pos0(phip); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C index 20f3fa227d..173f3829ce 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C @@ -169,14 +169,14 @@ void Foam::inletOutletTotalTemperatureFvPatchScalarField::updateCoeffs() return; } - const fvPatchVectorField& Up = - patch().lookupPatchField(UName_); + const auto& Up = + patch().lookupPatchField(UName_); - const fvsPatchField& phip = - patch().lookupPatchField(this->phiName_); + const auto& phip = + patch().lookupPatchField(this->phiName_); - const fvPatchField& psip = - patch().lookupPatchField(psiName_); + const auto& psip = + patch().lookupPatchField(psiName_); scalar gM1ByG = (gamma_ - 1.0)/gamma_; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C index e9a77fa0ad..3a6d2f7f0f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity/interstitialInletVelocityFvPatchVectorField.C @@ -135,8 +135,7 @@ void Foam::interstitialInletVelocityFvPatchVectorField::updateCoeffs() return; } - const fvPatchField& alphap = - patch().lookupPatchField(alphaName_); + const auto& alphap = patch().lookupPatchField(alphaName_); operator==(inletVelocity_/alphap); fixedValueFvPatchVectorField::updateCoeffs(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C index c891352101..cf24ab6fe7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedField/mappedPatchFieldBase.C @@ -904,11 +904,7 @@ void Foam::mappedPatchFieldBase::mappedWeightField if (!fieldName.empty()) { thisWeights.ref() *= - patchField_.patch().template lookupPatchField - < - volScalarField, - scalar - > + patchField_.patch().template lookupPatchField ( fieldName ).patchInternalField(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C index 016619b6c4..f0b9e4144b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/mappedFlowRate/mappedFlowRateFvPatchVectorField.C @@ -127,8 +127,10 @@ void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs() nbrMesh ).boundary()[mpp.samplePolyPatch().index()]; - scalarList phi = - nbrPatch.lookupPatchField(nbrPhiName_); + scalarList phi + ( + nbrPatch.lookupPatchField(nbrPhiName_) + ); mpp.distribute(phi); @@ -147,8 +149,7 @@ void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs() } else if (phiName.dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); // mass flow-rate operator==(n*U/rhop); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C index 8e1bb149e7..e6a90deaab 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C @@ -117,7 +117,7 @@ Foam::movingWallVelocityFvPatchVectorField::Uwall() const scalarField phip ( - p.patchField(fvc::meshPhi(U)) + p.patchField(fvc::meshPhi(U)) ); const vectorField n(p.nf()); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C index c5e5e15f9c..c1fef7c612 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletInlet/outletInletFvPatchField.C @@ -126,10 +126,7 @@ void Foam::outletInletFvPatchField::updateCoeffs() } const Field& phip = - this->patch().template lookupPatchField - ( - phiName_ - ); + this->patch().template lookupPatchField(phiName_); this->valueFraction() = pos0(phip); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C index d90b61c7bc..64dc0e549c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/outletPhaseMeanVelocity/outletPhaseMeanVelocityFvPatchVectorField.C @@ -132,8 +132,10 @@ void Foam::outletPhaseMeanVelocityFvPatchVectorField::updateCoeffs() return; } - scalarField alphap = - patch().lookupPatchField(alphaName_); + scalarField alphap + ( + patch().lookupPatchField(alphaName_) + ); alphap = max(alphap, scalar(0)); alphap = min(alphap, scalar(1)); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C index e4b4028791..a5e0af6171 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C @@ -142,10 +142,7 @@ void Foam::phaseHydrostaticPressureFvPatchScalarField::updateCoeffs() } const scalarField& alphap = - patch().lookupPatchField - ( - phaseFraction_ - ); + patch().lookupPatchField(phaseFraction_); const uniformDimensionedVectorField& g = meshObjects::gravity::New(db().time()); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C index 770634339f..321a85d299 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/plenumPressure/plenumPressureFvPatchScalarField.C @@ -177,10 +177,9 @@ void Foam::plenumPressureFvPatchScalarField::updateCoeffs() ( internalField().name() ).oldTime().boundaryField()[patch().index()]; - const fvPatchField& U = - patch().lookupPatchField(UName_); - const fvsPatchField& phi = - patch().lookupPatchField(phiName_); + + const auto& U = patch().lookupPatchField(UName_); + const auto& phi = patch().lookupPatchField(phiName_); // Get the timestep const scalar dt = db().time().deltaTValue(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C index e2c83fb1c1..80429a5830 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C @@ -151,23 +151,18 @@ void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs() return; } - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); tmp n = patch().nf(); tmp ndmagS = (n & inletDir_)*patch().magSf(); - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { refValue() = inletDir_*phip/ndmagS; } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); refValue() = inletDir_*phip/(rhop*ndmagS); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C index aa8c33a182..c0ef598984 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C @@ -141,23 +141,18 @@ void Foam::pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs() return; } - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); tmp n = patch().nf(); tmp ndmagS = (n & inletDir_)*patch().magSf(); - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { operator==(inletDir_*phip/ndmagS); } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); operator==(inletDir_*phip/(rhop*ndmagS)); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C index fc21808f87..34f089687f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C @@ -121,11 +121,7 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs() return; } - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); tmp n = patch().nf(); const Field& magSf = patch().magSf(); @@ -134,14 +130,13 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs() vectorField Ut(patchInternalField()); Ut -= n()*(Ut & n()); - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { refValue() = Ut + n*phip/magSf; } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); refValue() = Ut + n*phip/(rhop*magSf); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C index 52c9d9e829..a30aa581c5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C @@ -175,7 +175,7 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::updateCoeffs() } const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(phiName_); valueFraction() = neg(phip)*(I - sqr(patch().nf())); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C index a7e1fba8fb..629aad6f38 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C @@ -109,23 +109,18 @@ void Foam::pressureInletVelocityFvPatchVectorField::updateCoeffs() return; } - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); tmp n = patch().nf(); const Field& magS = patch().magSf(); - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { operator==(n*phip/magS); } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); operator==(n*phip/(rhop*magS)); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C index c66edef9b1..7a0a8bfd74 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C @@ -121,23 +121,18 @@ void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs() return; } - const surfaceScalarField& phi = - db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); tmp n = patch().nf(); const Field& magS = patch().magSf(); - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { refValue() = n*phip/magS; } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); refValue() = n*phip/(rhop*magS); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C index ed7c739dfb..a93495d6fb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C @@ -222,10 +222,7 @@ void Foam::pressurePIDControlInletVelocityFvPatchVectorField::updateCoeffs() const scalar deltaT(db().time().deltaTValue()); // Get the flux field - const surfaceScalarField& phi - ( - db().lookupObject(phiName_) - ); + const auto& phi = db().lookupObject(phiName_); // Update the old-time quantities if (timeIndex_ != db().time().timeIndex()) @@ -244,10 +241,9 @@ void Foam::pressurePIDControlInletVelocityFvPatchVectorField::updateCoeffs() } else if (phi.dimensions() == dimMass/dimTime) { - const fvPatchField& rhoField = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); - rho = gSum(rhoField*patch().magSf())/gSum(patch().magSf()); + rho = gSum(rhop*patch().magSf())/gSum(patch().magSf()); } else { diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C index 8f70522e99..ddb0204626 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressurePermeableAlphaInletOutletVelocity/pressurePermeableAlphaInletOutletVelocityFvPatchVectorField.C @@ -131,21 +131,17 @@ updateCoeffs() return; } - const auto& phi = db().lookupObject(phiName_); - - const fvsPatchField& phip = - patch().patchField(phi); + const auto& phip = patch().lookupPatchField(phiName_); const vectorField n(patch().nf()); - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { refValue() = (phip/patch().magSf())*n; } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); refValue() = (phip/(rhop*patch().magSf()))*n; } @@ -164,7 +160,7 @@ updateCoeffs() if (alphaName_ != "none") { const scalarField& alphap = - patch().lookupPatchField(alphaName_); + patch().lookupPatchField(alphaName_); const scalarField alphaCut(pos(alphap - alphaMin_)); valueFraction() = max(alphaCut, valueFraction()); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.C index 1141e88bcd..6bc84ada0d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghPermeableAlphaTotalPressure/prghPermeableAlphaTotalPressureFvPatchScalarField.C @@ -189,13 +189,13 @@ void Foam::prghPermeableAlphaTotalPressureFvPatchScalarField::updateSnGrad } const scalarField& rhop = - patch().lookupPatchField(rhoName_); + patch().lookupPatchField(rhoName_); const scalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(phiName_); const vectorField& Up = - patch().lookupPatchField(UName_); + patch().lookupPatchField(UName_); const uniformDimensionedVectorField& g = meshObjects::gravity::New(db().time()); @@ -226,7 +226,8 @@ void Foam::prghPermeableAlphaTotalPressureFvPatchScalarField::updateSnGrad if (alphaName_ != "none") { const scalarField& alphap = - patch().lookupPatchField(alphaName_); + patch().lookupPatchField(alphaName_); + tmp alphaCut(pos(alphap - alphaMin_)); valueFraction() = 1 - alphaCut; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C index 551a140289..16ef1a9e75 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghPressure/prghPressureFvPatchScalarField.C @@ -147,10 +147,8 @@ void Foam::prghPressureFvPatchScalarField::updateCoeffs() return; } - const scalarField& rhop = patch().lookupPatchField - ( - rhoName_ - ); + const scalarField& rhop = + patch().lookupPatchField(rhoName_); const uniformDimensionedVectorField& g = meshObjects::gravity::New(db().time()); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.C index 10511de343..424839342c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.C @@ -122,16 +122,16 @@ void Foam::prghTotalHydrostaticPressureFvPatchScalarField::updateCoeffs() } const scalarField& rhop = - patch().lookupPatchField(rhoName_); + patch().lookupPatchField(rhoName_); const scalarField& ph_rghp = - patch().lookupPatchField(ph_rghName_); + patch().lookupPatchField(ph_rghName_); const scalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(phiName_); const vectorField& Up = - patch().lookupPatchField(UName_); + patch().lookupPatchField(UName_); operator== ( diff --git a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C index 9d3d89590b..42dfb9c088 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/prghTotalPressure/prghTotalPressureFvPatchScalarField.C @@ -154,13 +154,13 @@ void Foam::prghTotalPressureFvPatchScalarField::updateCoeffs() } const scalarField& rhop = - patch().lookupPatchField(rhoName_); + patch().lookupPatchField(rhoName_); const scalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(phiName_); const vectorField& Up = - patch().lookupPatchField(UName_); + patch().lookupPatchField(UName_); const uniformDimensionedVectorField& g = meshObjects::gravity::New(db().time()); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C index 0034ab05c1..c72a28c756 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C @@ -114,7 +114,7 @@ void Foam::rotatingTotalPressureFvPatchScalarField::updateCoeffs() const vectorField Up ( - patch().lookupPatchField(UName()) + patch().lookupPatchField(UName()) + rotationVelocity ); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C index 99b43776c7..923582b389 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C @@ -166,14 +166,11 @@ void Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs() return; } - const fvPatchField& pT = - patch().lookupPatchField(TName_); + const auto& pT = patch().lookupPatchField(TName_); - const fvPatchField& pp = - patch().lookupPatchField(pName_); + const auto& pp = patch().lookupPatchField(pName_); - const fvPatchField& ppsi = - patch().lookupPatchField(psiName_); + const auto& ppsi = patch().lookupPatchField(psiName_); // Need R of the free-stream flow. Assume R is independent of location // along patch so use face 0 diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C index 5a576a98d0..86e5291206 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFanVelocity/swirlFanVelocityFvPatchField.C @@ -40,25 +40,21 @@ void Foam::swirlFanVelocityFvPatchField::calcFanJump() { const scalar rpm = rpm_->value(this->db().time().timeOutputValue()); - const surfaceScalarField& phi = - db().lookupObject(phiName_); + const auto& phi = db().lookupObject(phiName_); - const fvPatchField& pOwner = - patch().lookupPatchField(pName_); + const auto& pOwner = patch().lookupPatchField(pName_); const label nbrIndex = this->cyclicPatch().neighbPatchID(); const fvPatch& nbrPatch = patch().boundaryMesh()[nbrIndex]; - const fvPatchField& pSlave = - nbrPatch.lookupPatchField(pName_); + const auto& pSlave = nbrPatch.lookupPatchField(pName_); scalarField deltaP(mag(pOwner - pSlave)); if (phi.dimensions() == dimMass/dimTime) { - deltaP /= - patch().lookupPatchField(rhoName_); + deltaP /= patch().lookupPatchField(rhoName_); } const vector axisHat = diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C index 7f9092557a..843068589b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C @@ -168,8 +168,7 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs() tmp n = patch().nf(); - const surfaceScalarField& phi = - db().lookupObject(phiName_); + const auto& phi = db().lookupObject(phiName_); if (phi.dimensions() == dimVolume/dimTime) { @@ -178,8 +177,8 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::updateCoeffs() } else if (phi.dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = + patch().lookupPatchField(rhoName_); // mass flow-rate operator==(tangentialVelocity + n*avgU/rhop); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C index 82627bce14..ec63722e69 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C @@ -200,17 +200,13 @@ void Foam::syringePressureFvPatchScalarField::updateCoeffs() scalar t = db().time().value(); scalar deltaT = db().time().deltaTValue(); - const surfaceScalarField& phi = - db().lookupObject(phiName_); + const auto& phip = patch().lookupPatchField(phiName_); - const fvsPatchField& phip = - patch().patchField(phi); - - if (phi.dimensions() == dimVolume/dimTime) + if (phip.internalField().dimensions() == dimVolume/dimTime) { ams_ = ams0_ + deltaT*sum((*this*psi_)*phip); } - else if (phi.dimensions() == dimMass/dimTime) + else if (phip.internalField().dimensions() == dimMass/dimTime) { ams_ = ams0_ + deltaT*sum(phip); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C index 5fab5879ee..f6daed7a87 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C @@ -167,8 +167,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs return; } - const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + const auto& phip = patch().lookupPatchField(phiName_); if (internalField().dimensions() == dimPressure) { @@ -176,8 +175,8 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs { // Variable density and low-speed compressible flow - const fvPatchField& rho = - patch().lookupPatchField(rhoName_); + const auto& rho = + patch().lookupPatchField(rhoName_); operator==(p0p - 0.5*rho*(1.0 - pos0(phip))*magSqr(Up)); } @@ -185,8 +184,8 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs { // High-speed compressible flow - const fvPatchField& psip = - patch().lookupPatchField(psiName_); + const auto& psip = + patch().lookupPatchField(psiName_); if (gamma_ > 1) { @@ -238,7 +237,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs() updateCoeffs ( p0(), - patch().lookupPatchField(UName()) + patch().lookupPatchField(UName()) ); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index 081dbd516e..79c18cc670 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -157,14 +157,14 @@ void Foam::totalTemperatureFvPatchScalarField::updateCoeffs() return; } - const fvPatchVectorField& Up = - patch().lookupPatchField(UName_); + const auto& Up = + patch().lookupPatchField(UName_); - const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + const auto& phip = + patch().lookupPatchField(phiName_); - const fvPatchField& psip = - patch().lookupPatchField(psiName_); + const auto& psip = + patch().lookupPatchField(psiName_); scalar gM1ByG = (gamma_ - 1.0)/gamma_; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C index 73716f4426..d4c054908c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C @@ -133,11 +133,11 @@ updateCoeffs() return; } - const fvPatchVectorField& Up = - patch().lookupPatchField(UName_); + const auto& Up = + patch().lookupPatchField(UName_); - const fvsPatchScalarField& phip = - patch().lookupPatchField(this->phiName_); + const auto& phip = + patch().lookupPatchField(this->phiName_); this->refValue() = 1.5*sqr(intensity_)*magSqr(Up); this->valueFraction() = 1.0 - pos0(phip); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C index 257dfc8151..1a40889aca 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformInletOutlet/uniformInletOutletFvPatchField.C @@ -152,7 +152,7 @@ void Foam::uniformInletOutletFvPatchField::updateCoeffs() this->refValue() = uniformInletValue_->value(t); const Field& phip = - this->patch().template lookupPatchField + this->patch().template lookupPatchField ( phiName_ ); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C index 8199cee64c..f9a64f8722 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C @@ -155,8 +155,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs scalar p0 = p0_->value(this->db().time().timeOutputValue()); - const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + const auto& phip = patch().lookupPatchField(phiName_); if (internalField().dimensions() == dimPressure) { @@ -164,8 +163,8 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs { // Variable density and low-speed compressible flow - const fvPatchField& rho = - patch().lookupPatchField(rhoName_); + const auto& rho = + patch().lookupPatchField(rhoName_); operator==(p0 - 0.5*rho*(1.0 - pos0(phip))*magSqr(Up)); } @@ -173,8 +172,8 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs { // High-speed compressible flow - const fvPatchField& psip = - patch().lookupPatchField(psiName_); + const auto& psip = + patch().lookupPatchField(psiName_); if (gamma_ > 1) { @@ -223,7 +222,7 @@ void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs void Foam::uniformTotalPressureFvPatchScalarField::updateCoeffs() { - updateCoeffs(patch().lookupPatchField(UName_)); + updateCoeffs(patch().lookupPatchField(UName_)); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C index ce850c96c1..1ee1eec1c6 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C @@ -137,8 +137,7 @@ void Foam::variableHeightFlowRateFvPatchScalarField::updateCoeffs() return; } - const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + const auto& phip = patch().lookupPatchField(phiName_); scalarField alphap(this->patchInternalField()); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C index d90a4d89a9..94b3a2522e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C @@ -109,8 +109,10 @@ void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField return; } - scalarField alphap = - patch().lookupPatchField(alphaName_); + scalarField alphap + ( + patch().lookupPatchField(alphaName_) + ); alphap = max(alphap, scalar(0)); alphap = min(alphap, scalar(1)); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index 7e33d7d86b..0be57ad252 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -155,8 +155,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() ddtSchemeType ddtScheme(ddtSchemeTypeNames_[ddtSchemeName]); // Retrieve the flux field from the database - const surfaceScalarField& phi = - db().lookupObject(phiName_); + const auto& phi = db().lookupObject(phiName_); // Cache the patch face-normal vectors tmp nf(patch().nf()); @@ -166,8 +165,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() if (phi.dimensions() == dimMass/dimTime) { - const scalarField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); dZetap /= rhop; } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C index 42d9cd4b21..aede4cebf4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C @@ -110,22 +110,23 @@ Foam::tmp Foam::waveTransmissiveFvPatchField::advectionSpeed() const { // Lookup the velocity and compressibility of the patch - const fvPatchField& psip = - this->patch().template - lookupPatchField(psiName_); + const auto& psip = + this->patch().template lookupPatchField(psiName_); - const surfaceScalarField& phi = + const auto& phi = this->db().template lookupObject(this->phiName_); - fvsPatchField phip = + scalarField phip + ( this->patch().template - lookupPatchField(this->phiName_); + lookupPatchField(this->phiName_) + ); if (phi.dimensions() == dimMass/dimTime) { - const fvPatchScalarField& rhop = + const auto& rhop = this->patch().template - lookupPatchField(this->rhoName_); + lookupPatchField(this->rhoName_); phip /= rhop; } diff --git a/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C b/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C index d0ae95a792..e7c86f2b12 100644 --- a/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C +++ b/src/functionObjects/field/extractEulerianParticles/extractEulerianParticles/extractEulerianParticles.C @@ -161,15 +161,11 @@ Foam::functionObjects::extractEulerianParticles::phiU() const { DebugInFunction << endl; - const surfaceScalarField& phi - ( - mesh_.lookupObject(phiName_) - ); + const auto& phi = mesh_.lookupObject(phiName_); if (phi.dimensions() == dimMass/dimTime) { - const volScalarField& rho = - mesh_.lookupObject(rhoName_); + const auto& rho = mesh_.lookupObject(rhoName_); return phi/fvc::interpolate(rho); } diff --git a/src/functionObjects/field/momentumError/momentumError.C b/src/functionObjects/field/momentumError/momentumError.C index 39f93ed6c8..4eceecaefc 100644 --- a/src/functionObjects/field/momentumError/momentumError.C +++ b/src/functionObjects/field/momentumError/momentumError.C @@ -147,7 +147,7 @@ Foam::functionObjects::momentumError::momentumError { read(dict); - const auto& phi =lookupObject(phiName_); + const auto& phi = lookupObject(phiName_); const dimensionSet momDims ( diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C index b4cf007ec5..ee813b1c83 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchFlowRateInjection/PatchFlowRateInjection.C @@ -127,8 +127,7 @@ Foam::scalar Foam::PatchFlowRateInjection::flowRate() const { const polyMesh& mesh = this->owner().mesh(); - const surfaceScalarField& phi = - mesh.lookupObject(phiName_); + const auto& phi = mesh.lookupObject(phiName_); const scalarField& phip = phi.boundaryField()[patchId_]; @@ -139,8 +138,7 @@ Foam::scalar Foam::PatchFlowRateInjection::flowRate() const } else { - const volScalarField& rho = - mesh.lookupObject(rhoName_); + const auto& rho = mesh.lookupObject(rhoName_); const scalarField& rhop = rho.boundaryField()[patchId_]; flowRateIn = max(0.0, -sum(phip/rhop)); diff --git a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C index 695f1e4c45..aad795f2a9 100644 --- a/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C +++ b/src/optimisation/adjointOptimisation/adjoint/adjointBoundaryConditions/adjointFarFieldPressure/adjointFarFieldPressureFvPatchScalarField.C @@ -110,7 +110,7 @@ void Foam::adjointFarFieldPressureFvPatchScalarField::updateCoeffs() // Adjoint flux //const fvsPatchField& phiap = - // patch().lookupPatchField("phia"); + // patch().lookupPatchField("phia"); // Primal velocity const fvPatchField& Up = boundaryContrPtr_->Ub(); diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C index c9604b3394..d6d88cae2e 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/derivedFvPatchFields/copiedFixedValue/copiedFixedValueFvPatchScalarField.C @@ -101,7 +101,7 @@ void Foam::copiedFixedValueFvPatchScalarField::updateCoeffs() operator== ( - patch().lookupPatchField(sourceFieldName_) + patch().lookupPatchField(sourceFieldName_) ); fixedValueFvPatchScalarField::updateCoeffs(); diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 9959791aee..f2d159e07d 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -165,7 +165,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() // lookup all the fields on this patch const fvPatchScalarField& alpha ( - patch().lookupPatchField + patch().lookupPatchField ( phased.volScalarField::name() ) @@ -173,7 +173,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() const fvPatchScalarField& gs0 ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("gs0", phased.name()) ) @@ -181,7 +181,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() const scalarField nu ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("nut", phased.name()) ) @@ -189,7 +189,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() const scalarField nuFric ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("nuFric", phased.name()) ) @@ -200,7 +200,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() const fvPatchScalarField& Theta ( db().foundObject(ThetaName) - ? patch().lookupPatchField(ThetaName) + ? patch().lookupPatchField(ThetaName) : alpha ); diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index cb21ff6520..85f52e183b 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -181,7 +181,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() // lookup all the fields on this patch const fvPatchScalarField& alpha ( - patch().lookupPatchField + patch().lookupPatchField ( phased.volScalarField::name() ) @@ -189,7 +189,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() const fvPatchVectorField& U ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("U", phased.name()) ) @@ -197,7 +197,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() const fvPatchScalarField& gs0 ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("gs0", phased.name()) ) @@ -205,7 +205,7 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() const fvPatchScalarField& kappa ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("kappa", phased.name()) ) diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 1ae8453c4d..03d3a85cbe 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -163,25 +163,21 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() ); // lookup all the fields on this patch - const fvPatchScalarField& alpha - ( - patch().lookupPatchField + const auto& alpha = + patch().lookupPatchField ( phased.volScalarField::name() - ) - ); + ); - const fvPatchScalarField& gs0 - ( - patch().lookupPatchField + const auto& gs0 = + patch().lookupPatchField ( IOobject::groupName("gs0", phased.name()) - ) - ); + ); const scalarField nu ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("nut", phased.name()) ) @@ -189,7 +185,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() const scalarField nuFric ( - patch().lookupPatchField + patch().lookupPatchField ( IOobject::groupName("nuFric", phased.name()) ) @@ -200,7 +196,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() const fvPatchScalarField& Theta ( db().foundObject(ThetaName) - ? patch().lookupPatchField(ThetaName) + ? patch().lookupPatchField(ThetaName) : alpha ); diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C index cb2bfbdc30..6d2663a470 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C @@ -179,37 +179,29 @@ void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs() ); // lookup all the fields on this patch - const fvPatchScalarField& alpha - ( - patch().lookupPatchField + const auto& alpha = + patch().lookupPatchField ( phased.volScalarField::name() - ) - ); + ); - const fvPatchVectorField& U - ( - patch().lookupPatchField + const auto& U = + patch().lookupPatchField ( IOobject::groupName("U", phased.name()) - ) - ); + ); - const fvPatchScalarField& gs0 - ( - patch().lookupPatchField + const auto& gs0 = + patch().lookupPatchField ( IOobject::groupName("gs0", phased.name()) - ) - ); + ); - const fvPatchScalarField& kappa - ( - patch().lookupPatchField + const auto& kappa = + patch().lookupPatchField ( IOobject::groupName("kappa", phased.name()) - ) - ); + ); const scalarField Theta(patchInternalField()); diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C index 7a7cabd103..9270915c13 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisRadiativeCoupledMixed/filmPyrolysisRadiativeCoupledMixedFvPatchScalarField.C @@ -266,14 +266,13 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs() scalarField intFld(patchInternalField()); - const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField& - nbrField = + const auto& nbrField = refCast < const filmPyrolysisRadiativeCoupledMixedFvPatchScalarField > ( - nbrPatch.lookupPatchField(TnbrName_) + nbrPatch.lookupPatchField(TnbrName_) ); // Swap to obtain full local values of neighbour internal field @@ -307,7 +306,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs() coupledPatchi = patchi; if (qrName_ != "none") { - qr = nbrPatch.lookupPatchField(qrName_); + qr = nbrPatch.lookupPatchField(qrName_); mpp.distribute(qr); } } @@ -316,7 +315,7 @@ void filmPyrolysisRadiativeCoupledMixedFvPatchScalarField::updateCoeffs() coupledPatchi = nbrPatch.index(); if (qrName_ != "none") { - qr = patch().lookupPatchField(qrName_); + qr = patch().lookupPatchField(qrName_); } } else diff --git a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C index 210f7f942b..549b41fd52 100644 --- a/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C +++ b/src/regionModels/regionCoupling/derivedFvPatchFields/filmPyrolysisVelocityCoupled/filmPyrolysisVelocityCoupledFvPatchVectorField.C @@ -173,15 +173,13 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs() pyrModel.toPrimary(pyrPatchi, phiPyr); - const surfaceScalarField& phi = - db().lookupObject(phiName_); + const auto& phi = db().lookupObject(phiName_); if (phi.dimensions() == dimVolume/dimTime) {} else if (phi.dimensions() == dimMass/dimTime) { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = patch().lookupPatchField(rhoName_); phiPyr /= rhop; } else diff --git a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C index a522f7f985..651f1349e0 100644 --- a/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C +++ b/src/regionModels/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C @@ -114,14 +114,9 @@ void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs() return; } - const fvsPatchField& phip = - patch().lookupPatchField(phiName_); - - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); - - const fvPatchField& deltafp = - patch().lookupPatchField(deltafName_); + const auto& phip = patch().lookupPatchField(phiName_); + const auto& rhop = patch().lookupPatchField(rhoName_); + const auto& deltafp = patch().lookupPatchField(deltafName_); vectorField n(patch().nf()); const scalarField& magSf = patch().magSf(); diff --git a/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index 0130150a92..26aa93d2ec 100644 --- a/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -319,7 +319,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() { qr = qrRelaxation_ - *patch().lookupPatchField(qrName_) + *patch().lookupPatchField(qrName_) + (1 - qrRelaxation_)*qrPrevious_; qrPrevious_ = qr; diff --git a/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C index 5055a52571..668940de76 100644 --- a/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C @@ -439,14 +439,12 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() const fvPatch& nbrPatch = refCast(nbrMesh).boundary()[nbrPatchI]; - const humidityTemperatureCoupledMixedFvPatchScalarField& - nbrField = - refCast + const auto& nbrField = refCast < const humidityTemperatureCoupledMixedFvPatchScalarField > ( - nbrPatch.lookupPatchField(TnbrName_) + nbrPatch.lookupPatchField(TnbrName_) ); // Swap to obtain full local values of neighbour internal field @@ -515,24 +513,21 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() const fixedGradientFvPatchField > ( - patch().lookupPatchField - ( - specieName_ - ) + patch().lookupPatchField(specieName_) ) ); - const fvPatchScalarField& pp = - patch().lookupPatchField(pName_); + const auto& pp = + patch().lookupPatchField(pName_); - const fvPatchVectorField& Up = - patch().lookupPatchField(UName_); + const auto& Up = + patch().lookupPatchField(UName_); - const fvPatchScalarField& rhop = - patch().lookupPatchField(rhoName_); + const auto& rhop = + patch().lookupPatchField(rhoName_); - const fvPatchScalarField& mup = - patch().lookupPatchField(muName_); + const auto& mup = + patch().lookupPatchField(muName_); const vectorField Ui(Up.patchInternalField()); const scalarField Yi(Yp.patchInternalField()); @@ -716,13 +711,13 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() scalarField qr(Tp.size(), Zero); if (qrName_ != "none") { - qr = patch().lookupPatchField(qrName_); + qr = patch().lookupPatchField(qrName_); } scalarField qrNbr(Tp.size(), Zero); if (qrNbrName_ != "none") { - qrNbr = nbrPatch.lookupPatchField(qrNbrName_); + qrNbr = nbrPatch.lookupPatchField(qrNbrName_); mpp.distribute(qrNbr); } diff --git a/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.C index 5f69d2c0d1..49d6b0ce93 100644 --- a/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/outletMachNumberPressure/outletMachNumberPressureFvPatchScalarField.C @@ -156,8 +156,7 @@ void Foam::outletMachNumberPressureFvPatchScalarField::updateCoeffs() const scalarField pb(p.oldTime().boundaryField()[patchi]); - const fvsPatchField& phi = - patch().lookupPatchField(phiName_); + const auto& phi = patch().lookupPatchField(phiName_); // Calculate the current mass flow rate if (phi.internalField().dimensions() != dimMass/dimTime) @@ -179,8 +178,7 @@ void Foam::outletMachNumberPressureFvPatchScalarField::updateCoeffs() const scalarField gamma(thermoPtr->gamma()().boundaryField()[patchi]); - const fvPatchField& rho = - patch().lookupPatchField(rhoName_); + const auto& rho = patch().lookupPatchField(rhoName_); const scalarField Mb(mag(Ub)/sqrt(gamma*pb/rho)); diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C index 3290afab04..e27c587628 100644 --- a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C @@ -132,8 +132,7 @@ Foam::semiPermeableBaffleMassFractionFvPatchScalarField::phiY() const const label nbrPatchi = samplePolyPatch().index(); const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchi]; - const fvPatchScalarField& nbrYp = - nbrPatch.lookupPatchField(YName); + const auto& nbrYp = nbrPatch.lookupPatchField(YName); scalarField nbrYc(nbrYp.patchInternalField()); mappedPatchBase::map().distribute(nbrYc); @@ -149,7 +148,7 @@ void Foam::semiPermeableBaffleMassFractionFvPatchScalarField::updateCoeffs() } const scalarField& phip = - patch().lookupPatchField(phiName_); + patch().lookupPatchField(phiName_); const turbulenceModel& turbModel = db().lookupObject diff --git a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C index d587414463..1af5600c2a 100644 --- a/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C +++ b/src/thermoTools/derivedFvPatchFields/semiPermeableBaffle/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C @@ -139,7 +139,7 @@ void Foam::semiPermeableBaffleVelocityFvPatchVectorField::updateCoeffs() typedef semiPermeableBaffleMassFractionFvPatchScalarField YBCType; const scalarField& rhop = - patch().lookupPatchField(rhoName_); + patch().lookupPatchField(rhoName_); const PtrList& Y = composition().Y(); diff --git a/src/thermoTools/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C b/src/thermoTools/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C index d6768f7fbb..adc76ad305 100644 --- a/src/thermoTools/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C +++ b/src/thermoTools/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C @@ -341,10 +341,7 @@ Foam::tmp Foam::temperatureCoupledBase::kappa mesh.lookupObject(basicThermo::dictName); const symmTensorField& alphaAni = - patch_.lookupPatchField - ( - alphaAniName_ - ); + patch_.lookupPatchField(alphaAniName_); const scalarField& pp = thermo.p().boundaryField()[patchi]; @@ -498,10 +495,7 @@ Foam::tmp Foam::temperatureCoupledBase::alpha case mtDirectionalSolidThermo: { const symmTensorField& alphaAni = - patch_.lookupPatchField - ( - alphaAniName_ - ); + patch_.lookupPatchField(alphaAniName_); const vectorField n(patch_.nf()); diff --git a/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index aea435936e..8ce9d2e6ef 100644 --- a/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -220,7 +220,7 @@ const solidType& thermalBaffle1DFvPatchScalarField::solid() const const thermalBaffle1DFvPatchScalarField& nbrField = refCast ( - nbrPatch.template lookupPatchField(TName_) + nbrPatch.template lookupPatchField(TName_) ); return nbrField.solid(); @@ -253,7 +253,7 @@ baffleThickness() const const thermalBaffle1DFvPatchScalarField& nbrField = refCast ( - nbrPatch.template lookupPatchField(TName_) + nbrPatch.template lookupPatchField(TName_) ); tmp tthickness @@ -284,7 +284,7 @@ tmp thermalBaffle1DFvPatchScalarField::qs() const const thermalBaffle1DFvPatchScalarField& nbrField = refCast ( - nbrPatch.template lookupPatchField(TName_) + nbrPatch.template lookupPatchField(TName_) ); tmp tqs(new scalarField(nbrField.qs())); @@ -365,15 +365,14 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() const scalarField kappaw(turbModel.kappaEff(patchi)); const fvPatchScalarField& Tp = - patch().template lookupPatchField(TName_); + patch().template lookupPatchField(TName_); scalarField qr(Tp.size(), Zero); if (qrName_ != "none") { - qr = patch().template lookupPatchField - (qrName_); + qr = patch().template lookupPatchField(qrName_); qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_; qrPrevious_ = qr; diff --git a/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C index 6c28ad6cc9..d3a6193123 100644 --- a/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C @@ -158,7 +158,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs() const label patchi = patch().index(); - const compressible::turbulenceModel& turbModel = + const auto& turbModel = db().lookupObject ( IOobject::groupName @@ -168,8 +168,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs() ) ); - const fvsPatchField& phip = - patch().lookupPatchField(phiName_); + const auto& phip = patch().lookupPatchField(phiName_); const scalarField alphap(turbModel.alphaEff(patchi)); diff --git a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index bb6c154687..e1b836fb11 100644 --- a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -346,10 +346,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() const turbulentTemperatureCoupledBaffleMixedFvPatchScalarField > ( - nbrPatch.lookupPatchField - ( - TnbrName_ - ) + nbrPatch.lookupPatchField(TnbrName_) ); // Swap to obtain full local values of neighbour K*delta diff --git a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index b6420d7a75..5dc9ad16eb 100644 --- a/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/thermoTools/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -373,7 +373,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() const auto& nbrField = refCast ( - nbrPatch.lookupPatchField(TnbrName_) + nbrPatch.lookupPatchField(TnbrName_) ); // Swap to obtain full local values of neighbour K*delta @@ -421,7 +421,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() scalarField qr(Tp.size(), Zero); if (qrName_ != "none") { - qr = patch().lookupPatchField(qrName_); + qr = patch().lookupPatchField(qrName_); } scalarField qrNbr(Tp.size(), Zero); @@ -433,13 +433,11 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() const label samplePatchi = mpp.samplePolyPatch().index(); const fvPatch& nbrPatch = refCast(nbrMesh).boundary()[samplePatchi]; - qrNbr = - nbrPatch.lookupPatchField(qrNbrName_); + qrNbr = nbrPatch.lookupPatchField(qrNbrName_); } else { - qrNbr = - patch().lookupPatchField(qrNbrName_); + qrNbr = patch().lookupPatchField(qrNbrName_); } distribute(qrNbrName_, qrNbr); } @@ -635,7 +633,7 @@ beta() const nbrField = refCast ( - nbrPatch.lookupPatchField(TnbrName_) + nbrPatch.lookupPatchField(TnbrName_) ); // Swap to obtain full local values of neighbour internal field diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C index 2179217ff1..27f4bea985 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationFvPatchScalarField.C @@ -133,15 +133,13 @@ void Foam::radiation::MarshakRadiationFvPatchScalarField::updateCoeffs() UPstream::msgType() = oldTag+1; // Temperature field - const scalarField& Tp = - patch().lookupPatchField(TName_); + const auto& Tp = patch().lookupPatchField(TName_); // Re-calc reference value refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Tp); // Diffusion coefficient - created by radiation model's ::updateCoeffs() - const scalarField& gamma = - patch().lookupPatchField("gammaRad"); + const auto& gamma = patch().lookupPatchField("gammaRad"); const boundaryRadiationProperties& boundaryRadiation = boundaryRadiationProperties::New(internalField().mesh()); diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C index b58d0e6d94..53a3e74fbf 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedTemperature/MarshakRadiationFixedTemperatureFvPatchScalarField.C @@ -158,7 +158,7 @@ updateCoeffs() // Diffusion coefficient - created by radiation model's ::updateCoeffs() const scalarField& gamma = - patch().lookupPatchField("gammaRad"); + patch().lookupPatchField("gammaRad"); //const scalarField temissivity = emissivity(); const boundaryRadiationProperties& boundaryRadiation = diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C index f0347d078a..b97fffa818 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C @@ -151,8 +151,7 @@ updateCoeffs() int oldTag = UPstream::msgType(); UPstream::msgType() = oldTag+1; - const scalarField& Tp = - patch().lookupPatchField(TName_); + const auto& Tp = patch().lookupPatchField(TName_); const fvDOM& dom = db().lookupObject("radiationProperties"); @@ -224,7 +223,7 @@ updateCoeffs() if (dom.useSolarLoad()) { // Looking for primary heat flux single band - Ir += patch().lookupPatchField + Ir += patch().lookupPatchField ( dom.primaryFluxName_ + "_0" ); diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C index a1fe42b8fe..614bb8b573 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveViewFactor/greyDiffusiveViewFactorFixedValueFvPatchScalarField.C @@ -173,7 +173,7 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField::qro(label bandI) const if (radiation.useSolarLoad()) { - tqrt.ref() += patch().lookupPatchField + tqrt.ref() += patch().lookupPatchField ( radiation.primaryFluxName_ + "_" + name(bandI) ); diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C index b9f061fde1..a0d90058d5 100644 --- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C @@ -211,7 +211,7 @@ updateCoeffs() if (dom.useSolarLoad()) { // Looking for primary heat flux single band - Ir += patch().lookupPatchField + Ir += patch().lookupPatchField ( dom.primaryFluxName_ + "_" + name(lambdaId) ); diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C index da1abae0ac..7cc73bc526 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/enthalpySorption/enthalpySorptionFvPatchScalarField.C @@ -208,10 +208,7 @@ patchSource() const const auto& Yp = refCast ( - patch().lookupPatchField - ( - speciesName_ - ) + patch().lookupPatchField(speciesName_) ); // mass rate [kg/sec/m3] @@ -224,11 +221,8 @@ patchSource() const if (includeHs_) { - const fvPatchField& pp = - patch().lookupPatchField(pName_); - - const fvPatchField& Tp = - patch().lookupPatchField(TName_); + const auto& pp = patch().lookupPatchField(pName_); + const auto& Tp = patch().lookupPatchField(TName_); const auto& thermo = db().lookupObject ( @@ -270,10 +264,7 @@ void Foam::enthalpySorptionFvPatchScalarField::updateCoeffs() const auto& Yp = refCast ( - patch().lookupPatchField - ( - speciesName_ - ) + patch().lookupPatchField(speciesName_) ); switch (enthalpyModel_) diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C index 24eeed4b48..7b1f9c7cd0 100644 --- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C +++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C @@ -369,8 +369,7 @@ void Foam::speciesSorptionFvPatchScalarField::updateCoeffs() // mole fraction tmp tco = calcMoleFractions(); - const fvPatchField& pp = - patch().lookupPatchField(pName_); + const auto& pp = patch().lookupPatchField(pName_); cEq = max_*(kl_*tco()*pp/(1 + kl_*tco()*pp)); break; diff --git a/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C index 91e9007bd7..b748264df6 100644 --- a/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaContactAngle/temperatureDependentAlphaContactAngle/temperatureDependentAlphaContactAngleFvPatchScalarField.C @@ -113,7 +113,7 @@ Foam::temperatureDependentAlphaContactAngleFvPatchScalarField::theta { return theta0_->value ( - patch().lookupPatchField(TName_) + patch().lookupPatchField(TName_) ); } diff --git a/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C index 90aedae653..a0aa069ae1 100644 --- a/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C +++ b/src/transportModels/twoPhaseProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C @@ -146,8 +146,7 @@ void Foam::alphaFixedPressureFvPatchScalarField::updateCoeffs() const uniformDimensionedVectorField& g = meshObjects::gravity::New(db().time()); - const fvPatchField& rho = - patch().lookupPatchField("rho"); + const auto& rho = patch().lookupPatchField("rho"); operator==(p_ - rho*(g.value() & patch().Cf())); diff --git a/tutorials/basic/potentialFoam/cylinder/system/controlDict b/tutorials/basic/potentialFoam/cylinder/system/controlDict index 1a3aebb7a0..09ab257862 100644 --- a/tutorials/basic/potentialFoam/cylinder/system/controlDict +++ b/tutorials/basic/potentialFoam/cylinder/system/controlDict @@ -56,13 +56,13 @@ functions #{ // Lookup U Info<< "Looking up field U\n" << endl; - const volVectorField& U = mesh().lookupObject("U"); + const auto& U = mesh().lookupObject("U"); Info<< "Reading inlet velocity uInfX\n" << endl; scalar ULeft = 0.0; label leftI = mesh().boundaryMesh().findPatchID("left"); - const fvPatchVectorField& fvp = U.boundaryField()[leftI]; + const auto& fvp = U.boundaryField()[leftI]; if (fvp.size()) { ULeft = fvp[0].x(); @@ -76,7 +76,7 @@ functions scalar magCylinder = 0.0; label cylI = mesh().boundaryMesh().findPatchID("cylinder"); - const fvPatchVectorField& cylFvp = mesh().C().boundaryField()[cylI]; + const auto& cylFvp = mesh().C().boundaryField()[cylI]; if (cylFvp.size()) { magCylinder = mag(cylFvp[0]); diff --git a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/system/controlDict b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/system/controlDict index 707cc621e4..fc24bd6706 100644 --- a/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/system/controlDict +++ b/tutorials/compressible/overRhoPimpleDyMFoam/twoSimpleRotors/system/controlDict @@ -112,8 +112,7 @@ functions codeWrite #{ - const volScalarField& rho = - mesh().lookupObject("rho"); + const auto& rho = mesh().lookupObject("rho"); Info<< "rho volume = " << rho.weightedAverage(mesh().Vsc()) << endl; #}; diff --git a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/system/controlDict b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/system/controlDict index 3ef465007c..9251c16eca 100644 --- a/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/system/controlDict +++ b/tutorials/multiphase/overInterDyMFoam/twoSimpleRotors/system/controlDict @@ -98,7 +98,7 @@ functions codeWrite #{ - const volScalarField& alpha = + const auto& alpha = mesh().lookupObject("alpha.water"); Info<< "Alpha volume = " << alpha.weightedAverage(mesh().Vsc()) diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions index 83a756ea1e..eed20ab52b 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions @@ -60,17 +60,16 @@ totalMass code #{ - const volScalarField& alphaGas = + const auto& alphaGas = mesh().lookupObject("alpha.gas"); - const volScalarField& alphaLiquid = + const auto& alphaLiquid = mesh().lookupObject("alpha.liquid"); - const volScalarField& rhoGas = + const auto& rhoGas = mesh().lookupObject("thermo:rho.gas"); - const volScalarField& rhoLiquid = + const auto& rhoLiquid = mesh().lookupObject("thermo:rho.liquid"); - const scalarField& v = mesh().V(); Info<< "coded totalMass output:" << endl