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/)
-   -   Help....varibbles are unset at somewhere in udf (https://www.cfd-online.com/Forums/fluent-udf/76375-help-varibbles-unset-somewhere-udf.html)

iman_1844 May 24, 2010 09:18

Help....varibbles are unset at somewhere in udf
 
#include "udf.h"

#define m 101

real X,Y;

.
.
.

static real timestep;

DEFINE_GRID_MOTION(canopy,domain,dt,time,dtime)
{
Thread *tf;
face_t f;
Node *V;

.
.
.

timestep = dtime ;


.
.
.


Message ("current time = %f, time step %f, dt %f\n", time, dtime, timestep); /* line:77 */


.
.
.


Message ("////time step = %i\n", timestep ); /* line:349 */

.
.
.


}


timestep is correct in first message but incorrect in second message.

first message:
current time = 0.000010, time step 0.000010, dt 0.000010

second message:
////time step = -2147483648

plz help...:confused::confused::eek:

dmoroian May 25, 2010 09:56

I would use instead of:
Code:

Message ("////time step = %i\n", timestep ); /* line:349 */
the following:
Code:

Message ("////time step = %f\n", timestep ); /* line:349 */

iman_1844 May 28, 2010 11:36

thx
 
Thanks friend!!!


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