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

Sending log to spreadsheets

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 18, 2008, 07:16
Default Hi, I just want to know if the
  #1
New Member
 
Samuel Pang
Join Date: Mar 2009
Posts: 15
Rep Power: 8
gemaforce is on a distinguished road
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
gemaforce is offline   Reply With Quote

Old   April 18, 2008, 07:56
Default Hi Samuel! You'll have to e
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,914
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
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
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 20, 2008, 20:42
Default Thank you so much Bernhard!I u
  #3
New Member
 
Samuel Pang
Join Date: Mar 2009
Posts: 15
Rep Power: 8
gemaforce is on a distinguished road
Thank you so much Bernhard!I understand how to do it now!
gemaforce is offline   Reply With Quote

Old   April 20, 2008, 21:27
Default Sorry, but I may sound really
  #4
New Member
 
Samuel Pang
Join Date: Mar 2009
Posts: 15
Rep Power: 8
gemaforce is on a distinguished road
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
gemaforce is offline   Reply With Quote

Old   April 21, 2008, 01:47
Default Hello, A log file is create
  #5
Member
 
a a saha
Join Date: Mar 2009
Posts: 67
Rep Power: 8
asaha is on a distinguished road
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>
asaha is offline   Reply With Quote

Old   April 21, 2008, 01:55
Default Oh ok! I get it now! I thought
  #6
New Member
 
Samuel Pang
Join Date: Mar 2009
Posts: 15
Rep Power: 8
gemaforce is on a distinguished road
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!
gemaforce is offline   Reply With Quote

Old   April 21, 2008, 01:56
Default Hello, I get the following
  #7
Member
 
a a saha
Join Date: Mar 2009
Posts: 67
Rep Power: 8
asaha is on a distinguished road
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.
asaha is offline   Reply With Quote

Old   April 21, 2008, 02:32
Default Hi Saha, and good morning to e
  #8
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,603
Rep Power: 25
ngj will become famous soon enoughngj will become famous soon enough
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 fun

- Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   April 22, 2008, 12:37
Default Alternately locate the file kn
  #9
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 698
Rep Power: 12
msrinath80 is on a distinguished road
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!
msrinath80 is offline   Reply With Quote

Old   April 22, 2008, 14:37
Default Hello Srinath, Thanks for y
  #10
Member
 
a a saha
Join Date: Mar 2009
Posts: 67
Rep Power: 8
asaha is on a distinguished road
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 is offline   Reply With Quote

Old   April 22, 2008, 14:51
Default Hello Niels, Thanks for you
  #11
Member
 
a a saha
Join Date: Mar 2009
Posts: 67
Rep Power: 8
asaha is on a distinguished road
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
asaha is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 23:26.