|
[Sponsors] |
February 24, 2010, 14:14 |
UDF to adjust pressure outlet
|
#1 |
New Member
adrian lynch
Join Date: Feb 2010
Posts: 9
Rep Power: 16 |
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) } |
|
February 24, 2010, 18:51 |
|
#2 |
New Member
Join Date: Feb 2010
Posts: 7
Rep Power: 16 |
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 ? ?? |
|
February 25, 2010, 07:07 |
|
#3 |
New Member
adrian lynch
Join Date: Feb 2010
Posts: 9
Rep Power: 16 |
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. |
|
February 13, 2012, 05:03 |
pressure udf
|
#4 |
Member
|
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 ????? |
|
February 15, 2021, 01:50 |
|
#5 |
Member
Join Date: Jan 2018
Posts: 34
Rep Power: 8 |
Would you remember, how did you obtained your udf at the outlet then?
|
|
Tags |
pressure outlet, udf, udf compilation |
|
|
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 |