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(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)
Exemple #4
0
    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(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()