|
| 1 | +Heater1D |
| 2 | +======== |
| 3 | + |
| 4 | +.. index:: |
| 5 | + pair: idaes.models_extra.power_generation.unit_models.heater_1D;Heater1D |
| 6 | + |
| 7 | +.. module:: idaes.models_extra.power_generation.unit_models.heater_1D |
| 8 | + |
| 9 | +This model is for a gas trim heater modeled as gas being blown perpendicularly across banks of hollow tubes, |
| 10 | +which are heated by resistive heating. Note that the ``finite_elements`` option in the control |
| 11 | +volume config should be set to an integer factor of ``number_passes`` in order for the |
| 12 | +discretization equations to make sense as a cross-flow heat exchanger. |
| 13 | + |
| 14 | +Example |
| 15 | +------- |
| 16 | + |
| 17 | +.. code-block:: python |
| 18 | +
|
| 19 | + import pyomo.environ as pyo |
| 20 | +
|
| 21 | + from idaes.core import FlowsheetBlock |
| 22 | + import idaes.core.util.scaling as iscale |
| 23 | + from idaes.models.properties.modular_properties import GenericParameterBlock |
| 24 | + from idaes.models_extra.power_generation.properties.natural_gas_PR import ( |
| 25 | + get_prop, |
| 26 | + EosType, |
| 27 | + ) |
| 28 | + from idaes.models_extra.power_generation.unit_models import Heater1D |
| 29 | + from idaes.core.util.model_statistics import degrees_of_freedom |
| 30 | +
|
| 31 | + optarg = { |
| 32 | + "constr_viol_tol": 1e-8, |
| 33 | + "nlp_scaling_method": "user-scaling", |
| 34 | + "linear_solver": "ma57", |
| 35 | + "OF_ma57_automatic_scaling": "yes", |
| 36 | + "max_iter": 350, |
| 37 | + "tol": 1e-8, |
| 38 | + "halt_on_ampl_error": "no", |
| 39 | + } |
| 40 | +
|
| 41 | + m = pyo.ConcreteModel() |
| 42 | + m.fs = FlowsheetBlock(dynamic=False) |
| 43 | + m.fs.h2_side_prop_params = GenericParameterBlock( |
| 44 | + **get_prop(["H2", "H2O", "Ar", "N2"], {"Vap"}, eos=EosType.IDEAL), |
| 45 | + doc="H2O + H2 gas property parameters", |
| 46 | + ) |
| 47 | + m.fs.heater = Heater1D( |
| 48 | + property_package=m.fs.h2_side_prop_params, |
| 49 | + has_holdup=True, |
| 50 | + dynamic=False, |
| 51 | + has_fluid_holdup=False, |
| 52 | + has_pressure_change=pressure_drop, |
| 53 | + finite_elements=4, |
| 54 | + tube_arrangement="in-line", |
| 55 | + transformation_method="dae.finite_difference", |
| 56 | + transformation_scheme="BACKWARD", |
| 57 | + ) |
| 58 | +
|
| 59 | + heater = m.fs.heater |
| 60 | +
|
| 61 | + heater.inlet.flow_mol.fix(5102.5) |
| 62 | + heater.inlet.temperature.fix(938.83) |
| 63 | + heater.inlet.pressure.fix(1.2e5) |
| 64 | + heater.inlet.mole_frac_comp[0, "H2"].fix(0.57375) |
| 65 | + heater.inlet.mole_frac_comp[0, "H2O"].fix(0.42517) |
| 66 | + heater.inlet.mole_frac_comp[0, "Ar"].fix(0.00086358) |
| 67 | + heater.inlet.mole_frac_comp[0, "N2"].fix(0.00021589) |
| 68 | +
|
| 69 | + heater.di_tube.fix(0.0525018) |
| 70 | + heater.thickness_tube.fix(0.0039116) |
| 71 | + heater.pitch_x.fix(0.1) |
| 72 | + heater.pitch_y.fix(0.1) |
| 73 | + heater.length_tube_seg.fix(10) |
| 74 | + heater.number_passes.fix(1) |
| 75 | + heater.rfouling = 0.0001 |
| 76 | + heater.fcorrection_htc_shell.fix(1) |
| 77 | + heater.cp_wall = 502.4 |
| 78 | + if pressure_drop: |
| 79 | + heater.fcorrection_dp_shell.fix(1) |
| 80 | +
|
| 81 | + heater.number_columns_per_pass.fix(40) |
| 82 | + heater.number_rows_per_pass.fix(40) |
| 83 | + heater.electric_heat_duty.fix(3.6504e06) |
| 84 | +
|
| 85 | + pp = m.fs.h2_side_prop_params |
| 86 | + pp.set_default_scaling("enth_mol_phase", 1e-3) |
| 87 | + pp.set_default_scaling("pressure", 1e-5) |
| 88 | + pp.set_default_scaling("temperature", 1e-2) |
| 89 | + pp.set_default_scaling("flow_mol", 1e-3) |
| 90 | +
|
| 91 | + _mf_scale = { |
| 92 | + "H2": 1, |
| 93 | + "H2O": 1, |
| 94 | + "N2": 10, |
| 95 | + "Ar": 10, |
| 96 | + } |
| 97 | + for comp, s in _mf_scale.items(): |
| 98 | + pp.set_default_scaling("mole_frac_comp", s, index=comp) |
| 99 | + pp.set_default_scaling("mole_frac_phase_comp", s, index=("Vap", comp)) |
| 100 | + pp.set_default_scaling("flow_mol_phase_comp", s * 1e-3, index=("Vap", comp)) |
| 101 | +
|
| 102 | + shell = heater.control_volume |
| 103 | + iscale.set_scaling_factor(shell.area, 1e-1) |
| 104 | + iscale.set_scaling_factor(shell.heat, 1e-6) |
| 105 | + iscale.set_scaling_factor(shell.enthalpy_flow_dx, 1e-7) |
| 106 | + iscale.set_scaling_factor(heater.heat_holdup, 1e-8) |
| 107 | +
|
| 108 | + iscale.calculate_scaling_factors(m) |
| 109 | +
|
| 110 | + initializer = m.fs.heat_exchanger.default_initializer( |
| 111 | + solver="ipopt", |
| 112 | + solver_options=optarg |
| 113 | + ) |
| 114 | + initializer.initialize(m.fs.heat_exchanger) |
| 115 | +
|
| 116 | + |
| 117 | + |
| 118 | +
|
| 119 | +Heater Geometry |
| 120 | +--------------- |
| 121 | +=========================== =========== ============================================================================================= |
| 122 | +Variable Index Sets Doc |
| 123 | +=========================== =========== ============================================================================================= |
| 124 | +``number_columns_per_pass`` None Number of columns of tube per pass |
| 125 | +``number_rows_per_pass`` None Number of rows of tube per pass |
| 126 | +``number_passes`` None Number of tube banks of ``nrow_tube * ncol_inlet`` tubes |
| 127 | +``pitch_x`` None Distance between tubes parallel to flow, measured from center-of-tube to center-of-tube |
| 128 | +``pitch_y`` None Distance between tubes perpendicular to flow, measured from center-of-tube to center-of-tube |
| 129 | +``length_tube_seg`` None Length of tube segment perpendicular to flow in each pass |
| 130 | +``area_flow_shell`` None Reference to flow area on control volume |
| 131 | +``length_flow_shell`` None Reference to flow length on control volume |
| 132 | +``area_flow_shell_min`` None Minimum flow area on shell side |
| 133 | +``di_tube`` None Inner diameter of tubes |
| 134 | +``thickness_tube`` None Thickness of tube wall. |
| 135 | +=========================== =========== ============================================================================================= |
| 136 | + |
| 137 | +============================ =========== =========================================================================== |
| 138 | +Expression Index Sets Doc |
| 139 | +============================ =========== =========================================================================== |
| 140 | +``nrow_tube`` None Total number of rows of tube |
| 141 | +``do_tube`` None Outer diameter of tube (equal to ``di_tube+2*thickness_tube``) |
| 142 | +``pitch_x_to_do`` None Ratio of ``pitch_x`` to ``do_tube`` |
| 143 | +``pitch_y_to_do`` None Ratio of ``pitch_y`` to ``do_tube`` |
| 144 | +``area_wall_seg`` None Total cross-sectional area of tube per pass |
| 145 | +``total_heat_transfer_area`` None Total heat transfer area, as measured on outer surface of tubes |
| 146 | +============================ =========== =========================================================================== |
| 147 | + |
| 148 | +=========================== =========== ================================================================================================= |
| 149 | +Constraint Index Sets Doc |
| 150 | +=========================== =========== ================================================================================================= |
| 151 | +``length_flow_shell_eqn`` None Constrains flow length from control volume to equal value implied by geometry |
| 152 | +``area_flow_shell_eqn`` None Constrains flow cross-sectional area from control volume to equal value implied by geometry |
| 153 | +``area_flow_shell_min_eqn`` None Constraints ``area_flow_shell_min`` to equal value determined by geometry |
| 154 | +=========================== =========== ================================================================================================= |
| 155 | + |
| 156 | +Performance Equations |
| 157 | +----------------------- |
| 158 | + |
| 159 | +================================== ============ ================================================================================= |
| 160 | +Variable Index Sets Doc |
| 161 | +================================== ============ ================================================================================= |
| 162 | +``electric_heat_duty`` time Electric heat duty supplied to entire heater unit |
| 163 | +``fcorrection_htc_shell`` time, length Correction factor for convective heat transfer |
| 164 | +``conv_heat_transfer_coeff_shell`` time, length Convective heat transfer coefficient |
| 165 | +``temp_wall_shell`` time, length Wall temperature of tube |
| 166 | +``temp_wall_center`` time, length Temperature at center of tube wall |
| 167 | +``v_shell`` time, length Flow velocity through minimum area |
| 168 | +``N_Re_shell`` time, length Reynolds number |
| 169 | +``N_Nu_shell`` time, length Nusselt number |
| 170 | +================================== ============ ================================================================================= |
| 171 | + |
| 172 | +=========================== =========== ================================================================================= |
| 173 | +Parameter Index Sets Doc |
| 174 | +=========================== =========== ================================================================================= |
| 175 | +``therm_cond_wall`` None Thermal conductivity of tube wall |
| 176 | +``density_wall`` None Mass density of tube wall metal |
| 177 | +``cp_wall`` None Tube wall heat capacity (mass basis) |
| 178 | +``rfouling_shell`` None Fouling resistance on shell side |
| 179 | +``f_arrangement`` None Adjustment factor depending on ``tube_arrangement`` in config |
| 180 | +=========================== =========== ================================================================================= |
| 181 | + |
| 182 | +====================================== ============ ================================================================================= |
| 183 | +Constraint Index Sets Doc |
| 184 | +====================================== ============ ================================================================================= |
| 185 | +``v_shell_eqn`` time, length Calculates velocity of flow through shell using ``area_flow_shell_min`` |
| 186 | +``N_Re_shell_eqn`` time, length Calculates the Reynolds number |
| 187 | +``conv_heat_transfer_coeff_shell_eqn`` time, length Calculates the convective heat transfer coefficient |
| 188 | +``N_Nu_shell_eqn`` time, length Calculate the Nusselt number |
| 189 | +``heat_shell_eqn`` time, length Calculates heat transfer per unit length |
| 190 | +``temp_wall_shell_eqn`` time, length Calculate the wall temperature of the outer tube |
| 191 | +``temp_wall_center_eqn`` time, length Overall energy balance on tube metal |
| 192 | +====================================== ============ ================================================================================= |
| 193 | + |
| 194 | +====================================== ============ =================================================================================== |
| 195 | +Expression Index Sets Doc |
| 196 | +====================================== ============ =================================================================================== |
| 197 | +``total_heat_transfer_coeff_shell`` time Returns ``conv_heat_transfer_coeff_shell``. Could be extended to include radiation. |
| 198 | +====================================== ============ =================================================================================== |
| 199 | + |
| 200 | +Pressure Change Equations |
| 201 | +------------------------- |
| 202 | + |
| 203 | +=========================== ============ ================================================================================= |
| 204 | +Parameter Index Sets Doc |
| 205 | +=========================== ============ ================================================================================= |
| 206 | +``fcorrection_dp_shell`` None Correction factor for pressure drop |
| 207 | +=========================== ============ ================================================================================= |
| 208 | + |
| 209 | +=========================== ============ ================================================================================= |
| 210 | +Variable Index Sets Doc |
| 211 | +=========================== ============ ================================================================================= |
| 212 | +``fcorrection_dp_shell`` None Correction factor for pressure drop |
| 213 | +``friction_factor_shell`` time, length Friction factor |
| 214 | +=========================== ============ ================================================================================= |
| 215 | + |
| 216 | +================================== ============ ================================================================================= |
| 217 | +Constraint Index Sets Doc |
| 218 | +================================== ============ ================================================================================= |
| 219 | +``friction_factor_shell_eqn`` time, length Calculates the friction factor |
| 220 | +``deltaP_shell_eqn`` time, length Sets ``deltaP_shell`` based on the friction factor and physical properties |
| 221 | +================================== ============ ================================================================================= |
| 222 | + |
| 223 | + |
| 224 | +Holdup Equations |
| 225 | +---------------- |
| 226 | + |
| 227 | +Created when ``has_holdup=True`` in the config. |
| 228 | + |
| 229 | +=========================== ============ ================================================================================= |
| 230 | +Variable Index Sets Doc |
| 231 | +=========================== ============ ================================================================================= |
| 232 | +``heat_holdup`` time, length Energy holdup per unit length of flow path |
| 233 | +=========================== ============ ================================================================================= |
| 234 | + |
| 235 | +=========================== ============ ================================================================================= |
| 236 | +Constraint Index Sets Doc |
| 237 | +=========================== ============ ================================================================================= |
| 238 | +``heat_holdup_eqn`` time, length Defines heat holdup in terms of geometry and physical properties |
| 239 | +=========================== ============ ================================================================================= |
| 240 | + |
| 241 | +Dynamic Equations |
| 242 | +----------------- |
| 243 | + |
| 244 | +Created when ``dynamic=True`` in the config. |
| 245 | + |
| 246 | +=========================== ============ ================================================================================= |
| 247 | +Derivative Variable Index Sets Doc |
| 248 | +=========================== ============ ================================================================================= |
| 249 | +``heat_accumulation`` time, length Energy accumulation in tube wall per unit length of shell flow path per unit time |
| 250 | +=========================== ============ ================================================================================= |
| 251 | + |
| 252 | + |
| 253 | +Initialization |
| 254 | +-------------- |
| 255 | + |
| 256 | +A simple initialization method that first initializes the control volume without heat transfer, |
| 257 | +then adds heat transfer in and solves it again, then finally solves the entire model. |
| 258 | + |
| 259 | + |
| 260 | +Heater1D Class |
| 261 | +-------------- |
| 262 | + |
| 263 | +.. autoclass:: Heater1D |
| 264 | + :members: |
| 265 | + |
| 266 | +Heater1DData Class |
| 267 | +------------------ |
| 268 | + |
| 269 | +.. autoclass:: Heater1DData |
| 270 | + :members: |
| 271 | + |
| 272 | +Heater1DInitializer Class |
| 273 | +------------------------- |
| 274 | + |
| 275 | +.. autoclass:: Heater1DInitializer |
| 276 | + :members: |
0 commit comments