# define_wall_functions density and dynamic viscosity

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

 March 2, 2017, 08:16 define_wall_functions density and dynamic viscosity #1 New Member   G Ionut Join Date: Sep 2016 Posts: 29 Rep Power: 9 Hi all, I want to extract the dynamic viscosity for each cell in an udf DEFINE_WALL_FUNCTIONS. Is C_MU_L(c,t) the dynamic viscosity? If not, how can I extract it from fluent? Here is the code I use: #include "udf.h" #include "mem.h" #define CMU 0.09 #define KARMAN 0.4187 #define E 9.793 #define MU 1.1e-3 DEFINE_WALL_FUNCTIONS(std_wf, f, t, c0, t0, wf_ret, yPlus, Emod) { real k, dist, y_plus; real wf_value; begin_c_loop(c0, t0) { rho = C_R(c0,t0); mu = C_MU_L(c0,t0); k = C_K(c0,t0); dist = (yPlus*MU)/(DENSITY*pow(CMU,0.25)*pow(k,0.5)); y_plus = (DENSITY*pow(CMU,(1./4.))*pow(k,(1./2.))*dist)/MU; } end_c_loop(c0, t0) switch (wf_ret) { case UPLUS_LAM: wf_value = y_plus; break; case UPLUS_TRB: wf_value = log(E*y_plus)/KARMAN; break; case DUPLUS_LAM: wf_value = 1.0; break; case DUPLUS_TRB: wf_value = 1./(KARMAN*y_plus); break; case D2UPLUS_TRB: wf_value = -1./(KARMAN*y_plus*y_plus); break; default: printf("Wall function return value unavailable\n"); } return wf_value; } Any help will be appreciated, thank you!

 March 2, 2017, 08:48 #2 Senior Member   Kevin Join Date: Dec 2016 Posts: 138 Rep Power: 9 Yes, C_MU_L(c,t) is the dynamic viscosity macro.

 March 2, 2017, 09:39 #3 New Member   G Ionut Join Date: Sep 2016 Posts: 29 Rep Power: 9 Hi Kevin, thank you very much!

March 15, 2017, 10:10
C_UDMI in define_wall_functions
#4
New Member

G Ionut
Join Date: Sep 2016
Posts: 29
Rep Power: 9
Hi,

I want to write in a variable the distance from the wall to the first cell using C_UDMI but i receive the following error:

iter continuity x-velocity y-velocity z-velocity k epsilon time/iter

===============================================

Node 0: Process 88256: Received signal SIGSEGV.

===============================================
===============================================

Node 1: Process 87820: Received signal SIGSEGV.

===============================================

===============================================

Node 2: Process 88216: Received signal SIGSEGV.

===============================================

===============================================

Node 3: Process 88212: Received signal SIGSEGV.

===============================================

===============================================

Node 4: Process 88284: Received signal SIGSEGV.

===============================================

===============================================

Node 5: Process 88236: Received signal SIGSEGV.

===============================================

===============================================

Node 6: Process 87872: Received signal SIGSEGV.

===============================================

===============================================

Node 7: Process 87804: Received signal SIGSEGV.

===============================================

===============================================

Node 8: Process 88268: Received signal SIGSEGV.

===============================================

===============================================

Node 9: Process 87880: Received signal SIGSEGV.

===============================================

===============================================

Node 10: Process 88280: Received signal SIGSEGV.

===============================================

===============================================

Node 11: Process 87812: Received signal SIGSEGV.

===============================================

===============================================

Node 12: Process 88248: Received signal SIGSEGV.

===============================================

===============================================

Node 13: Process 88264: Received signal SIGSEGV.

===============================================

===============================================

Node 14: Process 88004: Received signal SIGSEGV.

===============================================

===============================================
Node 15: Process 86712: Received signal SIGSEGV.

===============================================
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.

What I did wrong?
In the Number of User-Defined Memory Locations, I set 1.
The code is compiled using MS Visual Studio, I do not get errors when I compile the code.
I attached the C code.

Attached Files
 standard_wf_LoW.c (1.9 KB, 16 views)