CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Previous time macro in UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2008, 12:35
Default Previous time macro in UDF
  #1
Paolo Lampitella
Guest
 
Posts: n/a
Hello,

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:

DEFINE_INIT(init_func,d)

{

cell_t c;

Thread *t;

real x[ND_ND];

thread_loop_c(t,d)

{

begin_c_loop_all(c,t)

{

C_CENTROID(x,c,t);

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));

}

end_c_loop_all(c,t)

}

}

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

Thanks
  Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 06:55
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 03:32
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 10:55


All times are GMT -4. The time now is 05:06.