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

Same value for C_U and C_U_M1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 20, 2012, 02:59
Default Same value for C_U and C_U_M1
  #1
New Member
 
Join Date: Mar 2010
Posts: 25
Rep Power: 16
Dorit is on a distinguished road
Hi everyone,

I'm trying to calculate the acceleration of air during an unsteady simulation. To do so I'm using C_U and C_U_M1 to access the x velocity at the current and previous time step and then store it in a UDM. My problem is just that C_U and C_U_M1 always return the same value within a cell at any given iteration.

Below is my UDF. I used a DEFINE_CG_MOTION macro as I'll later also have to change the rotational speed of one of my volumes, but that is not an issue.
Does anyone have an idea where I've gone wrong or that I should change?

DEFINE_CG_MOTION(start_up, pointer, velocity, omega, time,dt)
{
cell c;
Domain *d = Get_Domain(1);
Thread *t = Lookup_Thread(d,10); /* 10 is the volume ID for the block that I'm interested in*/
Thread *ct = THREAD_T0(t);
thread_loop_c(ct,d)
{
begin_c_loop(c,ct)
{
C_UDMI(c,ct,0) =C_U(c,ct);
Message0 (“current time step %f , last time step %f \n”, C_U(c,ct), C_U_M1(c,ct));
}
end_c_loop(c,ct)
}
}

I also tried defining my thread using these below 2 methods, but the problem is the same.
Thread *ct = DT_THREAD((Dynamic_Thread *)pointer);
Thread *ct = DT_THREAD(pointer);

Thanks for any thoughts,
Dorit
Dorit is offline   Reply With Quote

Old   March 9, 2013, 16:06
Default
  #2
New Member
 
Nasser
Join Date: Dec 2012
Posts: 21
Rep Power: 14
nasser is on a distinguished road
hi
I think you have to use define_adjust for calculating your UDF in every iteration. read udf manual.
nasser is offline   Reply With Quote

Reply

Tags
acceleration, c_u, c_u_m1, transient, udf


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



All times are GMT -4. The time now is 16:43.