CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF for pressure at outlet (http://www.cfd-online.com/Forums/fluent/79095-udf-pressure-outlet.html)

mireis August 12, 2010 06:19

UDF for pressure at outlet
 
I'm trying to create a UDF function for the pressure at the outlet. I know the mass flow rate and temperature at this point so theoretically my pressure is a function of the velocity at the outlet. Is it possible to implement a UDF function that calculates the pressure as a function of the velocity?

I have tried with this one but Fluent says there is a "parse error".

Code:


#include "udf.h"
 
#define MDOT_OUT 0.000005  /* desired mass flow rate at the outlet  kg/s */
#define S_OUT 0.00000003905707  /* outlet surface in the model where the mass flow rate is MDOT_OUT  m^2 */
#define R 63.32 /* universal constant for gases  J/kg/K */
#define T 300.13 /* temperature  K */
 
DEFINE_PROFILE(outlet_pressure, thread, nv)
{
Thread *t;
face_t f;
cell_t c;
real CTE;
real actual_velocity=C_U(c,t);
/* real pressure = C_P(c,t);
CTE=MDOT_OUT*R*T/S_OUT;
begin_f_loop (f,t)
{
F_PROFILE(f,thread,nv) = CTE/actual_velocity;
}
end_f_loop (f,t)
}



Any suggestions would be greatly appreaciated :)


All times are GMT -4. The time now is 13:16.