# define_wall_functions density and dynamic viscosity

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

 March 2, 2017, 09:16 define_wall_functions density and dynamic viscosity #1 New Member   Grecu Ionut Stelian Join Date: Sep 2016 Posts: 15 Rep Power: 2 Sponsored Links 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, 09:48 #2 Senior Member   Kevin Join Date: Dec 2016 Posts: 138 Rep Power: 2 Yes, C_MU_L(c,t) is the dynamic viscosity macro.

 March 2, 2017, 10:39 #3 New Member   Grecu Ionut Stelian Join Date: Sep 2016 Posts: 15 Rep Power: 2 Hi Kevin, thank you very much!

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

Grecu Ionut Stelian
Join Date: Sep 2016
Posts: 15
Rep Power: 2
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, 6 views)

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post faizan_habib7 CFX 4 February 1, 2016 18:00 ooo OpenFOAM Running, Solving & CFD 6 January 28, 2014 13:46 NickolasPl Main CFD Forum 0 June 2, 2011 14:06 tstorm Main CFD Forum 4 January 29, 2010 12:08 tstorm FLUENT 0 August 13, 2009 16:49