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

C_UDMI & C_UDSI problem.

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 10, 2009, 12:28
Default C_UDMI & C_UDSI problem.
  #1
New Member
 
Join Date: Jun 2009
Posts: 11
Rep Power: 9
dfytanid is on a distinguished road
I want to run a DEFINE_ON_DEMAND udf in order to save the UDS at the wall in a UDM.
Actualy, I dont have any problem if i save the whole UDS result but i am not able to do it too.

I used the following code:


DEFINE_ON_DEMAND(wall_UDS_value)
{
Domain *d;
face_t f;
cell_t c, c0;
Thread *t,*t0, *c_thread;
int Zone_ID=3; /* Zone ID of the wall on which UDS to be calculated */
/* It can be obtained from the boundary condition panel.*/
d=Get_Domain(1);

/* Initialize the UDM value to zero in complete domain */
thread_loop_c(c_thread,d)
{
begin_c_loop(c, c_thread)
{
C_UDMI(c,c_thread,0)= 0;
}
end_c_loop(c, c_thread)
}

t=Lookup_Thread(d,Zone_ID);
begin_c_loop (c,t)
{
c0 = F_C0(f,t);
t0 = THREAD_T0(t);
C_UDMI(c0,t0,0) = C_UDSI(c,t,0);

}
end_c_loop (c,t)
}


Can anyone help me. What i did wrong?

Thank you for your answer.

Dim
dfytanid is online now   Reply With Quote

Old   September 11, 2009, 04:01
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 9
coglione is on a distinguished road
hello dimitrios,

to access the values on a wall, which is, from the geometrical point of view a 2-d plane and in the context of fluent a "face", you need to loop over faces and not cells.
Thus, use something like begin_f_loop and F_UDMI and you wil get what you want.

cheers
coglione is offline   Reply With Quote

Old   September 11, 2009, 19:44
Exclamation
  #3
New Member
 
Join Date: Jun 2009
Posts: 11
Rep Power: 9
dfytanid is on a distinguished road
Hello Max,
Firstly, thank you very much for your quick reply and help.
I tried what you said but I had some problems. When i used the following code the result is an "ACCESS_VIOLATION".

Could you tell me please if you know something more about that?

DEFINE_ON_DEMAND(wall_UDS_value)
{
Domain *d;
face_t f;
cell_t c;
Thread *t,*t0, *f_thread;
int Zone_ID=3; /* Zone ID of the wall on which UDS to be calculated */
/* It can be obtained from the boundary condition panel.*/
d=Get_Domain(1);
/* Initialize the UDM value to zero in complete domain */
thread_loop_f (f_thread,d)
{
begin_f_loop(f, f_thread)
{
F_UDMI(f,f_thread,0)=0;
}
end_f_loop(f,f_thread)
}

t=Lookup_Thread(d,Zone_ID);
begin_f_loop (f,t)
{
t0 = THREAD_T0(t);
F_UDMI(f,t0,0) = F_UDSI(f,t,0);
}
end_f_loop (f,t)
}

Thank you for your answer.

Dim

dfytanid is online now   Reply With Quote

Old   September 13, 2009, 04:26
Default
  #4
Member
 
Ivan
Join Date: May 2009
Posts: 85
Rep Power: 9
ivanbuz is on a distinguished road
if I may throw in my 2 cents. first, f is from thread t, I am NOT sure if you can use it in F_UDMI(f,t0,0). correct me if I am wrong. second, F UDMI is available for wall and
flow boundary faces only and t0 may NOT be either of those.
ivanbuz is offline   Reply With Quote

Old   September 13, 2009, 05:11
Red face
  #5
New Member
 
Join Date: Jun 2009
Posts: 11
Rep Power: 9
dfytanid is on a distinguished road
Hello Ivan,
Thank you very much for your reply.
You are right! Sorry I posted by mistake the wrong udf.

actually i used the following udf with the same "ACCESS_VIOLATION".

DEFINE_ON_DEMAND(wall_UDS_value)
{
Domain *d;
face_t f;
cell_t c;
Thread *t, *f_thread;
int Zone_ID=3; /* Zone ID of the wall on which UDS to be calculated */
/* It can be obtained from the boundary condition panel.*/
d=Get_Domain(1);
/* Initialize the UDM value to zero in complete domain */
thread_loop_f (f_thread,d)
{
begin_f_loop(f, f_thread)
{
F_UDMI(f,f_thread,0)=0;
}
end_f_loop(f,f_thread)
}
t=Lookup_Thread(d,Zone_ID);
begin_f_loop (f,t)
{
F_UDMI(f,t,0) = F_UDSI(f,t,0);
}
end_f_loop (f,t)
}

Any ideas?

Thank you for your answers.
Dim
dfytanid is online now   Reply With Quote

Reply

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
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Incoherent problem table in hollow-fiber spinning Gianni FLUENT 0 April 5, 2008 10:33
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
convergence problem Trushar Phoenics 5 August 27, 2002 23:40


All times are GMT -4. The time now is 18:12.