CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   simpleFoam source code (https://www.cfd-online.com/Forums/openfoam/69129-simplefoam-source-code.html)

prapanj October 13, 2009 02:03

simpleFoam source code
 
Hi,

In simpleFoam source code, what do the following lines (in Ueqn.H) mean?

Ueqn().relax();
eqnResidual = solve
( Ueqn() == -fvc::grd(p)
).initial Residual()

I understand the part Ueqn()== -fvc::grad(p), please someone explain the rest. Thank you

markusrehm October 14, 2009 03:03

Hello,

Ueqn().relax();
this is for under-relaxing the momentum equation.


Correct me if I am wrong, but I think, the two lines with "initialResidual" are for stopping the whole solution process once the residuals of all equations are low enough.

Regards, Markus.

jploz October 14, 2009 03:33

Hi,

not exactly. The code

Code:

eqnResidual = solve( .. ).initial Residual()
assigns the initial residual of the equation to be solved to the existing variable 'eqnResidual' and solves the equation within a single statement.

The check, whether the convergence criterion is satisfied is done later (see file convergenceCheck.H).

HTH, Jean-Peer.


All times are GMT -4. The time now is 17:25.