In this post, preliminary Linux examples to using gnuplot is provided.
First, prepare any cases and run with solver such as icoFoam using command:
icoFoam >logs &
Let's say the 'logs' file looks like below if we use command: cat logs
-------------------------------------------------------------------------------------------------------------------------------------
Selecting LES delta type cubeRootVol
--> FOAM Warning :
From function cubeRootVolDelta::calcDelta()
in file LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C at line 55
Case is 2D, LES is not strictly applicable
No MRF models present
No finite volume options present
Starting time loop
Time = 5e-005
Courant Number mean: 7.14286e-005 max: 0.0395
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.000166824, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 1, No Iterations 0
GAMG: Solving for p, Initial residual = 1, Final residual = 6.70649e-007, No Iterations 86
time step continuity errors : sum local = 9.5807e-011, global = -2.40967e-011, cumulative = -2.40967e-011
GAMG: Solving for p, Initial residual = 0.00259042, Final residual = 8.67473e-007, No Iterations 45
time step continuity errors : sum local = 6.52214e-008, global = -1.01924e-008, cumulative = -1.02165e-008
smoothSolver: Solving for omega, Initial residual = 0.103716, Final residual = 0.103716, No Iterations 0
smoothSolver: Solving for k, Initial residual = 1, Final residual = 1, No Iterations 0
ExecutionTime = 0.485 s ClockTime = 0 s
Time = 0.0001
Courant Number mean: 0.0421269 max: 3.42834
smoothSolver: Solving for Ux, Initial residual = 0.753266, Final residual = 0.753266, No Iterations 0
smoothSolver: Solving for Uy, Initial residual = 0.269283, Final residual = 0.269283, No Iterations 0
GAMG: Solving for p, Initial residual = 0.0127023, Final residual = 9.86352e-007, No Iterations 107
time step continuity errors : sum local = 7.34932e-008, global = 2.35392e-010, cumulative = -9.98112e-009
GAMG: Solving for p, Initial residual = 0.0343905, Final residual = 8.3762e-007, No Iterations 75
time step continuity errors : sum local = 2.9792e-010, global = 9.09627e-012, cumulative = -9.97202e-009
smoothSolver: Solving for omega, Initial residual = 0.00254583, Final residual = 0.00254583, No Iterations 0
smoothSolver: Solving for k, Initial residual = 1, Final residual = 1, No Iterations 0
ExecutionTime = 0.797 s ClockTime = 1 s
-------------------------------------------------------------------------------------------------------------------------------------
Let us see what will happen if we use a few Linux command on the basis of above logs file.
First, prepare any cases and run with solver such as icoFoam using command:
icoFoam >logs &
Let's say the 'logs' file looks like below if we use command: cat logs
-------------------------------------------------------------------------------------------------------------------------------------
Selecting LES delta type cubeRootVol
--> FOAM Warning :
From function cubeRootVolDelta::calcDelta()
in file LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C at line 55
Case is 2D, LES is not strictly applicable
No MRF models present
No finite volume options present
Starting time loop
Time = 5e-005
Courant Number mean: 7.14286e-005 max: 0.0395
smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 0.000166824, No Iterations 1
smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 1, No Iterations 0
GAMG: Solving for p, Initial residual = 1, Final residual = 6.70649e-007, No Iterations 86
time step continuity errors : sum local = 9.5807e-011, global = -2.40967e-011, cumulative = -2.40967e-011
GAMG: Solving for p, Initial residual = 0.00259042, Final residual = 8.67473e-007, No Iterations 45
time step continuity errors : sum local = 6.52214e-008, global = -1.01924e-008, cumulative = -1.02165e-008
smoothSolver: Solving for omega, Initial residual = 0.103716, Final residual = 0.103716, No Iterations 0
smoothSolver: Solving for k, Initial residual = 1, Final residual = 1, No Iterations 0
ExecutionTime = 0.485 s ClockTime = 0 s
Time = 0.0001
Courant Number mean: 0.0421269 max: 3.42834
smoothSolver: Solving for Ux, Initial residual = 0.753266, Final residual = 0.753266, No Iterations 0
smoothSolver: Solving for Uy, Initial residual = 0.269283, Final residual = 0.269283, No Iterations 0
GAMG: Solving for p, Initial residual = 0.0127023, Final residual = 9.86352e-007, No Iterations 107
time step continuity errors : sum local = 7.34932e-008, global = 2.35392e-010, cumulative = -9.98112e-009
GAMG: Solving for p, Initial residual = 0.0343905, Final residual = 8.3762e-007, No Iterations 75
time step continuity errors : sum local = 2.9792e-010, global = 9.09627e-012, cumulative = -9.97202e-009
smoothSolver: Solving for omega, Initial residual = 0.00254583, Final residual = 0.00254583, No Iterations 0
smoothSolver: Solving for k, Initial residual = 1, Final residual = 1, No Iterations 0
ExecutionTime = 0.797 s ClockTime = 1 s
-------------------------------------------------------------------------------------------------------------------------------------
Let us see what will happen if we use a few Linux command on the basis of above logs file.
cat logs | grep 'Solving for Ux' //open logs, find lines containing keyword ' Solving for Ux'
cat logs | grep 'Solving for Ux' | cut -d ' ' -f9
//open logs, find lines containing keyword ' Solving for Ux', show 9th field. (fields are separated by delimiter of a space)
eg: 59 34 23 54 65
cut -d ' ' -f4
You will have: 54
cut -d ' ' -f5
You will have: 65
//open logs, find lines containing keyword ' Solving for Ux', show 9th field. (fields are separated by delimiter of a space)
eg: 59 34 23 54 65
cut -d ' ' -f4
You will have: 54
cut -d ' ' -f5
You will have: 65
cat logs | grep 'Solving for Ux' | cut -d ' ' -f9 | tr -d ',' //Similar as above, but delete comma.
cat log | grep -w 'Time =' | cut -d' ' -f3 | tr -d ',' > time_tmp.dat //Same as above, but save output to another file.
More useful commands available:
www.computerhope.com/unix/ucut.htm Linux and Unix cut command
stackoverflow.com/questions/28955761/linux-tr-command 8 Linux TR Command Examples
www.computerhope.com/unix/ucut.htm Linux and Unix cut command
stackoverflow.com/questions/28955761/linux-tr-command 8 Linux TR Command Examples