CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   simpleFoam source code (

prapanj October 13, 2009 02:03

simpleFoam source code

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

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


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


not exactly. The 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:21.