CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Local Residuals for rhoSimpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2015, 03:51
Default Local Residuals for rhoSimpleFoam
  #1
New Member
 
Join Date: Feb 2013
Posts: 17
Rep Power: 13
Werne is on a distinguished road
Hello,

I'm looking for a way to calculate the local residuals of the velocity-field. I know that there is a utility (namely simpleFoamResiduals) to do this for a simpleFoam setup, however it doesn't work with a rhoSimpleFoam case.
Is there a way to calculate the residual field of a rhoSimpleFoam simulation in a way that allows me to view it in Paraview?

I'm glad for any help.
Werne is offline   Reply With Quote

Old   May 4, 2017, 08:07
Default
  #2
Member
 
Fynn
Join Date: Feb 2016
Posts: 48
Rep Power: 10
PanPeter is on a distinguished road
Hi Werne,

There's no residual field. What you probably want is to plot the residual of some field. For the rhoSimpleFoam solver you can plot the residuals for p and U simply by executing the residuals function object: Add this to your controlDict file:
Code:
functions
{
	#includeFunc  residuals
}
You'll then need to copy the residuals dictionary from
Code:
 $WM_PROJECT_DIR/etc/caseDicts/postProcessing/numerical/residuals
to your system folder. The residuals for your case are then monitored and written to your postProcessing folder. You can then monitor the development of the residuals through:
Code:
foamMonitor -l postProcessing/residuals/0/residuals.dat
There's more options to it, so here's the documentation to the above said:
HTML Code:
https://cfd.direct/openfoam/user-guide/graphs-monitoring/
What I would really like to know in that regard is why it is not possible to use the residuals function object for monitoring the rho field. Any ideas?

cheers,
Fynn

Last edited by PanPeter; May 6, 2017 at 06:38. Reason: error in residuals dictionary path: $FOAM_SRC ---> $WM_PROJECT_DIR
PanPeter is offline   Reply With Quote

Old   May 5, 2017, 12:15
Exclamation
  #3
Member
 
power
Join Date: Jun 2014
Posts: 86
Rep Power: 11
enginpower is on a distinguished road
Hello,
me too I'm using rhoSimpleFoam in this case " solver for supersonic flow butane close to condensation" and I'd like to plot residuals. I do that, but I have the problem that U, Ux, Uv, etc.. are not plotted. Is the above description useful to solve this issue? Or is it independent?

Thanks

Last edited by enginpower; May 8, 2017 at 08:18.
enginpower is offline   Reply With Quote

Old   May 6, 2017, 06:52
Default
  #4
Member
 
Fynn
Join Date: Feb 2016
Posts: 48
Rep Power: 10
PanPeter is on a distinguished road
Hi enginpower,

First, note that I corrected an error in my post above. Does that already fix your problem?

If not:
Quote:
I have the problem that U, Ux, Uv, etc.. are not plotted
Does that mean that you get an empty gnuPlot window and the residuals are simply not plotted? Then I would test the above procedure on the squareBend example case for rhoSimpleFoam. If that is plotting your residuals you have a working example that you can compare you case with.

Or is there not even an empty gnuPlot window appearing? Then foamMonitor should give you an error message.

cheers,
Fynn
PanPeter is offline   Reply With Quote

Old   May 8, 2017, 08:16
Unhappy
  #5
Member
 
power
Join Date: Jun 2014
Posts: 86
Rep Power: 11
enginpower is on a distinguished road
Hi,
thanks for reply

Actually, I'm using this script:
Code:
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log.rhoSimpleFoam | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for U' | cut -d' ' -f9 | tr -d ','" title 'U' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for epsilon' | cut -d' ' -f9 | tr -d ','" title 'epsilon' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for nut' | cut -d' ' -f9 | tr -d ','" title 'nut' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for T' | cut -d' ' -f9 | tr -d ','" title 'T' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for e' | cut -d' ' -f9 | tr -d ','" title 'e' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for rho' | cut -d' ' -f9 | tr -d ','" title 'rho' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for alphat' | cut -d' ' -f9 | tr -d ','" title 'alphat' with lines,\
     "< cat log.rhoSimpleFoam | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines
pause 1
reset
reread
It works for tutorial cases.

As I explained in this post, the problem is not plotting in general, but plotting some variables like Ux, Uy, etc...
As you can see in this image, the residuals of other variables are plotted, what is not plotted is the velocity residuals.
A concern to help to understand this is that Ux information is not in the log file. What I mean is this:
  • part of the log file of the tutorial case is the following:
    Code:
    Starting time loop
    
    Time = 1
    
    smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 0.0673067, No Iterations 4
    smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 0.0519002, No Iterations 4
    smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 0.0564047, No Iterations 4
    smoothSolver:  Solving for e, Initial residual = 0.00130693, Final residual = 1.34285e-05, No Iterations 2
    GAMG:  Solving for p, Initial residual = 1, Final residual = 0.0490362, No Iterations 8
    time step continuity errors : sum local = 6.68145, global = -1.46266, cumulative = -1.46266
    rho max/min : 1.20199 1.17693
    smoothSolver:  Solving for epsilon, Initial residual = 0.0857374, Final residual = 0.000364367, No Iterations 2
    and it has Ux value residual
  • part of the log file of my case is the following:
    Code:
    Starting time loop
    
    Time = 1
    
    smoothSolver:  Solving for e, Initial residual = 0.999872, Final residual = 0.0742461, No Iterations 1
    GAMG:  Solving for p, Initial residual = 1, Final residual = 0.000128453, No Iterations 1
    time step continuity errors : sum local = 1.08951, global = 0.335102, cumulative = 0.335102
    rho max/min : 51.2989 1.86835
    smoothSolver:  Solving for epsilon, Initial residual = 0.169512, Final residual = 0.00942059, No Iterations 2
    smoothSolver:  Solving for k, Initial residual = 1, Final residual = 0.0520951, No Iterations 2
    ExecutionTime = 40.51 s  ClockTime = 40 s
    
    Time = 2
    It has not any ux information. Why? I believe there is some problem with the setting, but I can't solve alone. I don't catch where is the problem.
I hope to solve very soon with your help.



Thanks to who wants to help me
enginpower 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
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 01:42.