def build(self): ''' Callable method for Block construction. ''' super(PropertyInterrogatorData, self).build() self._state_block_class = InterrogatorStateBlock # Phase objects # TODO : Allow users to define custom Phase obejcts/phase list self.Liq = LiquidPhase() self.Vap = VaporPhase() # Component objects self.A = Component() self.B = Component() # Set up dict to record property calls self.required_properties = {} # Dummy phase equilibrium definition so we can handle flash cases self.phase_equilibrium_idx = Set(initialize=[1]) self.phase_equilibrium_list = \ {1: ["A", ("Vap", "Liq")]}
def model(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.params = CubicParameterBlock(default={"valid_phase": "Vap"}) m.fs.params.a = Component() m.fs.params.b = Component() m.fs.params.cubic_type = CubicEoS.SRK m.fs.params.gas_const = Param(default=8.314462618) m.fs.params.pressure_crit = Param( m.fs.params.component_list, initialize={'a': 5e6, 'b': 4e6}) m.fs.params.temperature_crit = Param( m.fs.params.component_list, initialize={"a": 500, "b": 600}) m.fs.params.omega = Param( m.fs.params.component_list, initialize={"a": 0.2, "b": 0.2}) m.fs.params.kappa = Param( m.fs.params.component_list, m.fs.params.component_list, initialize={('a', 'a'): 0.0, ('a', 'b'): 0.0, ('b', 'a'): 0.0, ('b', 'b'): 0.0}) return m
def build(self): super(ParameterData, self).build() # all components are in the aqueous phase self.aq = Phase() self.S = Component() self.E = Component() self.C = Component() self.P = Component() self.Solvent = Component() self._state_block_class = AqueousEnzymeStateBlock
def build(self): super(_PhysicalParameterBlock, self).build() self.p1 = Phase() self.p2 = Phase() self.c1 = Component() self.c2 = Component() self.phase_equilibrium_idx = Set(initialize=["e1", "e2"]) self.element_list = Set(initialize=["H", "He", "Li"]) self.element_comp = {"c1": {"H": 1, "He": 2, "Li": 3}, "c2": {"H": 4, "He": 5, "Li": 6}} self.phase_equilibrium_list = \ {"e1": ["c1", ("p1", "p2")], "e2": ["c2", ("p1", "p2")]} # Add inherent reactions for use when needed self.inherent_reaction_idx = Set(initialize=["i1", "i2"]) self.inherent_reaction_stoichiometry = {("i1", "p1", "c1"): 1, ("i1", "p1", "c2"): 1, ("i1", "p2", "c1"): 1, ("i1", "p2", "c2"): 1, ("i2", "p1", "c1"): 1, ("i2", "p1", "c2"): 1, ("i2", "p2", "c1"): 1, ("i2", "p2", "c2"): 1} # Attribute to switch flow basis for testing self.basis_switch = 1 self.default_balance_switch = 1 self._state_block_class = TestStateBlock self.set_default_scaling("flow_vol", 100) self.set_default_scaling("flow_mol", 101) self.set_default_scaling("flow_mol_phase_comp", 102) self.set_default_scaling("test_var", 103) self.set_default_scaling("pressure", 104) self.set_default_scaling("temperature", 105) self.set_default_scaling("enth_mol", 106) self.set_default_scaling("gibbs_mol_phase_comp", 107) self.set_default_scaling("entr_mol", 108) self.set_default_scaling("mole_frac_phase_comp", 109) self.set_default_scaling("enthalpy_flow", 110) self.set_default_scaling("energy_dens", 111) self.set_default_scaling("material_flow_mol", 112) self.set_default_scaling("material_dens_mol", 113) self.set_default_scaling("material_flow_mass", 114) self.set_default_scaling("material_dens_mass", 115)
def build(self): super(_NoPressureParameterBlock, self).build() self.p1 = Phase() self.p2 = Phase() self.c1 = Component() self.c2 = Component() self.phase_equilibrium_idx = Set(initialize=["e1", "e2"]) self.phase_equilibrium_list = \ {"e1": ["c1", ("p1", "p2")], "e2": ["c2", ("p1", "p2")]} self._state_block_class = NoPressureStateBlock
def build(self): ''' Callable method for Block construction. ''' super(PropertyInterrogatorData, self).build() self._state_block_class = InterrogatorStateBlock # Phase objects if self.config.phase_list is None: self.Liq = LiquidPhase() self.Vap = VaporPhase() else: for p, t in self.config.phase_list.items(): if t is None: t = Phase elif not isclass(t) or not issubclass(t, Phase): raise ConfigurationError( f"{self.name} invalid phase type {t} (for phase {p})." f" Type must be a subclass of Phase.") self.add_component(p, t()) # Component objects if self.config.component_list is None: self.A = Component() self.B = Component() else: for j, t in self.config.component_list.items(): if t is None: t = Component elif not isclass(t) or not issubclass(t, Component): raise ConfigurationError( f"{self.name} invalid component type {t} (for " f"component {j}). Type must be a subclass of " f"Component.") self.add_component(j, t()) # Set up dict to record property calls self.required_properties = {} # Dummy phase equilibrium definition so we can handle flash cases self.phase_equilibrium_idx = Set(initialize=[1]) self.phase_equilibrium_list = \ {1: ["A", ("Vap", "Liq")]}
def build(self): ''' Callable method for Block construction. ''' super(ReactionParameterBlock, self).build() self._reaction_block_class = ReactionBlock # Create Phase objects self.Vap = VaporPhase() self.Sol = SolidPhase() # Create Component objects self.CH4 = Component() self.CO2 = Component() self.H2O = Component() self.Fe2O3 = Component() self.Fe3O4 = Component() self.Al2O3 = Component() # Component list subsets self.gas_component_list = Set(initialize=['CO2', 'H2O', 'CH4']) self.sol_component_list = Set(initialize=['Fe2O3', 'Fe3O4', 'Al2O3']) # Reaction Index self.rate_reaction_idx = Set(initialize=["R1"]) # Gas Constant self.gas_const = Param(within=PositiveReals, mutable=False, default=8.314459848e-3, doc='Gas Constant [kJ/mol.K]') # Smoothing factor self.eps = Param(mutable=True, default=1e-8, doc='Smoothing Factor') # Reaction rate scale factor self._scale_factor_rxn = Param(mutable=True, default=1, doc='Scale Factor for reaction eqn.' 'Used to help initialization routine') # Reaction Stoichiometry self.rate_reaction_stoichiometry = { ("R1", "Vap", "CH4"): -1, ("R1", "Vap", "CO2"): 1, ("R1", "Vap", "H2O"): 2, ("R1", "Sol", "Fe2O3"): -12, ("R1", "Sol", "Fe3O4"): 8, ("R1", "Sol", "Al2O3"): 0 } # Reaction stoichiometric coefficient self.rxn_stoich_coeff = Param(self.rate_reaction_idx, default=12, mutable=True, doc='Reaction stoichiometric' 'coefficient [-]') # Standard Heat of Reaction - kJ/mol_rxn dh_rxn_dict = {"R1": 136.5843} self.dh_rxn = Param(self.rate_reaction_idx, initialize=dh_rxn_dict, doc="Heat of reaction [kJ/mol]") # ------------------------------------------------------------------------- """ Reaction properties that can be estimated""" # Particle grain radius within OC particle self.grain_radius = Var(domain=Reals, initialize=2.6e-7, doc='Representative particle grain' 'radius within OC particle [m]') self.grain_radius.fix() # Molar density OC particle self.dens_mol_sol = Var(domain=Reals, initialize=32811, doc='Molar density of OC particle [mol/m^3]') self.dens_mol_sol.fix() # Available volume for reaction - from EPAT report (1-ep)' self.a_vol = Var(domain=Reals, initialize=0.28, doc='Available reaction vol. per vol. of OC') self.a_vol.fix() # Activation Energy self.energy_activation = Var(self.rate_reaction_idx, domain=Reals, initialize=4.9e1, doc='Activation energy [kJ/mol]') self.energy_activation.fix() # Reaction order self.rxn_order = Var(self.rate_reaction_idx, domain=Reals, initialize=1.3, doc='Reaction order in gas species [-]') self.rxn_order.fix() # Pre-exponential factor self.k0_rxn = Var(self.rate_reaction_idx, domain=Reals, initialize=8e-4, doc='Pre-exponential factor' '[mol^(1-N_reaction)m^(3*N_reaction -2)/s]') self.k0_rxn.fix()
def build(self): ''' Callable method for Block construction. ''' super(PhysicalParameterData, self).build() self._state_block_class = SolidPhaseThermoStateBlock # Create Phase object self.Sol = SolidPhase() # Create Component objects self.Fe2O3 = Component() self.Fe3O4 = Component() self.Al2O3 = Component() # ------------------------------------------------------------------------- """ Pure solid component properties""" # Mol. weights of solid components - units = kg/mol. ref: NIST webbook mw_comp_dict = {'Fe2O3': 0.15969, 'Fe3O4': 0.231533, 'Al2O3': 0.10196} self.mw_comp = Param( self.component_list, mutable=False, initialize=mw_comp_dict, doc="Molecular weights of solid components [kg/mol]") # Skeletal density of solid components - units = kg/m3. ref: NIST dens_mass_comp_skeletal_dict = { 'Fe2O3': 5250, 'Fe3O4': 5000, 'Al2O3': 3987 } self.dens_mass_comp_skeletal = Param( self.component_list, mutable=False, initialize=dens_mass_comp_skeletal_dict, doc='Skeletal density of solid components' '[kg/m3]') # Ideal gas spec. heat capacity parameters(Shomate) of # components - ref: NIST webbook. Shomate equations from NIST. # Parameters A-E are used for cp calcs while A-H are used for enthalpy # calc. # 1e3*cp_comp = A + B*T + C*T^2 + D*T^3 + E/(T^2) # where T = Temperature (K)/1000, and cp_comp = (kJ/mol.K) # H_comp = H - H(298.15) = A*T + B*T^2/2 + C*T^3/3 + # D*T^4/4 - E/T + F - H where T = Temp (K)/1000 and H_comp = (kJ/mol) cp_param_dict = { ('Al2O3', 1): 102.4290, ('Al2O3', 2): 38.74980, ('Al2O3', 3): -15.91090, ('Al2O3', 4): 2.628181, ('Al2O3', 5): -3.007551, ('Al2O3', 6): -1717.930, ('Al2O3', 7): 146.9970, ('Al2O3', 8): -1675.690, ('Fe3O4', 1): 200.8320000, ('Fe3O4', 2): 1.586435e-7, ('Fe3O4', 3): -6.661682e-8, ('Fe3O4', 4): 9.452452e-9, ('Fe3O4', 5): 3.18602e-8, ('Fe3O4', 6): -1174.1350000, ('Fe3O4', 7): 388.0790000, ('Fe3O4', 8): -1120.8940000, ('Fe2O3', 1): 110.9362000, ('Fe2O3', 2): 32.0471400, ('Fe2O3', 3): -9.1923330, ('Fe2O3', 4): 0.9015060, ('Fe2O3', 5): 5.4336770, ('Fe2O3', 6): -843.1471000, ('Fe2O3', 7): 228.3548000, ('Fe2O3', 8): -825.5032000 } self.cp_param = Param(self.component_list, range(1, 10), mutable=False, initialize=cp_param_dict, doc="Shomate equation heat capacity parameters") # Std. heat of formation of comp. - units = kJ/(mol comp) - ref: NIST enth_mol_form_comp_dict = { 'Fe2O3': -825.5032, 'Fe3O4': -1120.894, 'Al2O3': -1675.690 } self.enth_mol_form_comp = Param( self.component_list, mutable=False, initialize=enth_mol_form_comp_dict, doc="Component molar heats of formation [kJ/mol]") # ------------------------------------------------------------------------- """ Mixed solid properties""" # These are setup as fixed vars to allow for parameter estimation # Particle size self.particle_dia = Var(domain=Reals, initialize=1.5e-3, doc='Diameter of solid particles [m]') self.particle_dia.fix() # TODO -provide reference # Minimum fluidization velocity - EPAT value used for Davidson model self.velocity_mf = Var(domain=Reals, initialize=0.039624, doc='Velocity at minimum fluidization [m/s]') self.velocity_mf.fix() # Minimum fluidization voidage - educated guess as rough # estimate from ergun equation results (0.4) are suspicious self.voidage_mf = Var(domain=Reals, initialize=0.45, doc='Voidage at minimum fluidization [-]') self.voidage_mf.fix() # Particle thermal conductivity self.therm_cond_sol = Var(domain=Reals, initialize=12.3e-3, doc='Thermal conductivity of solid' 'particles [kJ/m.K.s]') self.therm_cond_sol.fix()
def build(self): ''' Callable method for Block construction. ''' ''' Create Component objects components created using the component class are added to the component_list object which is used by the framework ''' super(PhysicalParameterData, self).build() if (self.config.process_type == ProcessType.stripper): self.CO2 = Component() self.H2O = Component() elif (self.config.process_type == ProcessType.absorber): self.CO2 = Component() self.H2O = Component() self.O2 = Component() self.N2 = Component() self._state_block_class = VaporStateBlock # Create Phase object self.Vap = VaporPhase() # Thermodynamic reference state self.pressure_ref = Param(within=PositiveReals, mutable=True, default=101325, units=pyunits.Pa, doc='Reference pressure ') self.temperature_ref = Param(default=298.15, units=pyunits.K, doc='Thermodynamic Reference Temperature [K]') # Mol. weights of vapor component - units = kg/mol. mw_comp_dict_all = {'CO2': 0.04401, 'H2O': 0.01802, 'O2': 0.032, 'N2': 0.02801} mw_comp_dict = {} for i in self.component_list: mw_comp_dict[i] = mw_comp_dict_all[i] self.mw_comp = Param( self.component_list, mutable=False, initialize=mw_comp_dict, units=pyunits.kg / pyunits.mol, doc="Molecular weights of vapor components") # from Van Ness, J. Smith (appendix C): CO2,N2,O2,WATER # cpig/R = A + BT + CT^-2 # unit depends on unit of gas constant(J/mol.K) cp_param_dict_all = { ('O2', 1): 3.639 * CONST.gas_constant, ('O2', 2): 0.506E-3 * CONST.gas_constant, ('O2', 3): -0.227E5 * CONST.gas_constant, ('CO2', 1): 5.457 * CONST.gas_constant, ('CO2', 2): 1.045E-3 * CONST.gas_constant, ('CO2', 3): -1.157E5 * CONST.gas_constant, ('H2O', 1): 3.47 * CONST.gas_constant, ('H2O', 2): 1.45E-3 * CONST.gas_constant, ('H2O', 3): 0.121E5 * CONST.gas_constant, ('N2', 1): 3.28 * CONST.gas_constant, ('N2', 2): 0.593E-3 * CONST.gas_constant, ('N2', 3): 0.04E5 * CONST.gas_constant } cp_param_dict = {} for i in self.component_list: for j in [1, 2, 3]: cp_param_dict[i, j] = cp_param_dict_all[i, j] self.cp_param = Param(self.component_list, range(1, 4), mutable=False, initialize=cp_param_dict, units=pyunits.J / (pyunits.mol * pyunits.K), doc="Ideal gas heat capacity parameters") # Viscosity constants #CO2 & H2O # calculated from :C1*T^(C2)/(1+C3/T) # Reference: Perry and Green Handbook; McGraw Hill,8th edition 2008 #O2 & N2 # calculated from Sutherland Formular # C1*(C2 + C3)/(T+C3)*(T/C2)^1.5: # constants C1,C2,C3 in sutherlands' formular are: #C1 = vis_d_ref #C2 = temperature_ref # C3 = sutherland constant visc_d_param_dict_all = { ('N2', 1): 0.01781e-3, ('N2', 2): 300.55, ('N2', 3): 111, ('O2', 1): 0.02018e-3, ('O2', 2): 292.25, ('O2', 3): 127, ('CO2', 1): 2.148e-6, ('CO2', 2): 0.46, ('CO2', 3): 290, ('H2O', 1): 1.7096e-8, ('H2O', 2): 1.1146, ('H2O', 3): 0.0 } visc_d_param_dict = {} for i in self.component_list: for j in [1, 2, 3]: visc_d_param_dict[i, j] = visc_d_param_dict_all[i, j] self.visc_d_param = Param(self.component_list, range(1, 4), mutable=True, initialize=visc_d_param_dict, units=pyunits.Pa * pyunits.s, doc="Dynamic viscosity constants") # Thermal conductivity constants - # Reference: Perry and Green Handbook; McGraw Hill, 8th edition 2008 therm_cond_param_dict_all = {('N2', 1): 0.000331, ('N2', 2): 0.7722, ('N2', 3): 16.323, ('N2', 4): 373.72, ('CO2', 1): 3.69, ('CO2', 2): -0.3838, ('CO2', 3): 964, ('CO2', 4): 1.86e6, ('H2O', 1): 6.204e-6, ('H2O', 2): 1.3973, ('H2O', 3): 0, ('H2O', 4): 0, ('O2', 1): 0.00045, ('O2', 2): 0.7456, ('O2', 3): 56.699, ('O2', 4): 0.0} therm_cond_param_dict = {} for i in self.component_list: for j in [1, 2, 3, 4]: therm_cond_param_dict[i, j] = therm_cond_param_dict_all[i, j] self.therm_cond_param = Param(self.component_list, range(1, 5), mutable=True, initialize=therm_cond_param_dict, units=pyunits.W / pyunits.m / pyunits.K, doc="Thermal conductivity constants") # Diffusion Coefficient(binary) constants - # Diffusion volumes in Fuller-Schettler-Giddings correlation # for estimating binary diffusivities of components in vapor phase # Reference: Table 3.1 pp 71 Seader Henley (2006) diffus_binary_param_dict_all = { 'N2': 18.5, 'CO2': 26.7, 'H2O': 13.1, 'O2': 16.3} diffus_binary_param_dict = {} for i in self.component_list: diffus_binary_param_dict[i] = diffus_binary_param_dict_all[i] self.diffus_binary_param = \ Param(self.component_list, initialize=diffus_binary_param_dict, units=pyunits.m**2 / pyunits.s, doc="Diffusion volume parameter for binary diffusivity")
def build(self): ''' Callable method for Block construction. ''' super(PhysicalParameterData, self).build() self._state_block_class = GasPhaseStateBlock # Create Phase object self.Vap = VaporPhase() # Create Component objects self.CH4 = Component() self.CO2 = Component() self.H2O = Component() # Gas Constant self.gas_const = Param(within=PositiveReals, default=8.314459848e-3, doc='Gas Constant [kJ/mol.K]', units=pyunits.kJ / pyunits.mol / pyunits.K) # ------------------------------------------------------------------------- """ Pure gas component properties""" # Mol. weights of gas - units = kg/mol. ref: NIST webbook mw_comp_dict = {'CH4': 0.016, 'CO2': 0.044, 'H2O': 0.018} self.mw_comp = Param( self.component_list, mutable=False, initialize=mw_comp_dict, doc="Molecular weights of gas components [kg/mol]", units=pyunits.kg / pyunits.mol) # Std. heat of formation of comp. - units = kJ/(mol comp) - ref: NIST enth_mol_form_comp_dict = { 'CH4': -74.8731, 'CO2': -393.5224, 'H2O': -241.8264 } self.enth_mol_form_comp = Param( self.component_list, mutable=False, initialize=enth_mol_form_comp_dict, doc="Component molar heats of formation [kJ/mol]", units=pyunits.kJ / pyunits.mol) # Ideal gas spec. heat capacity parameters(Shomate) of # components - ref: NIST webbook. Shomate equations from NIST. # Parameters A-E are used for cp calcs while A-H are used for enthalpy # calc. # 1e3*cp_comp = A + B*T + C*T^2 + D*T^3 + E/(T^2) # where T = Temperature (K)/1000, and cp_comp = (kJ/mol.K) # H_comp = H - H(298.15) = A*T + B*T^2/2 + C*T^3/3 + # D*T^4/4 - E/T + F - H where T = Temp (K)/1000 and H_comp = (kJ/mol) cp_param_dict = { ('CH4', 1): -0.7030290, ('CH4', 2): 108.4773000, ('CH4', 3): -42.5215700, ('CH4', 4): 5.8627880, ('CH4', 5): 0.6785650, ('CH4', 6): -76.8437600, ('CH4', 7): 158.7163000, ('CH4', 8): -74.8731000, ('CO2', 1): 24.9973500, ('CO2', 2): 55.1869600, ('CO2', 3): -33.6913700, ('CO2', 4): 7.9483870, ('CO2', 5): -0.1366380, ('CO2', 6): -403.6075000, ('CO2', 7): 228.2431000, ('CO2', 8): -393.5224000, ('H2O', 1): 30.0920000, ('H2O', 2): 6.8325140, ('H2O', 3): 6.7934350, ('H2O', 4): -2.5344800, ('H2O', 5): 0.0821390, ('H2O', 6): -250.8810000, ('H2O', 7): 223.3967000, ('H2O', 8): -241.8264000 } self.cp_param = Param(self.component_list, range(1, 10), mutable=False, initialize=cp_param_dict, doc="Shomate equation heat capacity parameters") # Viscosity constants: # Reference: Perry and Green Handbook; McGraw Hill, 2008 visc_d_param_dict = { ('CH4', 1): 5.2546e-7, ('CH4', 2): 0.59006, ('CH4', 3): 105.67, ('CH4', 4): 0, ('CO2', 1): 2.148e-6, ('CO2', 2): 0.46, ('CO2', 3): 290, ('CO2', 4): 0, ('H2O', 1): 1.7096e-8, ('H2O', 2): 1.1146, ('H2O', 3): 0, ('H2O', 4): 0 } self.visc_d_param = Param(self.component_list, range(1, 10), mutable=True, initialize=visc_d_param_dict, doc="Dynamic viscosity constants") # Thermal conductivity constants: # Reference: Perry and Green Handbook; McGraw Hill, 2008 therm_cond_param_dict = { ('CH4', 1): 8.3983e-6, ('CH4', 2): 1.4268, ('CH4', 3): -49.654, ('CH4', 4): 0, ('CO2', 1): 3.69, ('CO2', 2): -0.3838, ('CO2', 3): 964, ('CO2', 4): 1.86e6, ('H2O', 1): 6.204e-6, ('H2O', 2): 1.3973, ('H2O', 3): 0, ('H2O', 4): 0 } self.therm_cond_param = Param(self.component_list, range(1, 10), mutable=True, initialize=therm_cond_param_dict, doc="Thermal conductivity constants") # Component diffusion volumes: # Ref: (1) Prop gas & liquids (2) Fuller et al. IECR, 58(5), 19, 1966 diff_vol_param_dict = {'CH4': 24.42, 'CO2': 26.9, 'H2O': 13.1} self.diff_vol_param = Param(self.component_list, mutable=True, initialize=diff_vol_param_dict, doc="Component diffusion volumes")
def build(self): ''' Callable method for Block construction. ''' super(ETOHParameterData, self).build() self._state_block_class = IdealStateBlock self.ethanol = Component() self.water = Component() self.CO2 = Component() #self.hydrogen = Component() self.Liq = LiquidPhase() self.Vap = VaporPhase() # List of components in each phase (optional) self.phase_comp = { "Liq": self.component_list, "Vap": self.component_list } # List of phase equilibrium index self.phase_equilibrium_idx = Set(initialize=[1, 2, 3]) self.phase_equilibrium_list = \ {1: ["ethanol", ("Vap", "Liq")], # 2: ["water", ("Vap", "Liq")], 3: ["CO2", ("Vap", "Liq")]} #4: ["methane", ("Vap", "Liq")], #5: ["diphenyl", ("Vap", "Liq")]} # Thermodynamic reference state self.pressure_ref = Param(mutable=True, default=101325, doc='Reference pressure [Pa]') self.temperature_ref = Param(mutable=True, default=298.15, doc='Reference temperature [K]') # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid pressure_crit_data = {'ethanol': 63e5, 'water': 220.5e5, 'CO2': 73.8e5} self.pressure_crit = Param(self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(pressure_crit_data), doc='Critical pressure [Pa]') # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid temperature_crit_data = { 'ethanol': 515.15, 'water': 647.15, 'CO2': 304.34 } self.temperature_crit = Param( self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(temperature_crit_data), doc='Critical temperature [K]') # Gas Constant self.gas_const = Param(within=NonNegativeReals, mutable=False, default=8.314, doc='Gas Constant [J/mol.K]') # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid mw_comp_data = { 'ethanol': 46.07E-3, 'water': 18.02E-3, 'CO2': 44.01e-3 } self.mw_comp = Param(self.component_list, mutable=False, initialize=extract_data(mw_comp_data), doc="molecular weight Kg/mol") # Constants for liquid densities # Source: Perry's Chemical Engineers Handbook # - Robert H. Perry (Cp_liq) dens_liq_data = { ('ethanol', '1'): 1.048, #todo ('ethanol', '2'): 0.27627, ('ethanol', '3'): 513.92, ('ethanol', '4'): 0.2331, ('water', '1'): 5.459, ('water', '2'): 0.30542, ('water', '3'): 647.13, ('water', '4'): 0.081, ('CO2', '1'): 2.768, ('CO2', '2'): 0.26212, ('CO2', '3'): 304.21, ('CO2', '4'): 0.2908 } self.dens_liq_params = Param( self.component_list, ['1', '2', '3', '4'], mutable=False, initialize=extract_data(dens_liq_data), doc="Parameters to compute liquid densities") # Boiling point at standard pressure # Source: Perry's Chemical Engineers Handbook # - Robert H. Perry (Cp_liq) bp_data = {('ethanol'): 351.52, ('water'): 373.15, ('CO2'): 194.69} self.temperature_boil = Param( self.component_list, mutable=False, initialize=extract_data(bp_data), doc="Pure component boiling points at standard pressure [K]") # Constants for specific heat capacity, enthalpy # Sources: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid # Perry's Chemical Engineers Handbook # - Robert H. Perry (Cp_liq) # Unit: J/kmol-K cp_ig_data = { ('Liq', 'ethanol', '1'): 1.2064E5, #todo ('Liq', 'ethanol', '2'): -1.3963E2, ('Liq', 'ethanol', '3'): -3.0341E-2, ('Liq', 'ethanol', '4'): 2.0386E-3, ('Liq', 'ethanol', '5'): 0, ('Vap', 'ethanol', '1'): 36.548344E3, ('Vap', 'ethanol', '2'): 5.221192, ('Vap', 'ethanol', '3'): 0.46109444, ('Vap', 'ethanol', '4'): -0.000583975, ('Vap', 'ethanol', '5'): 2.20986E-07, ('Liq', 'water', '1'): 2.7637E5, #reference: toluene 1.40e5 ('Liq', 'water', '2'): -2.0901E3, ('Liq', 'water', '3'): 8.1250, ('Liq', 'water', '4'): -1.4116E-2, ('Liq', 'water', '5'): 9.3701E-6, ('Vap', 'water', '1'): 3.654E4, ('Vap', 'water', '2'): -34.802404, ('Vap', 'water', '3'): -0.1168117, ('Vap', 'water', '4'): -0.000130031, ('Vap', 'water', '5'): 5.25445E-08, ('Liq', 'CO2', '1'): -8.3043E6, # 6.6653e1, ('Liq', 'CO2', '2'): 1.0437E5, # 6.7659e3, ('Liq', 'CO2', '3'): -4.3333E2, # -1.2363e2, ('Liq', 'CO2', '4'): 6.0042E-1, # 4.7827e2, # Eqn 2 ('Liq', 'CO2', '5'): 0, ('Vap', 'CO2', '1'): 27095.326, ('Vap', 'CO2', '2'): 11.273784, ('Vap', 'CO2', '3'): 0.12487628, ('Vap', 'CO2', '4'): -0.000197374, ('Vap', 'CO2', '5'): 8.77958E-08 } self.cp_ig = Param(self.phase_list, self.component_list, ['1', '2', '3', '4', '5'], mutable=False, initialize=extract_data(cp_ig_data), doc="parameters to compute Cp_comp") # Source: NIST # fitted to Antoine form # Unit: Pvp [bar] -> unit conversion later pressure_sat_coeff_data = { ('ethanol', 'A'): 5.24677, ('ethanol', 'B'): 1598.673, ('ethanol', 'C'): -46.424, ('water', 'A'): 5.40221, ('water', 'B'): 1838.675, ('water', 'C'): -31.737, ('CO2', 'A'): 6.812, ('CO2', 'B'): 1302, ('CO2', 'C'): -3.494 } self.pressure_sat_coeff = Param( self.component_list, ['A', 'B', 'C'], mutable=False, initialize=extract_data(pressure_sat_coeff_data), doc="parameters to compute Cp_comp") # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid dh_vap = {'ethanol': 42.4e3, 'water': 43.86e3, 'CO2': 16.5e3} self.dh_vap = Param(self.component_list, mutable=False, initialize=extract_data(dh_vap), doc="heat of vaporization")
def build(self): ''' Callable method for Block construction. ''' super(PhysicalParameterData, self).build() self._state_block_class = GasPhaseStateBlock # Create Phase object self.Vap = VaporPhase() # Create Component objects self.N2 = Component() self.O2 = Component() self.CO2 = Component() self.H2O = Component() # Gas Constant self.gas_const = Param(within=PositiveReals, default=8.314459848e-3, doc='Gas Constant [kJ/mol.K]', units=pyunits.kJ / pyunits.mol / pyunits.K) # Mol. weights of gas - units = kg/mol. ref: NIST webbook mw_comp_dict = {'O2': 0.032, 'N2': 0.028, 'CO2': 0.044, 'H2O': 0.018} self.mw_comp = Param( self.component_list, mutable=False, initialize=mw_comp_dict, doc="Molecular weights of gas components [kg/mol]", units=pyunits.kg / pyunits.mol) # Std. heat of formation of comp. - units = kJ/(mol comp) - ref: NIST enth_mol_form_comp_dict = { 'O2': 0, 'N2': 0, 'CO2': -393.5224, 'H2O': -241.8264 } self.enth_mol_form_comp = Param( self.component_list, mutable=False, initialize=enth_mol_form_comp_dict, doc="Component molar heats of formation [kJ/mol]", units=pyunits.kJ / pyunits.mol) # Ideal gas spec. heat capacity parameters(Shomate) of # components - ref: NIST webbook. Shomate equations from NIST. # Parameters A-E are used for cp calcs while A-H are used for enthalpy # calc. # 1e3*cp_comp = A + B*T + C*T^2 + D*T^3 + E/(T^2) # where T = Temperature (K)/1000, and cp_comp = (kJ/mol.K) # H_comp = H - H(298.15) = A*T + B*T^2/2 + C*T^3/3 + # D*T^4/4 - E/T + F - H where T = Temp (K)/1000 and H_comp = (kJ/mol) cp_param_dict = { ('O2', 1): 30.03235, ('O2', 2): 8.772972, ('O2', 3): -3.988133, ('O2', 4): 0.788313, ('O2', 5): -0.741599, ('O2', 6): -11.32468, ('O2', 7): 236.1663, ('O2', 8): 0.0000, ('N2', 1): 19.50583, ('N2', 2): 19.88705, ('N2', 3): -8.598535, ('N2', 4): 1.369784, ('N2', 5): 0.527601, ('N2', 6): -4.935202, ('N2', 7): 212.3900, ('N2', 8): 0.0000, ('CO2', 1): 24.9973500, ('CO2', 2): 55.1869600, ('CO2', 3): -33.6913700, ('CO2', 4): 7.9483870, ('CO2', 5): -0.1366380, ('CO2', 6): -403.6075000, ('CO2', 7): 228.2431000, ('CO2', 8): -393.5224000, ('H2O', 1): 30.0920000, ('H2O', 2): 6.8325140, ('H2O', 3): 6.7934350, ('H2O', 4): -2.5344800, ('H2O', 5): 0.0821390, ('H2O', 6): -250.8810000, ('H2O', 7): 223.3967000, ('H2O', 8): -241.8264000 } self.cp_param = Param(self.component_list, range(1, 10), mutable=False, initialize=cp_param_dict, doc="Shomate equation heat capacity parameters") # Viscosity constants: # Reference: Perry and Green Handbook; McGraw Hill, 2008 visc_d_param_dict = { ('O2', 1): 1.101e-6, ('O2', 2): 0.5634, ('O2', 3): 96.3, ('O2', 4): 0, ('N2', 1): 6.5592e-7, ('N2', 2): 0.6081, ('N2', 3): 54.714, ('N2', 4): 0, ('CO2', 1): 2.148e-6, ('CO2', 2): 0.46, ('CO2', 3): 290, ('CO2', 4): 0, ('H2O', 1): 1.7096e-8, ('H2O', 2): 1.1146, ('H2O', 3): 0, ('H2O', 4): 0 } self.visc_d_param = Param(self.component_list, range(1, 10), mutable=True, initialize=visc_d_param_dict, doc="Dynamic viscosity constants") # Thermal conductivity constants: # Reference: Perry and Green Handbook; McGraw Hill, 2008 therm_cond_param_dict = { ('N2', 1): 3.3143e-4, ('N2', 2): 0.7722, ('N2', 3): 16.323, ('N2', 4): 0, ('O2', 1): 4.4994e-4, ('O2', 2): 0.7456, ('O2', 3): 56.699, ('O2', 4): 0, ('CO2', 1): 3.69, ('CO2', 2): -0.3838, ('CO2', 3): 964, ('CO2', 4): 1.86e6, ('H2O', 1): 6.204e-6, ('H2O', 2): 1.3973, ('H2O', 3): 0, ('H2O', 4): 0 } self.therm_cond_param = Param(self.component_list, range(1, 10), mutable=True, initialize=therm_cond_param_dict, doc="Thermal conductivity constants") # Component diffusion volumes: # Ref: (1) Prop gas & liquids (2) Fuller et al. IECR, 58(5), 19, 1966 diff_vol_param_dict = { 'O2': 16.6, 'N2': 17.9, 'CO2': 26.9, 'H2O': 13.1 } self.diff_vol_param = Param(self.component_list, mutable=True, initialize=diff_vol_param_dict, doc="Component diffusion volumes") self._eps = Param(initialize=1e-8, doc="Smooth abs reformulation parameter")
def build(self): ''' Callable method for Block construction. ''' super(PhysicalParameterData, self).build() self._state_block_class = GasPhaseStateBlock # Create Phase object self.Vap = VaporPhase() # Create Component objects self.CH4 = Component() self.CO2 = Component() self.H2O = Component() # ------------------------------------------------------------------------- """ Pure gas component properties""" # Mol. weights of gas - units = kg/mol. ref: NIST webbook mw_comp_dict = {'CH4': 0.016, 'CO2': 0.044, 'H2O': 0.018} # Molecular weight should be defined in default units # (default mass units)/(default amount units) # per the define_meta.add_default_units method below self.mw_comp = Param( self.component_list, mutable=False, initialize=mw_comp_dict, doc="Molecular weights of gas components [kg/mol]", units=pyunits.kg / pyunits.mol) # Std. heat of formation of comp. - units = J/(mol comp) - ref: NIST enth_mol_form_comp_dict = { 'CH4': -74.8731E3, 'CO2': -393.5224E3, 'H2O': -241.8264E3 } self.enth_mol_form_comp = Param( self.component_list, mutable=False, initialize=enth_mol_form_comp_dict, doc="Component molar heats of formation [J/mol]", units=pyunits.J / pyunits.mol) # Ideal gas spec. heat capacity parameters(Shomate) of # components - ref: NIST webbook. Shomate equations from NIST. # Parameters A-E are used for cp calcs while A-H are used for enthalpy # calc. # cp_comp = A + B*T + C*T^2 + D*T^3 + E/(T^2) # where T = Temperature (K)/1000, and cp_comp = (J/mol.K) # H_comp = H - H(298.15) = A*T + B*T^2/2 + C*T^3/3 + # D*T^4/4 - E/T + F - H where T = Temp (K)/1000 and H_comp = (kJ/mol) cp_param_dict = { ('CH4', 1): -0.7030290, ('CH4', 2): 108.4773000, ('CH4', 3): -42.5215700, ('CH4', 4): 5.8627880, ('CH4', 5): 0.6785650, ('CH4', 6): -76.8437600, ('CH4', 7): 158.7163000, ('CH4', 8): -74.8731000, ('CO2', 1): 24.9973500, ('CO2', 2): 55.1869600, ('CO2', 3): -33.6913700, ('CO2', 4): 7.9483870, ('CO2', 5): -0.1366380, ('CO2', 6): -403.6075000, ('CO2', 7): 228.2431000, ('CO2', 8): -393.5224000, ('H2O', 1): 30.0920000, ('H2O', 2): 6.8325140, ('H2O', 3): 6.7934350, ('H2O', 4): -2.5344800, ('H2O', 5): 0.0821390, ('H2O', 6): -250.8810000, ('H2O', 7): 223.3967000, ('H2O', 8): -241.8264000 } self.cp_param_1 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 1}, doc="Shomate equation heat capacity coeff 1", units=pyunits.J / pyunits.mol / pyunits.K) self.cp_param_2 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 2}, doc="Shomate equation heat capacity coeff 2", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK) self.cp_param_3 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 3}, doc="Shomate equation heat capacity coeff 3", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK**2) self.cp_param_4 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 4}, doc="Shomate equation heat capacity coeff 4", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK**3) self.cp_param_5 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 5}, doc="Shomate equation heat capacity coeff 5", units=pyunits.J / pyunits.mol / pyunits.K * pyunits.kK**2) self.cp_param_6 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 6}, doc="Shomate equation heat capacity coeff 6", units=pyunits.kJ / pyunits.mol) self.cp_param_7 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 7}, doc="Shomate equation heat capacity coeff 7", units=pyunits.J / pyunits.mol / pyunits.K) self.cp_param_8 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 8}, doc="Shomate equation heat capacity coeff 8", units=pyunits.kJ / pyunits.mol) # Viscosity constants: # Reference: Perry and Green Handbook; McGraw Hill, 2008 visc_d_param_dict = { ('CH4', 1): 5.2546e-7, ('CH4', 2): 0.59006, ('CH4', 3): 105.67, ('CH4', 4): 0, ('CO2', 1): 2.148e-6, ('CO2', 2): 0.46, ('CO2', 3): 290, ('CO2', 4): 0, ('H2O', 1): 1.7096e-8, ('H2O', 2): 1.1146, ('H2O', 3): 0, ('H2O', 4): 0 } self.visc_d_param_1 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in visc_d_param_dict.items() if j == 1 }, doc="Dynamic viscosity constants", units=pyunits.kg / pyunits.m / pyunits.s) # The units of parameter 1 are dependent upon the value of parameter 2: # [visc_d_param_1] = kg/m-s * K^(-(value([visc_d_param_2))) # this is accounted for in the equation on line 655 self.visc_d_param_2 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in visc_d_param_dict.items() if j == 2 }, doc="Dynamic viscosity constants", units=pyunits.dimensionless) self.visc_d_param_3 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in visc_d_param_dict.items() if j == 3 }, doc="Dynamic viscosity constants", units=pyunits.K) self.visc_d_param_4 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in visc_d_param_dict.items() if j == 4 }, doc="Dynamic viscosity constants", units=pyunits.K**2) # Thermal conductivity constants: # Reference: Perry and Green Handbook; McGraw Hill, 2008 therm_cond_param_dict = { ('CH4', 1): 8.3983e-6, ('CH4', 2): 1.4268, ('CH4', 3): -49.654, ('CH4', 4): 0, ('CO2', 1): 3.69, ('CO2', 2): -0.3838, ('CO2', 3): 964, ('CO2', 4): 1.86e6, ('H2O', 1): 6.204e-6, ('H2O', 2): 1.3973, ('H2O', 3): 0, ('H2O', 4): 0 } self.therm_cond_param_1 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in therm_cond_param_dict.items() if j == 1 }, doc="Dynamic viscosity constants", units=pyunits.J / pyunits.m / pyunits.s) # The units of parameter 1 are dependent upon the value of parameter 2: # [therm_cond_param_1] = J/m-s * K^(-(1 + value([therm_cond_param_2))) # this is accounted for in the equation on line 734 self.therm_cond_param_2 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in therm_cond_param_dict.items() if j == 2 }, doc="Dynamic viscosity constants", units=pyunits.dimensionless) self.therm_cond_param_3 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in therm_cond_param_dict.items() if j == 3 }, doc="Dynamic viscosity constants", units=pyunits.K) self.therm_cond_param_4 = Param( self.component_list, mutable=True, initialize={ k: v for (k, j), v in therm_cond_param_dict.items() if j == 4 }, doc="Dynamic viscosity constants", units=pyunits.K**2) # Component diffusion volumes: # Ref: (1) Prop gas & liquids (2) Fuller et al. IECR, 58(5), 19, 1966 diff_vol_param_dict = {'CH4': 24.42, 'CO2': 26.9, 'H2O': 13.1} self.diff_vol_param = Param(self.component_list, mutable=True, initialize=diff_vol_param_dict, doc="Component diffusion volumes", units=pyunits.dimensionless) # Set default scaling for comp in self.component_list: self.set_default_scaling("mole_frac_comp", 1e2, index=comp) self.set_default_scaling("visc_d", 1e4) self.set_default_scaling("therm_cond", 1e2)
def build(self): ''' Callable method for Block construction. ''' super(HDAParameterData, self).build() self._state_block_class = HDAStateBlock self.benzene = Component() self.toluene = Component() self.methane = Component() self.hydrogen = Component() self.diphenyl = Component() self.Vap = VaporPhase() # Thermodynamic reference state self.pressure_ref = Param(mutable=True, default=101325, units=pyunits.Pa, doc='Reference pressure') self.temperature_ref = Param(mutable=True, default=298.15, units=pyunits.K, doc='Reference temperature') # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid self.mw_comp = Param(self.component_list, mutable=False, initialize={'benzene': 78.1136E-3, 'toluene': 92.1405E-3, 'hydrogen': 2.016e-3, 'methane': 16.043e-3, 'diphenyl': 154.212e-4}, units=pyunits.kg/pyunits.mol, doc="Molecular weight") # Constants for specific heat capacity, enthalpy # Sources: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid self.cp_mol_ig_comp_coeff_A = Var( self.component_list, initialize={"benzene": -3.392E1, "toluene": -2.435E1, "hydrogen": 2.714e1, "methane": 1.925e1, "diphenyl": -9.707e1}, units=pyunits.J/pyunits.mol/pyunits.K, doc="Parameter A for ideal gas molar heat capacity") self.cp_mol_ig_comp_coeff_A.fix() self.cp_mol_ig_comp_coeff_B = Var( self.component_list, initialize={"benzene": 4.739E-1, "toluene": 5.125E-1, "hydrogen": 9.274e-3, "methane": 5.213e-2, "diphenyl": 1.106e0}, units=pyunits.J/pyunits.mol/pyunits.K**2, doc="Parameter B for ideal gas molar heat capacity") self.cp_mol_ig_comp_coeff_B.fix() self.cp_mol_ig_comp_coeff_C = Var( self.component_list, initialize={"benzene": -3.017E-4, "toluene": -2.765E-4, "hydrogen": -1.381e-5, "methane": -8.855e-4, "diphenyl": -8.855e-4}, units=pyunits.J/pyunits.mol/pyunits.K**3, doc="Parameter C for ideal gas molar heat capacity") self.cp_mol_ig_comp_coeff_C.fix() self.cp_mol_ig_comp_coeff_D = Var( self.component_list, initialize={"benzene": 7.130E-8, "toluene": 4.911E-8, "hydrogen": 7.645e-9, "methane": -1.132e-8, "diphenyl": 2.790e-7}, units=pyunits.J/pyunits.mol/pyunits.K**4, doc="Parameter D for ideal gas molar heat capacity") self.cp_mol_ig_comp_coeff_D.fix() # Source: NIST Webook, https://webbook.nist.gov/, retrieved 11/3/2020 self.enth_mol_form_vap_comp_ref = Var( self.component_list, initialize={"benzene": -82.9e3, "toluene": -50.1e3, "hydrogen": 0, "methane": -75e3, "diphenyl": -180e3}, units=pyunits.J/pyunits.mol, doc="Standard heat of formation at reference state") self.enth_mol_form_vap_comp_ref.fix()
def build(self): """ Add contents to the block.""" super(FlueGasParameterData, self).build() self._state_block_class = FlueGasStateBlock # Create Component objects self.N2 = Component() self.O2 = Component() self.NO = Component() self.CO2 = Component() self.H2O = Component() self.SO2 = Component() # Create Phase object self.Vap = VaporPhase() # Molecular weight self.mw_comp = Param(self.component_list, initialize={ 'O2': 0.031998, 'N2': 0.0280134, 'NO': 0.0300057, 'CO2': 0.04401, 'H2O': 0.01801528, 'SO2': 0.0640588 }, doc='Molecular Weight [kg/mol]') # Thermodynamic reference state self.pressure_ref = Param(within=PositiveReals, default=1.01325e5, doc='Reference pressure [Pa]') self.temperature_ref = Param(within=PositiveReals, default=298.15, doc='Reference temperature [K]') # Critical Properties self.pressure_crit = Param(self.component_list, within=PositiveReals, initialize={ 'O2': 50.45985e5, 'N2': 33.943875e5, 'NO': 64.85e5, 'CO2': 73.8e5, 'H2O': 220.64e5, 'SO2': 7.883e6 }, doc='Critical pressure [Pa]') self.temperature_crit = Param(self.component_list, within=PositiveReals, initialize={ 'O2': 154.58, 'N2': 126.19, 'NO': 180.0, 'CO2': 304.18, 'H2O': 647, 'SO2': 430.8 }, doc='Critical temperature [K]') # Constants for specific heat capacity, enthalpy, and entropy # calculations for ideal gas (from NIST 01/08/2020 # https://webbook.nist.gov/cgi/cbook.cgi?ID=C7727379&Units=SI&Mask=1#Thermo-Gas) cp_mol_ig_comp_coeff_parameter_table = { ('A', 'N2'): 19.50583, ('B', 'N2'): 19.88705, ('C', 'N2'): -8.598535, ('D', 'N2'): 1.369784, ('E', 'N2'): 0.527601, ('F', 'N2'): -4.935202, ('G', 'N2'): 212.39, ('H', 'N2'): 0, ('A', 'O2'): 30.03235, ('B', 'O2'): 8.772972, ('C', 'O2'): -3.98813, ('D', 'O2'): 0.788313, ('E', 'O2'): -0.7416, ('F', 'O2'): -11.3247, ('G', 'O2'): 236.1663, ('H', 'O2'): 0, ('A', 'CO2'): 24.99735, ('B', 'CO2'): 55.18696, ('C', 'CO2'): -33.69137, ('D', 'CO2'): 7.948387, ('E', 'CO2'): -0.136638, ('F', 'CO2'): -403.6075, ('G', 'CO2'): 228.2431, ('H', 'CO2'): -393.5224, ('A', 'H2O'): 30.092, ('B', 'H2O'): 6.832514, ('C', 'H2O'): 6.793435, ('D', 'H2O'): -2.53448, ('E', 'H2O'): 0.082139, ('F', 'H2O'): -250.881, ('G', 'H2O'): 223.3967, ('H', 'H2O'): -241.8264, ('A', 'NO'): 23.83491, ('B', 'NO'): 12.58878, ('C', 'NO'): -1.139011, ('D', 'NO'): -1.497459, ('E', 'NO'): 0.214194, ('F', 'NO'): 83.35783, ('G', 'NO'): 237.1219, ('H', 'NO'): 90.29114, ('A', 'SO2'): 21.43049, ('B', 'SO2'): 74.35094, ('C', 'SO2'): -57.75217, ('D', 'SO2'): 16.35534, ('E', 'SO2'): 0.086731, ('F', 'SO2'): -305.7688, ('G', 'SO2'): 254.8872, ('H', 'SO2'): -296.8422 } # cp_mol_ig_comp_coeff units: J/(gmol-K) self.cp_mol_ig_comp_coeff = Param( ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'], self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_table, doc='Constants for spec. heat capacity for ideal ' 'gas J/(gmol-K)') # Vapor pressure coefficients, currently uses N2 data for # NO since the data for NO are not available NIST Webbook 01/08/2020 # https://webbook.nist.gov/cgi/cbook.cgi?ID=C7727379&Units=SI&Mask=4#Thermo-Phase iv_pvap = { ('N2', 'A'): 3.7362, ('N2', 'B'): 264.651, ('N2', 'C'): -6.788, ('O2', 'A'): 3.9523, ('O2', 'B'): 340.024, ('O2', 'C'): -4.144, ('H2O', 'A'): 3.55959, ('H2O', 'B'): 643.748, ('H2O', 'C'): -198.043, ('CO2', 'A'): 6.81228, ('CO2', 'B'): 1301.679, ('CO2', 'C'): -3.494, ('NO', 'A'): 3.7362, ('NO', 'B'): 264.651, ('NO', 'C'): -6.788, ('SO2', 'A'): 4.37798, ('SO2', 'B'): 966.575, ('SO2', 'C'): -42.071 } self.vapor_pressure_coeff = Param( self.component_list, ['A', 'B', 'C'], initialize=iv_pvap, mutable=True, doc="Antoine coefficients for vapor pressure P in bar, T in K") self.set_default_scaling("flow_mol", 1e-4) self.set_default_scaling("flow_mass", 1e-3) self.set_default_scaling("flow_vol", 1e-3) # anything not explicitly listed self.set_default_scaling("mole_frac_comp", 1) self.set_default_scaling("mole_frac_comp", 1e3, index="NO") self.set_default_scaling("mole_frac_comp", 1e3, index="SO2") self.set_default_scaling("mole_frac_comp", 1e2, index="H2O") self.set_default_scaling("mole_frac_comp", 1e2, index="CO2") self.set_default_scaling("flow_vol", 1) # For flow_mol_comp, will calculate from flow_mol and mole_frac_comp # user should set a scale for both, and for each compoent of mole_frac_comp self.set_default_scaling("pressure", 1e-5) self.set_default_scaling("temperature", 1e-1) self.set_default_scaling("pressure_red", 1e-3) self.set_default_scaling("temperature_red", 1) self.set_default_scaling("enth_mol_phase", 1e-3) self.set_default_scaling("enth_mol", 1e-3) self.set_default_scaling("entr_mol", 1e-2) self.set_default_scaling("entr_mol_phase", 1e-2) self.set_default_scaling("cp_mol", 0.1) self.set_default_scaling("cp_mol_phase", 0.1) self.set_default_scaling("compress_fact", 1) self.set_default_scaling("dens_mol_phase", 1) self.set_default_scaling("pressure_sat", 1e-4) self.set_default_scaling("visc_d_comp", 1e4) self.set_default_scaling("therm_cond_comp", 1e2) self.set_default_scaling("visc_d", 1e4) self.set_default_scaling("therm_cond", 1e2) self.set_default_scaling("mw", 1) self.set_default_scaling("mw_comp", 1)
def build(self): """ Add contents to the block.""" super(FlueGasParameterData, self).build() self._state_block_class = FlueGasStateBlock # Create Component objects self.N2 = Component() self.O2 = Component() self.NO = Component() self.CO2 = Component() self.H2O = Component() self.SO2 = Component() # Create Phase object self.Vap = VaporPhase() # Molecular weight self.mw_comp = Param(self.component_list, initialize={'O2': 0.0319988, 'N2': 0.0280134, 'NO': 0.0300061, 'CO2': 0.0440095, 'H2O': 0.0180153, 'SO2': 0.064064}, doc='Molecular Weight [kg/mol]', units=pyunits.kg/pyunits.mol) # Thermodynamic reference state self.pressure_ref = Param(within=PositiveReals, default=1.01325e5, doc='Reference pressure [Pa]', units=pyunits.Pa) self.temperature_ref = Param(within=PositiveReals, default=298.15, doc='Reference temperature [K]', units=pyunits.K) # Critical Properties self.pressure_crit = Param(self.component_list, within=PositiveReals, initialize={'O2': 50.45985e5, 'N2': 33.943875e5, 'NO': 64.85e5, 'CO2': 73.8e5, 'H2O': 220.64e5, 'SO2': 7.883e6}, doc='Critical pressure [Pa]', units=pyunits.Pa) self.temperature_crit = Param(self.component_list, within=PositiveReals, initialize={'O2': 154.58, 'N2': 126.19, 'NO': 180.0, 'CO2': 304.18, 'H2O': 647, 'SO2': 430.8}, doc='Critical temperature [K]', units=pyunits.K) # Constants for specific heat capacity, enthalpy, and entropy # calculations for ideal gas (from NIST 01/08/2020 # https://webbook.nist.gov/cgi/cbook.cgi?ID=C7727379&Units=SI&Mask=1#Thermo-Gas) cp_mol_ig_comp_coeff_parameter_A = {'N2': 19.50583, 'O2': 30.03235, 'CO2': 24.99735, 'H2O': 30.092, 'NO': 23.83491, 'SO2': 21.43049} cp_mol_ig_comp_coeff_parameter_B = {'N2': 19.88705, 'O2': 8.772972, 'CO2': 55.18696, 'H2O': 6.832514, 'NO': 12.58878, 'SO2': 74.35094} cp_mol_ig_comp_coeff_parameter_C = {'N2': -8.598535, 'O2': -3.98813, 'CO2': -33.69137, 'H2O': 6.793435, 'NO': -1.139011, 'SO2': -57.75217} cp_mol_ig_comp_coeff_parameter_D = {'N2': 1.369784, 'O2': 0.788313, 'CO2': 7.948387, 'H2O': -2.53448, 'NO': -1.497459, 'SO2': 16.35534} cp_mol_ig_comp_coeff_parameter_E = {'N2': 0.527601, 'O2': -0.7416, 'CO2': -0.136638, 'H2O': 0.082139, 'NO': 0.214194, 'SO2': 0.086731} cp_mol_ig_comp_coeff_parameter_F = {'N2': -4.935202, 'O2': -11.3247, 'CO2': -403.6075, 'H2O': -250.881, 'NO': 83.35783, 'SO2': -305.7688} cp_mol_ig_comp_coeff_parameter_G = {'N2': 212.39, 'O2': 236.1663, 'CO2': 228.2431, 'H2O': 223.3967, 'NO': 237.1219, 'SO2': 254.8872} cp_mol_ig_comp_coeff_parameter_H = {'N2': 0, 'O2': 0, 'CO2': -393.5224, 'H2O': -241.8264, 'NO': 90.29114, 'SO2': -296.8422} self.cp_mol_ig_comp_coeff_A = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_A, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.J/pyunits.mol/pyunits.K) self.cp_mol_ig_comp_coeff_B = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_B, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.J/pyunits.mol/pyunits.K/pyunits.kK) self.cp_mol_ig_comp_coeff_C = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_C, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.J/pyunits.mol/pyunits.K/pyunits.kK**2) self.cp_mol_ig_comp_coeff_D = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_D, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.J/pyunits.mol/pyunits.K/pyunits.kK**3) self.cp_mol_ig_comp_coeff_E = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_E, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.J/pyunits.mol/pyunits.K*pyunits.kK**2) self.cp_mol_ig_comp_coeff_F = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_F, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.kJ/pyunits.mol) self.cp_mol_ig_comp_coeff_G = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_G, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.J/pyunits.mol/pyunits.K) self.cp_mol_ig_comp_coeff_H = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_H, doc='Constants for spec. heat capacity for ideal gas', units=pyunits.kJ/pyunits.mol) # Viscosity and thermal conductivity parameters self.ce_param = Param( initialize=2.6693e-5, units=(pyunits.g**0.5*pyunits.mol**0.5*pyunits.angstrom**2 * pyunits.K**-0.5*pyunits.cm**-1*pyunits.s**-1), doc="Parameter for the Chapman-Enskog viscosity correlation") self.sigma = Param( self.component_list, initialize={ 'O2': 3.458, 'N2': 3.621, 'NO': 3.47, 'CO2': 3.763, 'H2O': 2.605, 'SO2': 4.29}, doc='collision diameter in Angstrom (10e-10 m)', units=pyunits.angstrom ) self.ep_Kappa = Param( self.component_list, initialize={ 'O2': 107.4, 'N2': 97.53, 'NO': 119.0, 'CO2': 244.0, 'H2O': 572.4, 'SO2': 252.0}, doc="characteristic energy of interaction between pair of " "molecules, K = Boltzmann constant in Kelvin", units=pyunits.K) self.set_default_scaling("flow_mol", 1e-4) self.set_default_scaling("flow_mass", 1e-3) self.set_default_scaling("flow_vol", 1e-3) # anything not explicitly listed self.set_default_scaling("mole_frac_comp", 1) self.set_default_scaling("mole_frac_comp", 1e3, index="NO") self.set_default_scaling("mole_frac_comp", 1e3, index="SO2") self.set_default_scaling("mole_frac_comp", 1e2, index="H2O") self.set_default_scaling("mole_frac_comp", 1e2, index="CO2") self.set_default_scaling("flow_vol", 1) # For flow_mol_comp, will calculate from flow_mol and mole_frac_comp # user should set a scale for both, and for each compoent of # mole_frac_comp self.set_default_scaling("pressure", 1e-5) self.set_default_scaling("temperature", 1e-1) self.set_default_scaling("pressure_red", 1e-3) self.set_default_scaling("temperature_red", 1) self.set_default_scaling("enth_mol_phase", 1e-3) self.set_default_scaling("enth_mol", 1e-3) self.set_default_scaling("entr_mol", 1e-2) self.set_default_scaling("entr_mol_phase", 1e-2) self.set_default_scaling("cp_mol", 0.1) self.set_default_scaling("cp_mol_phase", 0.1) self.set_default_scaling("compress_fact", 1) self.set_default_scaling("dens_mol_phase", 1) self.set_default_scaling("pressure_sat", 1e-4) self.set_default_scaling("visc_d_comp", 1e4) self.set_default_scaling("therm_cond_comp", 1e2) self.set_default_scaling("visc_d", 1e4) self.set_default_scaling("therm_cond", 1e2) self.set_default_scaling("mw", 1) self.set_default_scaling("mw_comp", 1)
def build(self): ''' Callable method for Block construction. ''' self.component_list_master = Set( initialize=['benzene', 'toluene', 'o-xylene']) # Create component objects # NOTE: User needs to update this list; can be a subset or # equal to the master component list self.benzene = Component() self.toluene = Component() super(BTXParameterData, self).build() # List of phase equilibrium index self.phase_equilibrium_idx_master = Set(initialize=[1, 2, 3]) self.phase_equilibrium_idx = Set(initialize=[1, 2]) self.phase_equilibrium_list_master = \ {1: ["benzene", ("Vap", "Liq")], 2: ["toluene", ("Vap", "Liq")], 3: ["o-xylene", ("Vap", "Liq")]} self.phase_equilibrium_list = \ {1: ["benzene", ("Vap", "Liq")], 2: ["toluene", ("Vap", "Liq")]} # Thermodynamic reference state self.pressure_reference = Param(mutable=True, default=101325, doc='Reference pressure [Pa]', units=pyunits.Pa) self.temperature_reference = Param(mutable=True, default=298.15, doc='Reference temperature [K]', units=pyunits.K) # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid pressure_critical_data = { 'benzene': 48.9e5, 'toluene': 41e5, 'o-xylene': 37.3e5 } self.pressure_critical = Param( self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(pressure_critical_data), doc='Critical pressure [Pa]', units=pyunits.Pa) # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid temperature_critical_data = { 'benzene': 562.2, 'toluene': 591.8, 'o-xylene': 630.3 } self.temperature_critical = Param( self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(temperature_critical_data), doc='Critical temperature [K]', units=pyunits.K) # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid mw_comp_data = { 'benzene': 78.1136E-3, 'toluene': 92.1405E-3, 'o-xylene': 106.167e-3 } self.mw_comp = Param(self.component_list, mutable=False, initialize=extract_data(mw_comp_data), doc="molecular weight kg/mol", units=pyunits.kg / pyunits.mol) # Constants for specific heat capacity, enthalpy # Sources: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid # Perry's Chemical Engineers Handbook # - Robert H. Perry (Cp_liq) Cp_Liq_A_data = { ('benzene'): 1.29E5, ('toluene'): 1.40E5, ('o-xylene'): 3.65e4 } Cp_Liq_B_data = { ('benzene'): -1.7E2, ('toluene'): -1.52E2, ('o-xylene'): 1.0175e3 } Cp_Liq_C_data = { ('benzene'): 6.48E-1, ('toluene'): 6.95E-1, ('o-xylene'): -2.63 } Cp_Liq_D_data = {('benzene'): 0, ('toluene'): 0, ('o-xylene'): 3.02e-3} Cp_Liq_E_data = {('benzene'): 0, ('toluene'): 0, ('o-xylene'): 0} self.cp_mol_liq_comp_coeff_A = Param( self.component_list, units=pyunits.J / pyunits.kmol / pyunits.K, doc="Liquid phase Cp parameter A", initialize=extract_data(Cp_Liq_A_data)) self.cp_mol_liq_comp_coeff_B = Param( self.component_list, units=pyunits.J / pyunits.kmol / pyunits.K**2, doc="Liquid phase Cp parameter B", initialize=extract_data(Cp_Liq_B_data)) self.cp_mol_liq_comp_coeff_C = Param( self.component_list, units=pyunits.J / pyunits.kmol / pyunits.K**3, doc="Liquid phase Cp parameter C", initialize=extract_data(Cp_Liq_C_data)) self.cp_mol_liq_comp_coeff_D = Param( self.component_list, units=pyunits.J / pyunits.kmol / pyunits.K**4, doc="Liquid phase Cp parameter D", initialize=extract_data(Cp_Liq_D_data)) self.cp_mol_liq_comp_coeff_E = Param( self.component_list, units=pyunits.J / pyunits.kmol / pyunits.K**5, doc="Liquid phase Cp parameter E", initialize=extract_data(Cp_Liq_E_data)) Cp_Vap_A_data = { ('benzene'): -3.392E1, ('toluene'): -2.435E1, ('o-xylene'): -1.585e-1 } Cp_Vap_B_data = { ('benzene'): 4.739E-1, ('toluene'): 5.125E-1, ('o-xylene'): 5.962e-1 } Cp_Vap_C_data = { ('benzene'): -3.017E-4, ('toluene'): -2.765E-4, ('o-xylene'): -3.443e-4 } Cp_Vap_D_data = { ('benzene'): 7.130E-8, ('toluene'): 4.911E-8, ('o-xylene'): 7.528E-8 } Cp_Vap_E_data = {('benzene'): 0, ('toluene'): 0, ('o-xylene'): 0} self.cp_mol_vap_comp_coeff_A = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K, doc="Vapor phase Cp parameter A", initialize=extract_data(Cp_Vap_A_data)) self.cp_mol_vap_comp_coeff_B = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**2, doc="Vapor phase Cp parameter B", initialize=extract_data(Cp_Vap_B_data)) self.cp_mol_vap_comp_coeff_C = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**3, doc="Vapor phase Cp parameter C", initialize=extract_data(Cp_Vap_C_data)) self.cp_mol_vap_comp_coeff_D = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**4, doc="Vapor phase Cp parameter D", initialize=extract_data(Cp_Vap_D_data)) self.cp_mol_vap_comp_coeff_E = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**5, doc="Vapor phase Cp parameter E", initialize=extract_data(Cp_Vap_E_data)) # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid pressure_sat_coeff_data = { ('benzene', 'A'): -6.98273, ('benzene', 'B'): 1.33213, ('benzene', 'C'): -2.62863, ('benzene', 'D'): -3.33399, ('toluene', 'A'): -7.28607, ('toluene', 'B'): 1.38091, ('toluene', 'C'): -2.83433, ('toluene', 'D'): -2.79168, ('o-xylene', 'A'): -7.53357, ('o-xylene', 'B'): 1.40968, ('o-xylene', 'C'): -3.10985, ('o-xylene', 'D'): -2.85992 } self.pressure_sat_coeff = Param( self.component_list, ['A', 'B', 'C', 'D'], mutable=False, initialize=extract_data(pressure_sat_coeff_data), doc="parameters to compute P_sat") # Standard heats of formation # Source: NIST Webbook, https://webbook.nist.gov # Retrieved 25th September 2019 dh_form_data = { ('Vap', 'benzene'): 82.9e3, ('Vap', 'toluene'): 50.1e3, ('Vap', 'o-xylene'): 19.0e3, ('Liq', 'benzene'): 49.0e3, ('Liq', 'toluene'): 12.0e3, ('Liq', 'o-xylene'): -24.4e3 } self.dh_form = Param(self.phase_list, self.component_list, mutable=False, initialize=extract_data(dh_form_data), doc="Standard heats of formation [J/mol]", units=pyunits.J / pyunits.mol) # Standard entropy of formation # Source: Engineering Toolbox, https://www.engineeringtoolbox.com # o-xylene from NIST Webbook, https://webbook.nist.gov # Retrieved 9th October, 2019 ds_form_data = { ('Vap', 'benzene'): -269, ('Vap', 'toluene'): -321, ('Vap', 'o-xylene'): -353.6, ('Liq', 'benzene'): -173, ('Liq', 'toluene'): -220, ('Liq', 'o-xylene'): -246 } self.ds_form = Param(self.phase_list, self.component_list, mutable=False, initialize=extract_data(ds_form_data), doc="Standard entropy of formation [J/mol.K]", units=pyunits.J / pyunits.mol / pyunits.K)
def build(self): ''' Callable method for Block construction. ''' super(HDAParameterData, self).build() self._state_block_class = IdealStateBlock self.benzene = Component() self.toluene = Component() self.methane = Component() self.hydrogen = Component() self.Liq = LiquidPhase() self.Vap = VaporPhase() # List of components in each phase (optional) self.phase_comp = {"Liq": self.component_list, "Vap": self.component_list} # List of phase equilibrium index self.phase_equilibrium_idx = Set(initialize=[1, 2, 3, 4, 5]) self.phase_equilibrium_list = \ {1: ["benzene", ("Vap", "Liq")], 2: ["toluene", ("Vap", "Liq")], 3: ["hydrogen", ("Vap", "Liq")], 4: ["methane", ("Vap", "Liq")], 5: ["diphenyl", ("Vap", "Liq")]} # Thermodynamic reference state self.pressure_ref = Param(mutable=True, default=101325, doc='Reference pressure [Pa]') self.temperature_ref = Param(mutable=True, default=298.15, doc='Reference temperature [K]') # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid pressure_crit_data = {'benzene': 48.9e5, 'toluene': 41e5, 'hydrogen': 12.9e5, 'methane': 46e5, 'diphenyl': 38.5e5 } self.pressure_crit = Param( self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(pressure_crit_data), doc='Critical pressure [Pa]') # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid temperature_crit_data = {'benzene': 562.2, 'toluene': 591.8, 'hydrogen': 33.0, 'methane': 190.4, 'diphenyl': 789 } self.temperature_crit = Param( self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(temperature_crit_data), doc='Critical temperature [K]') # Gas Constant self.gas_const = Param(within=NonNegativeReals, mutable=False, default=8.314, doc='Gas Constant [J/mol.K]') # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid mw_comp_data = {'benzene': 78.1136E-3, 'toluene': 92.1405E-3, 'hydrogen': 2.016e-3, 'methane': 16.043e-3, 'diphenyl': 154.212e-4} self.mw_comp = Param(self.component_list, mutable=False, initialize=extract_data(mw_comp_data), doc="molecular weight Kg/mol") # Constants for liquid densities # Source: Perry's Chemical Engineers Handbook # - Robert H. Perry (Cp_liq) dens_liq_data = {('benzene', '1'): 1.0162, ('benzene', '2'): 0.2655, ('benzene', '3'): 562.16, ('benzene', '4'): 0.28212, ('toluene', '1'): 0.8488, ('toluene', '2'): 0.26655, ('toluene', '3'): 591.8, ('toluene', '4'): 0.2878, ('hydrogen', '1'): 5.414, ('hydrogen', '2'): 0.34893, ('hydrogen', '3'): 33.19, ('hydrogen', '4'): 0.2706, ('methane', '1'): 2.9214, ('methane', '2'): 0.28976, ('methane', '3'): 190.56, ('methane', '4'): 0.28881, ('diphenyl', '1'): 0.5039, ('diphenyl', '2'): 0.25273, ('diphenyl', '3'): 789.26, ('diphenyl', '4'): 0.281} self.dens_liq_params = Param( self.component_list, ['1', '2', '3', '4'], mutable=False, initialize=extract_data(dens_liq_data), doc="Parameters to compute liquid densities") # Boiling point at standard pressure # Source: Perry's Chemical Engineers Handbook # - Robert H. Perry (Cp_liq) bp_data = {('benzene'): 353.25, ('toluene'): 383.95, ('hydrogen'): 20.45, ('methane'): 111.75, ('diphenyl'): 528.05} self.temperature_boil = Param( self.component_list, mutable=False, initialize=extract_data(bp_data), doc="Pure component boiling points at standard pressure [K]") # Constants for specific heat capacity, enthalpy # Sources: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid # Perry's Chemical Engineers Handbook # - Robert H. Perry (Cp_liq) cp_ig_data = {('Liq', 'benzene', '1'): 1.29E5, ('Liq', 'benzene', '2'): -1.7E2, ('Liq', 'benzene', '3'): 6.48E-1, ('Liq', 'benzene', '4'): 0, ('Liq', 'benzene', '5'): 0, ('Vap', 'benzene', '1'): -3.392E1, ('Vap', 'benzene', '2'): 4.739E-1, ('Vap', 'benzene', '3'): -3.017E-4, ('Vap', 'benzene', '4'): 7.130E-8, ('Vap', 'benzene', '5'): 0, ('Liq', 'toluene', '1'): 1.40E5, ('Liq', 'toluene', '2'): -1.52E2, ('Liq', 'toluene', '3'): 6.95E-1, ('Liq', 'toluene', '4'): 0, ('Liq', 'toluene', '5'): 0, ('Vap', 'toluene', '1'): -2.435E1, ('Vap', 'toluene', '2'): 5.125E-1, ('Vap', 'toluene', '3'): -2.765E-4, ('Vap', 'toluene', '4'): 4.911E-8, ('Vap', 'toluene', '5'): 0, ('Liq', 'hydrogen', '1'): 0, # 6.6653e1, ('Liq', 'hydrogen', '2'): 0, # 6.7659e3, ('Liq', 'hydrogen', '3'): 0, # -1.2363e2, ('Liq', 'hydrogen', '4'): 0, # 4.7827e2, # Eqn 2 ('Liq', 'hydrogen', '5'): 0, ('Vap', 'hydrogen', '1'): 2.714e1, ('Vap', 'hydrogen', '2'): 9.274e-3, ('Vap', 'hydrogen', '3'): -1.381e-5, ('Vap', 'hydrogen', '4'): 7.645e-9, ('Vap', 'hydrogen', '5'): 0, ('Liq', 'methane', '1'): 0, # 6.5708e1, ('Liq', 'methane', '2'): 0, # 3.8883e4, ('Liq', 'methane', '3'): 0, # -2.5795e2, ('Liq', 'methane', '4'): 0, # 6.1407e2, # Eqn 2 ('Liq', 'methane', '5'): 0, ('Vap', 'methane', '1'): 1.925e1, ('Vap', 'methane', '2'): 5.213e-2, ('Vap', 'methane', '3'): 1.197e-5, ('Vap', 'methane', '4'): -1.132e-8, ('Vap', 'methane', '5'): 0, ('Liq', 'diphenyl', '1'): 1.2177e5, ('Liq', 'diphenyl', '2'): 4.2930e2, ('Liq', 'diphenyl', '3'): 0, ('Liq', 'diphenyl', '4'): 0, ('Liq', 'diphenyl', '5'): 0, ('Vap', 'diphenyl', '1'): -9.707e1, ('Vap', 'diphenyl', '2'): 1.106e0, ('Vap', 'diphenyl', '3'): -8.855e-4, ('Vap', 'diphenyl', '4'): 2.790e-7, ('Vap', 'diphenyl', '5'): 0} self.cp_ig = Param(self.phase_list, self.component_list, ['1', '2', '3', '4', '5'], mutable=False, initialize=extract_data(cp_ig_data), doc="parameters to compute Cp_comp") # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid # fitted to Antoine form # H2, Methane from NIST webbook pressure_sat_coeff_data = {('benzene', 'A'): 4.202, ('benzene', 'B'): 1322, ('benzene', 'C'): -38.56, ('toluene', 'A'): 4.216, ('toluene', 'B'): 1435, ('toluene', 'C'): -43.33, ('hydrogen', 'A'): 3.543, ('hydrogen', 'B'): 99.40, ('hydrogen', 'C'): 7.726, ('methane', 'A'): 3.990, ('methane', 'B'): 443.0, ('methane', 'C'): -0.49, ('diphenyl', 'A'): 4.345, ('diphenyl', 'B'): 1988, ('diphenyl', 'C'): -70.82} self.pressure_sat_coeff = Param( self.component_list, ['A', 'B', 'C'], mutable=False, initialize=extract_data(pressure_sat_coeff_data), doc="parameters to compute Cp_comp") # Source: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid dh_vap = {'benzene': 3.387e4, 'toluene': 3.8262e4, 'hydrogen': 0, 'methane': 0, "diphenyl": 6.271e4} self.dh_vap = Param(self.component_list, mutable=False, initialize=extract_data(dh_vap), doc="heat of vaporization")
def build(self): ''' Callable method for Block construction. ''' super(BTParameterData, self).build() self.cubic_type = CubicEoS.PR # Add Component objects self.benzene = Component( default={"elemental_composition": { "C": 6, "H": 6 }}) self.toluene = Component( default={"elemental_composition": { "C": 7, "H": 8 }}) # List of phase equilibrium index self.phase_equilibrium_idx = Set(initialize=[1, 2]) self.phase_equilibrium_list = \ {1: ["benzene", ("Vap", "Liq")], 2: ["toluene", ("Vap", "Liq")]} # Thermodynamic reference state self.pressure_ref = Param(mutable=True, default=101325, doc='Reference pressure [Pa]', units=pyunits.Pa) self.temperature_ref = Param(mutable=True, default=298.15, doc='Reference temperature [K]', units=pyunits.K) # Critical Properties pressure_crit_data = {'benzene': 48.9e5, 'toluene': 41.0e5} self.pressure_crit = Param(self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(pressure_crit_data), doc='Critical pressure [Pa]', units=pyunits.Pa) temperature_crit_data = {'benzene': 562.2, 'toluene': 591.8} self.temperature_crit = Param( self.component_list, within=NonNegativeReals, mutable=False, initialize=extract_data(temperature_crit_data), doc='Critical temperature [K]', units=pyunits.K) # Pitzer acentricity factor omega_data = {'benzene': 0.212, 'toluene': 0.263} self.omega = Param(self.component_list, within=Reals, mutable=False, initialize=extract_data(omega_data), doc='Acentricity Factor') # Peng-Robinson binary interaction parameters kappa_data = { ('benzene', 'benzene'): 0.0000, ('benzene', 'toluene'): 0.0000, ('toluene', 'benzene'): 0.0000, ('toluene', 'toluene'): 0.0000 } self.kappa = Param(self.component_list, self.component_list, within=Reals, mutable=False, initialize=extract_data(kappa_data), doc='Peng-Robinson binary interaction parameters') # Molecular Weights mw_comp_data = {'benzene': 78.1136E-3, 'toluene': 92.1405E-3} self.mw_comp = Param(self.component_list, mutable=False, initialize=extract_data(mw_comp_data), doc="molecular weight kg/mol", units=pyunits.kg / pyunits.mol) # Constants for specific heat capacity, enthalpy and entropy self.cp_mol_ig_comp_coeff_1 = Param( self.component_list, mutable=False, initialize={ 'benzene': -3.392E1, 'toluene': -2.435E1 }, doc="Parameter 1 to compute cp_mol_comp", units=pyunits.J / pyunits.mol / pyunits.K) self.cp_mol_ig_comp_coeff_2 = Param( self.component_list, mutable=False, initialize={ 'benzene': 4.739E-1, 'toluene': 5.125E-1 }, doc="Parameter 2 to compute cp_mol_comp", units=pyunits.J / pyunits.mol / pyunits.K**2) self.cp_mol_ig_comp_coeff_3 = Param( self.component_list, mutable=False, initialize={ 'benzene': -3.017E-4, 'toluene': -2.765E-4 }, doc="Parameter 3 to compute cp_mol_comp", units=pyunits.J / pyunits.mol / pyunits.K**3) self.cp_mol_ig_comp_coeff_4 = Param( self.component_list, mutable=False, initialize={ 'benzene': 7.130E-8, 'toluene': 4.911E-8 }, doc="Parameter 4 to compute cp_mol_comp", units=pyunits.J / pyunits.mol / pyunits.K**4) # Standard heats of formation # Source: NIST Webbook, https://webbook.nist.gov # Retrieved 25th September 2019 dh_form_data = {'benzene': 82.9e3, 'toluene': 50.1e3} self.enth_mol_form_ref = Param(self.component_list, mutable=False, initialize=extract_data(dh_form_data), doc="Standard heats of formation", units=pyunits.J / pyunits.mol) # Standard entropy of formation # Source: Engineering Toolbox, https://www.engineeringtoolbox.com # Retrieved 25th September, 2019 ds_form_data = {'benzene': -269, 'toluene': -321} self.entr_mol_form_ref = Param(self.component_list, mutable=False, initialize=extract_data(ds_form_data), doc="Standard entropy of formation", units=pyunits.J / pyunits.mol / pyunits.K) # Antoine coefficients for ideal vapour (units: bar, K) # This is needed for initial guesses of bubble and dew points self.antoine_coeff_A = Param( self.component_list, mutable=False, initialize={ 'benzene': 4.202, 'toluene': 4.216 }, doc="Antoine A Parameter to calculate pressure_sat", units=pyunits.dimensionless) self.antoine_coeff_B = Param( self.component_list, mutable=False, initialize={ 'benzene': 1322, 'toluene': 1435 }, doc="Antoine B Parameter to calculate pressure_sat", units=pyunits.K) self.antoine_coeff_C = Param( self.component_list, mutable=False, initialize={ 'benzene': -38.56, 'toluene': -43.33 }, doc="Antoine C Parameter to calculate pressure_sat", units=pyunits.K)
def build(self): ''' Callable method for Block construction. ''' super(PhysicalParameterData, self).build() self._state_block_class = IdealStateBlock # List of valid phases and components in property package if self.config.valid_phase == ('Liq', 'Vap') or \ self.config.valid_phase == ('Vap', 'Liq'): self.Liq = LiquidPhase() self.Vap = VaporPhase() elif self.config.valid_phase == 'Liq': self.Liq = LiquidPhase() else: self.Vap = VaporPhase() self.CH4 = Component() self.CO = Component() self.H2 = Component() self.CH3OH = Component() self.phase_equilibrium_idx = Set(initialize=[1, 2, 3, 4]) self.phase_equilibrium_list = \ {1: ["CH4", ("Vap", "Liq")], 2: ["CO", ("Vap", "Liq")], 3: ["H2", ("Vap", "Liq")], 4: ["CH3OH", ("Vap", "Liq")]} # Antoine coefficients assume pressure in mmHG and temperature in K self.vapor_pressure_coeff = {('CH4', 'A'): 15.2243, ('CH4', 'B'): 897.84, ('CH4', 'C'): -7.16, ('CO', 'A'): 14.3686, ('CO', 'B'): 530.22, ('CO', 'C'): -13.15, ('H2', 'A'): 13.6333, ('H2', 'B'): 164.9, ('H2', 'C'): 3.19, ('CH3OH', 'A'): 18.5875, ('CH3OH', 'B'): 3626.55, ('CH3OH', 'C'): -34.29} Cp = self.config.Cp Cv = value(Cp - pyunits.convert(Constants.gas_constant, pyunits.MJ/pyunits.kmol/pyunits.K)) gamma = Cp / Cv self.gamma = Param(within=NonNegativeReals, mutable=True, default=gamma, doc='Ratio of Cp to Cv') self.Cp = Param(within=NonNegativeReals, mutable=True, default=Cp, units=pyunits.MJ/pyunits.kmol/pyunits.K, doc='Constant pressure heat capacity')
def build(self): ''' Callable method for Block construction. ''' super(MethaneParameterData, self).build() # Component list - a list of component identifiers self.H2 = Component() self.N2 = Component() self.O2 = Component() self.CH4 = Component() self.CO = Component() self.CO2 = Component() self.H2O = Component() self.NH3 = Component() # List of all chemical elements that constitute the chemical species self.element_list = Set(initialize=['H', 'N', 'O', 'C']) # Elemental composition of all species self.element_comp = { 'H2': { 'H': 2, 'N': 0, 'O': 0, 'C': 0 }, 'N2': { 'H': 0, 'N': 2, 'O': 0, 'C': 0 }, 'O2': { 'H': 0, 'N': 0, 'O': 2, 'C': 0 }, 'CH4': { 'H': 4, 'N': 0, 'O': 0, 'C': 1 }, 'CO': { 'H': 0, 'N': 0, 'O': 1, 'C': 1 }, 'CO2': { 'H': 0, 'N': 0, 'O': 2, 'C': 1 }, 'H2O': { 'H': 2, 'N': 0, 'O': 1, 'C': 0 }, 'NH3': { 'H': 3, 'N': 1, 'O': 0, 'C': 0 } } # Thermodynamic reference state self.pressure_reference = Param(mutable=True, default=101325, doc='Reference pressure [Pa]', units=pyunits.Pa) self.temperature_reference = Param(mutable=True, default=1500, doc='Reference temperature [K]', units=pyunits.K) # Constants for specific heat capacity, enthalpy # Sources: The Properties of Gases and Liquids (1987) # 4th edition, Chemical Engineering Series - Robert C. Reid Cp_Vap_A_data = { ('CH4'): 1.925e1, ('CO'): 3.087e1, ('CO2'): 1.980e1, ('H2'): 2.714e1, ('H2O'): 3.224e1, ('N2'): 3.115e1, ('NH3'): 2.731e1, ('O2'): 2.811e1 } Cp_Vap_B_data = { ('CH4'): 5.213e-2, ('CO'): -1.285e-2, ('CO2'): 7.344e-2, ('H2'): 9.274e-3, ('H2O'): 1.924e-3, ('N2'): -1.357e-2, ('NH3'): 2.383e-2, ('O2'): -3.680e-6 } Cp_Vap_C_data = { ('CH4'): 1.197e-5, ('CO'): 2.789e-5, ('CO2'): -5.602e-5, ('H2'): -1.381e-5, ('H2O'): 1.055e-5, ('N2'): 2.680e-5, ('NH3'): 1.707e-5, ('O2'): 1.746e-5 } Cp_Vap_D_data = { ('CH4'): -1.132e-8, ('CO'): -1.272e-8, ('CO2'): 1.715e-8, ('H2'): 7.645e-9, ('H2O'): -3.596e-9, ('N2'): -1.168e-8, ('NH3'): -1.185e-8, ('O2'): -1.065e-8 } Cp_Vap_E_data = { ('CH4'): 0, ('CO'): 0, ('CO2'): 0, ('H2'): 0, ('H2O'): 0, ('N2'): 0, ('NH3'): 0, ('O2'): 0 } self.cp_mol_vap_comp_coeff_A = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K, doc="Vapor phase Cp parameter A", initialize=extract_data(Cp_Vap_A_data)) self.cp_mol_vap_comp_coeff_B = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**2, doc="Vapor phase Cp parameter B", initialize=extract_data(Cp_Vap_B_data)) self.cp_mol_vap_comp_coeff_C = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**3, doc="Vapor phase Cp parameter C", initialize=extract_data(Cp_Vap_C_data)) self.cp_mol_vap_comp_coeff_D = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**4, doc="Vapor phase Cp parameter D", initialize=extract_data(Cp_Vap_D_data)) self.cp_mol_vap_comp_coeff_E = Param( self.component_list, units=pyunits.J / pyunits.mol / pyunits.K**5, doc="Vapor phase Cp parameter E", initialize=extract_data(Cp_Vap_E_data)) # Source: NIST Webbook, 9th October 2019 dh_form = { ("Vap", "CH4"): -74600, ("Vap", "CO"): -110530, ("Vap", "CO2"): -393520, ("Vap", "H2"): 0, ("Vap", "H2O"): -241830, ("Vap", "N2"): 0, ("Vap", "NH3"): -45900, ("Vap", "O2"): 0 } self.dh_form = Param(self.phase_list, self.component_list, mutable=False, initialize=extract_data(dh_form), doc="Heats of formation (J/mol)", units=pyunits.J / pyunits.mol) # Source: NIST Webbook, 9th October 2019 ds_form = { ("Vap", "CH4"): 186.25, ("Vap", "CO"): 197.66, ("Vap", "CO2"): 213.79, ("Vap", "H2"): 130.68, ("Vap", "H2O"): 188.84, ("Vap", "N2"): 191.61, ("Vap", "NH3"): 192.77, ("Vap", "O2"): 205.15 } self.ds_form = Param(self.phase_list, self.component_list, mutable=False, initialize=extract_data(ds_form), doc="Entropies of formation (J/mol.K)", units=pyunits.J / pyunits.mol / pyunits.K)
def build(self): """Add contents to the block.""" super().build() self._state_block_class = FlueGasStateBlock _valid_comps = ["N2", "O2", "NO", "CO2", "H2O", "SO2"] for j in self.config.components: if j not in _valid_comps: raise ConfigurationError(f"Component '{j}' is not supported") self.add_component(j, Component()) # Create Phase object self.Vap = VaporPhase() # Molecular weight self.mw_comp = Param( self.component_list, initialize={ k: v for k, v in { "O2": 0.0319988, "N2": 0.0280134, "NO": 0.0300061, "CO2": 0.0440095, "H2O": 0.0180153, "SO2": 0.064064, }.items() if k in self.component_list }, doc="Molecular Weight [kg/mol]", units=pyunits.kg / pyunits.mol, ) # Thermodynamic reference state self.pressure_ref = Param( within=PositiveReals, default=1.01325e5, doc="Reference pressure [Pa]", units=pyunits.Pa, ) self.temperature_ref = Param( within=PositiveReals, default=298.15, doc="Reference temperature [K]", units=pyunits.K, ) # Critical Properties self.pressure_crit = Param( self.component_list, within=PositiveReals, initialize={ k: v for k, v in { "O2": 50.45985e5, "N2": 33.943875e5, "NO": 64.85e5, "CO2": 73.8e5, "H2O": 220.64e5, "SO2": 7.883e6, }.items() if k in self.component_list }, doc="Critical pressure [Pa]", units=pyunits.Pa, ) self.temperature_crit = Param( self.component_list, within=PositiveReals, initialize={ k: v for k, v in { "O2": 154.58, "N2": 126.19, "NO": 180.0, "CO2": 304.18, "H2O": 647, "SO2": 430.8, }.items() if k in self.component_list }, doc="Critical temperature [K]", units=pyunits.K, ) # Constants for specific heat capacity, enthalpy, and entropy # calculations for ideal gas (from NIST 01/08/2020 # https://webbook.nist.gov/cgi/cbook.cgi?ID=C7727379&Units=SI&Mask=1#Thermo-Gas) cp_mol_ig_comp_coeff_parameter_A = { k: v for k, v in { "N2": 19.50583, "O2": 30.03235, "CO2": 24.99735, "H2O": 30.092, "NO": 23.83491, "SO2": 21.43049, }.items() if k in self.component_list } cp_mol_ig_comp_coeff_parameter_B = { k: v for k, v in { "N2": 19.88705, "O2": 8.772972, "CO2": 55.18696, "H2O": 6.832514, "NO": 12.58878, "SO2": 74.35094, }.items() if k in self.component_list } cp_mol_ig_comp_coeff_parameter_C = { k: v for k, v in { "N2": -8.598535, "O2": -3.98813, "CO2": -33.69137, "H2O": 6.793435, "NO": -1.139011, "SO2": -57.75217, }.items() if k in self.component_list } cp_mol_ig_comp_coeff_parameter_D = { k: v for k, v in { "N2": 1.369784, "O2": 0.788313, "CO2": 7.948387, "H2O": -2.53448, "NO": -1.497459, "SO2": 16.35534, }.items() if k in self.component_list } cp_mol_ig_comp_coeff_parameter_E = { k: v for k, v in { "N2": 0.527601, "O2": -0.7416, "CO2": -0.136638, "H2O": 0.082139, "NO": 0.214194, "SO2": 0.086731, }.items() if k in self.component_list } cp_mol_ig_comp_coeff_parameter_F = { k: v for k, v in { "N2": -4.935202, "O2": -11.3247, "CO2": -403.6075, "H2O": -250.881, "NO": 83.35783, "SO2": -305.7688, }.items() if k in self.component_list } cp_mol_ig_comp_coeff_parameter_G = { k: v for k, v in { "N2": 212.39, "O2": 236.1663, "CO2": 228.2431, "H2O": 223.3967, "NO": 237.1219, "SO2": 254.8872, }.items() if k in self.component_list } cp_mol_ig_comp_coeff_parameter_H = { k: v for k, v in { "N2": 0, "O2": 0, "CO2": -393.5224, "H2O": -241.8264, "NO": 90.29114, "SO2": -296.8422, }.items() if k in self.component_list } self.cp_mol_ig_comp_coeff_A = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_A, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.J / pyunits.mol / pyunits.K, ) self.cp_mol_ig_comp_coeff_B = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_B, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK, ) self.cp_mol_ig_comp_coeff_C = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_C, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK**2, ) self.cp_mol_ig_comp_coeff_D = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_D, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK**3, ) self.cp_mol_ig_comp_coeff_E = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_E, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.J / pyunits.mol / pyunits.K * pyunits.kK**2, ) self.cp_mol_ig_comp_coeff_F = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_F, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.kJ / pyunits.mol, ) self.cp_mol_ig_comp_coeff_G = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_G, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.J / pyunits.mol / pyunits.K, ) self.cp_mol_ig_comp_coeff_H = Param( self.component_list, initialize=cp_mol_ig_comp_coeff_parameter_H, doc="Constants for spec. heat capacity for ideal gas", units=pyunits.kJ / pyunits.mol, ) # Viscosity and thermal conductivity parameters self.ce_param = Param( initialize=2.6693e-5, units=(pyunits.g**0.5 * pyunits.mol**0.5 * pyunits.angstrom**2 * pyunits.K**-0.5 * pyunits.cm**-1 * pyunits.s**-1), doc="Parameter for the Chapman-Enskog viscosity correlation", ) self.sigma = Param( self.component_list, initialize={ k: v for k, v in { "O2": 3.458, "N2": 3.621, "NO": 3.47, "CO2": 3.763, "H2O": 2.605, "SO2": 4.29, }.items() if k in self.component_list }, doc="collision diameter", units=pyunits.angstrom, ) self.ep_Kappa = Param( self.component_list, initialize={ k: v for k, v in { "O2": 107.4, "N2": 97.53, "NO": 119.0, "CO2": 244.0, "H2O": 572.4, "SO2": 252.0, }.items() if k in self.component_list }, doc= "Boltzmann constant divided by characteristic Lennard-Jones energy", units=pyunits.K, ) self.set_default_scaling("flow_mol", 1e-4) self.set_default_scaling("flow_mass", 1e-3) self.set_default_scaling("flow_vol", 1e-3) # anything not explicitly listed self.set_default_scaling("mole_frac_comp", 1) self.set_default_scaling("mole_frac_comp", 1e3, index="NO") self.set_default_scaling("mole_frac_comp", 1e3, index="SO2") self.set_default_scaling("mole_frac_comp", 1e2, index="H2O") self.set_default_scaling("mole_frac_comp", 1e2, index="CO2") self.set_default_scaling("flow_vol", 1) # For flow_mol_comp, will calculate from flow_mol and mole_frac_comp # user should set a scale for both, and for each compoent of # mole_frac_comp self.set_default_scaling("pressure", 1e-5) self.set_default_scaling("temperature", 1e-1) self.set_default_scaling("pressure_red", 1e-3) self.set_default_scaling("temperature_red", 1) self.set_default_scaling("enth_mol_phase", 1e-3) self.set_default_scaling("enth_mol", 1e-3) self.set_default_scaling("entr_mol", 1e-2) self.set_default_scaling("entr_mol_phase", 1e-2) self.set_default_scaling("cp_mol", 0.1) self.set_default_scaling("cp_mol_phase", 0.1) self.set_default_scaling("compress_fact", 1) self.set_default_scaling("dens_mol_phase", 1) self.set_default_scaling("pressure_sat", 1e-4) self.set_default_scaling("visc_d_comp", 1e4) self.set_default_scaling("therm_cond_comp", 1e2) self.set_default_scaling("visc_d", 1e4) self.set_default_scaling("therm_cond", 1e2) self.set_default_scaling("mw", 1) self.set_default_scaling("mw_comp", 1)
def build(self): ''' Callable method for Block construction. ''' super(PhysicalParameterData, self).build() self._state_block_class = SolidPhaseStateBlock # Create Phase object self.Sol = SolidPhase() # Create Component objects self.Fe2O3 = Component() self.Fe3O4 = Component() self.Al2O3 = Component() # ------------------------------------------------------------------------- """ Pure solid component properties""" # Mol. weights of solid components - units = kg/mol. ref: NIST webbook mw_comp_dict = {'Fe2O3': 0.15969, 'Fe3O4': 0.231533, 'Al2O3': 0.10196} # Molecular weight should be defined in default units # (default mass units)/(default amount units) # per the define_meta.add_default_units method below self.mw_comp = Param( self.component_list, mutable=False, initialize=mw_comp_dict, doc="Molecular weights of solid components [kg/mol]", units=pyunits.kg / pyunits.mol) # Skeletal density of solid components - units = kg/m3. ref: NIST dens_mass_comp_skeletal_dict = { 'Fe2O3': 5250, 'Fe3O4': 5000, 'Al2O3': 3987 } self.dens_mass_comp_skeletal = Param( self.component_list, mutable=False, initialize=dens_mass_comp_skeletal_dict, doc='Skeletal density of solid components [kg/m3]', units=pyunits.kg / pyunits.m**3) # Ideal gas spec. heat capacity parameters(Shomate) of # components - ref: NIST webbook. Shomate equations from NIST. # Parameters A-E are used for cp calcs while A-H are used for enthalpy # calc. # cp_comp = A + B*T + C*T^2 + D*T^3 + E/(T^2) # where T = Temperature (K)/1000, and cp_comp = (J/mol.K) # H_comp = H - H(298.15) = A*T + B*T^2/2 + C*T^3/3 + # D*T^4/4 - E/T + F - H where T = Temp (K)/1000 and H_comp = (kJ/mol) cp_param_dict = { ('Al2O3', 1): 102.4290, ('Al2O3', 2): 38.74980, ('Al2O3', 3): -15.91090, ('Al2O3', 4): 2.628181, ('Al2O3', 5): -3.007551, ('Al2O3', 6): -1717.930, ('Al2O3', 7): 146.9970, ('Al2O3', 8): -1675.690, ('Fe3O4', 1): 200.8320000, ('Fe3O4', 2): 1.586435e-7, ('Fe3O4', 3): -6.661682e-8, ('Fe3O4', 4): 9.452452e-9, ('Fe3O4', 5): 3.18602e-8, ('Fe3O4', 6): -1174.1350000, ('Fe3O4', 7): 388.0790000, ('Fe3O4', 8): -1120.8940000, ('Fe2O3', 1): 110.9362000, ('Fe2O3', 2): 32.0471400, ('Fe2O3', 3): -9.1923330, ('Fe2O3', 4): 0.9015060, ('Fe2O3', 5): 5.4336770, ('Fe2O3', 6): -843.1471000, ('Fe2O3', 7): 228.3548000, ('Fe2O3', 8): -825.5032000 } self.cp_param_1 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 1}, doc="Shomate equation heat capacity coeff 1", units=pyunits.J / pyunits.mol / pyunits.K) self.cp_param_2 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 2}, doc="Shomate equation heat capacity coeff 2", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK) self.cp_param_3 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 3}, doc="Shomate equation heat capacity coeff 3", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK**2) self.cp_param_4 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 4}, doc="Shomate equation heat capacity coeff 4", units=pyunits.J / pyunits.mol / pyunits.K / pyunits.kK**3) self.cp_param_5 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 5}, doc="Shomate equation heat capacity coeff 5", units=pyunits.J / pyunits.mol / pyunits.K * pyunits.kK**2) self.cp_param_6 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 6}, doc="Shomate equation heat capacity coeff 6", units=pyunits.kJ / pyunits.mol) self.cp_param_7 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 7}, doc="Shomate equation heat capacity coeff 7", units=pyunits.J / pyunits.mol / pyunits.K) self.cp_param_8 = Param( self.component_list, mutable=False, initialize={k: v for (k, j), v in cp_param_dict.items() if j == 8}, doc="Shomate equation heat capacity coeff 8", units=pyunits.kJ / pyunits.mol) # Std. heat of formation of comp. - units = J/(mol comp) - ref: NIST enth_mol_form_comp_dict = { 'Fe2O3': -825.5032E3, 'Fe3O4': -1120.894E3, 'Al2O3': -1675.690E3 } self.enth_mol_form_comp = Param( self.component_list, mutable=False, initialize=enth_mol_form_comp_dict, doc="Component molar heats of formation [J/mol]", units=pyunits.J / pyunits.mol) # Set default scaling for mass fractions for comp in self.component_list: self.set_default_scaling("mass_frac_comp", 1e2, index=comp) # ------------------------------------------------------------------------- """ Mixed solid properties""" # These are setup as fixed vars to allow for parameter estimation # Particle size self.particle_dia = Var(domain=Reals, initialize=1.5e-3, doc='Diameter of solid particles [m]', units=pyunits.m) self.particle_dia.fix() # TODO -provide reference # Minimum fluidization velocity - EPAT value used for Davidson model self.velocity_mf = Var(domain=Reals, initialize=0.039624, doc='Velocity at minimum fluidization [m/s]', units=pyunits.m / pyunits.s) self.velocity_mf.fix() # Minimum fluidization voidage - educated guess as rough # estimate from ergun equation results (0.4) are suspicious self.voidage_mf = Var(domain=Reals, initialize=0.45, doc='Voidage at minimum fluidization [-]', units=pyunits.m**3 / pyunits.m**3) self.voidage_mf.fix() # Voidage of the bed self.voidage = Var(domain=Reals, initialize=0.35, doc='Voidage [-]', units=pyunits.m**3 / pyunits.m**3) self.voidage.fix() # Particle thermal conductivity self.therm_cond_sol = Var( domain=Reals, initialize=12.3e-0, doc='Thermal conductivity of solid particles [J/m.K.s]', units=pyunits.J / pyunits.m / pyunits.K / pyunits.s) self.therm_cond_sol.fix()
def build(self): """ Callable method for Block construction. """ super().build() self._state_block_class = ASM1StateBlock # Add Phase objects self.Liq = LiquidPhase() # Add Component objects self.H2O = Solvent() self.S_I = Solute(doc="Soluble inert organic matter, S_I") self.S_S = Solute(doc="Readily biodegradable substrate, S_S") self.X_I = Solute(doc="Particulate inert organic matter, X_I") self.X_S = Solute(doc="Slowly biodegradable substrate, X_S") self.X_BH = Solute(doc="Active heterotrophic biomass, X_B,H") self.X_BA = Solute(doc="Active autotrophic biomass, X_B,A") self.X_P = Solute( doc="Particulate products arising from biomass decay, X_P") self.S_O = Solute(doc="Oxygen, S_O") self.S_NO = Solute(doc="Nitrate and nitrite nitrogen, S_NO") self.S_NH = Solute(doc="NH4+ + NH3 nitrogen, S_NH") self.S_ND = Solute(doc="Soluble biodegradable organic nitrogen, S_ND") self.X_ND = Solute( doc="Particulate biodegradable organic nitrogen, X_ND") self.S_ALK = Component(doc="Alkalinity, S_ALK") # Heat capacity of water self.cp_mass = pyo.Param( mutable=False, initialize=4182, doc="Specific heat capacity of water", units=pyo.units.J / pyo.units.kg / pyo.units.K, ) # Density of water self.dens_mass = pyo.Param( mutable=False, initialize=997, doc="Density of water", units=pyo.units.kg / pyo.units.m**3, ) # Thermodynamic reference state self.pressure_ref = pyo.Param( within=pyo.PositiveReals, mutable=True, default=101325.0, doc="Reference pressure", units=pyo.units.Pa, ) self.temperature_ref = pyo.Param( within=pyo.PositiveReals, mutable=True, default=298.15, doc="Reference temperature", units=pyo.units.K, )