I have some general questions about a UDF I have been using to define the heat transfer coefficient between air and the material which makes up my porous domain ("sand"). The flow is Darcy governed. The UDF is described below and my QUESTIONS are found beneath the UDF.
Somethings to note about my UDF:
d_p (particle diameter, meters) and Pr (Prandtl Number) are both explicitly defined.
In particular, Pr is a value from literature for which my Nusselt Number (Nu) expression is valid.
I also have used the UDF with a "calculated" Pr and simulation results did not seem to be noticeable different (at least from my assessment).
real dens, visc; /*Fluid*/
real cond, cp; /* Fluid*/
d_p = 0.0001875;
Pr = 0.72;
dens = C_R(c,t); /*Density of fluid*/
visc = C_MU_L(c,t); /*Viscosity fluid*/
cond = C_K_L(c,t); /*Conductivity fluid*/
cp = C_CP(c,t); /*Specific heat fluid*/
Re = (ND_MAG(C_U(c,t),C_V(c,t),C_W(c,t))*d_p*dens)/visc;
Nu = 0.001*(pow(Re,1.97)*pow(Pr,1./3.));
F_PROFILE(c,t,i) = (Nu*cond)/d_p;
1) I have read that DEFINE_PROFILE is used to create a custom boundary profile. Why then can it be used to define a heat transfer coefficient throughout the domain?
2) Why is it possible that F_PROFILE can be used while looping over cell values? I have also used C_PROFILE within this UDF in place of F_PROFILE with no significant difference in simulation results (to my knowledge).
3) Overall, are there any glaring improvements I can make to my UDF?
4) Finally, I have been wanting to implement some method to "tell me" if my UDF is outputting the correct values. I have thought of printing the heat transfer coefficient values to a .txt file. Any suggestions on the best way to check UDF outputs and debug?
Thanks in advance for any help that can be offered and please let me know if any further clarification is needed.