# volume flow rate error in udf

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

 LinkBack Thread Tools Search this Thread Display Modes
 July 12, 2010, 08:49 volume flow rate error in udf #1 New Member   christophe Join Date: Aug 2009 Posts: 24 Rep Power: 16 In order to model a specific pressure outlet condition, I wrote a UDF that compute the outlet pressure with the following equation: p_out=k*(4e6)*Q_out+2000 (1) where p_out is the outlet pressure, Q_out the outlet volume flow rate and k a coefficient that i use to increase the resistance at the outlet. In my real model I have 19 outlets, and 8 should use this condition (for the other k=1). I tested my UDF on a cylinder of 1cm radius and 8cm length, for Re=1000 at the inlet (velocity inlet), with k=2 and 200. among the different test, I output the outlet pressure and I compared it with the expected pressure from equ. (1). I was really surprised of the difference: p_out=2009Pa instead of 2928Pa for k=2 and 5327Pa instead of 94800Pa for k=200. Could you tell me if there is any problem in my udf, especially the way to obtain the outlet volume flow rate? the code is as follow: #include "udf.h" #include "unsteady.h" DEFINE_PROFILE(resistance_S,thread,i) { real Q=0.; real t=CURRENT_TIME; real A[ND_ND]; face_t f; float u,v,w,vi,vn; float k=2.0; { begin_f_loop(f,thread) { u=F_U(f,thread); v=F_V(f,thread); w=F_W(f,thread); vi=u*u+v*v+w*w; vn=sqrt(vi); F_AREA(A,f,thread); Q=Q+NV_MAG(A)*vn; F_PROFILE(f,thread,i)=k*(4e6)*Q+2000.0; u=0.; v=0.; w=0.; vn=0.; Q=0.; } end_f_loop(f,thread) } Thank you for any help

 July 13, 2010, 04:23 #2 New Member   christophe Join Date: Aug 2009 Posts: 24 Rep Power: 16 It seems there were some mistake in my UDF, so I re wrote it as follow: #include "udf.h" #include "unsteady.h" DEFINE_PROFILE(resistance_S,thread,i) { real Q=0.; real t=CURRENT_TIME; real A[ND_ND]; face_t f; float u,v,w,vi,vn; float k=2.0; { begin_f_loop(f,thread) { u=F_U(f,thread); v=F_V(f,thread); w=F_W(f,thread); vi=u*u+v*v+w*w; vn=sqrt(vi); F_AREA(A,f,thread); Q=Q+NV_MAG(A)*vn; u=0.; v=0.; w=0.; vn=0.; } end_f_loop(f,thread) begin_f_loop(f,thread) { F_PROFILE(f,thread,i)=k*(4e6)*Q+2000.0; } end_f_loop(f,thread) } } This seems fine now for k=2, but if I set k to 200, I should get a pressure at the outlet of 2.012x10^6Pa, instead I have 1.229x10^6Pa. I also tried it with a Y junction mesh, and even with k=1 for both outlet, the results are not good. Any one could explain me why?

 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 wildli FLUENT 3 September 15, 2022 12:19 a.lynchy Fluent UDF and Scheme Programming 31 October 4, 2018 14:10 rbigelow FloEFD, FloWorks & FloTHERM 1 November 16, 2009 01:32 SAMUEL FLUENT 3 December 25, 2004 00:36 SAMUEL FLUENT 0 December 16, 2004 02:55

All times are GMT -4. The time now is 16:41.

 Contact Us - CFD Online - Privacy Statement - Top