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 Tree3Likes
  • 2 Post By ic3wall
  • 1 Post By Ben UWIHANGANYE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 21, 2011, 16:54
Default Residuals Calculation
  #1
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 15
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, 17:51
Default
  #2
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 15
ic3wall is on a distinguished road
Nobody knows how exactly they are calculated ??
ic3wall is offline   Reply With Quote

Old   December 23, 2011, 07:22
Default
  #3
Senior Member
 
Paulo Vatavuk
Join Date: Mar 2009
Location: Campinas, Brasil
Posts: 200
Rep Power: 18
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, 15:57
Default
  #4
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 15
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, 14:18
Default
  #5
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 15
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, 124 views)
File Type: jpg Res_non_Normalisés.jpg (59.1 KB, 108 views)
File Type: jpg NormFactor.jpg (57.6 KB, 104 views)
AnthonyP and blr like this.
ic3wall is offline   Reply With Quote

Old   September 11, 2018, 10:42
Default
  #6
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 9
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, 42 views)
blr likes this.
Ben UWIHANGANYE is offline   Reply With Quote

Old   May 9, 2024, 03:53
Default
  #7
blr
New Member
 
He Shang
Join Date: Nov 2023
Posts: 6
Rep Power: 2
blr is on a distinguished road
I have met a similar problem. The residuals of p can not continue to decrease at an order of 2e-2. So I installed the v-2312 version of OpenFOAM, it can give the residuals filed of U and p. By looking the residuals field of p, the real value is really small, the maximum value is about 5e-5 and absolute average value is about 3.3e-8. So I am very confused why the OpenFOAM normalized the residuals....
blr 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 03:55
MRF and Heat transfer calculation Susan YU FLUENT 0 June 2, 2010 09:46
Need Help Understanding RMS residual calculation TWaung CFX 1 September 22, 2009 19:21
Convergence - scaled vs unscaled residuals HS FLUENT 1 November 7, 2005 06:45
Warning 097- AB Siemens 6 November 15, 2004 05:41


All times are GMT -4. The time now is 13:36.