mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +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:
@ -70,7 +70,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
|
||||
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
|
||||
|
||||
tmp<volScalarField> tGtot = XiGModel_->G();
|
||||
volScalarField& Gtot = tGtot();
|
||||
volScalarField& Gtot = tGtot.ref();
|
||||
|
||||
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
|
||||
scalarField N(Nv.internalField()*Cw);
|
||||
|
||||
@ -113,7 +113,7 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
|
||||
)
|
||||
);
|
||||
|
||||
volSymmTensorField& DragDcu = tDragDcu();
|
||||
volSymmTensorField& DragDcu = tDragDcu.ref();
|
||||
|
||||
if (on_)
|
||||
{
|
||||
@ -147,7 +147,7 @@ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField& Gk = tGk();
|
||||
volScalarField& Gk = tGk.ref();
|
||||
|
||||
if (on_)
|
||||
{
|
||||
|
||||
@ -161,9 +161,9 @@ void PDRkEpsilon::correct()
|
||||
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
|
||||
);
|
||||
|
||||
epsEqn().relax();
|
||||
epsEqn.ref().relax();
|
||||
|
||||
epsEqn().boundaryManipulate(epsilon_.boundaryField());
|
||||
epsEqn.ref().boundaryManipulate(epsilon_.boundaryField());
|
||||
|
||||
solve(epsEqn);
|
||||
bound(epsilon_, epsilonMin_);
|
||||
@ -182,7 +182,7 @@ void PDRkEpsilon::correct()
|
||||
- fvm::Sp(betav*rho_*epsilon_/k_, k_)
|
||||
);
|
||||
|
||||
kEqn().relax();
|
||||
kEqn.ref().relax();
|
||||
solve(kEqn);
|
||||
bound(k_, kMin_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user