- **OpenFOAM**
(*https://www.cfd-online.com/Forums/openfoam/*)

- - **plot residuals in multiregion solver**
(*https://www.cfd-online.com/Forums/openfoam/99472-plot-residuals-multiregion-solver.html*)

plot residuals in multiregion solverHello,
I would like to plot the residuals from a logfile with gnuplot. A nice tutorial for that can be found here. With single region solvers it works nice but not with multiregion solvers. As an example, here is a timestep of a tutorial case: Code:
`Time = 0.0469758` I'm struckling to plot for example Tmax of the heater region. Any hint is appreciated. Best Regards, Toni |

Dear Tony.
Did you find an answer. I now at this positions. I want to plot the temperature in each Region ( solid & Fluid ) But couldnt find a GNUplot code for including the next line.. Solving for solid region led_oben DICPCG: Solving for T, Initial residual = 1, Final residual = 0.04405201, No Iterations 2 Min/max T:406.8886 580.7125 Solving for solid region led_untenDICPCG: Solving for T, Initial residual = 1, Final residual = 0.04022057, No Iterations 2 Min/max T:407.0093 580.5514 Solving for solid region kuehlkoerper DICPCG: Solving for T, Initial residual = 1, Final residual = 0.01958096, No Iterations 2 Min/max T:300 439.3916 Thanks & Regards Unni |

Hi,
it won't work just with gnuplot. You need an additional script to extract the desired values before running gnuplot. It should look somehow like this: Code:
`grep 'Solving for T:' log.chtMultiRegionFoam >log_new2` Best Regards, Toni |

Thanks for the reply.. It was very helpful...
Thanks & Regards Unni |

I tried the following simple adaptation to the tutorial and it worked nicely. The key is to use grep twice. First you output the number of lines
after the line where the keyword is allocated with grep. Then you apply grep as in the tutorial. So something like plot "< cat logfile | grep -A2 specificRegion | grep 'Min/max T:' | cut -d' ' -f1 | tr -d ','" title 'T_specificRegion' with lines,\ where -A2 means that grep outputs 2 lines after the searched text (e.g bottomAir). For three lines, use -A3... etc... Cheers, Mohamed |

All times are GMT -4. The time now is 00:04. |