CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

define_wall_functions density and dynamic viscosity

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 2, 2017, 09:16
Default define_wall_functions density and dynamic viscosity
  #1
New Member
 
Grecu Ionut Stelian
Join Date: Sep 2016
Posts: 14
Rep Power: 2
Ionut G is on a distinguished road
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!
Ionut G is offline   Reply With Quote

Old   March 2, 2017, 09:48
Default
  #2
Senior Member
 
Kevin
Join Date: Dec 2016
Posts: 137
Rep Power: 2
KevinZ09 is on a distinguished road
Yes, C_MU_L(c,t) is the dynamic viscosity macro.
KevinZ09 is offline   Reply With Quote

Old   March 2, 2017, 10:39
Default
  #3
New Member
 
Grecu Ionut Stelian
Join Date: Sep 2016
Posts: 14
Rep Power: 2
Ionut G is on a distinguished road
Hi Kevin, thank you very much!
Ionut G is offline   Reply With Quote

Old   March 15, 2017, 11:10
Default C_UDMI in define_wall_functions
  #4
New Member
 
Grecu Ionut Stelian
Join Date: Sep 2016
Posts: 14
Rep Power: 2
Ionut G is on a distinguished road
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.

Thanks in advance for help.
Attached Files
File Type: c standard_wf_LoW.c (1.9 KB, 3 views)
Ionut G is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
How to find density without having dynamic viscosity? ooo OpenFOAM Running, Solving & CFD 6 January 28, 2014 13:46
Dynamic Viscosity at transportproperties dictionary NickolasPl Main CFD Forum 0 June 2, 2011 14:06
User-defined turbulent viscosity - kinematic or dynamic? tstorm Main CFD Forum 4 January 29, 2010 12:08
User-defined turbulent viscosity - kinematic or dynamic? tstorm FLUENT 0 August 13, 2009 16:49


All times are GMT -4. The time now is 15:08.