diff --git a/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_direct.mo b/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_direct.mo index fb3b28cf..213954fa 100644 --- a/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_direct.mo +++ b/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_direct.mo @@ -22,7 +22,7 @@ model GasTurbine_direct parameter Real combustionChamber_eta = 0.9999; // Inputs for calibration - output Units.NegativeMassFlowRate source_Q "kg/s"; + output Units.PositiveMassFlowRate source_Q "kg/s"; output Real compressor_P_out "barA"; output Real compressor_T_out "degC"; output Real W "MW"; @@ -68,7 +68,7 @@ equation source_fuel.P_out = P_fuel; source_fuel.h_out = h_fuel; source_fuel.Q_out = Q_fuel; - source_fuel.Xi_out = {0.90,0.05,0,0,0.025,0.025}; + source_fuel.Xi_out = {0.80,0.05,0,0,0.025,0.025,0.1}; // Parameters combustion_chamber.Kfr = combustion_chamber_Kfr; diff --git a/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_reverse.mo b/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_reverse.mo index 3d0334a7..55452837 100644 --- a/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_reverse.mo +++ b/MetroscopeModelingLibrary/Examples/CCGT/GasTurbine_reverse.mo @@ -22,7 +22,7 @@ model GasTurbine_reverse parameter Real combustionChamber_eta = 0.9999; // Inputs for calibration - input Units.NegativeMassFlowRate source_Q(start=500) "kg/s"; + input Units.PositiveMassFlowRate source_Q(start=500) "kg/s"; input Real compressor_P_out(start = 16) "barA"; input Real compressor_T_out(start = 406) "degC"; input Real W(start = 200) "MW"; @@ -68,7 +68,7 @@ equation source_fuel.P_out = P_fuel; source_fuel.h_out = h_fuel; source_fuel.Q_out = Q_fuel; - source_fuel.Xi_out = {0.90,0.05,0,0,0.025,0.025}; + source_fuel.Xi_out = {0.80,0.05,0,0,0.025,0.025,0.1}; // Parameters combustion_chamber.Kfr = combustion_chamber_Kfr; diff --git a/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_direct.mo b/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_direct.mo index e134ecda..748a39bd 100644 --- a/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_direct.mo +++ b/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_direct.mo @@ -693,7 +693,7 @@ equation Q_fuel_source_sensor.Q = Q_fuel_source; P_fuel_source_sensor.P_barA = P_fuel_source; T_fuel_source_sensor.T_degC = T_fuel_source; - source_fuel.Xi_out = {0.90,0.05,0,0,0.025,0.025}; + source_fuel.Xi_out = {0.80,0.05,0,0,0.025,0.025,0.1}; // Air Filter // Quantities definition diff --git a/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_reverse.mo b/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_reverse.mo index a3f03037..f8dd9374 100644 --- a/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_reverse.mo +++ b/MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_reverse.mo @@ -399,7 +399,7 @@ equation Q_fuel_source_sensor.Q = Q_fuel_source; P_fuel_source_sensor.P_barA = P_fuel_source; T_fuel_source_sensor.T_degC = T_fuel_source; - source_fuel.Xi_out = {0.90,0.05,0,0,0.025,0.025}; + source_fuel.Xi_out = {0.80,0.05,0,0,0.025,0.025,0.1}; // Air Filter // Quantities definition diff --git a/MetroscopeModelingLibrary/Fuel/BoundaryConditions/Source.mo b/MetroscopeModelingLibrary/Fuel/BoundaryConditions/Source.mo index b49880a7..31c108a3 100644 --- a/MetroscopeModelingLibrary/Fuel/BoundaryConditions/Source.mo +++ b/MetroscopeModelingLibrary/Fuel/BoundaryConditions/Source.mo @@ -17,6 +17,8 @@ model Source Real amC4H10 "C4H10 molecular mass"; Real amCO2 "CO2 molecular mass"; Real amN2 "H2O molecular mass"; + Real amH2 "H2 molecular mass"; + // Fuel composition Utilities.Units.MassFraction X_CH4(start=0.848); @@ -25,6 +27,7 @@ model Source Utilities.Units.MassFraction X_C4H10_n_butane(start=0.00668); Utilities.Units.MassFraction X_N2(start=0.024); Utilities.Units.MassFraction X_CO2(start=0.025); + Utilities.Units.MassFraction X_H2(start=0.0); // Mole fractions Real X_molar_CH4(start=0.92); @@ -33,6 +36,7 @@ model Source Real X_molar_C4H10_n_butane(start=0.002); Real X_molar_N2(start=0.015); Real X_molar_CO2(start=0.01); + Real X_molar_H2(start=0.0); // Mean molecular mass Real mean_molecular_mass(start=17); @@ -46,6 +50,7 @@ equation amC4H10 = 4*amC + 10*amH; amN2 = 2*amN; amCO2 = amC + 2*amO; + amH2 = 2*amH; // Composition mass fraction X_CH4 = Xi_out[1]; // methane @@ -54,6 +59,7 @@ equation X_C4H10_n_butane = Xi_out[4]; // butane X_N2 = Xi_out[5]; // nitrogen X_CO2 = Xi_out[6]; // carbon dioxyde + X_H2 = Xi_out[7]; // carbon dioxyde // Mean Molecular Mass: this gives the correct results only if the molar fraction is given as an input, if the mass fraction is given, this quantity is useless mean_molecular_mass = X_molar_CH4*amCH4 + X_molar_C2H6*amC2H6 + X_molar_C3H8*amC3H8 + X_molar_C4H10_n_butane*amC4H10 + X_molar_N2*amN2 + X_molar_CO2*amCO2; @@ -65,6 +71,7 @@ equation X_molar_C4H10_n_butane = X_C4H10_n_butane/amC4H10 * mean_molecular_mass; X_molar_N2 = X_N2/amN2 * mean_molecular_mass; X_molar_CO2 = X_CO2/amCO2 * mean_molecular_mass; + X_molar_H2 = X_H2/amH2 * mean_molecular_mass; annotation (Icon(graphics={ Ellipse( diff --git a/MetroscopeModelingLibrary/MultiFluid/Machines/CombustionChamber.mo b/MetroscopeModelingLibrary/MultiFluid/Machines/CombustionChamber.mo index 99753496..2cad8d2c 100644 --- a/MetroscopeModelingLibrary/MultiFluid/Machines/CombustionChamber.mo +++ b/MetroscopeModelingLibrary/MultiFluid/Machines/CombustionChamber.mo @@ -44,14 +44,15 @@ model CombustionChamber Units.MassFraction X_fuel_C4H10_n_butane(start=0.002); Units.MassFraction X_fuel_N2(start=0.015); Units.MassFraction X_fuel_CO2(start=0.01); + Units.MassFraction X_fuel_H2(start=0.01); Units.MassFraction X_fuel_C(start=0.8) "C mass fraction in the fuel"; Units.MassFraction X_fuel_H(start=0.2) "H mass fraction in the fuel"; Units.MassFraction X_fuel_O(start=0) "O mass fraction in the fuel"; // Heating values - Units.SpecificEnthalpy HHV = (hhv_mass_CH4*X_fuel_CH4 + hhv_mass_C2H6*X_fuel_C2H6 + hhv_mass_C3H8*X_fuel_C3H8 + hhv_mass_C4H10*X_fuel_C4H10_n_butane)*1e6 "J/kg can be assigned in component modifiers"; - Units.SpecificEnthalpy LHV = HHV - 2202.92069 * m_H*(4*X_fuel_CH4/m_CH4 + 6*X_fuel_C2H6/m_C2H6 + 8*X_fuel_C3H8/m_C3H8 + 10*X_fuel_C4H10_n_butane/m_C4H10)*1e4 "J/kg can be assigned in component modifiers"; + Units.SpecificEnthalpy HHV = (hhv_mass_H2*X_fuel_H2 + hhv_mass_CH4*X_fuel_CH4 + hhv_mass_C2H6*X_fuel_C2H6 + hhv_mass_C3H8*X_fuel_C3H8 + hhv_mass_C4H10*X_fuel_C4H10_n_butane)*1e6 "J/kg can be assigned in component modifiers"; + Units.SpecificEnthalpy LHV = HHV - 2202.92069 * X_fuel_H*1e4 "J/kg can be assigned in component modifiers"; // Initialization parameters parameter Units.SpecificEnthalpy h_in_air_0 = 5e5; @@ -72,10 +73,10 @@ equation Q_air = sink_air.Q_in; Q_fuel = sink_fuel.Q_in; Q_exhaust = - source_exhaust.Q_out; + h_exhaust = source_exhaust.h_out; h_in_air = sink_air.h_in; h_in_fuel = sink_fuel.h_in; - h_exhaust = source_exhaust.h_out; X_in_N2 = sink_air.Xi_in[1]; X_in_O2 = sink_air.Xi_in[2]; @@ -89,6 +90,7 @@ equation X_fuel_C4H10_n_butane= sink_fuel.Xi_in[4]; //butane X_fuel_N2= sink_fuel.Xi_in[5]; // nitrogen X_fuel_CO2= sink_fuel.Xi_in[6]; // carbon dioxyde + X_fuel_H2= sink_fuel.Xi_in[7]; // hydrogen // Final quantities X_out_N2 = source_exhaust.Xi_out[1]; @@ -112,7 +114,7 @@ equation // Chemical balance // Quantity of reactants in fuel X_fuel_C = m_C*(X_fuel_CH4/m_CH4 + 2*X_fuel_C2H6/m_C2H6 + 3*X_fuel_C3H8/m_C3H8 + 4*X_fuel_C4H10_n_butane/m_C4H10 + X_fuel_CO2/m_CO2); - X_fuel_H = m_H*(4*X_fuel_CH4/m_CH4 + 6*X_fuel_C2H6/m_C2H6 + 8*X_fuel_C3H8/m_C3H8 + 10*X_fuel_C4H10_n_butane/m_C4H10); + X_fuel_H = m_H*(2*X_fuel_H2/m_H2 + 4*X_fuel_CH4/m_CH4 + 6*X_fuel_C2H6/m_C2H6 + 8*X_fuel_C3H8/m_C3H8 + 10*X_fuel_C4H10_n_butane/m_C4H10); X_fuel_O = 2*m_O*X_fuel_CO2/m_CO2; // Mass balance for all species @@ -131,11 +133,6 @@ equation preserveAspectRatio=false, extent={{-100,-100},{100,100}}, grid={2,2})), - Window( - x=0.03, - y=0.02, - width=0.95, - height=0.95), Icon(coordinateSystem( preserveAspectRatio=false, extent={{-100,-100},{100,100}}, diff --git a/MetroscopeModelingLibrary/Tests/Multifluid/Machines/CombustionChamber.mo b/MetroscopeModelingLibrary/Tests/Multifluid/Machines/CombustionChamber.mo index 045e3ed1..cbd5211f 100644 --- a/MetroscopeModelingLibrary/Tests/Multifluid/Machines/CombustionChamber.mo +++ b/MetroscopeModelingLibrary/Tests/Multifluid/Machines/CombustionChamber.mo @@ -33,14 +33,16 @@ equation source_air.Xi_out = {0.768,0.232,0.0,0.0,0.0}; source_fuel.P_out = P_fuel; - source_fuel.h_out = h_fuel; + source_fuel.T_out = 160 + 273.15; source_fuel.Q_out = - Q_fuel; - source_fuel.X_molar_CH4=0.92; + + source_fuel.X_molar_CH4=0.82; source_fuel.X_molar_C2H6=0.048; source_fuel.X_molar_C3H8=0.005; source_fuel.X_molar_C4H10_n_butane=0.002; source_fuel.X_molar_N2=0.015; source_fuel.X_molar_CO2=0.01; + source_fuel.X_molar_H2=0.1; // Parameters combustion_chamber.Kfr = combustion_chamber_Kfr; diff --git a/MetroscopeModelingLibrary/Utilities/Constants/package.mo b/MetroscopeModelingLibrary/Utilities/Constants/package.mo index 89f9df62..71fcaf56 100644 --- a/MetroscopeModelingLibrary/Utilities/Constants/package.mo +++ b/MetroscopeModelingLibrary/Utilities/Constants/package.mo @@ -38,6 +38,7 @@ package Constants "Stores all constants used in MML" // Atomic/Molecular masses final constant Units.AtomicMass m_H = 1.00798; + final constant Units.AtomicMass m_H2 = m_H*2; final constant Units.AtomicMass m_C = 12.0106; final constant Units.AtomicMass m_O = 15.9994; final constant Units.MolecularMass m_CH4 = m_C + m_H*4; @@ -60,6 +61,27 @@ package Constants "Stores all constants used in MML" // n-Butane C4H10 final constant Real hhv_molar_C4H10 = 2879.63 "kJ/mol"; final constant Real hhv_mass_C4H10 = hhv_molar_C4H10/m_C4H10 "MJ/kg"; + // Hydrogen H2 + final constant Real hhv_molar_H2 = 286.13 "kJ/mol"; + final constant Real hhv_mass_H2 = hhv_molar_H2/m_H2 "MJ/kg"; + + + // Heating values: based on ISO 6976 at 25°C + // Methane CH4 + final constant Real lhv_molar_CH4 = 802.69 "kJ/mol"; + final constant Real lhv_mass_CH4 = lhv_molar_CH4/m_CH4 "MJ/kg"; + // Ethane C2H6 + final constant Real lhv_molar_C2H6 = 1428.83 "kJ/mol"; + final constant Real lhv_mass_C2H6 = lhv_molar_C2H6/m_C2H6 "MJ/kg"; + // Propane C3H8 + final constant Real lhv_molar_C3H8 = 2043.35 "kJ/mol"; + final constant Real lhv_mass_C3H8 = lhv_molar_C3H8/m_C3H8 "MJ/kg"; + // n-Butane C4H10 + final constant Real lhv_molar_C4H10 = 2657.58 "kJ/mol"; + final constant Real lhv_mass_C4H10 = lhv_molar_C4H10/m_C4H10 "MJ/kg"; + // Hydrogen H2 + final constant Real lhv_molar_H2 = 241.72 "kJ/mol"; + final constant Real lhv_mass_H2 = lhv_molar_H2/m_H2 "MJ/kg"; annotation ( Icon(coordinateSystem(extent={{-100.0,-100.0},{100.0,100.0}}), graphics={ diff --git a/MetroscopeModelingLibrary/Utilities/Constants/package.order b/MetroscopeModelingLibrary/Utilities/Constants/package.order index f0bb5020..700b34e6 100644 --- a/MetroscopeModelingLibrary/Utilities/Constants/package.order +++ b/MetroscopeModelingLibrary/Utilities/Constants/package.order @@ -21,6 +21,7 @@ kgs_to_lbs kgs_to_Mlbh kgs_to_lbh m_H +m_H2 m_C m_O m_CH4 @@ -37,3 +38,15 @@ hhv_molar_C3H8 hhv_mass_C3H8 hhv_molar_C4H10 hhv_mass_C4H10 +hhv_molar_H2 +hhv_mass_H2 +lhv_molar_CH4 +lhv_mass_CH4 +lhv_molar_C2H6 +lhv_mass_C2H6 +lhv_molar_C3H8 +lhv_mass_C3H8 +lhv_molar_C4H10 +lhv_mass_C4H10 +lhv_molar_H2 +lhv_mass_H2 diff --git a/MetroscopeModelingLibrary/Utilities/Media/FuelMedium/package.mo b/MetroscopeModelingLibrary/Utilities/Media/FuelMedium/package.mo index 9cab6afe..97e28500 100644 --- a/MetroscopeModelingLibrary/Utilities/Media/FuelMedium/package.mo +++ b/MetroscopeModelingLibrary/Utilities/Media/FuelMedium/package.mo @@ -7,15 +7,17 @@ package FuelMedium Modelica.Media.IdealGases.Common.SingleGasesData.C3H8, Modelica.Media.IdealGases.Common.SingleGasesData.C4H10_n_butane, Modelica.Media.IdealGases.Common.SingleGasesData.N2, - Modelica.Media.IdealGases.Common.SingleGasesData.CO2}, + Modelica.Media.IdealGases.Common.SingleGasesData.CO2, + Modelica.Media.IdealGases.Common.SingleGasesData.H2}, fluidConstants={Modelica.Media.IdealGases.Common.FluidData.CH4, Modelica.Media.IdealGases.Common.FluidData.C2H6, Modelica.Media.IdealGases.Common.FluidData.C3H8, Modelica.Media.IdealGases.Common.FluidData.C4H10_n_butane, Modelica.Media.IdealGases.Common.FluidData.N2, - Modelica.Media.IdealGases.Common.FluidData.CO2}, - substanceNames = {"Methane","Ethane","Propane","N-Butane,","Nitrogen","Carbondioxide"}, - reference_X={0.92,0.048,0.005,0.002,0.015,0.01}) annotation(IconMap(primitivesVisible=false)); + Modelica.Media.IdealGases.Common.FluidData.CO2, + Modelica.Media.IdealGases.Common.FluidData.H2}, + substanceNames = {"Methane","Ethane","Propane","N-Butane,","Nitrogen","Carbondioxide","Hydrogen"}, + reference_X={0.92,0.048,0.005,0.002,0.015,0.01,0.0}) annotation(IconMap(primitivesVisible=false)); annotation (Icon(graphics={ Rectangle(