CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

CONVERGENCE > MY RESULTS > interpretation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 30, 2014, 09:04
Default CONVERGENCE > MY RESULTS > interpretation
  #1
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
I have this problem with residual plotting.. no message errors appears .... what is the problem?

I recorded a video relating my problem:
https://www.youtube.com/watch?v=rDt4...ature=youtu.be


After correct this problem... Can you prepare a Residual file for me? ... I don't know. I desire plot "p" also...

Best Regards,
Vitor Spadeto Venturin
vitorspadetoventurin is offline   Reply With Quote

Old   November 30, 2014, 11:43
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

It's not a good idea to present text information in video format. Next time just attach Residuals file and a piece of log file.

Gnuplot will not plot if there's nothing to plot. Execute your commands from Residuals file in the shell just to see if they return anything at all.

Here's what I usually use for plotting residuals:

Code:
#!/usr/bin/env gnuplot

r_ux = "< grep 'Solving for Ux,' log | awk '{print $8}' | tr -d ,"
r_uy = "< grep 'Solving for Uy,' log | awk '{print $8}' | tr -d ,"
r_uz = "< grep 'Solving for Uz,' log | awk '{print $8}' | tr -d ,"
r_pr = "< grep 'Solving for p,' log | sed -n '0~2p' | awk '{print $8}' | tr -d ,"
r_epsilon = "< grep 'Solving for epsilon,' log | awk '{print $8}' | tr -d ,"
r_k = "< grep 'Solving for k,' log | awk '{print $8}' | tr -d ,"

set logscale y
set yrange [5e-7:1]
set xlabel 'Time, s'
set ylabel 'Residual'

set ytics nomirror format "%.0e"

plot r_ux w l ls 1 lw 2 title 'ux residual', \
     r_uy w l ls 2 lw 2 title 'uy residual', \
     r_uz w l ls 3 lw 2 title 'uz residual', \
     r_pr w l ls 4 lw 2 title 'pressure residual', \
     r_epsilon w l ls 5 lw 2 title 'epsilon residual', \
     r_k w l ls 6 lw 2 title 'k residual'

pause(-1)
In sed pattern 2 is the number of pressure lines in log file. If you have more, change the number accordingly.
alexeym is offline   Reply With Quote

Old   December 1, 2014, 20:57
Default CONVERGENCE > MY RESULTS > interpretation
  #3
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
Dears, I am beginner and woul like to understand better my results... my simulation are running just now.. and the residuals is keeping in this values... :
Code:
DILUPBiCG:  Solving for Ux, Initial residual = 1.30388e-06, Final residual = 1.02656e-07, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 2.51207e-05, Final residual = 1.16967e-06, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 2.37728e-06, Final residual = 4.56727e-08, No Iterations 2
GAMG:  Solving for p, Initial residual = 1.14214e-05, Final residual = 2.01907e-06, No Iterations 1
GAMG:  Solving for p, Initial residual = 6.04496e-06, Final residual = 6.04496e-06, No Iterations 0
GAMG:  Solving for p, Initial residual = 6.04496e-06, Final residual = 6.04496e-06, No Iterations 0
time step continuity errors : sum local = 0.000151313, global = 3.31381e-08, cumulative = -0.000114931
ExecutionTime = 2945.06 s  ClockTime = 3257 s
How are calculate "reltol" , "tolerance" and "residuaControl"? I dont know interpret these values looking residues presented above..

in this post a guy talk how to interpret these values.. but I dont know if it is correct.. http://www.cfd-online.com/Forums/ope...tml#post300525

this is my fvsolution:

Code:
solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-05;
        relTol          0.1;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps     2;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 10;
        mergeLevels     1;
    }


  "(k|epsilon|R|nuTilda)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0.1;
    }


   U
   {
      solver PBiCG;
      preconditioner DILU;
      tolerance 1e-8;
      relTol 0.1;
   }

}

SIMPLE
{
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        p               1e-5;
        U               1e-5;
        "(k|epsilon|omega)" 1e-3;
    }
}

relaxationFactors
{
    fields
    {
        p               0.3;
    }
    equations
    {
        U               0.7;
        k               0.7;
        epsilon         0.7;
        R               0.7;
        nuTilda         0.7;
    }
}


// ************************************************************************* //
question 2: Do you think that tolerance 1e-8 is good for velocity? or can I decrease?

the main question is about interpreting of residuals considering fvsolution values..
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 03:59
Default
  #4
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Hi, I am not sure what your main question is about, but the guy in your link is right.

For your case:
Code:
Ux, Initial residual = 1.30388e-06, Final residual = 1.02656e-07, No Iterations 1
This means, your calculation starts with a residual of 1.30388e-06. Now it starts to iterate. The number of iterations is given by the fvSolution file, "U", since it is the "U"-equation:
Code:
 U
   {
      solver PBiCG;
      preconditioner DILU;
      tolerance 1e-8;
      relTol 0.1;
   }
relTol=0.1 means, that the solver will iterate until the final residual is smaller than 0.1 * the initial residual = 0.1 * 1.30388e-06 = 1.30388e-07.
Obviously, after one iteration the residual is lower (=1.02656e-07 in your case), that's why the solver tells you it just needed one iteration.
You can see, for Uz equation the solver needs two iterations.

But there is another criterion, "tolerance 1e-8" in your fvSolution. This means, if the residual is below 1e-8 the solver will stop, no matter if "relTol" is already achieved.

So it stops iterating if either the residual is relativly small compared to the intial residual (relTol) or if it is small by means of absolute value (tolerance).

For simple algorithm it is important, that the residuals are reduced from one outer iteration (=one of the cycles of Ux,Uy,Uz,p and the turbulence values) to the next and not within one cycle. This is given by the "residualControl" in your fvSolution. It says, that the initial residuals must be below the values you give here. In your case the initial residual of "p" is higher than the value given in fvSolution (1.14214e-05 > 1e-5). That's why simple keeps iterating.

Question 2) You need to look at the initial residuals. Just from that number one can not state that it is good enough. Plot the residuals over the iteration and post it.

-> Why did you deactivate the turbulence model?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 2, 2014, 05:38
Default
  #5
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
thank you for answer friend! ... with relation plot residuals...
residuals are not working:
https://www.youtube.com/watch?v=rDt4FOiIDUc

And pyfoam gives a lot of problems.. I prefer residuals file, as in youtube video.. but gives that problem..Do you know what is the problem?

about "Why did you deactivate the turbulence model?".. My simulation is laminar..as in the paper I am trying to validate (non newtonian, laminar)
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 06:49
Default
  #6
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Hmm... does the x-gnuplot window open for other scripts? I remember an error I had, where I needed to install some special kind of gnuplot extra package to get the x-window working.
Maybe a simple
Code:
sudo apt-get install gnuplot-x11
will help.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 2, 2014, 06:58
Default
  #7
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
woooowwww... it works! I am so happy
I had no success for two weeks .. I will plot here the residuals... It is my first time looking graphically.. can you analize my simulation and give me a basic explanation...in order I can understand analize these graph? I will plot in minutes the graph
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 06:59
Default
  #8
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Hi, I'm glad it works.
Use:
Code:
set terminal jpeg font 'Helvetica,10' 
set output "pressure.jpeg"
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
set format y "%e"

set grid
plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\
"< cat log | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\
"< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\
"< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" every 1 title 'p' with lines lc 7
to get a jpeg.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 2, 2014, 07:19
Default
  #9
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
how can I plot for p? my nonorthogonalityCorrectors is 3..


What should I change?

Code:
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\
"< cat log | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\
"< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\
"< cat log | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines,\
"< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\
"< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines
pause 1
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 07:23
Default
  #10
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
with this Residuals file I get:

asdfasdf.jpg
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 07:24
Default
  #11
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Have a look at my last post. Just use "every 4" in the pressure line to plot every 4th p value.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 2, 2014, 07:33
Default
  #12
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
I don't know ...Can you write for me correcting my code?
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 07:34
Default
  #13
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Just look at my post #6 and change "every 1" in "every 4" to plot just every 4th line
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 2, 2014, 07:37
Default
  #14
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
IM SORRY.... I did not see this post.... oO ,, just a moment
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 07:38
Default
  #15
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Quote:
Originally Posted by vitorspadetoventurin View Post
IM SORRY.... I did not see this post.... oO ,, just a moment
???
The number of each post is shown in the upper right corner of each post. Scroll up and down until you find a "#6". This is my post. Actually you can just click on this link to scroll there:
http://www.cfd-online.com/Forums/ope...tml#post522055
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 2, 2014, 07:41
Default
  #16
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
pressure.jpeg


Can you help me to interpret my graph? Is it good? good convergence? I a beginner with this plot.. I dont know if it is good or not
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 07:47
Default
  #17
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Hi, I think it looks good, but I don't know your case. But anyway, something is wrong with the plot command. Are you sure you wrote "every 4"? Looks like you wrote "every 3". All residuals should end at the same x-value.

Edit: My fault. If orthogonal correctors is 4, you need to write "every 5". But please post the output of "checkMesh", I don't think that many correctors are necessary.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   December 2, 2014, 08:13
Default
  #18
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
I fix it...
1- just a beginner's question... what means that Uz finish with 1e-06?means that the difference between the penultimate and last iteration is 1e-06? Is it the initial residual for Uz?

pressure.jpeg


2- Can you talk a little about my graph? I dont understand also how to interpret when will gives converged..

my fvsolution is:

Code:
/
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-05;
        relTol          0.01;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps     2;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 10;
        mergeLevels     1;
    }


  "(k|epsilon|R|nuTilda)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0.01;
    }


   U
   {
      solver PBiCG;
      preconditioner DILU;
      tolerance 1e-8;
      relTol 0.01;
   }

}

SIMPLE
{
    nNonOrthogonalCorrectors 4;

    residualControl
    {
        p               1e-5;
        U               1e-5;
        "(k|epsilon|omega)" 1e-3;
    }
}

relaxationFactors
{
    fields
    {
        p               0.3;
    }
    equations
    {
        U               0.7;
        k               0.7;
        epsilon         0.7;
        R               0.7;
        nuTilda         0.7;
    }
}
I dont understand well how to configure fvsolution, I just copied from other case... I dont now if these criterias are good..

Sorry for this kind of question.. I am a beginner. Your opinion will open my mind..
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 08:18
Default
  #19
Member
 
vitor spadeto
Join Date: Nov 2014
Posts: 51
Rep Power: 11
vitorspadetoventurin is on a distinguished road
checkMesh:

Code:
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           129436
    faces:            1375651
    internal faces:   1316745
    cells:            673099
    faces per cell:   4
    boundary patches: 4
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     0
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    673099
    polyhedra:     0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology                  
    inlet_host          380      216      ok (non-closed singly connected)  
    outlet              430      241      ok (non-closed singly connected)  
    wall                57716    28932    ok (non-closed singly connected)  
    inlet_graft         380      216      ok (non-closed singly connected)  

Checking geometry...
    Overall domain bounding box (-0.025 -0.0015 -0.0015) (0.02 0.0015 0.0160563)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-2.40961e-16 -2.09889e-16 1.90397e-16) OK.
    Max cell openness = 2.81535e-16 OK.
    Max aspect ratio = 7.39353 OK.
    Minimum face area = 1.8821e-09. Maximum face area = 7.62702e-08.  Face area magnitudes OK.
    Min volume = 4.50799e-14. Max volume = 6.63018e-12.  Total volume = 4.45876e-07.  Cell volumes OK.
    Mesh non-orthogonality Max: 63.5336 average: 14.7407
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.691846 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End
vitorspadetoventurin is offline   Reply With Quote

Old   December 2, 2014, 08:28
Default
  #20
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Quote:
Originally Posted by vitorspadetoventurin View Post
what means that Uz finish with 1e-06?means that the difference between the penultimate and last iteration is 1e-06? Is it the initial residual for Uz?
You need to read a bit about the simple algorithm to be able to understand this. "1e-6" means that the initial residual of your linear solver is 1e-6. This means, that the simple algorithm already converged pretty good, otherwise the initial residual would be higher. So this is nice. Your equations are solved 1000000 times better than at the beginning of your simulations.

Quote:
Originally Posted by vitorspadetoventurin View Post
2- Can you talk a little about my graph? I dont understand also how to interpret when will gives converged..
All curves (after some short initial fluctuations) decrease strongly for several decades. They don't "jump" back to higher values or do anything fishy. This looks like you want them.


Quote:
Originally Posted by vitorspadetoventurin View Post
I dont understand well how to configure fvsolution, I just copied from other case... I dont now if these criterias are good..
Yes, copy them, that's good. No need to reinvent the wheel.

You need the simple (outer) iterations to converge. That's the main objective. One iteration of the "outer" / simple algorithm consist of Ux,Uy,Uz and p solving = one "block" as shown in your third post log.
So from iteration to iteration the initial residuals should decrease. This is what you plot in gnuplot.
Each of these outer iterations has to solve a linear system of equations. They are set up by the "solver" commands in fvSolution. It's not important that the final residual of each linear solver is low. It just must be low enough so the outer iterations converge. So I would set all "relTol" to 0.1 and only increase them if simple doesn't converge.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
higher grid resolution --> later convergence? cfd-noob89 Main CFD Forum 4 October 31, 2013 09:47
Not getting the results after convergence Agnimitra Main CFD Forum 0 January 16, 2008 00:28
Interpretation of Results Danial Main CFD Forum 3 October 19, 2001 13:38
Different Results in Convergence Figen FLUENT 0 February 9, 2000 16:07
convergence problem with SIMPLER NURAY KAYAKOL Main CFD Forum 1 February 24, 1999 13:43


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