|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Zeno Brighenti
Join Date: May 2023
Posts: 7
Rep Power: 3 ![]() |
Hello Foamers,
I'm perfectly aware this issue has been treated a lot in the past, but unfortunately, that's my fault, i'm not still able to face it. I run a PISO RSM simulation and i would like to plot the residual with Gnuplot. I've followed this guide (Tutorial of how to plot residuals !) with no results, since unfortunately i'm not a gnuplot expert and no command explanation is given in the aforementioned tutorial: Code:
set logscale y set title "Residuals" set ylabel 'Residual' set xlabel 'Iteration' plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\ "< cat log | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\ "< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\ "< cat log | grep 'Solving for Rx' | cut -d' ' -f9 | tr -d ','" title 'Rx' with lines,\ "< cat log | grep 'Solving for Ry' | cut -d' ' -f9 | tr -d ','" title 'Ry' with lines,\ "< cat log | grep 'Solving for Rz' | cut -d' ' -f9 | tr -d ','" title 'Rz' with lines,\ "< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\ "< cat log | grep 'Solving for epsilon' | cut -d' ' -f9 | tr -d ','" title 'epsilon' with lines,\ "< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines pause 1 reread Code:
Courant Number mean: 0.00012169 max: 0.331303 deltaT = 2.70046e-07 Time = 0.00700068s diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for Ux, Initial residual = 0.000485903, Final residual = 4.31859e-09, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.000129991, Final residual = 8.78841e-10, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 0.000491682, Final residual = 4.87483e-09, No Iterations 2 DILUPBiCGStab: Solving for h, Initial residual = 0.000680715, Final residual = 4.33642e-07, No Iterations 1 GAMG: Solving for p, Initial residual = 0.000834368, Final residual = 1.86958e-07, No Iterations 1 GAMG: Solving for p, Initial residual = 1.8936e-06, Final residual = 7.15294e-09, No Iterations 1 GAMG: Solving for p, Initial residual = 1.10342e-07, Final residual = 1.10342e-07, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 1.82047e-10, global = -1.97094e-13, cumulative = 1.33439e-12 GAMG: Solving for p, Initial residual = 1.64091e-06, Final residual = 1.74194e-09, No Iterations 1 GAMG: Solving for p, Initial residual = 3.12903e-08, Final residual = 3.12903e-08, No Iterations 0 GAMG: Solving for p, Initial residual = 3.12903e-08, Final residual = 3.12903e-08, No Iterations 0 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 5.16241e-11, global = -1.75414e-14, cumulative = 1.31684e-12 smoothSolver: Solving for epsilon, Initial residual = 6.2732e-05, Final residual = 3.46349e-09, No Iterations 2 bounding epsilon, min: -6.45685e-05 max: 7.86881e+06 average: 539.917 smoothSolver: Solving for Rxx, Initial residual = 0.000439767, Final residual = 2.4545e-09, No Iterations 5 smoothSolver: Solving for Rxy, Initial residual = 0.0144549, Final residual = 3.58382e-09, No Iterations 7 smoothSolver: Solving for Rxz, Initial residual = 0.011701, Final residual = 6.47263e-09, No Iterations 6 smoothSolver: Solving for Ryy, Initial residual = 0.000441822, Final residual = 3.08538e-09, No Iterations 5 smoothSolver: Solving for Ryz, Initial residual = 0.00830103, Final residual = 7.33049e-09, No Iterations 6 smoothSolver: Solving for Rzz, Initial residual = 0.000434931, Final residual = 2.49343e-09, No Iterations 5 ExecutionTime = 539.768 s ClockTime = 555 s |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,257
Rep Power: 29 ![]() ![]() |
Hello,
You need to spend a bit of time to understand how the script is working. I didn't try on this specific case, but tools like chatgpt can be pretty helpful to give you an explanation of what the script is doing. Code:
cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ',' Same for solving for Rx, you are retrieving 3 points at each timestep (Rxx Rxy Rxz) and Ry (2 points: Ryy Ryz) You need to adapt your script to match what your solver is solving, and what you want to see. I personnally prefer to use a function object (residuals in the foundation branch, solverInfo in the OpenCFD branch) rather than plotting from the log file, but to each his own! Regards, Yann |
|
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
Zeno Brighenti
Join Date: May 2023
Posts: 7
Rep Power: 3 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#5 | |
New Member
Zeno Brighenti
Join Date: May 2023
Posts: 7
Rep Power: 3 ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
|
||
![]() |
![]() |
![]() |
![]() |
#7 | ||
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,257
Rep Power: 29 ![]() ![]() |
Quote:
For the Reynolds stress, instead of searching for "Solving for Rx", search each components : "Solving for Rxx", "Solving for Rxy", etc... For the pressure, you need to plot only one value by timestep, for instance the first "Solving for p" of each timestep. So basically you need to filter your log file to output "Solving for p" every 6 lines. Code:
cat log | grep 'Solving for p' | awk 'NR % 6 == 1' | cut -d' ' -f9 | tr -d ',' ![]() Quote:
Yann |
|||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Tutorials] Tutorial of how to plot residuals ! | wolle1982 | OpenFOAM Community Contributions | 172 | December 6, 2024 07:20 |
GnuPlot does not work. | ahamed68 | OpenFOAM Post-Processing | 3 | January 29, 2024 06:02 |
Cannot find functionObject file residuals | vava10 | OpenFOAM Pre-Processing | 2 | November 14, 2020 13:21 |
[PyFoam] PyFoam 0.6.9 wrong path to gnuplot | klausb | OpenFOAM Community Contributions | 5 | March 15, 2018 15:28 |
motorBike Residuals for SST k-omega... and mine | JR22 | OpenFOAM Running, Solving & CFD | 6 | August 1, 2013 10:08 |