|
[Sponsors] |
Wall distance macro not available any more. Any alternative? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 19, 2016, 16:44 |
Wall distance macro not available any more. Any alternative?
|
#1 |
Senior Member
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17 |
Hi all,
Apparently wall distance macro, C_WALL_DIST, is not available anymore and we cannot use it in a UDF. Is there any alternative to that? Thanks, Ali |
|
March 12, 2017, 18:27 |
|
#2 |
Senior Member
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17 |
It seems that it is available. It just has to be filled first.
I received a UDF from a friend indicating how to do that. I do not fully understand this code and how to use it. An help in understanding this would be greatly appreciated. #include "udf.h" #include "prox.h" static cxboolean wall_dist_set = FALSE; DEFINE_ON_DEMAND(set_wall_dist_udm0) { #if !RP_HOST Domain *domain; Thread *t; cell_t c; if (! wall_dist_set) { domain = Get_Domain(ROOT_DOMAIN_ID); Alloc_Storage_Vars(domain, SV_RTMP_0, SV_NULL); Calc_Cell_Wall_Distance_New(domain, SV_RTMP_0); thread_loop_c(t,domain) { begin_c_loop(c,t) { C_UDMI(c,t,0) = C_TMP0(c,t); } end_c_loop(c,t) } wall_dist_set = TRUE; } #endif /* !RP_HOST */ } DEFINE_ON_DEMAND(reset_udm0) { #if !RP_HOST Domain *domain; Thread *t; cell_t c; domain = Get_Domain(ROOT_DOMAIN_ID); thread_loop_c(t,domain) { begin_c_loop(c,t) { C_UDMI(c,t,0) = 0.0; } end_c_loop(c,t) } #endif /* !RP_HOST */ wall_dist_set = FALSE; } |
|
March 13, 2017, 23:54 |
|
#3 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 65 |
I remember this being a very old issue that came up several years ago and you should be able to search for several examples. I believe you run into a segmentation fault because the macro depends on specific variables being declared that Fluent does not allocate automatically. Thus, the fix is to force Fluent to calculate the wall distance on-demand using some form of user-defined memory.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 13:55 |
cell wall distance using C_WALL_DIST(c,t) or other udf | zhixin | Fluent UDF and Scheme Programming | 11 | April 18, 2016 10:17 |
Difficulty In Setting Boundary Conditions | Moinul Haque | CFX | 4 | November 25, 2014 17:30 |
Wall Distance in CFX | davidwilcox | CFX | 1 | September 22, 2014 21:01 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 17:11 |