CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   How does openFoam calculate residuals? (https://www.cfd-online.com/Forums/openfoam/73183-how-does-openfoam-calculate-residuals.html)

sahm March 1, 2010 15:10

How does openFoam calculate residuals?
 
I have solved a case with the density based solver rhoPisoFoam. When I checked the residuals for convergence, I noticed that the residuals for Rho were zero in every time step. Does anyone know how it can be? Does any body know how does OpenFoam calculate the residuals in every timestep?
Since the Piso loop in solver solves the rho, I thought this can be the result. But rho is being solved several times in piso loop, so it is changing, and this can be the method for calculation of residuals?

Houthuys October 18, 2017 17:27

Quote:

Originally Posted by sahm (Post 247975)
Does any body know how does OpenFoam calculate the residuals in every timestep?

Did you find answer to your question?

I know how the linear solver residual is calculated. But how the SIMPLE residual is calculated?

krikre October 20, 2017 06:41

I'm interested in this topic and will try to contribue what I can.

The correction of rho is outside of the PISO loop.

https://github.com/OpenCFD/OpenFOAM-.../rhoPisoFoam.C

See the:
Code:

#include "rhoEqn.H"
I'm guessing this is the rhoEqn.H. The fvm term is implicit and the fvc is explicit. I assumed that this simple equation
Code:

solve(fvm::ddt(rho) + fvc::div(phi));
reduces to an assignment operation. Correct me if I'm wrong.

Houthuys, if you could exlpain the linear solver residual, I'd be grateful. I found this on the OF+ site. Do you understand this?

I guess \bar{ \textbf{x}} = \frac{1}{N}\sum_i^N x_i and \vert\textbf{x}\vert = \sqrt{\sum_i^N x_i^2}
but I still don't understand the logic behind the calculation of n.

krikre October 26, 2017 17:24

Anyone looking at this thread should also see
https://www.cfd-online.com/Forums/op...d-solvers.html


All times are GMT -4. The time now is 03:38.