CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Previous time macro in UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   March 4, 2008, 13:35
Default Previous time macro in UDF
Paolo Lampitella
Posts: n/a

i'm trying to write an UDF to initialize the field and i'm trying to also assigning the field at time level n-1, that is t = -dt.

The UDF is correctly compiled but, when i try to initialize i get the well known FATAL ERROR (ACCESS VIOLATION).

This is the file:



cell_t c;

Thread *t;

real x[ND_ND];






C_U(c,t) = -cos(x[0])*sin(x[1]);

C_V(c,t) = cos(x[1])*sin(x[0]);

C_P(c,t) = -0.25*(cos(2.0*x[0])+cos(2.0*x[1]));

C_U_M1(c,t) = -cos(x[0])*sin(x[1])*exp(2.0*(CURRENT_TIMESTEP));

C_V_M1(c,t) = cos(x[1])*sin(x[0])*exp(2.0*(CURRENT_TIMESTEP));

C_P_M1(c,t) = -0.25*(cos(2.0*x[0])+cos(2.0*x[1]))*exp(4.0*(CURRENT_TIMESTEP));





It correctly works without assigning the M1 variables; does this mean that i just can't assign them when initializing or what?

  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 30 September 19, 2017 12:38
reading "global" variables in a UDF macro? bawfuls Fluent UDF and Scheme Programming 1 July 1, 2010 21:22
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35
Computational time sunnysun OpenFOAM Running, Solving & CFD 5 March 16, 2009 04:32
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 11:55

All times are GMT -4. The time now is 23:35.