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

variable mass flow inlet conditions for two components in transient simulation

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2025, 01:40
Default variable mass flow inlet conditions for two components in transient simulation
  #1
New Member
 
cfd_enthusiast
Join Date: Jul 2024
Posts: 7
Rep Power: 2
eldhosek1987@gmail.com is on a distinguished road
I am using a UDF to give variable mass flow rates for a mixture containing two components: Hydrogen and Helium. Initially ONLY Hydrogen enters with a fixed mass flow rate for a specific period of time. After that, ONLY Helium enters at another fixed mass flow rate. I have written the UDF for this. Though it can be hooked to the mass flow inlet boundary conditions, I am not getting the variable mass flow rate at the inlet. It is showing only first component mass flow rate. It is not taking the mass flow rate according to the mass fraction of the components properly. Expecting somebody's help on this.
The UDF goes like this....


#include "udf.h"
DEFINE_PROFILE(mixture_inlet_mass_flow_rate, t, nv)
{
face_t f ;
real flow_time = RP_Get_Real("flow-time");
if (flow_time < 0.005)
{
printf("Time = %f sec. \n",flow_time);
printf("Targeted mass-flow rate set at 0.001 kg/s \n");
begin_f_loop(f,t)
{
F_PROFILE(f,t,nv) = 0.001 ;
}
end_f_loop(f,t)
}
else
{
printf("Time = %f sec. \n",flow_time);
printf("Targeted mass-flow rate set at 0.002 kg/s \n") ;

begin_f_loop(f,t)
{
F_PROFILE(f,t,nv) = 0.002 ;
}
end_f_loop(f,t)
}

}

DEFINE_PROFILE(mixture_inlet_profile, t,nv)
{
real time = CURRENT_TIME;
real X_H2, X_He;

if (time<0.005)
{
X_H2 = 1 ;
X_He = 0 ;

}

else if (t>0.005)
{
X_H2 = 0 ;
X_He = 1 ;

}

if (i == 0)
{
F_PROFILE(f, t, i) = X_H2;
}
else if (i == 1)
{
F_PROFILE(f, t, i) = X_He;
}

}
eldhosek1987@gmail.com is offline   Reply With Quote

Reply

Tags
#boundary;#inlet, #udf.#fluent, multiphase mixture model

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
Wind turbine simulation Saturn CFX 60 July 17, 2024 05:45
Transient simulation of flow through a valve aadit.shroff Main CFD Forum 12 April 12, 2018 04:20
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
Boudaries for bouynat driven flow with additional mass flux at inlet Charon CFX 2 April 27, 2013 08:02
reversed flow at velocity inlet / mass flow inlet ib FLUENT 1 March 26, 2007 13:11


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