CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   are residulas real or normalized? (

immortality June 26, 2013 13:54

are residulas real or normalized?
the residual of equations that we can see also by pyFoam(thanks to dear Bernhard Gschaider:D) are real or normalized?if the latter by what?

cfdonline2mohsen June 26, 2013 14:35

Dear Ehsan
Can you tell me how to see the residuals in ParaFoam?
(btw I don't know the answer of your question)

immortality June 26, 2013 15:21

Hi Mohsen
I corrected it.I meant pyFoam:D
you also can see residuals after run by gnuplot if you had not it be saved by pyFoam.there is a script code for that but pyFoam way is better(and easier) in my opinion.
do you know how to work with pyFoam?

cfdonline2mohsen June 27, 2013 03:20

Thanks for the reply.
Yeah, I've used gnuplot but it works (as far as I know and used) only for a single processor run but I couldn't utilize it for my parallel run with multiple processors. do you how to use it in parallel?
And no, I am not familiar with pyFoam but I will search the forums for it.
thanks for the hint.

immortality June 27, 2013 06:41

see openfoamwiki and search for pyFoam contrib (as I remember)
after installing I'll tell you which commands you shows residuals during run and also save it to case folder and also save residuals for next uses.its very useful.

immortality January 1, 2014 13:21

1 Attachment(s)
I have noticed and encountered another question about residuals,does anyone know?
for example I have set the tolerance for U to be 1e-14, but in residuals that are shown,its far more of 1e-14.its around 1e-5.why?

        solver          smoothSolver;
        smoother        DICGaussSeidel;
        //nSweeps        2;
        tolerance      1e-14;
        relTol          0;
        maxIter        25000;

wyldckat January 1, 2014 14:09

Hi Ehsan,


Originally Posted by immortality (Post 468309)
for example I have set the tolerance for U to be 1e-14, but in residuals that are shown,its far more of 1e-14.its around 1e-5.why?

Did you look at the output from the solver? ;)

The idea is that the residual that matters to us for considering if it the solution is as good as "converged", is the Initial residual, which should be lower than 1e-2 to 1e-4 or smaller, depending on the kind of simulation you're performing. That is the residual value being controled inside the "SIMPLE", "PISO" and "PIMPLE" settings in "system/fvSolution" (not certain if all of them have got it). And that is the one being plotted.

The residual being controlled in the matrix/equation solver is the Final residual, which is also present in the output of the solver (Initial ... Final ... No iterations...).

Best regards,

Bernhard January 2, 2014 03:29

Also, I suppose you are hitting the maxIter limit? You can easily check that with your log-file. In any case, especially a transient one, you do not want 25000 iterations, because this is mostly related to a bad case. Also, you are showing the solver settings for U. Which means that you are using the momentum predictor, I guess. Why would you want to solve it down to this accuracy? I don't think it makes much sense.

immortality January 2, 2014 07:01

Oh Bruno,I thought that I was knowing that before but had forgotten about initial and final residuals.I remembered all things now. thanks for help.
@Bernhard:thanks to your consideration dear Bernhard,I used that maxIter when I was encountering convergence problems that was because of boundary conditions,after the problems be solved,I didn't managed to change it,thought it may be better to be there.I wanted reaching to convergence be sure.

All times are GMT -4. The time now is 20:22.