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

Residuals Calculation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ic3wall

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 21, 2011, 15:54
Default Residuals Calculation
  #1
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
Hi all,

Does anybody know how the residuals displayed when running simpleFoam are calculated in OpenFoam 1.7.1 ?

I can't find any precise info on this ...

I'm solving a problem where the pressure should converge to 0, but I'm wondering if the solver normalises the residuals by some factor like the mean pressure for example, if this is the case, it would explain why I obtain quite high residuals.

Thank you
ic3wall is offline   Reply With Quote

Old   December 22, 2011, 16:51
Default
  #2
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
Nobody knows how exactly they are calculated ??
ic3wall is offline   Reply With Quote

Old   December 23, 2011, 06:22
Default
  #3
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 196
Rep Power: 17
vatavuk is on a distinguished road
Hi ic3wall,
There is an old thread that has the information you want:
http://www.cfd-online.com/Forums/ope...d-solvers.html

I hope this helps
vatavuk is offline   Reply With Quote

Old   December 23, 2011, 14:57
Default
  #4
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
Cool, thank you very much, exactly what I was looking for!
ic3wall is offline   Reply With Quote

Old   March 8, 2012, 13:18
Default
  #5
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
Sorry to bring back this thread up but I think it's an interesting topic that many could benefit from...
----------------------------------------------------------
According to hjasak, residuals are calculated as follow:

For matrix

A x = b,

residual is defined as

res = b - Ax

We then apply residual scaling with the following normalisation factor procedure:

Type xRef = gAverage(x);


wA = A x;
pA = A xRef;

normFactor =
gSum(cmptMag(wA - pA) + cmptMag(source - pA))
+ matrix.small_;

and the scaled residual is:

residual =
gSum(cmptMag(source - wA))/normFactor;

-------------------------------------------------------------------

My situation:

I'm modeling an atmospheric boundary layer over a flat terrain using k-eps RANS. The flow is driven by a shear stress applied at the top boundary. I set the pressure to 0 at one point in my domain and apply zeroGradient at every boundary. The velocity components (V & W) perpendicular to the flow should be zero (coriolis is ignored) as well as the pressure.

My problem is that residuals for V,W and P won't go down (please see attached images). I'm suspecting that the normFactor is responsible for that. What happen to the normFactor when wA, pA and source approaches 0, normFactor also approaches 0 ? The consequence is high residuals ...

In my case, the results agree with the analytical solutions, but accoding to residuals convergence is not reached. In the pictures attached, you'll find the standard residuals calculated by OpenFoam, the residuals multiplied by the normFactor which are "absolute residuals" and finally the normFactor alone. Everything is plotted versus iterations.

According to "absolute residuals", I'm very close to the solution.

I'd like to have opinions of others on that ?
Attached Images
File Type: jpg Res_Normalisés.jpg (54.9 KB, 116 views)
File Type: jpg Res_non_Normalisés.jpg (59.1 KB, 101 views)
File Type: jpg NormFactor.jpg (57.6 KB, 98 views)
AnthonyP likes this.
ic3wall is offline   Reply With Quote

Old   September 11, 2018, 09:42
Default
  #6
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Hello ic3wall,

Did you find the answer to that? May you help to know what is happening on this simulation(attache plot of residuals). Is there a way i can calculate the average of residuals so that i can plot residuals in a good way.


Thank you!
Attached Images
File Type: png residualsplot.png (66.2 KB, 35 views)
Ben UWIHANGANYE 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
[Tutorials] Tutorial of how to plot residuals ! wolle1982 OpenFOAM Community Contributions 171 February 20, 2024 02:55
MRF and Heat transfer calculation Susan YU FLUENT 0 June 2, 2010 08:46
Need Help Understanding RMS residual calculation TWaung CFX 1 September 22, 2009 18:21
Convergence - scaled vs unscaled residuals HS FLUENT 1 November 7, 2005 05:45
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 19:26.