CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Calculating liquid volume in interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By clapointe
  • 1 Post By clapointe

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 22, 2020, 14:47
Default Calculating liquid volume in interFoam
  #1
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 8
joshmccraney is on a distinguished road
Hi FOAMers!

A tank partially filled with liquid has a hole at the bottom where liquid drains. In searching for how to do this, I found this thread. Specifically, post #13, which states to post this code

Code:
dimensionedScalar totalLiquidVolume = sum(mesh.V()*gamma);

Info << "Total Liquid Volume, Value: "
<< totalLiquidVolume.value() << ", Dimensions = " << totalLiquidVolume.dimensions() << endl;
into your main solver before

runTime.write();

and recompile your solver. The post also says to check it first on a single processor because you might need to change sum() with gSum().


Before I ask if this works, I don't know how to recompile my solver. Is it as simple as backing up a few folders to /applications and then executing ./Allwmake ?
joshmccraney is offline   Reply With Quote

 


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
How to use "translation" in solidBodyMotionFunction in OpenFOAM rupesh_w OpenFOAM Running, Solving & CFD 5 August 16, 2016 04:27
multiphase turbulance case floating error harsha_kulkarni OpenFOAM Running, Solving & CFD 3 February 18, 2016 05:06
How to calculate liquid volume as the interface moves for interFoam Solver asaha OpenFOAM Running, Solving & CFD 25 October 21, 2009 04:34
Calculating volume of Phase Pavan FLUENT 2 March 5, 2008 10:04
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


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