CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF previous time step parameters (http://www.cfd-online.com/Forums/fluent-udf/109788-udf-previous-time-step-parameters.html)

Johnyi November 26, 2012 19:53

UDF previous time step parameters
 
Hi,
Anyone CAN HELP ME TO SOLVE THE PROBLEM?
I am going to define a source to a cell zone. The source is a function of temperature of the previous time step. I wrote the UDF as follows:

include "udf.h"
DEFINE_SOURCE(heat_source,c,t,dS,eqn)
{
real x[ND_ND];
real source;
real tem1;
tem1=C_T_M1(c,t);
source=tem1/1000;
dS[eqn]=0.0;
return source;
}


and I successfully interpreted or complied it and loaded it and defined to the cell zone. however, when trying to run Fluent, It gave the information:
FLUENT received fatal signal (ACCESS_VIOLATION)

Can anybody tell me what's wrong?

Johnny

villager December 13, 2012 17:20

Maybe, you need look through "Cell Macros" section (Cell Variables in prev. versions) in UDF Manual.
"Important: Note that data from C_T_M1 is available only if user-defined scalars are defined. It can also be used with adaptive time stepping."
Define -> UDF scalars -> increase number...
Maybe these thoughts will help.


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