Function lambd(T0;T;a) //function to calculate the air factor knowing a (4 for CH4), T0 reactant initial temperature and T adiabatic temperature //CH4 + lambda (1+a/4) (O2 + 3.76 N2) <--> CO2 + 2 H2O + 3.76 lambda (1+a/4) N2 + (lambda-1) (1+a/4)O2 //CHa + lambda (1 + a/4) (O2+ 3.76 N2) --> CO2 + a/2 H2O // + (lambda -1) (1 + a/4) O2 + 3.76 lambda (1 + a/4) N2 // lambda (3.76 (1+a/4) N2 - (1+a/4) (O2(T0) + 3.76 N2 (T0)) + (1+a/4)O2 ) = CH4(T0) - CO2 - a/2 H2O + (1+a/4)O2 num= enthalpy(CH4;T=T0)-enthalpy(CO2;T=T)-a/2*enthalpy(H2O;T=T)+(1+a/4)*enthalpy(O2;T=T) denom=(1+a/4)*3,76*(enThalpy(N2;T=T)-enthalpy(N2;T=T0)) +(1+a/4)*(enthalpy(O2;T=T)-enthalpy(O2;T=T0)) lambd= num/denom End Function h_products(;T;a;lambda) //function to calculate the enthalpy of reactants knowing a (4 for CH4), air factor lambda and temperature T //CH4 + lambda (1+a/4) (O2 + 3.76 N2) <--> CO2 + (1+a/4) H2O + 3.76 lambda (1+a/4) N2 + (lambda-1) (1+a/4) O2 //CHa + lambda (1 + a/4) (O2+ 3.76 N2) --> CO2 + a/2 H2O // + (lambda -1) (1 + a/4 ) O2 + 3.76 lambda (1 + a/4 ) N2 nb_moles=1+a/2 + (lambda-1)*(1+a/4) +3,76*lambda*(1+a/4) molar_mass=molarmass(CO2)/nb_moles+molarmass(H2O)*a/2/nb_moles+molarmass(N2)*3,76*lambda*(1+a/4)/nb_moles+molarmass(O2)*(lambda-1)*(1+a/4)/nb_moles fract_CO2=1/nb_moles*molarmass(CO2)/molar_mass fract_H2O=a/2/nb_moles*molarmass(H2O)/molar_mass fract_N2=3,76*lambda*(1+a/4)/nb_moles*molarmass(N2)/molar_mass fract_O2=(lambda-1)*(1+a/4)/nb_moles*molarmass(O2)/molar_mass DeltaHr = (-(-74850) +(-393520) + a/2* (-242000))/16 hf0_CO2=-393,520/molarmass(CO2) hf0_H2O=-241,000/molarmass(H2O) AFR = 3,76*lambda*(1+a/4)*molar_mass/molarmass(CH4) ARF=1/AFR DeltaH=DeltaHr*ARF hCH4=enthalpy(CH4;T=24,85) // num=(enthalpy(CO2;T=T)-hf0_CO2)*fract_CO2+(enthalpy(H2O;T=T)-hf0_H2O)*fract_H2O+enthalpy(N2;T=T)*fract_N2+enthalpy(O2;T=T)*fract_O2-enthalpy(CH4;T=T0) h_products=enThalpy(CO2;T=T)*fracT_CO2+enthalpy(H2O;T=T)*fract_H2O+enthalpy(N2;T=T)*fract_N2+enthalpy(O2;T=T)*fract_O2 End Function s_products(T;P;a;lambda) //function to calculate the entropy of reactants knowing a (4 for CH4), air factor lambda, temperature T and pressure P //CH4 + lambda (1+a/4) (O2 + 3.76 N2) <--> CO2 + (1+a/4) H2O + 3.76 lambda (1+a/4) N2 + (lambda-1) (1+a/4) O2 nb_moles=(1+(1+a/4)+3,76*lambda*(1+a/4)+(lambda-1)*(1+a/4)) molar_mass=molarmass(CO2)/nb_moles+molarmass(H2O)*(1+a/4)/nb_moles+molarmass(N2)*3,76*lambda*(1+a/4)/nb_moles+molarmass(O2)*(lambda-1)*(1+a/4)/nb_moles fract_CO2=1/nb_moles*molarmass(CO2)/molar_mass fract_H2O=(a/2)/nb_moles*molarmass(H2O)/molar_mass fract_N2=3,76*lambda*(1+a/4)/nb_moles*molarmass(N2)/molar_mass fract_O2=(lambda-1)*(1+a/4)/nb_moles*molarmass(O2)/molar_mass mixEntropy=0//-8,314/molar_mass*(1/nb_moles*ln(1/nb_moles)+(a/2)/nb_moles*ln((a/2)/nb_moles)+3,76*lambda*(1+a/4)/nb_moles*ln(3,76*lambda*(1+a/4)/nb_moles)+(lambda-1)*(1+a/4)/nb_moles*ln((lambda-1)*(1+a/4)/nb_moles)) s0=enTroPy(CO2;T=T;P=P)*fracT_CO2+entroPy(H2O;T=T;P=P)*fract_H2O+entropy(N2;T=T;P=P)*fract_N2+entropy(O2;T=T;P=P)*fract_O2 s_products= s0 +mixEntropy End //EQUATIONS //Units: SI, Temperatures in Celsius, pressures in bar //Project file: D:\_classement\_Thopt\THERMOPTIM_Pro_282\proj\regen_GT_CH4,prj //Date and Time: 2024-08-13 18:54:58 //Flow rate unit: - //GASES //burnt gases //burnt_gas //air //air //CH4 ` methane //PROCESSES //Process: regen gas //Equation: 1 m_dot_regengas = m_dot_turbine // Upstream process - turbine // Comment = isobaricExchange //Equation: 2 p_5 = p_4 // Upstream point - 4 - Downstream point - 5 // Comment = //Exchange process connected to a heat exchanger //Process: regen air //Equation: 3 m_dot_regenair = m_dot_compressor // Upstream process - compressor // Comment = isobaricExchange //Equation: 4 p_2bis = p_2 // Upstream point - 2 - Downstream point - 2 bis // Comment = //Exchange process connected to a heat exchanger //Process: gas outlet //Equation: 5 m_dot_gasoutlet = m_dot_regengas // Upstream process - regen gas //Equation: 6 //m_dot_gasoutlet = 1,01677988 // Given value //Process: air inlet //Equation: 7 m_dot_airinlet = 1,0 // Given value //Equation: 8 T_airinlet = 15,0// Given value (Celsius) //Equation: 9 p_airinlet = 1,0// Given value (bar) //Equation: 10 h_airinlet = enthalpy(Air;T = T_airinlet) // Downstream point - air inlet //Equation: 11 m_dot_compressor = m_dot_airinlet //Flow propagation //Process: fuel //Equation: 12 //m_dot_fuel = 0,0163721503 // Given value //Equation: 13 //T_fuel = 15,0// Given value (Celsius) //Equation: 14 //p_fuel = 20,0// Given value (bar) //Equation: 15 //h_fuel = enthalpy(CH4 ` methane;T = T_fuel) // Downstream point - fuel //Equation: 16 //m_dot_combustionchamber = m_dot_fuel //Flow propagation //Process: compressor //Equation: 17 //m_dot_compressor = m_dot_airinlet // Upstream process - air inlet //Equation: 18 s_airinlet = entropy(Air;P = p_airinlet;H = h_airinlet) // Upstream point - air inlet - Downstream point - 2 // Comment = Polytropic reference //Equation: 19 ds_2 = (1 - etaT_compressor)/etaT_compressor*8,314/M_airinlet*ln(p_2/p_airinlet) // Upstream point - air inlet - Downstream point - 2 //Equation: 20 s_2 = s_airinlet + ds_2 // Entropy - 2 //Equation: 21 M_airinlet = 28,957763399999997 // Molar mass - 2 //Equation: 22 etaT_compressor = 0,85// Polytropic efficiency // Comment = Polytropic coefficient: k = -Math,log(aval,p/amont,p)/Math,log(aval,V/amont,V) //Equation: 23 h_2 = enthalpy(Air;P = p_2;S = s_2) // Enthalpy //Equation: 24 T_2 = temperature(Air;H = h_2) // Downstream point - 2 // Comment = Given outlet pressure //Equation: 25 p_2 = 16,0// Outlet pressure //Equation: 26 W_dot_compressor = m_dot_compressor*(h_2 - h_airinlet) // DeltaH //Process: turbine //Equation: 27 m_dot_turbine = m_dot_combustionchamber // Upstream process - combustion chamber //Equation: 28 //s_3 = entropy(burnt_gas;P = p_3;H = h_3) // Upstream point - 3 - Downstream point - 4 s_3 = s_products(T_3;p_3;a_combustionchamber;lambda_combustionchamber)// enropy of the reactants // Comment = Polytropic reference //Equation: 29 ds_4 = -(1 - etaT_turbine)*8,314/M_3*ln(p_4/p_3) // Upstream point - 3 - Downstream point - 4 //Equation: 30 s_4 = s_3 + ds_4 // Entropy - 4 //Equation: 31 M_3 = 28,587050454025974 // Molar mass - 4 //Equation: 32 etaT_turbine = 0,85// Polytropic efficiency //Equation: 33 //h_4 = enthalpy(burnt_gas;P = p_4;S = s_4) // Enthalpy // Comment = Polytropic coefficient: k = -Math,log(aval,p/amont,p)/Math,log(aval,V/amont,V) //Equation: 34 //h_4 = enthalpy(burnt_gas;P = p_4;S = s_4) // Enthalpy h_4 = h_products(T_4;a_combustionchamber;lambda_combustionchamber)// enthalpy of the reactants //Equation: 35 //T_4 = temperature(burnt_gas;H = h_4) // Downstream point - 4 s_4 = s_products(T_4;p_4;a_combustionchamber;lambda_combustionchamber)// enropy of the // Comment = Given outlet pressure //Equation: 36 p_4 = 1,0// Outlet pressure //Equation: 37 W_dot_turbine = m_dot_turbine*(h_4 - h_3) // DeltaH //Process: combustion chamber // Comment = Calculate lambda simplified model oxidizer air, fuel CH4 //Equation: 38 T_3 = 1150,0// Given value (Celsius) //Equation: 39 a_combustionchamber = 4// for CH4 //Equation: 40 lambda_combustionchamber = lambd(T_2bis;T_3;a_combustionchamber)// air factor lambda //Equation: 41 h_3 = h_products(T_3;a_combustionchamber;lambda_combustionchamber)// enthalpy of the reactants //Equation: 42 hfict_2bis = h_products(T_2bis;a_combustionchamber;lambda_combustionchamber)// enthalpy of a fictitious inlet point for calculating the heat released //Equation: 43 m_dot_combustionchamber = m_dot_regenair + m_dot_fuel // Upstream process - regen air - Fuel process fuel - Downstream process - combustion chamber //Equation: 44 //m_dot_turbine = m_dot_combustionchamber //Flow propagation //Equation: 45 Q_dot_combustionchamber = (h_3 - hfict_2bis)*m_dot_combustionchamber // DeltaH //Equation: 46 DeltaHr_combustionchamber = (-(-74850) +(-393520)+a_combustionchamber/2*(-242000))/16 // DeltaHr (kJ/kg) = (-(-74850) +(-393520) + a/2* (-242000))/16 for methane //Equation: 47 m_dot_fuel = abs(Q_dot_combustionchamber/DeltaHr_combustionchamber) // fuel flow rate // Comment = Isobaric process //Equation: 48 p_3 = p_2bis// Isopressure //Equation: 49 T_fuel = 15,0// Given value (Celsius) //Equation: 50 p_fuel = 20,0// Given value (bar) //Equation: 51 h_fuel = enthalpy(CH4;T = T_fuel) // Fuel point - fuel //NODES //HEAT EXCHANGERS //Heat exchanger: regenerator //Equation: 52 mCp_regenair = (h_2bis - h_2)/(T_2bis - T_2)*m_dot_regenair // mCpf =deltaH/deltaT - regen air //Equation: 53 mCp_regengas = (h_5 - h_4)*m_dot_regengas/(T_5 - T_4) // mCpc =-deltaH/deltaT - regen gas // Comment = mCpc>mCpf //Equation: 54 UA_regenerator = NTU_regenerator *mCp_regenair // Cold fluid - regen air //Equation: 55 R_regenerator = mCp_regenair /mCp_regengas // Hot fluid - regen gas - Cold fluid - regen air //Equation: 56 T_2bis = T_2 + epsilon_regenerator*(T_4 - T_2) // Hot fluid outlet temperature //Equation: 57 h_2bis = enthalpy(Air;T = T_2bis)// Enthalpy //Equation: 58 h_5 = - m_dot_regenair /m_dot_regengas*(h_2bis - h_2) + h_4 // Hot fluid - regen gas - Cold fluid - regen air //Equation: 59 //T_5 = temperature(burnt_gas;H = h_5)// Hot fluid outlet temperature h_5 = h_products(T_5;a_combustionchamber;lambda_combustionchamber)// enthalpy of the reactants // Comment = epsilon given value //Equation: 60 epsilon_regenerator = 0,8499764597591365 // Given value //Equation: 61 argLn_regenerator = (1 - epsilon_regenerator*R_regenerator)/(1 - epsilon_regenerator) //Equation: 62 NTU_regenerator = 1/(1 - R_regenerator)*ln(argLn_regenerator) // Counterflow heat exchanger //Equation: 63 Q_dot_regengas = m_dot_regengas*(h_5 - h_4) // DeltaH hot fluid //Equation: 64 Q_dot_regenair = m_dot_regenair*(h_2bis - h_2) // DeltaH cold fluid //Number of equations: 64 //POINTS WITH SATURATION TEMPERATURE SET //OTHER POINTS WITH PRESSURE SET //SET FLOW RATES //OVERALL BALANCE //Equation: 65 useful_Energy = W_dot_compressor + W_dot_turbine //Equation: 66 purchased_Energy = Q_dot_combustionchamber //Equation: 67 eta_global = abs(useful_Energy/purchased_Energy)