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

interFoam Average velocity of water only!

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 5, 2011, 08:44
Default interFoam Average velocity of water only!
  #1
New Member
 
Diego Sanz
Join Date: Aug 2011
Posts: 9
Rep Power: 6
dsanza is on a distinguished road
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!
dsanza is offline   Reply With Quote

Old   September 5, 2011, 11:15
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by dsanza View Post
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"
gschaider is offline   Reply With Quote

Old   September 6, 2011, 08:35
Default
  #3
New Member
 
Diego Sanz
Join Date: Aug 2011
Posts: 9
Rep Power: 6
dsanza is on a distinguished road
thank you very much! these swak tools help a lot!
dsanza is offline   Reply With Quote

Old   September 7, 2011, 10:00
Default
  #4
Senior Member
 
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 201
Rep Power: 11
kwardle is on a distinguished road
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
kwardle is offline   Reply With Quote

Old   September 7, 2011, 10:16
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by kwardle View Post
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.
gschaider is offline   Reply With Quote

Old   August 3, 2015, 12:44
Default Mass Flow of water only
  #6
Member
 
Rafael Marques
Join Date: Mar 2014
Location: Almada/Mülheim a.d. Ruhr, Portugal/Germany
Posts: 63
Rep Power: 3
rafa13 is on a distinguished road
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
rafa13 is offline   Reply With Quote

Reply

Tags
average, interfoam, mass flow, patchaverage

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
reconstructed velocity in InterFoam Andrea_85 OpenFOAM 0 July 19, 2011 10:05
Variable for AVERAGE VELOCITY, Pressure etc. in UDF? aam Fluent UDF and Scheme Programming 0 May 15, 2009 05:21
Velocity in Porous medium : HELP! HELP! HELP! Kali Sanjay Phoenics 0 November 6, 2006 07:10
average velocity? matlab>pdetool Muhammad Ishaq Main CFD Forum 0 August 21, 2006 05:59
calculate average velocity whith Phoenics Olfa Daboussi Phoenics 4 October 14, 2005 16:37


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