|
[Sponsors] |
May 19, 2022, 06:14 |
UDF to set pressure
|
#1 |
New Member
cedric k
Join Date: Mar 2022
Posts: 4
Rep Power: 4 |
Hi all,
I work on a project and i'm pretty new in UDF. I have to set an udf depending on the mass flow rate at the outlet. i try to write an udf code but it doesn,t work : #include "udf.h" DEFINE_PROFILE(pressure_outlet,t,i) { real inlet_mass_flow_rate = 0.025 ; /* liquid inlet mass flow rate */ real current_mass_flow_rate; /* declare variable for the current mass flow rate */ real error; real kp = 50; /* proportional constant */ face_t f; begin_f_loop(f,t) { current_mass_flow_rate = F_FLUX(f,t); /* F_FLUX is the mass flow rate through a face */ error = inlet_mass_flow_rate - current_mass_flow_rate; /* difference between each mass flow rate */ F_PROFILE(f,t,i) = F_P(f,t) + kp * error; /* pressure definition */ } end_f_loop(f,t) } I think i have forgotten something. I found an article about that so they said that : the set point of the exit mass flow rates ( sp mexit ) was determined as the inlet mass flow rate. The error (Ei) between the set point and the actual mass flow rate ( ie m xit ) at the ith time level was calculated as follows: Ei = msp -mexit The exit pressure ( i+1 Pexit ) at the next time level was obtained from the current exit pressure (P i exit ) and a correction value proportional to the error Pexit(i+1) = P(i) - K Ei Someone can help me ? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF to adjust pressure outlet | a.lynchy | FLUENT | 4 | February 15, 2021 01:50 |
Setting up the pressure variation due to tornado in a duct(UDF)+animation | guillaume1990 | FLUENT | 0 | March 3, 2014 12:59 |
Set inlet velocity and pressure in cavitational model | GerardX89 | FLUENT | 1 | July 5, 2012 17:17 |
how to get pressure and pressure gradient using UDF | Honglin | Fluent UDF and Scheme Programming | 0 | May 24, 2012 07:47 |
Fluent 5.2, UDF and Pressure BC's | Alfonso Ferrandez | FLUENT | 0 | May 4, 2000 08:02 |