Heater1D#
This model is for a gas trim heater modeled as gas being blown perpendicularly across banks of hollow tubes,
which are heated by resistive heating. Note that the finite_elements
option in the control
volume config should be set to an integer factor of number_passes
in order for the
discretization equations to make sense as a cross-flow heat exchanger.
Example#
import pyomo.environ as pyo
from idaes.core import FlowsheetBlock
import idaes.core.util.scaling as iscale
from idaes.models.properties.modular_properties import GenericParameterBlock
from idaes.models_extra.power_generation.properties.natural_gas_PR import (
get_prop,
EosType,
)
from idaes.models_extra.power_generation.unit_models import Heater1D
from idaes.core.util.model_statistics import degrees_of_freedom
optarg = {
"constr_viol_tol": 1e-8,
"nlp_scaling_method": "user-scaling",
"linear_solver": "ma57",
"OF_ma57_automatic_scaling": "yes",
"max_iter": 350,
"tol": 1e-8,
"halt_on_ampl_error": "no",
}
m = pyo.ConcreteModel()
m.fs = FlowsheetBlock(dynamic=False)
m.fs.h2_side_prop_params = GenericParameterBlock(
**get_prop(["H2", "H2O", "Ar", "N2"], {"Vap"}, eos=EosType.IDEAL),
doc="H2O + H2 gas property parameters",
)
m.fs.heater = Heater1D(
property_package=m.fs.h2_side_prop_params,
has_holdup=True,
dynamic=False,
has_fluid_holdup=False,
has_pressure_change=pressure_drop,
finite_elements=4,
tube_arrangement="in-line",
transformation_method="dae.finite_difference",
transformation_scheme="BACKWARD",
)
heater = m.fs.heater
heater.inlet.flow_mol.fix(5102.5)
heater.inlet.temperature.fix(938.83)
heater.inlet.pressure.fix(1.2e5)
heater.inlet.mole_frac_comp[0, "H2"].fix(0.57375)
heater.inlet.mole_frac_comp[0, "H2O"].fix(0.42517)
heater.inlet.mole_frac_comp[0, "Ar"].fix(0.00086358)
heater.inlet.mole_frac_comp[0, "N2"].fix(0.00021589)
heater.di_tube.fix(0.0525018)
heater.thickness_tube.fix(0.0039116)
heater.pitch_x.fix(0.1)
heater.pitch_y.fix(0.1)
heater.length_tube_seg.fix(10)
heater.number_passes.fix(1)
heater.rfouling = 0.0001
heater.fcorrection_htc_shell.fix(1)
heater.cp_wall = 502.4
if pressure_drop:
heater.fcorrection_dp_shell.fix(1)
heater.number_columns_per_pass.fix(40)
heater.number_rows_per_pass.fix(40)
heater.electric_heat_duty.fix(3.6504e06)
pp = m.fs.h2_side_prop_params
pp.set_default_scaling("enth_mol_phase", 1e-3)
pp.set_default_scaling("pressure", 1e-5)
pp.set_default_scaling("temperature", 1e-2)
pp.set_default_scaling("flow_mol", 1e-3)
_mf_scale = {
"H2": 1,
"H2O": 1,
"N2": 10,
"Ar": 10,
}
for comp, s in _mf_scale.items():
pp.set_default_scaling("mole_frac_comp", s, index=comp)
pp.set_default_scaling("mole_frac_phase_comp", s, index=("Vap", comp))
pp.set_default_scaling("flow_mol_phase_comp", s * 1e-3, index=("Vap", comp))
shell = heater.control_volume
iscale.set_scaling_factor(shell.area, 1e-1)
iscale.set_scaling_factor(shell.heat, 1e-6)
iscale.set_scaling_factor(shell.enthalpy_flow_dx, 1e-7)
iscale.set_scaling_factor(heater.heat_holdup, 1e-8)
iscale.calculate_scaling_factors(m)
initializer = m.fs.heat_exchanger.default_initializer(
solver="ipopt",
solver_options=optarg
)
initializer.initialize(m.fs.heat_exchanger)
Heater Geometry#
Variable |
Index Sets |
Doc |
---|---|---|
|
None |
Number of columns of tube per pass |
|
None |
Number of rows of tube per pass |
|
None |
Number of tube banks of |
|
None |
Distance between tubes parallel to flow, measured from center-of-tube to center-of-tube |
|
None |
Distance between tubes perpendicular to flow, measured from center-of-tube to center-of-tube |
|
None |
Length of tube segment perpendicular to flow in each pass |
|
None |
Reference to flow area on control volume |
|
None |
Reference to flow length on control volume |
|
None |
Minimum flow area on shell side |
|
None |
Inner diameter of tubes |
|
None |
Thickness of tube wall. |
Expression |
Index Sets |
Doc |
---|---|---|
|
None |
Total number of rows of tube |
|
None |
Outer diameter of tube (equal to |
|
None |
Ratio of |
|
None |
Ratio of |
|
None |
Total cross-sectional area of tube per pass |
|
None |
Total heat transfer area, as measured on outer surface of tubes |
Constraint |
Index Sets |
Doc |
---|---|---|
|
None |
Constrains flow length from control volume to equal value implied by geometry |
|
None |
Constrains flow cross-sectional area from control volume to equal value implied by geometry |
|
None |
Constraints |
Performance Equations#
Variable |
Index Sets |
Doc |
---|---|---|
|
time |
Electric heat duty supplied to entire heater unit |
|
time, length |
Correction factor for convective heat transfer |
|
time, length |
Convective heat transfer coefficient |
|
time, length |
Wall temperature of tube |
|
time, length |
Temperature at center of tube wall |
|
time, length |
Flow velocity through minimum area |
|
time, length |
Reynolds number |
|
time, length |
Nusselt number |
Parameter |
Index Sets |
Doc |
---|---|---|
|
None |
Thermal conductivity of tube wall |
|
None |
Mass density of tube wall metal |
|
None |
Tube wall heat capacity (mass basis) |
|
None |
Fouling resistance on shell side |
|
None |
Adjustment factor depending on |
Constraint |
Index Sets |
Doc |
---|---|---|
|
time, length |
Calculates velocity of flow through shell using |
|
time, length |
Calculates the Reynolds number |
|
time, length |
Calculates the convective heat transfer coefficient |
|
time, length |
Calculate the Nusselt number |
|
time, length |
Calculates heat transfer per unit length |
|
time, length |
Calculate the wall temperature of the outer tube |
|
time, length |
Overall energy balance on tube metal |
Expression |
Index Sets |
Doc |
---|---|---|
|
time |
Returns |
Pressure Change Equations#
Parameter |
Index Sets |
Doc |
---|---|---|
|
None |
Correction factor for pressure drop |
Variable |
Index Sets |
Doc |
---|---|---|
|
None |
Correction factor for pressure drop |
|
time, length |
Friction factor |
Constraint |
Index Sets |
Doc |
---|---|---|
|
time, length |
Calculates the friction factor |
|
time, length |
Sets |
Holdup Equations#
Created when has_holdup=True
in the config.
Variable |
Index Sets |
Doc |
---|---|---|
|
time, length |
Energy holdup per unit length of flow path |
Constraint |
Index Sets |
Doc |
---|---|---|
|
time, length |
Defines heat holdup in terms of geometry and physical properties |
Dynamic Equations#
Created when dynamic=True
in the config.
Derivative Variable |
Index Sets |
Doc |
---|---|---|
|
time, length |
Energy accumulation in tube wall per unit length of shell flow path per unit time |
Initialization#
A simple initialization method that first initializes the control volume without heat transfer, then adds heat transfer in and solves it again, then finally solves the entire model.
Heater1D Class#
- class idaes.models_extra.power_generation.unit_models.heater_1D.Heater1D(*args, **kwds)#
- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- dynamic
Indicates whether this model will be dynamic or not, default = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}
- has_holdup
Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}
- has_fluid_holdup
Indicates whether holdup terms for the fluid should be constructed or not. default - False. Valid values: { False - do not construct holdup terms}
- material_balance_type
Indicates what type of mass balance should be constructed, default - MaterialBalanceType.componentTotal. Valid values: { MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}
- energy_balance_type
Indicates what type of energy balance should be constructed, default - EnergyBalanceType.enthalpyTotal. Valid values: { EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}
- momentum_balance_type
Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}
- has_pressure_change
Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}
- property_package
Property parameter object used to define property calculations (default = ‘use_parent_value’) - ‘use_parent_value’ - get package from parent (default = None) - a ParameterBlock object
- property_package_args
A dict of arguments to be passed to the PropertyBlockData and used when constructing these (default = ‘use_parent_value’) - ‘use_parent_value’ - get package from parent (default = None) - a dict (see property package for documentation)
- transformation_method
Discretization method to use for DAE transformation. See Pyomo documentation for supported transformations.
- transformation_scheme
Discretization scheme to use when transforming domain. See Pyomo documentation for supported schemes.
- finite_elements
Number of finite elements to use when discretizing length domain (default=5). Should set to the number of tube rows
- collocation_points
If using collocation, number of collocation points to use per finite element when discretizing length domain (default=3)
- tube_arrangement
tube arrangement could be in-line or staggered
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(Heater1D) New instance
Heater1DData Class#
Heater1DInitializer Class#
- class idaes.models_extra.power_generation.unit_models.heater_1D.Heater1DInitializer(**kwargs)[source]#
Initializer for Heater 1D units.
A simple initialization method that first initializes the control volume without heat transfer, then adds heat transfer in and solves it again, then finally solves the entire model.
- constraint_tolerance
Tolerance for checking constraint convergence
- output_level
Set output level for logging messages
- solver
Solver to use for initialization
- solver_options
Dict of options to pass to solver
- writer_config
Dict of writer_config arguments to pass to solver
- default_submodel_initializer
Default Initializer object to use for sub-models. Only used if no Initializer defined in submodel_initializers.
- always_estimate_states
Whether initialization routine should estimate values for state variables that already have values. Note that if set to True, this will overwrite any initial guesses provided.
- initialize_main_model(model, copy_inlet_state=False)[source]#
Initialization routine for the main Heater 1D model (as opposed to submodels like costing, which presently do not exist).
- Parameters:
model (Block) – Pyomo Block to be initialized.
copy_inlet_state (bool) – bool (default=False). Whether to copy inlet state to other states or not (0-D control volumes only). Copying will generally be faster, but inlet states may not contain all properties required elsewhere.
duty – initial guess for heat duty to assist with initialization. Can be a Pyomo expression with units.
- Returns:
Pyomo solver results object.