CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   interFoam Average velocity of water only! (https://www.cfd-online.com/Forums/openfoam-post-processing/92180-interfoam-average-velocity-water-only.html)

dsanza September 5, 2011 08:44

interFoam Average velocity of water only!
 
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!

gschaider September 5, 2011 11:15

Quote:

Originally Posted by dsanza (Post 322935)
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"

dsanza September 6, 2011 08:35

thank you very much! these swak tools help a lot!

kwardle September 7, 2011 10:00

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

gschaider September 7, 2011 10:16

Quote:

Originally Posted by kwardle (Post 323291)
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.

rafa13 August 3, 2015 12:44

Mass Flow of water only
 
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


All times are GMT -4. The time now is 20:48.