CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Sending log to spreadsheets (http://www.cfd-online.com/Forums/openfoam-post-processing/61396-sending-log-spreadsheets.html)

gemaforce April 18, 2008 07:16

Hi, I just want to know if the
 
Hi, I just want to know if there's a way of capturing the log data into spreadsheets like Open Office. I would like to take the information printed on the log file and chart it out you see.

Thanks!

Samuel

gschaider April 18, 2008 07:56

Hi Samuel! You'll have to e
 
Hi Samuel!

You'll have to extract the info into CSV-files (or something similar). This is for instance done by the foamLog-Skript described in section 7.6 of the UserGuide or (beware: advertising) by some of the pyFoam-Utilities

Bernhard

gemaforce April 20, 2008 20:42

Thank you so much Bernhard!I u
 
Thank you so much Bernhard!I understand how to do it now!

gemaforce April 20, 2008 21:27

Sorry, but I may sound really
 
Sorry, but I may sound really stupid at this point in time..

I tried following the UserGuide section 7.6, but I encountered a problem. I can't seem to execute the foamLog script within OpenFOAM. It says on the UserGuide that I have to type in foamLog <root> <case> <logfile>, but I'm not sure which logFile I'm referring to because I can't find the subdirectory called logs anywhere in OpenFOAM-1.4.1.

Please guide me along.

Thank you,
Samuel

asaha April 21, 2008 01:47

Hello, A log file is create
 
Hello,

A log file is created in the case directory when you execute:

foamJob <solver> <root> <case>


Then you need to execute:

foamLog <root> <case> <logfile>

gemaforce April 21, 2008 01:55

Oh ok! I get it now! I thought
 
Oh ok! I get it now! I thought the logFile was there all along and when I tried to execute it, I thought the system hung right there! Thank you!

asaha April 21, 2008 01:56

Hello, I get the following
 
Hello,

I get the following log for each time step:

Courant Number mean: 0.0201787 max: 0.264922
deltaT = 0.00473396
Time = 0.0263302

MULES: Solving for gamma
Liquid phase volume fraction = 0.130194 Min(gamma) = -7.81823e-47 Max(gamma) = 1
MULES: Solving for gamma
Liquid phase volume fraction = 0.130194 Min(gamma) = -7.444e-47 Max(gamma) = 1
DICPCG: Solving for pd, Initial residual = 0.0305024, Final residual = 0.000290093, No Iterations 1
DICPCG: Solving for pd, Initial residual = 0.000299968, Final residual = 1.33247e-05, No Iterations 10
DICPCG: Solving for pd, Initial residual = 2.02136e-05, Final residual = 9.3558e-08, No Iterations 36
time step continuity errors : sum local = 5.60007e-07, global = 4.57038e-08, cumulative = 1.23805e-07
Mass of Fluid 1 = 0.646099 kg
ExecutionTime = 0.53 s ClockTime = 1 s


I wish to extract the information for "Liquid phase volume fraction = 0.130194" for each time step from the log file. I tried to use the foamLog script, but this information is particularly missing in the subdirectory log.

Kindly help me.

Regards,

A A Saha.

ngj April 21, 2008 02:32

Hi Saha, and good morning to e
 
Hi Saha, and good morning to everyone

If your log file is called runLog, I would do the following from the command line:

grep -A3 -E "^Time" runLog | grep -v "MULES"

Then you at least have the data written to screen / can redirect it to a file. If you need the data to be plotted using some script, you probably want the data in a tab-separated file, this could be done like this:

grep -A3 -E "^Time" runLog | grep -v "MULES" | sed -e 's/\//'| awk 'BEGIN {RS="T"} {print $3,$9}' > myLiquidFraction

The part sed -e 's/\//' might be omitted, but I got some weird formating, which I removed by that command.

Have funhttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

- Niels

msrinath80 April 22, 2008 12:37

Alternately locate the file kn
 
Alternately locate the file known as foamLog.db and add an entry for 'Liquid phase...whatever' in it. Now, foamLog can extract that info for you!

asaha April 22, 2008 14:37

Hello Srinath, Thanks for y
 
Hello Srinath,

Thanks for your post. I added the entry in the foamLog.db and the Liquid phase is now available in foamLog.

Thanks,

A A Saha

asaha April 22, 2008 14:51

Hello Niels, Thanks for you
 
Hello Niels,

Thanks for your post. The command line option works great and serves exactly what I was looking for.

I got the following error:

sed: -e expression #1, char 5: unterminated `s' command

Omitting sed -e 's/\//' it workes fine.

Thanks again.


Regards,

A A Saha


All times are GMT -4. The time now is 03:47.