First see if you get the right values from C_WALL_DIST macro. If not, then it is rather simple to write your own udf that computes this distance using the BOUNDARY_FACE_GEOMETRY macro.
Dragos |
Thanks a lot.....
I tried the C_WALL_DIST.... the udf compiles but when initaliasing it shows error....... I will try with the Boundary_FACE_geometry..... where can i find an example on how to use that?? |
I wouldn't give up using C_WALL_DIST macro. What error do you get? Could you post your udf? There is an error in your previous posted code.
Try first your code changing the line: Code:
y=C_WALL_DIST(c,t); Code:
y=C_WALL_DIST(cell,thread); However, here is an untested example of how to compute it your self (should be valid for Gina, too): Code:
real wallDist(cell_t c, Thread *t) |
Hi Vivek,
can you find any solution for your udf? for me, I could not turn it to have good results :(:(:( |
there is someone who can help me?:(
I would like to know whether a UDF turbulent viscosity permits me to provide a turbulent viscosity profile where the turbulent visosity is a function of wall normal distance y. I know that, i must calculate the wall normal distance and define turbulent viscosity as a function of the distance. but how to do this?? I AM NEW IN UDF ALSO IN C PROGRAMATION..... please i need some help |
Hi Gina,
I think your approach should work if you are using a low Re turbulence model (meaning without wall functions). Did you check if the C_WALL_DIST gives you the right values? Dragos |
hi Dragos,
I use k-e model with enhanced wall treatment. my Reynolds number= 5400. Gina |
Do you have enough resolution near the wall? If you don't then enhanced wall treatment will apply a wall function and your back to what Krishna said before.
If the resolution is enough then what is the error you are complaining about? Have you checked the C_WALL_DISTANCE macro if it provides the right value? You can also attach a debugger to your udf and follow it step by step. There is an example on wiki describing how to do this (http://www.cfd-online.com/Wiki/Fluen..._udf_using_gdb). Dragos |
dear dragos,
yes i have enough resolution near the wall. no i have not checked the C_WALL_DISTANCE macro if it provides right value, how to do this? the objective of my udf is to improved the nu_t formula in the near wall region when y_plus<=20. can you send me your mail @ to explain better what i want to to thank you gina |
Quote:
If you have used a centroid macro or any other method, please share. I am struggling with this too. |
Quote:
|
Quote:
|
Quote:
I am using the following udf (modified as per my knowledge, from the basic udf for k-epsilon mixture model) But it does not seem to be taking the correct value of k, epsilon etc from the fluent: " #include "udf.h" DEFINE_TURBULENT_VISCOSITY(mu_t_ke_air,c,t) { real rho_g, KE_g, D_g, mu_t_g; rho_g = C_R(c, t); /* gas phase density */ KE_g = C_K(c, t); /* gas phase Kinetic energy */ D_g = C_D(c, t); /* gas phase epsilon */ mu_t_g= 0.09*rho_g*KE_g*KE_g/D_g; C_UDMI(c,t,2) = mu_t_g; // (Calculated above) return mu_t_g; } " |
All times are GMT -4. The time now is 20:06. |