CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF to adjust pressure outlet

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By a.lynchy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 24, 2010, 14:14
Post UDF to adjust pressure outlet
  #1
New Member
 
adrian lynch
Join Date: Feb 2010
Posts: 9
Rep Power: 16
a.lynchy is on a distinguished road
Hello,
I am trying to write a UDF and have no experience doing this.

What i require the UDF to do, is to determine the mass flow rate at the outlet and compare it to a set value for mass flow rate. If the set point mass flux and actual mass flux are not equall i want to adjust the outlet pressure in an iterative approach to make them equal.
I want to apply the UDF to a straight pipe initially, with a pressure inlet and pressure outlet as the boundary conditions.

I have atttempted to write the UDF and have got it to interprete but when i initialize the model the Fluent software crashes.

I have attached my attempt at a UDF below.

Any help or direction you could give in relation to this would be greatly appreciated.

#include "udf.h"
#define SET_POINT 0.005
DEFINE_PROFILE(outlet_pressure, thread, nv)
{
Thread *t;
face_t f;
cell_t c;

real actual_mass_flow;
real pressure = C_P(c,t);

actual_mass_flow = F_FLUX(f,t);

if (actual_mass_flow > SET_POINT)
begin_f_loop (f,t)
{
F_PROFILE(f,thread,nv) = pressure + 1;
}
end_f_loop (f,t)


else if (actual_mass_flow < SET_POINT)
begin_f_loop (f,t)
{
F_PROFILE(f,thread,nv) = pressure - 1;
}
end_f_loop (f,t)

else
begin_f_loop (f,t)
{
F_PROFILE(f,thread,nv) = pressure;
}
end_f_loop (f,t)
}
wc34071209 likes this.
a.lynchy is offline   Reply With Quote

Old   February 24, 2010, 18:51
Default
  #2
New Member
 
Join Date: Feb 2010
Posts: 7
Rep Power: 16
aounallah is on a distinguished road
hi lynchy

well, I think that you simulates flow in pipe, solving fluid mechanics equations make equal the flow mass rate in entrance to the exit (continuty eqt.)
you can improve accuracy by reduicing the tolerance of equation and verfing the net imbalance between inlet and outlet

I think it is not necessary to use UDF just to equalize the flow rate

what you are thinking ? ??
aounallah is offline   Reply With Quote

Old   February 25, 2010, 07:07
Default
  #3
New Member
 
adrian lynch
Join Date: Feb 2010
Posts: 9
Rep Power: 16
a.lynchy is on a distinguished road
Thanks aounallah,
i agree for a straight pipe the mass flow in and out must balance. I suppose i should have outline the actually final geometry i will be applying it to.

The geometry i have is an artery system with 3 inlets and 6 outlets, with communication arteries that connect all inlets ad outlets. I know the pressure and mass flow rate at the inlet and i know what ratio the mass flow rate is divided between the outlets. What i want to get is the pressure at the outlets. I want these pressure outlet values because in later models i will have to set a pressure in and pressure out as the BC's.

Fluent does not allow a pressure inlet and outflow BC unfortunately, so i was trying to set a pressure inlet and pressure outlet. However i only have an idea of what p out should be, so i was trying to use an iterative process in the form of a UDF to determine the pressure out i requires to the mass flow rates out each outlet then i want.
a.lynchy is offline   Reply With Quote

Old   February 13, 2012, 05:03
Default pressure udf
  #4
Member
 
Nirav
Join Date: Jul 2011
Posts: 43
Rep Power: 15
niravtm007 is on a distinguished road
Send a message via Skype™ to niravtm007
Hii friends
My problem is flow through river channel, I have taken a orbitary region so at exit of my geometry flow exits into river itself. so i need to know how to apply UDf at exit, as pressure must vary with P=row*g*h. my exit cross section is not uniform so what should i do please help. is it possible to apply custom field function ???? pressure should vary with outlet depth of water which changes with depth of liquid at outlet. so how can i apply udf ?????
niravtm007 is offline   Reply With Quote

Old   February 15, 2021, 01:50
Default
  #5
Member
 
Join Date: Jan 2018
Posts: 34
Rep Power: 8
UchihaMadara is on a distinguished road
Would you remember, how did you obtained your udf at the outlet then?
UchihaMadara is offline   Reply With Quote

Reply

Tags
pressure outlet, udf, udf compilation


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
simple model, difficult outlet Eric CFX 7 May 23, 2014 09:13
UDF Defining VOF Free Surface at Outlet Alex Fluent UDF and Scheme Programming 13 August 8, 2012 17:50
Pressure Drop in outlet Vent Abdul FLUENT 2 October 28, 2008 13:13
pressure outlet problem chanchala FLUENT 2 November 5, 2003 07:59
UDF in Fluent to Match Mass Flow at Pressure Outlet Jonas Larsson Main CFD Forum 1 April 29, 1999 11:44


All times are GMT -4. The time now is 17:04.