CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Please help (an UDF for regulating the mass flow rate) (https://www.cfd-online.com/Forums/fluent-udf/156303-please-help-udf-regulating-mass-flow-rate.html)

swidi July 7, 2015 09:13

Please help (an UDF for regulating the mass flow rate)
 
Hello friends I really need your help

I am trying to control the injection of the mass flow rate at a velocity inlet using a UDF. In fact I want to have the same mass flow rate at the inlet and at the outlet-pressour. So I need to put a condition at my velocity-inlet like if the two mass flow rates are not equal it has to stop injecting ( water ) until they ll be equal
I begun by this UDF, it only needs the regulation part

#include "udf.h"
DEFINE_EXECUTE_AT_END(measure_mass_flow)
{
Domain *d;
real flow=0.;
face_t f;
Thread *t;
t= Lookup_Thread(d, 12);
d = Get_Domain(1);

thread_loop_f(t,d)
{
begin_f_loop(f,t)
{
flow+=F_FLUX(f,t);
}
end_f_loop(f,t)
}
printf("MASS Flow Rate: %g\n",flow);
flow=0.;
}

sbaffini July 7, 2015 11:09

Why do you expect the mass flow rate at the pressure outlet to be different from the inlet one?

However, the task is more difficult than the way you approached it. Both inlet and outlet surfaces can be irregularly distributed among different processes in parallel. So you need to consider this beforehand.

Moreover, even in serial, you need the flow variable to be available outside the routine computing it (which, by the way, i would write as a DEFINE_ADJUST instead of EXECUTE_AT_END) and a DEFINE_PROFILE routine to use it.

asimavd July 30, 2015 12:32

HI,
My case is rectangular channel with 0.45 mm to 3.6 mm and length 260.6 mm.it is small part of counter flow heat exchanger, with just 12 channels with four rows of hot and cold fluid flow channels.
re no is 1202 and 911 for hot and cold fluid respectively. I know the pressure inlet and temperature inlet and mass flow.
can someone tell me the BC and whether I should go for compressible flow or incompressible flow.


All times are GMT -4. The time now is 15:09.