Difference between codes and representations
Hi Foamers,
I have a small question concerning relaxation. Is there any difference, when writting the code, between the following forms of relaxation, when solving the Navier stokes equation for laminar flow of newtonian fluids. Form 1 fvVector UEqn ( fvm::ddt(U) + fvm::div(phi,U)  fvm::laplacian(nu,U) ); UEqn.relax(); solve (UEqn == fvc:: grad(p)); Form 2 fvVector UEqn() ( fvm::ddt(U) + fvm::div(phi,U)  fvm::laplacian(nu,U) ); UEqn().relax(); solve (UEqn() == fvc:: grad(p)); Is there any significant difference between the two formulations. Thanks, Titio 
No. The second UEqn is probably a autoPtr of a fvMatrix.

Hi Titio,
Bernhard is absolutely right. Form 2 (and Form 1) are quoted incorrectly. Form 2 should read: tmp<fvVectorMatrix> UEqn ( fvm::ddt(U) + fvm::div(phi,U)  fvm::laplacian(nu,U) ); (see simpleFoam) By using tmp (or alternatively autoPtr) one is able throw away the UMatrix before solving the pequation. This way, you can save some peakmemory in steadystate solvers. Regards, Henrik 
Quote:
But Henrik's answer is better anyway 
All times are GMT 4. The time now is 21:55. 