Volume fraction for entire domain in interFoam
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. |
Hi
just type on a terminal if your log file is named "log": Code:
cat log | grep Liquid | cut -d' ' -f6 > massLog |
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.
|
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.
|
Quote:
Quote:
|
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. |
All times are GMT -4. The time now is 17:32. |