CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF (https://www.cfd-online.com/Forums/fluent/31833-udf.html)

wang July 15, 2003 21:42

UDF
 
Hello all:

I use the UDF try to get the previous time step temperatur by C_T_M1(c,t) for unsteady flow simulation. But it cann't run normally. If i change the C_T_M1(c,t) to C_U_M1(c,t), there are no any problem. Clould anyone tell me hot to get the previous time Temperature? The bellow is the udf code:

#include "udf.h" #define CON 0.5 #define SL 1.0

DEFINE_SOURCE(cell_source,c, t, dS, eqn) { float source; float temp; float t1; float t0; float dt; float density; float curr_ts;

curr_ts = RP_Get_Real("flow-time"); dt=RP_Get_Real("physical-time-step");

if (curr_ts>0.1) { t0=C_T(c,t); t1=C_T_M1(c,t); density=C_R(c,t); printf("%15.7f%15.7f%15.7f\n",t1,t0,dt); source = -CON*SL*density*t1/dt; dS[eqn] = -CON*SL*density; }

return source; }



All times are GMT -4. The time now is 04:12.