CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

Integrate mass of phase?

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

LinkBack Thread Tools Display Modes
Old   August 11, 2016, 07:20
Default Integrate mass of phase?
New Member
Simo Sepponen
Join Date: Jun 2016
Posts: 8
Rep Power: 2
sepponen is on a distinguished road

I would like to calculate the mass of a phase as function of time using twoPhaseEulerFoam. Could this be done without modifying the solver, maybe with a function object? Is there a function object which integrates a variable over the domain?

Thank you for your attention,
sepponen is offline   Reply With Quote

Old   August 12, 2016, 05:56
Senior Member
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 358
Rep Power: 14
tomf is on a distinguished road
Send a message via MSN to tomf Send a message via Skype™ to tomf

If the density of the phase is constant you can follow the volume fraction of the phase that you are interested in in the log of the solver. If you want to plot it you can use some bash to extract the values from the log. I typically use something like this:

grep fra twoPhaseEulerFoam.log | awk '{print $5}' > volumeFraction
The grep command gives you something like this for every occurrence of "fra":
alpha.particles volume fraction = 0.0005668175397  Min(alpha.particles) = 0  Max(alpha.particles) = 0.05349701286
The awk command gives the 5th column, which is the overal volume fraction of the particles phase. You can than plot the file volumeFraction.

awk also allows multiplication to have the entire mass using:

awk '{print rho*$5*domainvolume}'
where rho is your density and domainvolume is the entire volume of the domain.

If your density is not constant you maybe can use the volRegion functionObject to obtain a weighted volume average or a volume integral.

Use the following to find some more information:
find $FOAM_SRC -iname *volRegion*
tomf is offline   Reply With Quote


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Divergence after change in mass flow rate in two phase flow meetsunilkale FLUENT 1 March 25, 2013 04:03
Discrete Phase & Mass Flow Rate MagnusZeus FLUENT 0 December 2, 2011 18:57
How to calculate mass flow of the discrete phase in Euler-lagrange model juliom CFX 0 November 8, 2011 20:50
Multiphase Multicomponent mass transfer -Initial condition pannsave CFX 10 February 9, 2011 02:12
liquid phase reactions and mass transfer Swarup FLUENT 0 January 17, 2005 01:47

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