diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/setRegionFluidFields.H index c11535179b..d1c253ebb0 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/setRegionFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionTwoPhaseEulerFoam/fluid/setRegionFluidFields.H @@ -8,11 +8,13 @@ volVectorField& U1 = phase1.URef(); surfaceScalarField& phi1 = phase1.phiRef(); - const surfaceScalarField& alphaPhi1 = phase1.alphaPhi(); + const tmp talphaPhi1 = phase1.alphaPhi(); + const auto& alphaPhi1 = talphaPhi1(); volVectorField& U2 = phase2.URef(); surfaceScalarField& phi2 = phase2.phiRef(); - const surfaceScalarField& alphaPhi2 = phase2.alphaPhi(); + const tmp talphaPhi2 = phase2.alphaPhi(); + const auto& alphaPhi2 = talphaPhi2(); surfaceScalarField& phi = fluid.phi(); diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C index 19ccb4eef9..930b2b8a6e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C @@ -74,8 +74,11 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel const volScalarField& alpha1(mixture_.alpha1()); const volScalarField& alpha2(mixture_.alpha2()); - const volScalarField& rho1 = mixture_.thermo1().rho(); - const volScalarField& rho2 = mixture_.thermo2().rho(); + const tmp trho1 = mixture_.thermo1().rho(); + const tmp trho2 = mixture_.thermo2().rho(); + + const auto& rho1 = trho1(); + const auto& rho2 = trho2(); alphaRhoPhi1_ = ( @@ -185,8 +188,8 @@ void Foam::compressibleInterPhaseTransportModel::correctPhasePhi() { if (twoPhaseTransport_) { - const volScalarField& rho1 = mixture_.thermo1().rho(); - const volScalarField& rho2 = mixture_.thermo2().rho(); + const tmp rho1 = mixture_.thermo1().rho(); + const tmp rho2 = mixture_.thermo2().rho(); alphaRhoPhi1_.ref() = fvc::interpolate(rho1)*alphaPhi10_; alphaRhoPhi2_.ref() = fvc::interpolate(rho2)*(phi_ - alphaPhi10_); diff --git a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/EEqns.H index 22d875dce7..e69496b668 100644 --- a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/EEqns.H +++ b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/EEqns.H @@ -12,8 +12,11 @@ for (int Ecorr=0; Ecorr trho = phase.rho(); + const tmp tU = phase.U(); + + const auto& rho = trho(); + const auto& U = tU(); fvScalarMatrix EEqn ( diff --git a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/YEqns.H b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/YEqns.H index 75e071490f..0ae4c7343e 100644 --- a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/YEqns.H +++ b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/YEqns.H @@ -11,7 +11,9 @@ UPtrList& Y = phase.YActiveRef(); const volScalarField& alpha = phase; - const volScalarField& rho = phase.rho(); + const tmp trho = phase.rho(); + + const auto& rho = trho(); forAll(Y, i) { diff --git a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pU/UEqns.H b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pU/UEqns.H index bb439af808..f4bd02e9d4 100644 --- a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pU/UEqns.H +++ b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pU/UEqns.H @@ -14,9 +14,11 @@ PtrList UEqns(phases.size()); phaseModel& phase = fluid.movingPhases()[movingPhasei]; const volScalarField& alpha = phase; - const volScalarField& rho = phase.rho(); + const tmp trho = phase.rho(); volVectorField& U = phase.URef(); + const auto& rho = trho(); + UEqns.set ( phase.index(), diff --git a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pUf/UEqns.H b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pUf/UEqns.H index cf72498e99..467bb44dc9 100644 --- a/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pUf/UEqns.H +++ b/applications/solvers/multiphase/reactingMultiphaseEulerFoam/pUf/UEqns.H @@ -17,9 +17,11 @@ PtrList UEqns(phases.size()); phaseModel& phase = fluid.movingPhases()[movingPhasei]; const volScalarField& alpha = phase; - const volScalarField& rho = phase.rho(); + const tmp trho = phase.rho(); volVectorField& U = phase.URef(); + const auto& rho = trho(); + UEqns.set ( phase.index(), diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/createFieldRefs.H b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/createFieldRefs.H index edad54fa18..a8247c9e1c 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/createFieldRefs.H +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/createFieldRefs.H @@ -6,11 +6,13 @@ const volScalarField& alpha2 = phase2; volVectorField& U1 = phase1.URef(); surfaceScalarField& phi1 = phase1.phiRef(); -const surfaceScalarField& alphaPhi1 = phase1.alphaPhi(); +const tmp talphaPhi1 = phase1.alphaPhi(); +const auto& alphaPhi1 = talphaPhi1(); volVectorField& U2 = phase2.URef(); surfaceScalarField& phi2 = phase2.phiRef(); -const surfaceScalarField& alphaPhi2 = phase2.alphaPhi(); +const tmp talphaPhi2 = phase2.alphaPhi(); +const auto& alphaPhi2 = talphaPhi2(); surfaceScalarField& phi = fluid.phi(); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C index 27ebc07801..0fb484b533 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellShapeControl/cellShapeControlMesh/cellShapeControlMesh.C @@ -743,12 +743,12 @@ Foam::label Foam::cellShapeControlMesh::estimateCellCount cit->vertex(3)->point() ); - pointFromPoint centre = topoint(CGAL::centroid(tet)); + const auto tetCentre = CGAL::centroid(tet); if ( - Pstream::parRun() - && !decomposition().positionOnThisProcessor(centre) + UPstream::parRun() + && !decomposition().positionOnThisProcessor(topoint(tetCentre)) ) { continue; diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 1309cac153..df9c6d9ce2 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -176,7 +176,7 @@ autoPtr procAddressing const objectRegistry& procRegistry, const word& name, const word& instance, - const word& local = fvMesh::meshSubDir + const word& local = polyMesh::meshSubDir ) { return autoPtr::New @@ -218,17 +218,22 @@ const labelIOList& procAddressing PtrList& procAddressingList ) { - const fvMesh& procMesh = procMeshList[proci]; + const auto& procMesh = procMeshList[proci]; - if (!procAddressingList.set(proci)) - { - procAddressingList.set + return procAddressingList.try_emplace + ( + proci, + IOobject ( - proci, - procAddressing(procMesh, name, procMesh.facesInstance()) - ); - } - return procAddressingList[proci]; + name, + procMesh.facesInstance(), + polyMesh::meshSubDir, + procMesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + IOobject::NO_REGISTER + ) + ); }