# UDF for shear stress

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Search this Thread Display Modes
 May 18, 2021, 07:31 UDF for shear stress #1 New Member   pxy Join Date: Apr 2021 Posts: 3 Rep Power: 2 Hello everyone, I'm writing a code to define the wall shear stress, but it's always wrong. How to write it correctly? τzx=-(σz*f+(ρ*g*vx^2)/ξ) #include"udf.h" #define F 0.3 /*friction coefficient*/ #define B 1000 /*turbulence parameter*/ #define D 1630 /*density*/ #define g 9.81 DEFINE_PROFILE(taux_profile, t, i) { real u, p; face_t f; Thread* t0; cell_t c0; begin_f_loop(f, t) { t0 = THREAD_T0(t); c0 = F_C0(f, t); p = C_P(c0, t0); u = C_U(c0, t0); F_PROFILE(f, t, i) = p * F + D * g * u * u / B; } end_f_loop(f, t) } DEFINE_PROFILE(tauy_profile, t, i) { real v, p; face_t f; Thread* t0; cell_t c0; begin_f_loop(f, t) { t0 = THREAD_T0(t); c0 = F_C0(f, t); p = C_P(c0, t0); v = C_V(c0, t0); F_PROFILE(f, t, i) = p * F + D * g * v * v / B; } end_f_loop(f, t) }

 May 19, 2021, 11:23 #2 Senior Member   Join Date: Nov 2013 Posts: 1,867 Rep Power: 23 Please explain how you concluded that it's wrong. __________________ "The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".

 May 19, 2021, 20:45 #3 Senior Member   Alexander Join Date: Apr 2013 Posts: 1,723 Rep Power: 28 check values of P and V/U you are extracting from adjusted to wall cells you may do it using Messages to console Code: ```p = C_P(c0, t0); u = C_U(c0, t0); Message0("u = %f, p = %f\n",u,p);``` __________________ best regards ****************************** press LIKE if this message was helpful

May 19, 2021, 23:55
#4
New Member

pxy
Join Date: Apr 2021
Posts: 3
Rep Power: 2
Quote:
 Originally Posted by pakk Please explain how you concluded that it's wrong.
Similarly, when I don't use UDF, the result is convergent, but when I add UDF, my result shows "floating point exception"

 June 5, 2021, 05:57 #5 Senior Member   Join Date: Nov 2013 Posts: 1,867 Rep Power: 23 Initialize, don't run, plot the shear stress. Is it what you expect? __________________ "The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".

June 9, 2021, 01:14
#6
New Member

pxy
Join Date: Apr 2021
Posts: 3
Rep Power: 2
Quote:
 Originally Posted by pakk Initialize, don't run, plot the shear stress. Is it what you expect?
Initialize but do not run, why is the shear stress a straight line equal to 0? Is my UDF written wrong?

I checked the units, length (m)， Pressure (Pascal), but when I run it, it shows that the shear stress of wall is especially small.

 Thread Tools Search this Thread Search this Thread: Advanced Search 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 Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post cibi FLUENT 0 December 11, 2020 05:44 a1ananth Fluent UDF and Scheme Programming 3 February 24, 2015 03:23 rsingh7 Fluent UDF and Scheme Programming 0 July 18, 2014 16:54 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14 Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01

All times are GMT -4. The time now is 23:33.

 Contact Us - CFD Online - Privacy Statement - Top