CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF for pressure outlet (resistance)

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

LinkBack Thread Tools Display Modes
Old   October 15, 2014, 06:22
Default UDF for pressure outlet (resistance)
Senior Member
Join Date: Feb 2011
Posts: 140
Rep Power: 8
Lilly is on a distinguished road

Dear all,

I try to write a UDF to set the pressure at the outlets of my geometry according to the equation p=R*Q (p: pressure, R: resistance and Q: volume flow rate) for a fixed value of R at each outlet which corresponds to the resistance of the downstream vessels. Therefore, I have to use/readout the outflow at each outlet to calculate the pressure. My first guess of the UDF was:

#include "udf.h"
#include "math.h"

#define Density 1050.
#define R1 3.590987710898600e+10

real QMout1;
real Qout1;
real Pout1;

face_t f;

QMout1=0.0; //initial value

QMout1+=F_FLUX(f,thread); //sum of mass flow rate of all faces of the outlet at the same time step


Qout1=QMout1/Density; //calculate volume flow rate

Pout1=R1*Qout1; //calculate pressure


I checked the results (static pressure and volume flow rate) for several time steps at several outlets and found the equation was satisfied.

However, I am not sure, if this makes sense, since I thought I must e.g. use the volume flow rate of the previous time step and solve the equation iteratively. But I am a bit confused how to integrate this at the UDF!? And what about the first time step? I certainly need to make a proper initial guess, dont I? Does anybody have an idea how to fix this UDF? I am thankful for any help and idea!
Lilly is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiphase udf ak2009 Fluent UDF and Scheme Programming 0 June 7, 2012 00:15
UDF to adjust pressure outlet a.lynchy FLUENT 3 February 13, 2012 05:03
UDF for Pressure outlet condition jubs FLUENT 0 February 8, 2007 05:30
UDF Hydrostatic Pressure Outlet Bridget FLUENT 0 May 16, 2006 17:55
UDF in Fluent to Match Mass Flow at Pressure Outlet Jonas Larsson Main CFD Forum 1 April 29, 1999 10:44

All times are GMT -4. The time now is 10:13.