Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions idaes/models/costing/SSLW.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def base_cost(blk):
# Material of construction factor Eq. 22.44 in the reference
blk.material_factor = pyo.Var(
initialize=3.5,
domain=pyo.NonNegativeReals,
bounds=(0, None),
doc="Construction material correction factor",
)

Expand Down Expand Up @@ -389,7 +389,7 @@ def hx_material_eqn(self):

# Assume higher pressure fluid is tube side
blk.pressure_factor = pyo.Var(
initialize=1, domain=pyo.NonNegativeReals, doc="Pressure design factor"
initialize=1, bounds=(0, None), doc="Pressure design factor"
)

try:
Expand Down Expand Up @@ -478,14 +478,13 @@ def cost_vessel(
# Build generic costing variables
blk.base_cost_per_unit = pyo.Var(
initialize=1e5,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Base cost per unit",
)

blk.capital_cost = pyo.Var(
initialize=1e4,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Capital cost of all units",
Expand Down Expand Up @@ -576,7 +575,7 @@ def cost_vessel(
# Calculate weight of vessel
blk.weight = pyo.Var(
initialize=1000,
domain=pyo.NonNegativeReals,
bounds=(0, None),
doc="Weight of vessel in lb",
units=pyo.units.pound,
)
Expand Down Expand Up @@ -658,7 +657,7 @@ def _cost_platforms_ladders(
blk.base_cost_platforms_ladders = pyo.Var(
initialize=1000,
units=pyo.units.USD_CE500,
domain=pyo.NonNegativeReals,
bounds=(0, None),
doc="Base cost of platforms and ladders",
)

Expand Down Expand Up @@ -720,7 +719,7 @@ def _cost_distillation_trays(
blk.base_cost_trays = pyo.Var(
initialize=1e6,
units=pyo.units.USD_CE500,
domain=pyo.NonNegativeReals,
bounds=(0, None),
doc="Purchase cost of trays",
)

Expand Down Expand Up @@ -769,7 +768,7 @@ def num_tray_factor_constraint(blk):
# Calculate base cost of a single tray
blk.base_cost_per_tray = pyo.Var(
initialize=1e4,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Base cost of a single tray",
)
Expand Down Expand Up @@ -953,7 +952,7 @@ def cost_fired_heater(

# Pressure design factor calculation
blk.pressure_factor = pyo.Var(
initialize=1.1, domain=pyo.NonNegativeReals, doc="Pressure design factor"
initialize=1.1, bounds=(0, None), doc="Pressure design factor"
)

@blk.Constraint()
Expand Down Expand Up @@ -1278,7 +1277,6 @@ def cost_turbine(blk, integer=True):
# Build costing variables
blk.capital_cost = pyo.Var(
initialize=1e4,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Capital cost of all units",
Expand All @@ -1287,7 +1285,7 @@ def cost_turbine(blk, integer=True):
if integer is True:
domain = pyo.Integers
else:
domain = pyo.NonNegativeReals
domain = pyo.Reals
blk.number_of_units = pyo.Var(
initialize=1,
domain=domain,
Expand Down Expand Up @@ -1369,7 +1367,6 @@ def cost_pump(
# Add common variables
blk.capital_cost = pyo.Var(
initialize=1e4,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Capital cost of all units",
Expand All @@ -1378,7 +1375,7 @@ def cost_pump(
if integer is True:
domain = pyo.Integers
else:
domain = pyo.NonNegativeReals
domain = pyo.Reals
blk.number_of_units = pyo.Var(
initialize=1,
domain=domain,
Expand Down Expand Up @@ -1416,7 +1413,7 @@ def cost_pump(
# Calculate pump head
blk.pump_head = pyo.Var(
initialize=10,
domain=pyo.NonNegativeReals,
bounds=(0, None),
doc="Pump Head in feet of fluid flowing (Pressure rise/density)",
units=pyo.units.pound_force * pyo.units.foot / pyo.units.pound,
)
Expand All @@ -1430,7 +1427,7 @@ def pump_head_eq(blk):
# H = pump head in feet of flowing (pressure rise/liquid density)
blk.size_factor = pyo.Var(
initialize=10000,
domain=pyo.NonNegativeReals,
bounds=(0, None),
doc="Pump size factor, f(Q,pump_head)",
)

Expand Down Expand Up @@ -1501,7 +1498,7 @@ def size_factor_eq(blk):
# Base pump cost per unit
blk.base_pump_cost_per_unit = pyo.Var(
initialize=1e5,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE394,
doc="Base cost of pump (less motor) per unit",
)
Expand Down Expand Up @@ -1535,7 +1532,7 @@ def base_pump_cost(blk):

blk.pump_capital_cost = pyo.Var(
initialize=100000,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Capital cost of pumps (less motors)",
)
Expand Down Expand Up @@ -1569,7 +1566,7 @@ def pump_capital_cost_eq(blk):

blk.base_motor_cost_per_unit = pyo.Var(
initialize=10000,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE394,
doc="Motor base purchase cost per unit",
)
Expand All @@ -1593,7 +1590,7 @@ def motor_base_cost(blk):

blk.motor_capital_cost = pyo.Var(
initialize=100000,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Capital cost of all motors",
)
Expand Down Expand Up @@ -1671,14 +1668,13 @@ def _make_common_vars(blk, integer=True):
# Build generic costing variables (most costing models need these vars)
blk.base_cost_per_unit = pyo.Var(
initialize=1e5,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Base cost per unit",
)

blk.capital_cost = pyo.Var(
initialize=1e4,
domain=pyo.NonNegativeReals,
bounds=(0, None),
units=pyo.units.USD_CE500,
doc="Capital cost of all units",
Expand All @@ -1687,7 +1683,7 @@ def _make_common_vars(blk, integer=True):
if integer is True:
domain = pyo.Integers
else:
domain = pyo.NonNegativeReals
domain = pyo.Reals
blk.number_of_units = pyo.Var(
initialize=1, domain=domain, bounds=(1, 100), doc="Number of units to install."
)
Expand Down
5 changes: 2 additions & 3 deletions idaes/models/properties/examples/saponification_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# Import Pyomo libraries
from pyomo.environ import (
Constraint,
NonNegativeReals,
Param,
PositiveReals,
Reals,
Expand Down Expand Up @@ -331,7 +330,7 @@ def build(self):
# Create state variables
self.flow_vol = Var(
initialize=1.0,
domain=NonNegativeReals,
bounds=(0, None),
doc="Total volumentric flowrate [m^3/s]",
units=units.m**3 / units.s,
)
Expand All @@ -351,7 +350,7 @@ def build(self):
)
self.conc_mol_comp = Var(
self.params.component_list,
domain=NonNegativeReals,
bounds=(0, None),
initialize=100.0,
doc="Component molar concentrations " "[mol/m^3]",
units=units.mol / units.m**3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from pyomo.environ import (
Constraint,
Expression,
NonNegativeReals,
Var,
units as pyunits,
)
Expand Down Expand Up @@ -94,7 +93,6 @@ def define_state(b):
# Add state variables
b.flow_mol = Var(
initialize=f_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc=" Total molar flowrate",
units=units.FLOW_MOLE,
Expand All @@ -108,7 +106,6 @@ def define_state(b):
)
b.pressure = Var(
initialize=p_init,
domain=NonNegativeReals,
bounds=p_bounds,
doc="State pressure",
units=units.PRESSURE,
Expand All @@ -130,7 +127,6 @@ def define_state(b):
b.flow_mol_phase = Var(
b.phase_list,
initialize=fp_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc="Phase molar flow rates",
units=units.FLOW_MOLE,
Expand All @@ -153,7 +149,6 @@ def flow_mol_phase_comp_rule(b, p, j):

b.temperature = Var(
initialize=t_init,
domain=NonNegativeReals,
bounds=t_bounds,
doc="Temperature",
units=units.TEMPERATURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from pyomo.environ import (
Constraint,
Expression,
NonNegativeReals,
Var,
value,
units as pyunits,
Expand Down Expand Up @@ -104,7 +103,6 @@ def define_state(b):
# Add state variables
b.flow_mol = Var(
initialize=f_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc=" Total molar flowrate",
units=units.FLOW_MOLE,
Expand All @@ -118,14 +116,12 @@ def define_state(b):
)
b.pressure = Var(
initialize=p_init,
domain=NonNegativeReals,
bounds=p_bounds,
doc="State pressure",
units=units.PRESSURE,
)
b.temperature = Var(
initialize=t_init,
domain=NonNegativeReals,
bounds=t_bounds,
doc="State temperature",
units=units.TEMPERATURE,
Expand All @@ -140,7 +136,6 @@ def define_state(b):
b.flow_mol_phase = Var(
b.phase_list,
initialize=fp_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc="Phase molar flow rates",
units=units.FLOW_MOLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from pyomo.environ import (
Constraint,
Expression,
NonNegativeReals,
Var,
units as pyunits,
)
Expand Down Expand Up @@ -90,21 +89,18 @@ def define_state(b):
b.flow_mol_comp = Var(
b.component_list,
initialize=f_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc="Component molar flowrate",
units=units.FLOW_MOLE,
)
b.pressure = Var(
initialize=p_init,
domain=NonNegativeReals,
bounds=p_bounds,
doc="State pressure",
units=units.PRESSURE,
)
b.enth_mol = Var(
initialize=h_init,
domain=NonNegativeReals,
bounds=h_bounds,
doc="Mixture molar specific enthalpy",
units=units.ENERGY_MOLE,
Expand All @@ -124,15 +120,13 @@ def define_state(b):
b.flow_mol_phase = Var(
b.phase_list,
initialize=fp_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc="Phase molar flow rates",
units=units.FLOW_MOLE,
)

b.temperature = Var(
initialize=t_init,
domain=NonNegativeReals,
bounds=t_bounds,
doc="Temperature",
units=units.TEMPERATURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from pyomo.environ import (
Constraint,
Expression,
NonNegativeReals,
Var,
units as pyunits,
)
Expand Down Expand Up @@ -89,21 +88,18 @@ def define_state(b):
b.flow_mol_comp = Var(
b.component_list,
initialize=f_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc=" Component molar flowrate",
units=units.FLOW_MOLE,
)
b.pressure = Var(
initialize=p_init,
domain=NonNegativeReals,
bounds=p_bounds,
doc="State pressure",
units=units.PRESSURE,
)
b.temperature = Var(
initialize=t_init,
domain=NonNegativeReals,
bounds=t_bounds,
doc="State temperature",
units=units.TEMPERATURE,
Expand All @@ -123,7 +119,6 @@ def define_state(b):
b.flow_mol_phase = Var(
b.phase_list,
initialize=fp_init,
domain=NonNegativeReals,
bounds=f_bounds,
doc="Phase molar flow rates",
units=units.FLOW_MOLE,
Expand Down
Loading
Loading