CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Pressure Initial Conditions (http://www.cfd-online.com/Forums/fluent/97828-pressure-initial-conditions.html)

 OscarD February 26, 2012 17:04

Pressure Initial Conditions

Hi,
I've been trying to set initial values of pressure and temperature in a simple 2d-axisymmetric geometry that generates an enclosed volume, with no inlet/outlet for fluid, steady state.
I got the initialization of all the cells' temperature as I wanted by using DEFINE_INIT (coaxial values of same value :D), but when it comes to pressure, it starts ok beside the axis, but when it continues radially, the value drops to almost -Pmax!! :mad:
Am I forgetting to set something within the UDF or in the FLUENT case?

Thanks in advance for any help related!!!

PS. The 'complex' code I'm using (just omitted the definition and value of the pX and tY constants)

************************************************** ********
#include "udf.h"

DEFINE_INIT(init_temp_press,d)
{

cell_t c;
real xc[ND_ND]
{

begin_c_loop_all(c,t)
{
C_CENTROID(xc,c,t);
if(xc[1] < 4.7e-4)
C_T(c,t) = t1*pow(xc[1],9.) + t2*pow(xc[1],8.) + t3*pow(xc[1],7.) + t4*pow(xc[1],6.) + t5*pow(xc[1],5.) + t6*pow(xc[1],4.) + t7*pow(xc[1],3.) + t8*pow(xc[1],2.) + t9*xc[1] + t10;
else
C_T(c,t) = 293;

if(xc[1] < 4e-4)
C_P(c,t) = p1*pow(xc[1],8.) + p2*pow(xc[1],7.) + p3*pow(xc[1],6.) + p4*pow(xc[1],5.) + p5*pow(xc[1],4.) + p6*pow(xc[1],3.) + p7*pow(xc[1],2.) + p8*xc[1] + p9;
else
C_P(c,t) = 6800;

end_c_loop_all(c,t)
}
}
}

************************************************** ******

 qing123 June 4, 2013 02:37