|
[Sponsors] |
July 2, 2009, 12:59 |
Difference between codes and representations
|
#1 |
Senior Member
|
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 |
|
July 2, 2009, 15:10 |
|
#2 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
No. The second UEqn is probably a autoPtr of a fvMatrix.
|
|
July 3, 2009, 04:32 |
|
#3 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
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 U-Matrix before solving the p-equation. This way, you can save some peak-memory in steady-state solvers. Regards, Henrik |
|
July 3, 2009, 08:58 |
|
#4 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
||
|
|