|
[Sponsors] |
September 5, 2011, 09:44 |
interFoam Average velocity of water only!
|
#1 |
New Member
Diego Sanz
Join Date: Aug 2011
Posts: 9
Rep Power: 15 |
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! |
|
September 5, 2011, 12:15 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
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, 09:35 |
|
#3 |
New Member
Diego Sanz
Join Date: Aug 2011
Posts: 9
Rep Power: 15 |
thank you very much! these swak tools help a lot!
|
|
September 7, 2011, 11:00 |
|
#4 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
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, 11:16 |
|
#5 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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, 13: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: 12 |
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 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
reconstructed velocity in InterFoam | Andrea_85 | OpenFOAM | 0 | July 19, 2011 11:05 |
Variable for AVERAGE VELOCITY, Pressure etc. in UDF? | aam | Fluent UDF and Scheme Programming | 0 | May 15, 2009 06: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 06:59 |
calculate average velocity whith Phoenics | Olfa Daboussi | Phoenics | 4 | October 14, 2005 17:37 |