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! |
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" |
thank you very much! these swak tools help a lot!
|
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 |
Quote:
|
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. |