CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   ChannelOodles Want to prescribe mass flux instead of mean velocity (

cfdmarkus September 22, 2008 07:01

Hi Tammo, I am having exact
Hi Tammo,

I am having exactly the same problem with prescribing a mass flux instead of Ubar.

The mas flux through cyclic patches is obviously zero.

Have you found a way to compute the mass flux through your domain?


ngj September 22, 2008 11:25

Hi I have done something si

I have done something similar once upon a time. As you are having the flowDirection, I believe something like this would give you the flux:

scalar flux = sum(pos(flowDirection & mesh.boundary()[patchID].Sf()) * phi.boundaryField()[patchID])

where patchID is referring to the cyclic patch in question. As the face-normal is pointing in opposite directions on the two cyclic patches the inner product will yield opposite sign, thus the "pos" part of the entry filters all opposite phis out of the summation, and voila

Have fun,


cfdmarkus September 22, 2008 12:23

Brilliant, it does exactly wha
Brilliant, it does exactly what I need.

Thank you very much!

All times are GMT -4. The time now is 01:27.