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

Wall distance macro not available any more. Any alternative?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2016, 16:44
Default Wall distance macro not available any more. Any alternative?
  #1
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17
alinik is on a distinguished road
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
alinik is offline   Reply With Quote

Old   March 12, 2017, 18:27
Default
  #2
Senior Member
 
ali
Join Date: Oct 2009
Posts: 318
Rep Power: 17
alinik is on a distinguished road
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;
}
alinik is offline   Reply With Quote

Old   March 13, 2017, 23:54
Default
  #3
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 65
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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.
LuckyTran 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
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


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