interFoam Average velocity of water only!

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 Sponsored Links

 LinkBack Thread Tools Display Modes
 September 5, 2011, 08:44 interFoam Average velocity of water only! #1 New Member   Diego Sanz Join Date: Aug 2011 Posts: 9 Rep Power: 7 Sponsored Links hi, im new with openfoam so sorry if my questions make little sense but i have been struglling with this problem for some days now. i am simulating the emptying of a water channel with interFoam and i would like to calculate de average water velocity of the on a cross-section of the channel. i have been looking at utilities like patchAverage or calcMassFlowDict. I have managed to use them, however since the water level is sinking i have to redefine my patches for every timestep i wan to calculate.... is there any way you know to calculate only the water velocity mean of a patch with water and air? the other thing i thought is calculating the mass flow of water and air, since there is not much air in the channel, it coulod work... any sugestion on how to deal with the different densities? (calcMassFlow only works with one!) thankyou! you could really help me with this headache!
 Sponsored Links

September 5, 2011, 11:15
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,005
Rep Power: 43
Quote:
 Originally Posted by dsanza hi, im new with openfoam so sorry if my questions make little sense but i have been struglling with this problem for some days now. i am simulating the emptying of a water channel with interFoam and i would like to calculate de average water velocity of the on a cross-section of the channel. i have been looking at utilities like patchAverage or calcMassFlowDict. I have managed to use them, however since the water level is sinking i have to redefine my patches for every timestep i wan to calculate.... is there any way you know to calculate only the water velocity mean of a patch with water and air? the other thing i thought is calculating the mass flow of water and air, since there is not much air in the channel, it coulod work... any sugestion on how to deal with the different densities? (calcMassFlow only works with one!) thankyou! you could really help me with this headache!
One way to evaluate general expressions would be with swak4Foam (depending on what you want you can do it either in a functionObject or with funkyDoCalc).

In your case that would be something like (I'm doin this free-handed so maybe to get it to work you'll have to adapt it)

variables "threshold=0.5;waterArea=sum(alpha>threshold?mag(S f()):0);waterVelSum=sum(alpha>threshold?mag(U*Sf() ):0);";
expression "waterVelSum/(waterArea+1e-10)";

This makes some assumptions about the flow on that patch:
- "water" is everything with alpha bigger than 0.5
- the flow goes only in one direction (either all in or all out)

Addition of the small value helps to avoid division by zero should your outlet "run dry"

 September 6, 2011, 08:35 #3 New Member   Diego Sanz Join Date: Aug 2011 Posts: 9 Rep Power: 7 thank you very much! these swak tools help a lot!

 September 7, 2011, 10:00 #4 Senior Member   Kent Wardle Join Date: Mar 2009 Location: Illinois, USA Posts: 217 Rep Power: 14 Hi, Why not just multiply the velocity by the volume fraction (U*alpha1) and then take the average of that? That should give you what you want, no? -Kent

September 7, 2011, 10:16
#5
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,005
Rep Power: 43
Quote:
 Originally Posted by kwardle Hi, Why not just multiply the velocity by the volume fraction (U*alpha1) and then take the average of that? That should give you what you want, no? -Kent
That would give the "average" liquid velocity over the whole cross-section. As I understood him he wants the average liquid velocity in the part that is really water. Which is not the same.

 August 3, 2015, 12:44 Mass Flow of water only #6 Member   Rafael Marques Join Date: Mar 2014 Location: Almada/Mülheim a.d. Ruhr, Portugal/Germany Posts: 67 Rep Power: 5 Hi everbody I know that this thread are old, but i tried to obtain the overtopping for a wave breaker simulation i am using Interfoam with a wave generator (ihfoam and waves2foam) and i only want to get the mass flow of the water at a certain crossection of the domain but i am not able to do it. I red many posts an tried it to include in my controlldict (swak4foam expressions) but i get error messages. I am quite new at using openfoam and it is the first time i am trying to use swak4foam...so is there somebody to help me out? thanks alot guys! Rafa Marques

 Tags average, interfoam, mass flow, patchaverage

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Andrea_85 OpenFOAM 0 July 19, 2011 10:05 aam Fluent UDF and Scheme Programming 0 May 15, 2009 05:21 Kali Sanjay Phoenics 0 November 6, 2006 07:10 Muhammad Ishaq Main CFD Forum 0 August 21, 2006 05:59 Olfa Daboussi Phoenics 4 October 14, 2005 16:37

 Sponsored Links

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

 Contact Us - CFD Online - Top