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

 October 29, 2009, 13:17 #21 Senior Member     Dragos Join Date: Mar 2009 Posts: 647 Rep Power: 11 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 joy2000 likes this.

 October 29, 2009, 13:21 #22 New Member   Vivek Sampath Join Date: Oct 2009 Location: Houston Posts: 6 Rep Power: 8 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??

 October 29, 2009, 13:46 #23 Senior Member     Dragos Join Date: Mar 2009 Posts: 647 Rep Power: 11 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);` with: Code: `y=C_WALL_DIST(cell,thread);` ...I hope you understand the error... 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) { real A[ND_ND], es[ND_ND], dr0[ND_ND]; real ds, A_by_es; real y; int n; face_t f; Thread *tf; c_face_loop(c, t, n) /* loops over all faces of a cell */ { f = C_FACE(c,t,n); tf = C_FACE_THREAD(c,t,n); if(BOUNDARY_FACE_P(tf)) /* if the face is on boundary */ { BOUNDARY_FACE_GEOMETRY(f,tf,A,ds,es,A_by_es,dr0); y = NV_DOT(es,dr0); return y; } } return 0; }``` Dragos mm.abdollahzadeh likes this.

 November 1, 2009, 16:04 #24 Member   gina Join Date: Apr 2009 Posts: 56 Rep Power: 8 Hi Vivek, can you find any solution for your udf? for me, I could not turn it to have good results

 November 1, 2009, 16:36 #25 Member   gina Join Date: Apr 2009 Posts: 56 Rep Power: 8 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

 November 2, 2009, 01:46 #26 Senior Member     Dragos Join Date: Mar 2009 Posts: 647 Rep Power: 11 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

 November 2, 2009, 16:31 #27 Member   gina Join Date: Apr 2009 Posts: 56 Rep Power: 8 hi Dragos, I use k-e model with enhanced wall treatment. my Reynolds number= 5400. Gina

 November 2, 2009, 18:28 #28 Senior Member     Dragos Join Date: Mar 2009 Posts: 647 Rep Power: 11 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

 November 3, 2009, 14:05 #29 Member   gina Join Date: Apr 2009 Posts: 56 Rep Power: 8 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

 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 nuimlabib Main CFD Forum 0 August 4, 2009 00:05 ap FLUENT 8 April 19, 2003 08:00 MIssNancy FLUENT 3 December 3, 2002 00:53 David Yang FLUENT 3 June 3, 2002 06:13 Christian Holm Main CFD Forum 4 June 23, 2001 22:04

All times are GMT -4. The time now is 19:32.