mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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.
38 lines
734 B
C
38 lines
734 B
C
// Solve the Momentum equation
|
|
|
|
MRF.correctBoundaryVelocity(U);
|
|
|
|
tmp<fvVectorMatrix> tUEqn
|
|
(
|
|
fvm::ddt(rho, U) + fvm::div(phi, U)
|
|
+ MRF.DDt(rho, U)
|
|
+ turb.divDevRhoReff(U)
|
|
==
|
|
fvOptions(rho, U)
|
|
);
|
|
fvVectorMatrix& UEqn = tUEqn.ref();
|
|
|
|
UEqn.relax();
|
|
|
|
fvOptions.constrain(UEqn);
|
|
|
|
if (momentumPredictor)
|
|
{
|
|
solve
|
|
(
|
|
UEqn
|
|
==
|
|
fvc::reconstruct
|
|
(
|
|
(
|
|
- ghf*fvc::snGrad(rho)
|
|
- fvc::snGrad(p_rgh)
|
|
)*mesh.magSf()
|
|
),
|
|
mesh.solver(U.select(finalIter))
|
|
);
|
|
|
|
fvOptions.correct(U);
|
|
K = 0.5*magSqr(U);
|
|
}
|