|
[Sponsors] |
May 19, 2022, 06:15 |
set udf for 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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Set local radial axis for radial velocity with UDF | vincenzolights | FLUENT | 1 | April 8, 2022 04:13 |
[ICEM] ICEM Scripting Issues | tylerplowright | ANSYS Meshing & Geometry | 33 | September 27, 2021 17:35 |
Ansys Licence Serve on Ubuntu 16.04 LTS | david.pasquale | ANSYS | 2 | January 20, 2017 12:52 |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
How to set a udf like this? | aleisia | Fluent UDF and Scheme Programming | 0 | March 29, 2011 22:50 |