# How does openFoam calculate residuals?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 1, 2010, 15:10 How does openFoam calculate residuals? #1 Senior Member     Seyyed Ali H.M. Join Date: Nov 2009 Location: Utah Posts: 107 Rep Power: 15 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?

October 18, 2017, 18:27
#2
New Member

rik houthuys
Join Date: Jan 2017
Posts: 27
Rep Power: 7
Quote:
 Originally Posted by sahm Does any body know how does OpenFoam calculate the residuals in every timestep?

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

 October 20, 2017, 07:41 #3 Member   Kristjan Join Date: Apr 2017 Location: Slovenia Posts: 36 Rep Power: 7 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 and but I still don't understand the logic behind the calculation of .

 October 26, 2017, 18:24 #4 Member   Kristjan Join Date: Apr 2017 Location: Slovenia Posts: 36 Rep Power: 7 Anyone looking at this thread should also see Residuals for convergence of segregated solvers

 Tags residual, rhopisofoam