|
[Sponsors] |
variable mass flow inlet conditions for two components in transient simulation |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
cfd_enthusiast
Join Date: Jul 2024
Posts: 7
Rep Power: 2 ![]() |
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; } } |
|
![]() |
![]() |
![]() |
Tags |
#boundary;#inlet, #udf.#fluent, multiphase mixture model |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |