mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
OpenFOAM: Updated all libraries, solvers and utilities to use the new const-safe tmp
The deprecated non-const tmp functionality is now on the compiler switch NON_CONST_TMP which can be enabled by adding -DNON_CONST_TMP to EXE_INC in the Make/options file. However, it is recommended to upgrade all code to the new safer tmp by using the '.ref()' member function rather than the non-const '()' dereference operator when non-const access to the temporary object is required. Please report any problems on Mantis. Henry G. Weller CFD Direct.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ MRF.DDt(U)
|
||||
@ -10,16 +10,17 @@
|
||||
==
|
||||
fvOptions(U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn().relax();
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (simple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{
|
||||
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
|
||||
UEqn.clear();
|
||||
tUEqn.clear();
|
||||
|
||||
surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf());
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,16 +10,17 @@
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn().relax();
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (simple.momentumPredictor())
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
rho = thermo.rho();
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
|
||||
UEqn.clear();
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
tUEqn.clear();
|
||||
|
||||
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,14 +10,15 @@
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn().relax();
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
rho = min(rho, rhoMax[i]);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
|
||||
UEqn.clear();
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
tUEqn.clear();
|
||||
|
||||
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::ddt(rho, U) + fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,16 +10,17 @@
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn().relax();
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (momentumPredictor)
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn()
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
volScalarField rAU("rAU", 1.0/UEqn().A());
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn().H(), U, p_rgh));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
|
||||
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ if (finalIter)
|
||||
{
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
tmp<fvScalarMatrix> hEqn
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(betav*rho, h)
|
||||
- (
|
||||
@ -18,11 +18,11 @@ if (finalIter)
|
||||
fvOptions(rho, h)
|
||||
);
|
||||
|
||||
hEqn().relax();
|
||||
hEqn.relax();
|
||||
|
||||
fvOptions.constrain(hEqn());
|
||||
fvOptions.constrain(hEqn);
|
||||
|
||||
hEqn().solve(mesh.solver(h.select(finalIter)));
|
||||
hEqn.solve(mesh.solver(h.select(finalIter)));
|
||||
|
||||
fvOptions.correct(h);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user