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

Residuals Calculation

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 21, 2011, 16:54
Default Residuals Calculation
  #1
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 5
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: 5
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: 110
Rep Power: 8
vatavuk is on a distinguished road
Hi ic3wall,
There is an old thread that has the information you want:
Residuals for convergence of segregated solvers

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: 5
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: 5
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, 54 views)
File Type: jpg Res_non_NormalisÚs.jpg (59.1 KB, 47 views)
File Type: jpg NormFactor.jpg (57.6 KB, 51 views)
ic3wall is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial of how to plot residuals ! wolle1982 OpenFOAM Running, Solving & CFD 113 August 2, 2015 08:46
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 06:45
Warning 097- AB CD-adapco 6 November 15, 2004 05:41


All times are GMT -4. The time now is 05:06.