OpenFOAM: Updated for gcc-13

gcc-13 has new code checking and warning mechanisms which are useful but not
entirely robust and produce many false positives, particularly with respect to
local references:

    warning: possibly dangling reference to a temporary

This commit resolves many of the new warning messages but the above false
warnings remain.  It is possible to switch off this warning but as it also
provides some useful checks it is currently left on.
This commit is contained in:
Henry Weller
2023-05-23 10:47:56 +01:00
parent 9d7c3d8768
commit fec6705dc9
59 changed files with 180 additions and 129 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,7 +70,9 @@ Foam::XiEqModels::Gulder::~Gulder()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
{
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon();
tmp<volScalarField> tepsilon = turbulence_.epsilon();
const volScalarField& epsilon = tepsilon();
if (subGridSchelkin_)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,8 +76,11 @@ Foam::XiEqModels::SCOPEXiEq::~SCOPEXiEq()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
{
const volScalarField& k = turbulence_.k();
const volScalarField& epsilon = turbulence_.epsilon();
tmp<volScalarField> tk = turbulence_.k();
const volScalarField& k = tk();
tmp<volScalarField> tepsilon = turbulence_.epsilon();
const volScalarField& epsilon = tepsilon();
volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin_)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -64,7 +64,9 @@ Foam::XiGModels::KTS::~KTS()
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
{
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon();
tmp<volScalarField> tepsilon = turbulence_.epsilon();
const volScalarField& epsilon = tepsilon();
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));

View File

@ -80,7 +80,7 @@ void Foam::solvers::compressibleMultiphaseVoF::pressureCorrector()
{
const compressibleVoFphase& phase = phases[phasei];
const rhoThermo& thermo = phase.thermo();
const volScalarField& rho = thermo.rho()();
const volScalarField& rho = phases[phasei].thermo().rho();
p_rghEqnComps.set
(

View File

@ -143,8 +143,8 @@ void Foam::solvers::compressibleVoF::prePredictor()
{
twoPhaseVoFSolver::prePredictor();
const volScalarField& rho1 = mixture.thermo1().rho();
const volScalarField& rho2 = mixture.thermo2().rho();
const volScalarField& rho1 = mixture_.thermo1().rho();
const volScalarField& rho2 = mixture_.thermo2().rho();
alphaRhoPhi1 = fvc::interpolate(rho1)*alphaPhi1;
alphaRhoPhi2 = fvc::interpolate(rho2)*(phi - alphaPhi1);

View File

@ -233,7 +233,7 @@ Foam::wordList Foam::solvers::isothermalFilm::alphaTypes() const
Foam::solvers::isothermalFilm::isothermalFilm
(
fvMesh& mesh,
autoPtr<fluidThermo> thermoPtr
autoPtr<rhoThermo> thermoPtr
)
:
solver(mesh),
@ -403,7 +403,7 @@ Foam::solvers::isothermalFilm::isothermalFilm
Foam::solvers::isothermalFilm::isothermalFilm(fvMesh& mesh)
:
isothermalFilm(mesh, fluidThermo::New(mesh))
isothermalFilm(mesh, rhoThermo::New(mesh))
{}

View File

@ -46,7 +46,7 @@ See also
#define isothermalFilm_H
#include "solver.H"
#include "fluidThermo.H"
#include "rhoThermo.H"
#include "filmCompressibleMomentumTransportModel.H"
#include "uniformDimensionedFields.H"
@ -93,10 +93,10 @@ protected:
// Thermophysical properties
//- Pointer to the fluid thermophysical properties
autoPtr<fluidThermo> thermoPtr_;
autoPtr<rhoThermo> thermoPtr_;
//- Reference to the fluid thermophysical properties
fluidThermo& thermo_;
rhoThermo& thermo_;
//- The thermodynamic pressure field
volScalarField& p;
@ -276,7 +276,7 @@ public:
const volScalarField& alpha;
//- Reference to the fluid thermophysical properties
const fluidThermo& thermo;
const rhoThermo& thermo;
//- Reference to the thermodynamic density field
const volScalarField& rho;
@ -300,7 +300,7 @@ public:
// Constructors
//- Construct from region mesh and thermophysical properties
isothermalFilm(fvMesh& mesh, autoPtr<fluidThermo>);
isothermalFilm(fvMesh& mesh, autoPtr<rhoThermo>);
//- Construct from region mesh
isothermalFilm(fvMesh& mesh);

View File

@ -131,7 +131,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
const volScalarField::Internal ReI
(
(interface_.rho()()()*interface_.magUr()()())
(interface_.rho()()*interface_.magUr()()())
/(magGradI*limitedAlpha1*limitedAlpha2*muI)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -157,8 +157,6 @@ JohnsonJacksonSchaeffer::nu
}
const fvPatchList& patches = phase.mesh().boundary();
const volVectorField& U = phase.U();
volScalarField::Boundary& nufBf = nuf.boundaryFieldRef();
forAll(patches, patchi)
@ -169,7 +167,7 @@ JohnsonJacksonSchaeffer::nu
(
pf.boundaryField()[patchi]*sin(phi_.value())
/(
mag(U.boundaryField()[patchi].snGrad())
mag(phase.U()().boundaryField()[patchi].snGrad())
+ small
)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -146,8 +146,6 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
}
const fvPatchList& patches = phase.mesh().boundary();
const volVectorField& U = phase.U();
volScalarField::Boundary& nufBf = nuf.boundaryFieldRef();
forAll(patches, patchi)
@ -158,7 +156,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
(
pf.boundaryField()[patchi]*sin(phi_.value())
/(
mag(U.boundaryField()[patchi].snGrad())
mag(phase.U()().boundaryField()[patchi].snGrad())
+ small
)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -410,7 +410,9 @@ void Foam::RASModels::kineticTheoryModel::correct()
const volScalarField& rho = phase_.rho();
const surfaceScalarField& alphaRhoPhi = alphaRhoPhi_;
const volVectorField& U = U_;
const volVectorField& Uc_ = continuousPhase.U();
tmp<volVectorField> tUc(continuousPhase.U());
const volVectorField& Uc = tUc();
const scalar sqrtPi = sqrt(constant::mathematical::pi);
const dimensionedScalar ThetaSmall("ThetaSmall", Theta_.dimensions(), 1e-6);
@ -470,7 +472,7 @@ void Foam::RASModels::kineticTheoryModel::correct()
const volScalarField J2
(
"J2",
0.25*sqr(beta)*da*magSqr(U - Uc_)
0.25*sqr(beta)*da*magSqr(U - Uc)
/(
max(alpha, residualAlpha_)*rho
*sqrtPi*(ThetaSqrt + ThetaSmallSqrt)

View File

@ -63,7 +63,7 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector()
fvc::interpolate
(
max(alpha.oldTime(), phase.residualAlpha())
*phase.rho()().oldTime()
*phase.rho().oldTime()
)
).ptr()
);

View File

@ -133,8 +133,14 @@ KocamustafaogullariIshiiDepartureDiameter::dDeparture
Tl,
Tsatw,
L,
liquid.thermo().rho(patchi)(),
vapour.thermo().rho(patchi)(),
static_cast<const scalarField&>
(
liquid.rho().boundaryField()[patchi]
),
static_cast<const scalarField&>
(
vapour.rho().boundaryField()[patchi]
),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)()
);
}
@ -158,8 +164,8 @@ KocamustafaogullariIshiiDepartureDiameter::dDeparture
liquid.thermo().T(),
Tsatw,
L,
liquid.thermo().rho()(),
vapour.thermo().rho()(),
liquid.rho(),
vapour.rho(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))()
);
}

View File

@ -143,8 +143,8 @@ Foam::wallBoilingModels::departureFrequencyModels::Cole::fDeparture
(
liquid.mesh(),
dDep,
liquid.thermo().rho()(),
vapour.thermo().rho()()
liquid.rho(),
vapour.rho()
);
}

View File

@ -128,8 +128,14 @@ KocamustafaogullariIshiiDepartureFrequency::fDeparture
(
liquid.mesh(),
dDep,
liquid.thermo().rho(patchi)(),
vapour.thermo().rho(patchi)(),
static_cast<const scalarField&>
(
liquid.rho().boundaryField()[patchi]
),
static_cast<const scalarField&>
(
vapour.rho().boundaryField()[patchi]
),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)()
);
}
@ -153,8 +159,8 @@ KocamustafaogullariIshiiDepartureFrequency::fDeparture
(
liquid.mesh(),
dDep,
liquid.thermo().rho()(),
vapour.thermo().rho()(),
liquid.rho(),
vapour.rho(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))()
);
}

View File

@ -145,8 +145,14 @@ KocamustafaogullariIshiiNucleationSite::nucleationSiteDensity
L,
dDep,
Tw,
liquid.thermo().rho(patchi)(),
vapour.thermo().rho(patchi)(),
static_cast<const scalarField&>
(
liquid.rho().boundaryField()[patchi]
),
static_cast<const scalarField&>
(
vapour.rho().boundaryField()[patchi]
),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour), patchi)()
);
}
@ -172,8 +178,8 @@ KocamustafaogullariIshiiNucleationSite::nucleationSiteDensity
L,
dDep,
Tf,
liquid.thermo().rho()(),
vapour.thermo().rho()(),
liquid.rho(),
vapour.rho(),
liquid.fluid().sigma(phaseInterfaceKey(liquid, vapour))()
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -693,7 +693,7 @@ correctInterfaceThermo()
const volScalarField rhoKDL
(
phase.thermo().rho()
phase.rho()
*diffusiveMassTransferModel.modelInThe(phase).K()
*compositionModel.modelInThe(phase).D(specie)
*this->Li

View File

@ -280,7 +280,9 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransfer()
fvVectorMatrix& eqn = *eqns[phase.name()];
const volVectorField& U = eqn.psi();
const surfaceScalarField& phi = phase.phi();
tmp<surfaceScalarField> tphi(phase.phi());
const surfaceScalarField& phi = tphi();
const tmp<surfaceScalarField> taphi(fvc::absolute(phi, U));
const surfaceScalarField& aphi(taphi());
@ -420,8 +422,11 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::momentumTransferf()
if (!phase.stationary())
{
const volVectorField& U = phase.U();
const surfaceScalarField& phi = phase.phi();
tmp<volVectorField> tU = phase.U();
const volVectorField& U = tU();
tmp<surfaceScalarField> tphi(phase.phi());
const surfaceScalarField& phi = tphi();
const tmp<surfaceScalarField> taphi(fvc::absolute(phi, U));
const surfaceScalarField& aphi(taphi());
@ -1132,7 +1137,7 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::ddtCorrs() const
fvc::ddtCorr
(
phase,
phase.rho()(),
phase.rho(),
phase.U()(),
phase.phi()(),
phase.Uf()

View File

@ -129,7 +129,7 @@ void Foam::diameterModels::IATE::correct()
+ fvc::div(phase().alphaPhi())
)
- (
fvc::ddt(phase(), phase().rho()())
fvc::ddt(phase(), phase().rho())
+ fvc::div(phase().alphaRhoPhi())
)/phase().rho()
),

View File

@ -170,7 +170,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
phaseCompressible::momentumTransportModel::New
(
*this,
this->thermo().rho(),
this->rho(),
U_,
alphaRhoPhi_,
phi_,
@ -335,7 +335,7 @@ Foam::tmp<Foam::fvVectorMatrix>
Foam::MovingPhaseModel<BasePhaseModel>::UEqn()
{
const volScalarField& alpha = *this;
const volScalarField& rho = this->thermo().rho();
const volScalarField& rho = this->rho();
return
(
@ -355,7 +355,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::UfEqn()
// As the "normal" U-eqn but without the ddt terms
const volScalarField& alpha = *this;
const volScalarField& rho = this->thermo().rho();
const volScalarField& rho = this->rho();
return
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,7 +91,7 @@ Foam::tmp<Foam::fvScalarMatrix>
Foam::MulticomponentPhaseModel<BasePhaseModel>::YiEqn(volScalarField& Yi)
{
const volScalarField& alpha = *this;
const volScalarField& rho = this->thermo().rho();
const volScalarField& rho = this->rho();
const tmp<surfaceScalarField> talphaRhoPhi(this->alphaRhoPhi());
const surfaceScalarField& alphaRhoPhi(talphaRhoPhi());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -90,7 +90,7 @@ Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::thermoRef()
template<class BasePhaseModel, class ThermoModel>
Foam::tmp<Foam::volScalarField>
const Foam::volScalarField&
Foam::ThermoPhaseModel<BasePhaseModel, ThermoModel>::rho() const
{
return thermo_->rho();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -103,7 +103,7 @@ public:
virtual rhoThermo& thermoRef();
//- Return the density field
virtual tmp<volScalarField> rho() const;
virtual const volScalarField& rho() const;
// Transport

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -210,7 +210,9 @@ void Foam::phaseModel::correctInflowOutflow(surfaceScalarField& alphaPhi) const
{
surfaceScalarField::Boundary& alphaPhiBf = alphaPhi.boundaryFieldRef();
const volScalarField::Boundary& alphaBf = boundaryField();
const surfaceScalarField::Boundary& phiBf = phi()().boundaryField();
tmp<surfaceScalarField> tphi(phi());
const surfaceScalarField::Boundary& phiBf = tphi().boundaryField();
forAll(alphaPhiBf, patchi)
{

View File

@ -261,7 +261,7 @@ public:
virtual rhoThermo& thermoRef() = 0;
//- Return the density field
virtual tmp<volScalarField> rho() const = 0;
virtual const volScalarField& rho() const = 0;
//- Return whether the phase is isothermal
virtual bool isothermal() const = 0;

View File

@ -701,7 +701,8 @@ void Foam::phaseSystem::correctBoundaryFlux()
{
phaseModel& phase = movingPhases()[movingPhasei];
const volVectorField::Boundary& UBf = phase.U()().boundaryField();
tmp<volVectorField> tU(phase.U());
const volVectorField::Boundary& UBf = tU().boundaryField();
FieldField<fvsPatchField, scalar> phiRelBf
(
@ -806,7 +807,7 @@ void Foam::phaseSystem::correctPhi
phaseModel& phase = phases()[phasei];
const volScalarField& alpha = phase;
psi += alpha*phase.thermo().psi()/phase.thermo().rho();
psi += alpha*phase.thermo().psi()/phase.rho();
}
fv::correctPhi

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -126,14 +126,14 @@ void Foam::diameterModels::LiaoBase::precompute()
(
"rhoc",
dimDensity,
gAverage(populationBalance_.continuousPhase().rho()())
gAverage(populationBalance_.continuousPhase().rho())
);
const dimensionedScalar rhod
(
"rhod",
dimDensity,
gAverage(populationBalance_.sizeGroups()[1].phase().rho()())
gAverage(populationBalance_.sizeGroups()[1].phase().rho())
);
const dimensionedScalar sigma

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,7 +107,9 @@ addToCoalescenceRate
const sizeGroup& fj = popBal_.sizeGroups()[j];
const volScalarField& T = popBal_.continuousPhase().thermo().T();
const volScalarField& mu = popBal_.continuousPhase().thermo().mu();
tmp<volScalarField> tmu(popBal_.continuousPhase().thermo().mu());
const volScalarField& mu = tmu();
const volScalarField Cci
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -178,7 +178,7 @@ void Foam::diameterModels::coalescenceModels::LiaoCoalescence::precompute()
(
popBal_.sigmaWithContinuousPhase(popBal_.sizeGroups()[1].phase())()
/(mag(g)*(popBal_.continuousPhase().rho()
- popBal_.sizeGroups()[1].phase().rho()()))
- popBal_.sizeGroups()[1].phase().rho()))
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,9 +74,9 @@ addToCoalescenceRate
const sizeGroup& fi = popBal_.sizeGroups()[i];
const sizeGroup& fj = popBal_.sizeGroups()[j];
const volScalarField& epsilon = popBal_.continuousTurbulence().epsilon();
const volScalarField& rho = popBal_.continuousPhase().rho();
const volScalarField& mu = popBal_.continuousPhase().thermo().mu();
tmp<volScalarField> epsilon(popBal_.continuousTurbulence().epsilon());
tmp<volScalarField> mu(popBal_.continuousPhase().thermo().mu());
coalescenceRate += C_*sqrt(epsilon*rho/mu)*pow3(fi.d() + fj.d());
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -67,7 +67,7 @@ void Foam::diameterModels::driftModels::densityChangeDrift::addToDriftRate
const sizeGroup& fi = popBal_.sizeGroups()[i];
const phaseModel& phase = fi.phase();
const volScalarField& alpha = phase;
const volScalarField& rho = phase.thermo().rho();
const volScalarField& rho = phase.rho();
driftRate -=
fi.x()

View File

@ -695,7 +695,7 @@ void Foam::diameterModels::populationBalanceModel::correctDilatationError()
const phaseModel& phase = fluid_.phases()[phaseName];
const velocityGroup& velGroup = *velocityGroupPtrs_[phaseName];
const volScalarField& alpha = phase;
const volScalarField& rho = phase.thermo().rho();
const volScalarField& rho = phase.rho();
dilatationError =
fvc::ddt(alpha) + fvc::div(phase.alphaPhi())
@ -1167,7 +1167,7 @@ void Foam::diameterModels::populationBalanceModel::solve()
sizeGroup& fi = sizeGroups_[i];
const phaseModel& phase = fi.phase();
const volScalarField& alpha = phase;
const volScalarField& rho = phase.thermo().rho();
const volScalarField& rho = phase.rho();
const volScalarField& dilatationError =
dilatationErrors_[phase.name()];

View File

@ -203,7 +203,7 @@ void Foam::solvers::solid::momentumPredictor()
void Foam::solvers::solid::thermophysicalPredictor()
{
volScalarField& e = thermo_.he();
const volScalarField& rho = thermo.rho();
const volScalarField& rho = thermo_.rho();
while (pimple.correctNonOrthogonal())
{

View File

@ -171,7 +171,7 @@ void Foam::solvers::solidDisplacement::pressureCorrector()
{
volVectorField& D(D_);
const volScalarField& rho = thermo.rho();
const volScalarField& rho = thermo_.rho();
int iCorr = 0;
scalar initialResidual = 0;