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

problem with Define_on_demand

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2009, 08:44
Default problem with Define_on_demand
  #1
Member
 
R. Roy
Join Date: Mar 2009
Location: India
Posts: 52
Rep Power: 17
rr123 is on a distinguished road
dear all,

this is my code:

#include"udf.h"
#include"dpm.h"
#include"surf.h"
int num_injection = 4;


DEFINE_ON_DEMAND(initalize_udmis)
{
Domain *d=Get_Domain(1);
Thread *tc;
cell_t c;
int injno = 0;

/* Init UDM */
if(injno < num_injection)
{
thread_loop_c(tc,d){
begin_c_loop(c,tc)
{
C_UDMI(c,tc,injno)=0;
}
end_c_loop(c,tc)
}
injno++;
}
}

when i use this code for initializing the User defined memories (i already put the UDM limit to 10); i get segmentation violation.

why is this so ?
can you help me to avoid this problem.

sincerely.
rr123 is offline   Reply With Quote

Old   April 16, 2009, 05:35
Default
  #2
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
Hi,

unfortunately I can not help you with your problem, but I'm experiencing exactly the same problem. I'm using DEFINE_ON_DEMAND and the UDM brings up a segmentation violation. I'm using FLUENT under Linux AMD 64, what are you using?

regards
O.D.Y. is offline   Reply With Quote

Old   April 16, 2009, 05:48
Default
  #3
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
Hi again,

I found the solution in this thread: http://www.cfd-online.com/Forums/flu...violation.html

I don't know why it works this way, but it works.... So You have to display the UDM in the contours before executing the UDF!

cheers
O.D.Y. is offline   Reply With Quote

Old   April 16, 2009, 07:58
Default
  #4
Member
 
R. Roy
Join Date: Mar 2009
Location: India
Posts: 52
Rep Power: 17
rr123 is on a distinguished road
dear sir,

thank you for this very important message and for letting me know the work-around.

sincerely.
rr123 is offline   Reply With Quote

Old   April 17, 2009, 08:03
Default
  #5
Member
 
R. Roy
Join Date: Mar 2009
Location: India
Posts: 52
Rep Power: 17
rr123 is on a distinguished road
i still have problems with the UDF.
the initialization works.
however, the simulation crashes with:
Error: > (greater-than): invalid argument [2]: wrong type [not a number]
Error Object: nan

the UDF is related to the discrete model.
can anyone give some clue what is wrong ?

best wishes.
rr123 is offline   Reply With Quote

Old   May 1, 2009, 14:10
Default
  #6
Member
 
O.D.Y.'s Avatar
 
Join Date: Mar 2009
Posts: 49
Rep Power: 17
O.D.Y. is on a distinguished road
Hi there, I have the same problem now.... same error, did you find any solution?

cheers
O.D.Y. is offline   Reply With Quote

Old   May 1, 2009, 15:36
Default
  #7
Member
 
R. Roy
Join Date: Mar 2009
Location: India
Posts: 52
Rep Power: 17
rr123 is on a distinguished road
dear sir,

i had since then modfied the code.
the nan however when something in denominator goes 0 or you have a negative exponent.
if you look into those areas, may be it can solve your problem.
i will look of i can help you with this any further if you can paste the code snippet.

good luck.
rr123 is offline   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
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
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 10:46.