|
[Sponsors] |
November 27, 2017, 09:17 |
How to get C_K_L
|
#1 |
New Member
Alain P. González
Join Date: Sep 2016
Posts: 3
Rep Power: 10 |
Hello everybody, I'm programming an UDF to calculate heat transfer coefficient but my UDF can't read thermal conductivity with C_K_L, what's wrong, please?
DEFINE_PROFILE(htc_1, thread, position) { face_t f; cell_t c; real lambda, rho, mu, cp; begin_f_loop(f, thread) { lambda = C_K_L(c,thread); rho = C_R(c,thread); mu = C_MU_L(c,thread); cp = C_CP(c,thread); x_vel = C_U(c, thread); F_PROFILE(f, thread, position) = 0.36 * lambda * (2 + pow(cp * mu / lambda,1 / 3) * x_vel) } end_f_loop(f, thread) } |
|
December 4, 2017, 08:10 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The problem: you are looping over faces ("begin_f_loop"), and then trying to access cells ("lambda = C_K_L(c,thread)").
Fluent does not know which cell you are talking about. You probably mean the neighboring cell: F_C0(f,t) So the code would be: Code:
lambda = C_K_L(F_C0(f,t),thread) |
|
December 4, 2017, 09:25 |
|
#3 |
New Member
Alain P. González
Join Date: Sep 2016
Posts: 3
Rep Power: 10 |
Oh, thanks pakk. I'll try it and then I tell you; I tried to do similar to the UDF User.
|
|
|
|