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

how to use foamLog?

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 5 Post By Bloerb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 29, 2014, 16:46
Default how to use foamLog?
  #1
New Member
 
Mehdi Famouri
Join Date: Jan 2011
Posts: 12
Rep Power: 15
mehdi8619 is on a distinguished road
Hey guys, I'm a rookie and trying to figure out how to use foamLog.

1- Is these two lines all I'm supposed to do? for "cavity" as an example
famouri@ubuntu:~/cavity$ foamJob icoFoam
famouri@ubuntu:~/cavity$ foamLog log

2- Is there any way to have all those data in one file? Like a file with more than two columns.

3- How can I add something not listed there as default?

Thank you in Advance
Mehdi
mehdi8619 is offline   Reply With Quote

Old   February 5, 2016, 04:59
Default
  #2
Member
 
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10
elmo555 is on a distinguished road
I'd be interested in this as well.
elmo555 is offline   Reply With Quote

Old   February 5, 2016, 09:56
Default
  #3
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 15
Bazinga is on a distinguished road
1) Basically, yes.
Here is a bit more information:
http://web.student.chalmers.se/group...ngLucchini.pdf

2) To my knowledge, no. You need to read each file separately.

3) Doesn't foamLog already take basically all information of the log file? What kind of information do you want? I think you would need to work in the code of the utility to change things.
Bazinga is offline   Reply With Quote

Old   March 29, 2016, 05:08
Default deltaT from foamLog
  #4
New Member
 
Malthe V. Eisum
Join Date: Nov 2015
Location: Nibe, Denmark
Posts: 5
Rep Power: 10
Malthe Eisum is on a distinguished road
Quote:
Originally Posted by mehdi8619 View Post
3- How can I add something not listed there as default?
Quote:
Originally Posted by Bazinga View Post
3) Doesn't foamLog already take basically all information of the log file? What kind of information do you want? I think you would need to work in the code of the utility to change things.
I have the same question.
Below is an example of a log file (pimpleFoam, slightly modified)

Code:
Courant Number mean: 0 max: 0 velocity magnitude: 0
deltaT = 0.00107403
Time = 0.00107403

dU0dt = dU0dt [0 1 -2 0 0 0 0] (3.51258e-06 0 0)
DILUPBiCG:  Solving for Ux, Initial residual = 1, Final residual = 2.89979e-10, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0
GAMG:  Solving for p, Initial residual = 2.91879e-09, Final residual = 2.91879e-09, No Iterations 0
time step continuity errors : sum local = 1.47332e-28, global = 4.77833e-29, cumulative = 4.77833e-29
GAMG:  Solving for p, Initial residual = 3.51043e-09, Final residual = 3.51043e-09, No Iterations 0
time step continuity errors : sum local = 1.77196e-28, global = 7.76479e-29, cumulative = 1.25431e-28
dU0dt = dU0dt [0 1 -2 0 0 0 0] (3.51258e-06 0 0)
DILUPBiCG:  Solving for Ux, Initial residual = 2.87496e-09, Final residual = 2.87496e-09, No Iterations 0
DILUPBiCG:  Solving for Uy, Initial residual = 4.41294e-11, Final residual = 4.41294e-11, No Iterations 0
GAMG:  Solving for p, Initial residual = 3.116e-09, Final residual = 3.116e-09, No Iterations 0
time step continuity errors : sum local = 1.57287e-28, global = 5.77382e-29, cumulative = 1.83169e-28
GAMG:  Solving for p, Initial residual = 3.54987e-09, Final residual = 3.54987e-09, No Iterations 0
time step continuity errors : sum local = 1.79187e-28, global = 6.37111e-29, cumulative = 2.46881e-28
ExecutionTime = 0.05 s  ClockTime = 0 s

Courant Number mean: 1.56175e-29 max: 8.27559e-12 velocity magnitude: 4.59998e-10
deltaT = 0.0012803
Time = 0.00235434

dU0dt = dU0dt [0 1 -2 0 0 0 0] (3.52066e-06 0 0)
DILUPBiCG:  Solving for Ux, Initial residual = 0.999568, Final residual = 3.42989e-10, No Iterations 1
DILUPBiCG:  Solving for Uy, Initial residual = 4.96118e-11, Final residual = 4.96118e-11, No Iterations 0
GAMG:  Solving for p, Initial residual = 3.97586e-08, Final residual = 3.97586e-08, No Iterations 0
time step continuity errors : sum local = 2.39233e-27, global = 2.16449e-27, cumulative = 2.41137e-27
GAMG:  Solving for p, Initial residual = 3.47099e-08, Final residual = 3.47099e-08, No Iterations 0
time step continuity errors : sum local = 2.08854e-27, global = 1.8607e-27, cumulative = 4.27207e-27
dU0dt = dU0dt [0 1 -2 0 0 0 0] (3.52066e-06 0 0)
DILUPBiCG:  Solving for Ux, Initial residual = 1.58338e-09, Final residual = 1.58338e-09, No Iterations 0
DILUPBiCG:  Solving for Uy, Initial residual = 9.32757e-11, Final residual = 9.32757e-11, No Iterations 0
GAMG:  Solving for p, Initial residual = 3.28166e-08, Final residual = 3.28166e-08, No Iterations 0
time step continuity errors : sum local = 1.97462e-27, global = 1.74678e-27, cumulative = 6.01885e-27
GAMG:  Solving for p, Initial residual = 2.58746e-08, Final residual = 2.58746e-08, No Iterations 0
time step continuity errors : sum local = 1.55691e-27, global = 1.17718e-27, cumulative = 7.19603e-27
ExecutionTime = 0.05 s  ClockTime = 0 s
If i run
Code:
formLog
i get the following outputs.
  • CourantMax
  • CourantMean
  • Separator
  • Time
  • Ux
  • UxFinalRes
  • UxIters
  • Uy
  • UyFinalRes
  • UyIters
  • contCumulative
  • contGlobal
  • contLocal
  • executionTime
  • p
  • pFinalRes
  • pIters

Is there a way I can get foamLog to output deltaT ? it is listed the same way as Time.

Writing this post I realised I can use the xy file of Time and still get the initial time step. But post any way out of professional curiosity and I know how to modify the solver to log a line of text with a value and can see the combination of this and formLog as a good combination in future use
__________________
Malthe Eisum
Malthe Eisum is offline   Reply With Quote

Old   April 7, 2016, 17:46
Default
  #5
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
One thing to consider is that a new residuals function object was introduced in 2.4.0 to make this simpler.

You can add this to your controlDict. Should look something like this.
Code:
functions
{
    residuals
    {
        functionObjectLibs ("libutilityFunctionObjects.so");
        type            residuals;
        outputControl   timeStep;
        outputInterval  1;
        fields
        (
            U
            p
        );
    }
}
It outputs it way easier to handle

More importantly you should learn about typical linux commands like sed awk cat and grep to make your life easier.

Quick example: grep searches for a pattern and outputs the line containing it. This outputs every line with "delta T =" in it. You can add > myFile to output this command to a file.
Code:
grep 'deltaT = ' log
The same can be done with sed. foamLog is just a shell around these commands. If you look into the code behind it you can for example see
Code:
getSolvedVars()
{
    fgrep ' Solving for ' $1 | fgrep ',' | sed -e 's/.* Solving for \([^,]*\)[,:].*/\1/' | sort -u
}
fgrep is equal to grep -f which stops error outputs. $1 is the name of your logfile.
The | is a pipeline command. It gives the result of the first to the second query.... I think the fastest way to learn on how to extract only the value of deltaT or something more fancy is googling how to do it with grep, awk or sed since it is possible with all three of them.
Bloerb 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
Using foamLog liamm OpenFOAM Running, Solving & CFD 17 September 10, 2020 04:00
foamLog problem Rickard.Solsjo OpenFOAM Post-Processing 11 November 19, 2014 20:57
foamLog fferroni OpenFOAM Post-Processing 8 May 21, 2012 17:05
foamLog not solving for Ux, Uy, Uz aerospain OpenFOAM Post-Processing 5 April 18, 2012 10:01
FoamLog for my case liugx212 OpenFOAM Running, Solving & CFD 9 June 18, 2008 13:12


All times are GMT -4. The time now is 15:36.