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

Volume fraction for entire domain in interFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2012, 09:49
Default Volume fraction for entire domain in interFoam
  #1
New Member
 
James McNeill
Join Date: Feb 2012
Posts: 4
Rep Power: 14
jmcneill is on a distinguished road
All,
I'm trying to determine the total phase-1 volume fraction at each time step of a simulation to calculate the mass of phase-1 in the domain. I've tried a few methods with swak4foam and Paraview, but I'm not confident in the numbers I am seeing. I noticed that the value I want is written to the log file at each time step as "Phase-1 volume fraction =". Is there a simple way to write this value to a separate output file? Thanks in advance.
jmcneill is offline   Reply With Quote

Old   May 21, 2012, 10:32
Default
  #2
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
Hi

just type on a terminal if your log file is named "log":

Code:
cat log | grep Liquid | cut -d' ' -f6 > massLog
and you will get a file called massLog with the mass evolution.
Phicau is offline   Reply With Quote

Old   May 21, 2012, 11:20
Default
  #3
New Member
 
James McNeill
Join Date: Feb 2012
Posts: 4
Rep Power: 14
jmcneill is on a distinguished road
Grep is an interesting thought. Thanks for that. I haven't used grep before, but is there a way to write the time in addition to alpha1? I eventually want to be able to plot alpha1 vs time.
jmcneill is offline   Reply With Quote

Old   May 21, 2012, 11:26
Default
  #4
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
I think it would be fairly easy to write a python script to do that. Just take into account that you have several mass values each time.
Phicau is offline   Reply With Quote

Old   May 21, 2012, 18:59
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jmcneill View Post
Grep is an interesting thought. Thanks for that. I haven't used grep before, but is there a way to write the time in addition to alpha1? I eventually want to be able to plot alpha1 vs time.
Quote:
Originally Posted by Phicau View Post
I think it would be fairly easy to write a python script to do that. Just take into account that you have several mass values each time.
Extracting values from a log and plotting them can be easily (that's what I think) done with http://openfoamwiki.net/index.php/Co...omRegexp-files
gschaider is offline   Reply With Quote

Old   May 22, 2012, 03:10
Default
  #6
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Alternatively, you can use volumeIntegrate from the simpleFunctionObjects (see contribution by Bernhard Gschaider)
http://openfoamwiki.net/index.php/Co...unctionObjects

Advantage here is that you don't need an extra step if you put it in the controlDict.
Bernhard is offline   Reply With Quote

Reply

Tags
integrate, interfoam, postprocessing, vof modeling


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
volume fraction in mixture model and VOF???? multiphase-flow FLUENT 4 August 7, 2014 11:35
Mass fraction and volume fraction eric weddle CFX 0 September 26, 2011 06:02
Difference between Volume Fraction and Mass Fraction in CEL foo7 CFX 0 September 21, 2011 09:45
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 22:14
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16


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