TAGGED: damping, fluid-flow, turbulence, wall-treatment
-
-
August 20, 2020 at 8:42 am
newbie123
SubscriberI need to obtain wall distance and I try C_Wall_Distance(c,t) but it appears to be removed. I have been looking around but I can't find a solution.nIf wall distance value is not provided, it the y+ value provided? Likewise, what about the wall-based Reynolds number Re_y and is it provided or not?n -
August 20, 2020 at 8:50 am
DrAmine
Ansys EmployeePlease refer to the Customization Documentation which contains all documented and hence supported macros. I still see C_WALL_DIST somewhere in my internal notes. n -
August 21, 2020 at 11:46 am
newbie123
SubscriberHi I can't find the command from the manual. I try using it but the solver crash when I initialize it. It shows 99999:mpt_accept error ...nnI am using Fluent 2020 R1n -
August 21, 2020 at 12:30 pm
DrAmine
Ansys EmployeeThen probably bad access. It is not in the documentation and so is not supported. The usage might be deprecated. I see they are some other hidden function but I cannot share on this open platformn -
August 21, 2020 at 1:28 pm
newbie123
SubscriberIs there other way at which I can obtain the wall distance value? n -
August 21, 2020 at 3:09 pm
Rob
Forum ModeratorHave a look for the macro c_wall_dist on Google, you'd be surprised how quickly you find the replacement. n -
August 22, 2020 at 9:33 am
newbie123
SubscriberI have been searching around but most of the search revolves around how to use C_Wall_dist which doesn't work in this case. So far I found a code but I am unsure how to use it.nhttps://www.cfd-online.com/Forums/fluent-udf/63211-calculate-distance-wall-neighbourig-cell-centroid.htmlnbegin_c_loop (c,t)n{nc_face_loop(c,t,n)n{ntf = C_FACE_THREAD(c,t,n);nif(THREAD_TYPE(tf) == THREAD_F_WALL)n{nf = C_FACE(c,t,n);nF_CENTROID(x,f,t);nwf = x[1]; /* for 2D */nC_CENTROID(cell,c,t);nnc = cell[1];ndist = FABS(wf-nc);n}n}n}nend_c_loop (c,t)nnMy issue is I don't know where to place it. I need the wall distance value for my eddy viscosity and I don't think I can't place the above into my EVM udf as it contains a loop which will lag my solver. How do I place the above code such that it only activates during the initialization step and that the calculated wall distance value can be used in later calculations subsequently?n -
August 23, 2020 at 8:46 am
newbie123
SubscriberCan you please tell me the highly accessible replacement you mention? I have been testing codes but none of them seem to workn -
August 24, 2020 at 6:57 am
DrAmine
Ansys EmployeePlease provide a university mail address so that I can share the new sets with you.n -
March 30, 2023 at 6:36 pm
Lukas Kramer
Subscriberhey im a student from dresden and currently working on something receiving the same problem with c_wall_dist giving the error. could you share the outcome with me too please? 2 years later i still didnt find a documentation for it while browsing the web or looking in the costumization manual. c_wall_dist is still used there. i just find Boundary_face_geometry but its not what i need.
kind regards
lukas
Â
-
March 31, 2023 at 8:39 am
DrAmine
Ansys EmployeeThe customization manual has an example where C_WALL_DIST is used.
-
March 31, 2023 at 9:01 pm
Lukas Kramer
Subscriberyeah. thats what i wrote. but its in an example and not documented as a function on how to use it. how i use it and i assume many people i read on forums do it produces sigsev node errors. its only used as argument in the geko and user_trans_alg_reg_cor functions in the manual. but its not clear how it writes the data to the function or how you could extract the data from c_wall_dist and save it for example in a udm for further use.
do you have an idea on that topic?
i also found this online, but it somehow flushes the UDM after one read out somehow. dont get it fully yet but it utilizes a function which is also supposed to be used in C_wall_dist (calc_cell_wall_distance_new). does it have something to do with pseudo local time steps?
code:
DEFINE_ON_DEMAND(calcDistance)
{
#if !RP_HOSTÂ Â Domain *d=Get_Domain(1);
  Thread *ct;
  cell_t c;  if (! wall_dist_set)
  {
    Alloc_Storage_Vars(d, SV_RTMP_0, SV_NULL);
    Calc_Cell_Wall_Distance_New(d, SV_RTMP_0);
    Â
    thread_loop_c(ct,d)
    {
      begin_c_loop(c,ct)
      {
        C_ABSTAND(c,ct) = C_TMP0(c,ct);
      }
      end_c_loop(c,ct)
    }    wall_dist_set = TRUE;
  }
  Â
#endif
}DEFINE_ON_DEMAND(distanceReset)
{
#if !RP_HOSTÂ Â Domain *d=Get_Domain(1);
  Thread *ct;
  cell_t c;
  Â
  thread_loop_c(ct,d)
  {
    begin_c_loop(c,ct)
    {
      C_DISTANCE(c,ct) = 0.0;
    }
    end_c_loop(c,ct)
  }#endif
  wall_dist_set = FALSE;
}Â
-
-
April 3, 2023 at 8:52 am
DrAmine
Ansys EmployeeWhich are the arguments of the C_WALL_DIST which you do not understand? It does require Cell Index and Cell Thread. The macro does work for me.
Yes there are some other macros / ways to access the wall distance which are not documented. One of these function is what you have found online. I remember I/ we wrote similar thing some years ago and posted on the Ansys Customer Portal. That has nothing to do with pseudo-time stepping.
-
April 3, 2023 at 9:28 am
Lukas Kramer
SubscriberHey thank you for your answer.
Im using Ansys 2022 and when i use C_WALL_DIST with the correct arguments for Cell Index and Cell Thread it gives me sigsev errors for each node and crashes the program. I want to do a simple calculation where i loop over the cells in the thread and multiply something with C_WALL_DIST. For this i tried to put C_WALL_DIST in the calculation itself and also another approach where i tried to save C_WALL_DIST in an extra UDM first. Both approaches gave me the sigsev errors. Might there be any Problem with the datatype, which C_WALL_DIST gives to the calculation or UDM?
I remember looking in Forums and some people had this problem with the sigsev errors too with no resolve. Thats why I tried to use the other method provided above.
-
April 3, 2023 at 9:31 am
Lukas Kramer
SubscriberNote: the sigsev errors only occured when placing C_WALL_DIST into the calculation or trying to save it via UDM. The code works perfectly with any constant Wall distance value in the calculation. Also its just a simple rectangle 2D geometry with walls on 2 opposing sites, an inlet-velocity and an outflow.
-
April 3, 2023 at 9:34 am
DrAmine
Ansys EmployeeHi Lukas, I am using 23R1 and I am using the macro to access the wall distance and storing that in a cell memory. The procedure is working as it should. If it is not working for you and another apporach is doing the job: That is good too!
-
- The topic ‘How to obtain wall distance value for udf?’ is closed to new replies.
-
6660
-
1906
-
1469
-
1313
-
1022
© 2026 Copyright ANSYS, Inc. All rights reserved.