CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   ChannelOodles Want to prescribe mass flux instead of mean velocity (http://www.cfd-online.com/Forums/openfoam-solving/58529-channeloodles-want-prescribe-mass-flux-instead-mean-velocity.html)

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?



Regards,
Markus

ngj September 22, 2008 11:25

Hi I have done something si
 
Hi

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 voilahttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Have fun,

Niels

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 06:43.