CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

User defined function of mass flow rate

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

LinkBack Thread Tools Search this Thread Display Modes
Old   April 17, 2005, 12:19
Default User defined function of mass flow rate
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.
  Reply With Quote

Old   April 22, 2005, 18:15
Default Re: User defined function of mass flow rate
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.


  Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 31 October 4, 2018 14:10
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 06:27
mass flow rate error Masood FLUENT 0 May 22, 2005 00:32
Mass flow rate Neser CFX 4 February 14, 2004 00:27

All times are GMT -4. The time now is 20:01.