# User defined function of mass flow rate

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

 April 17, 2005, 12:19 User defined function of mass flow rate #1 Eric Guest   Posts: n/a i have encountered a question about user defined function. since i had to input a unsteady UDF of both pressure and mass flow rate at the same time. with the reference of tutorial, i easily got the desired similar UDF as below. #include "udf.h" DEFINE_PROFILE(unsteady_pressure, thread, position) { float t, pressure; face_t f; t = RP_Get_Real("flow-time"); pressure (3800*t*t*t*t*t10000*t*t*t*t*t+10000*t*t*t*t-4000*t*t*t+50*t*t+200t+100); begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = pressure; } end_f_loop(f, thread) } but when i evaluate the result carefully. i forgot the pressure function only valid for the period of from t= 0 to t=1. After that,the pressure dropped to negative value, which was incorrect for my study. So what i wanted a solution was how to combined two function in a single UDF or can Fluent load two UDF at the same time and forced FLUENT to run the UDF periodically of 1 second. For the mass flow rate, say my designed function was mass = (-3*t*t*t*t+9*t*t*t-7*t*t+1*t+1); thanks in advance.

 April 22, 2005, 18:15 Re: User defined function of mass flow rate #2 Saad Guest   Posts: n/a Dear Eric, you can use an If-else check in your UDF, i.e., if (t >=0 && t <=1) { ....; } else { ...; } So that you can use a single UDF. Sincerely, Saad

 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 a.lynchy Fluent UDF and Scheme Programming 21 February 15, 2014 03:18 saii CFX 2 September 18, 2009 08:07 Christian Main CFD Forum 2 February 27, 2007 07:27 Masood FLUENT 0 May 22, 2005 00:32 Neser CFX 4 February 14, 2004 01:27

All times are GMT -4. The time now is 00:51.