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

pressure udf

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 19, 2022, 06:19
Post pressure udf
  #1
New Member
 
cedric k
Join Date: Mar 2022
Posts: 4
Rep Power: 3
le-ceko is on a distinguished road
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
le-ceko is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for vapor pressure anuarun Fluent UDF and Scheme Programming 12 December 24, 2021 11:12
UDF to adjust pressure outlet a.lynchy FLUENT 4 February 15, 2021 01:50
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 14:04
sonicFoam - pressure driven pipe: flow continuity violation and waveTransmissive BC Endel OpenFOAM Running, Solving & CFD 3 September 11, 2014 17:29
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 03:15


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