Skip to content

Commit

Permalink
Improving guess for heat duty scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee94 committed Oct 11, 2024
1 parent 1f200db commit c8e7408
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions idaes/models/unit_models/equilibrium_reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class EquilibriumReactorScaler(CustomScalerBase):

UNIT_SCALING_FACTORS = {
# "QuantityName: (reference units, scaling factor)
"Heat": (units.kW, 1),
"Pressure Change": (units.bar, 10),
}

Expand Down Expand Up @@ -115,11 +114,23 @@ def variable_scaling_routine(
self.scale_variable_by_units(
model.control_volume.deltaP[t], overwrite=overwrite
)

# Heat transfer - optional
# Scale heat based on enthalpy flow entering reactor
if hasattr(model.control_volume, "heat"):
for t in model.flowsheet().time:
self.scale_variable_by_units(
model.control_volume.heat[t], overwrite=overwrite
h_in = 0
for p in model.control_volume.properties_in.phase_list:
h_in += sum(
self.get_expression_nominal_values(
model.control_volume.properties_in[
t
].get_enthalpy_flow_terms(p)
)
)
# Scale for heat is general one order of magnitude less than enthalpy flow
self.set_variable_scaling_factor(
model.control_volume.heat[t], 1 / (0.1 * h_in)
)

def constraint_scaling_routine(
Expand Down

0 comments on commit c8e7408

Please sign in to comment.