def build(self): super().build() self._tech_type = "pump" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "tramp_oil_tank" build_pt(self) constant_intensity(self)
def build(self): super().build() build_pt(self) # self._has_recovery_removal = False self._tech_type = "storage_tank" self.storage_time = Var(self.flowsheet().time, units=pyunits.hours, doc="Storage time needed") self.surge_capacity = Var( self.flowsheet().time, units=pyunits.dimensionless, doc="Additional capacity needed for surge flow", ) self._fixed_perf_vars.append(self.storage_time) self._fixed_perf_vars.append(self.surge_capacity) self.tank_volume = Var(self.flowsheet().time, units=pyunits.m**3, doc="Storage tank volume") @self.Constraint(self.flowsheet().time, doc="Tank volume constraint") def tank_volume_constraint(b, t): return b.tank_volume[t] == pyunits.convert( b.properties[t].flow_vol, to_units=pyunits.m**3 / pyunits.hr) * b.storage_time[t] * (1 + b.surge_capacity[t]) self._perf_var_dict["Storage Time (hr)"] = self.storage_time self._perf_var_dict["Surge Capacity (%)"] = self.surge_capacity self._perf_var_dict["Tank Volume (m3)"] = self.tank_volume
def build(self): super().build() self._tech_type = "deep_well_injection" build_pt(self) self._Q = Reference(self.properties[:].flow_vol) pump_electricity(self, self._Q) self.pipe_distance = Var(self.flowsheet().config.time, units=pyunits.miles, doc="Piping distance") self.pipe_diameter = Var(self.flowsheet().config.time, units=pyunits.inches, doc="Pipe diameter") self.flow_basis = Var(self.flowsheet().time, units=pyunits.m**3 / pyunits.hour, doc="flow basis") self._fixed_perf_vars.append(self.pipe_distance) self._fixed_perf_vars.append(self.pipe_diameter) self._fixed_perf_vars.append(self.flow_basis) self._perf_var_dict["Pipe Distance (miles)"] = self.pipe_distance self._perf_var_dict["Pipe Diameter (inches)"] = self.pipe_diameter
def build(self): super().build() self._tech_type = "landfill" build_pt(self) constant_intensity(self) self.capacity_basis = Var(self.flowsheet().time, units=pyunits.kg / pyunits.hr, doc="capacity basis for capital cost") self.total_mass = Var(self.flowsheet().time, units=pyunits.kg / pyunits.hr, doc="total mass flow rate") self._fixed_perf_vars.append(self.capacity_basis) @self.Constraint(self.flowsheet().time, doc='Total mass constraint') def total_mass_constraint(b, t): return b.total_mass[t] == sum( pyunits.convert(b.inlet.flow_mass_comp[t, m], to_units=pyunits.kg / pyunits.hr) for m in b.config.property_package.component_list) self._perf_var_dict["Capacity Basis (kg/hr)"] = self.capacity_basis self._perf_var_dict["Total Mass (kg/hr)"] = self.total_mass
def build(self): super().build() self._tech_type = "blending_reservoir" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "feed_water_tank" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "municipal_wwtp" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "injection_well_disposal" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "co2_addition" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "cooling_supply" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "intrusion_mitigation" build_pt(self) constant_intensity(self)
def build(self): super().build() self._tech_type = "sw_onshore_intake" build_pt(self) self._Q = Reference(self.properties[:].flow_vol) pump_electricity(self, self._Q)
def build(self): super().build() self._tech_type = "chemical_addition" if self.config.process_subtype is None: raise ConfigurationError( f"{self.name} - zero-order chemical addition operations " "require the process_subtype configuration argument to be set" ) build_pt(self) self.chemical_dosage = pyo.Var( self.flowsheet().time, units=pyo.units.mg / pyo.units.L, bounds=(0, None), doc="Dosing rate of chemical", ) self.solution_density = pyo.Var( bounds=(0, None), units=pyo.units.kg / pyo.units.m**3, doc="Mass density of chemical solution", ) self.ratio_in_solution = pyo.Var( bounds=(0, 1), units=pyo.units.dimensionless, doc="Mass fraction of chemical in solution", ) self.chemical_flow_vol = pyo.Var( self.flowsheet().time, units=pyo.units.m**3 / pyo.units.s, bounds=(0, None), doc="Volumetric flow rate of chemical solution", ) self._fixed_perf_vars.append(self.chemical_dosage) self._fixed_perf_vars.append(self.solution_density) self._fixed_perf_vars.append(self.ratio_in_solution) self._perf_var_dict["Chemical Dosage"] = self.chemical_dosage self._perf_var_dict["Chemical Flow"] = self.chemical_flow_vol def rule_chem_flow(blk, t): return blk.chemical_flow_vol[t] == pyo.units.convert( blk.chemical_dosage[t] * blk.properties[t].flow_vol / (blk.solution_density * blk.ratio_in_solution), to_units=pyo.units.m**3 / pyo.units.s, ) self.chemical_flow_constraint = pyo.Constraint( self.flowsheet().time, rule=rule_chem_flow ) pump_electricity(self, self.chemical_flow_vol)
def build(self): super().build() self._tech_type = "energy_recovery" build_pt(self) constant_intensity(self) self.electricity.setlb(None) self.electricity.setub(0)
def build(self): super().build() self._tech_type = "pump_electricity" build_pt(self) self.lift_height = Var(units=pyunits.m, doc="Lift height for pump") self.eta_pump = Var(units=pyunits.dimensionless, doc="Efficiency of pump") self.eta_motor = Var(units=pyunits.dimensionless, doc="Efficiency of motor") self.electricity = Var( self.flowsheet().config.time, units=pyunits.kW, bounds=(0, None), doc="Electricity for low pressure pump", ) self.applied_pressure = Var( self.flowsheet().config.time, units=pyunits.bar, bounds=(0, None), doc="Applied pressure", ) self._fixed_perf_vars.append(self.lift_height) self._fixed_perf_vars.append(self.eta_pump) self._fixed_perf_vars.append(self.eta_motor) @self.Constraint( self.flowsheet().time, doc="Constraint for electricity consumption based on " "pump flowrate.", ) def electricity_consumption(b, t): return b.electricity[t] == pyunits.convert( b.lift_height * b.properties[t].flow_vol * b.properties[t].dens_mass * Constants.acceleration_gravity / (b.eta_pump * b.eta_motor), to_units=pyunits.kW, ) @self.Constraint(self.flowsheet().time, doc="Constraint for pump applied pressure") def applied_pressure_constraint(b, t): return b.applied_pressure[t] == pyunits.convert( b.lift_height * b.properties[t].dens_mass * Constants.acceleration_gravity, to_units=pyunits.bar, ) self._perf_var_dict["Electricity (kW)"] = self.electricity self._perf_var_dict["Applied Pressure (bar)"] = self.applied_pressure
def build(self): super().build() self._tech_type = "municipal_drinking" build_pt(self) self._Q = Reference(self.properties[:].flow_vol) pump_electricity(self, self._Q) # mutable parameter; default value found in WT3 self.lift_height.set_value(300 * pyunits.feet)
def build(self): super().build() self._tech_type = "water_pumping_station" build_pt(self) # create electricity variable and add to performance dictionary _common(self) self.lift_height = Var( self.flowsheet().time, initialize=100, units=pyunits.feet, doc="Lift height for pump", ) self.eta_pump = Var( self.flowsheet().time, initialize=0.9, units=pyunits.dimensionless, doc="Efficiency of pump", ) self.eta_motor = Var( self.flowsheet().time, initialize=0.9, units=pyunits.dimensionless, doc="Efficiency of motor", ) self._fixed_perf_vars.append(self.eta_pump) self._fixed_perf_vars.append(self.eta_motor) if not self.config.fix_pump_power: self._fixed_perf_vars.append(self.lift_height) else: self._fixed_perf_vars.append(self.electricity) @self.Constraint( self.flowsheet().time, doc="Constraint for electricity consumption based on " "pump flowrate.", ) def electricity_consumption(b, t): A = (3960 * pyunits.gallon * pyunits.foot / pyunits.minute / pyunits.horsepower) return b.electricity[t] == pyunits.convert( b.properties[t].flow_vol * b.lift_height[t] / (A * b.eta_pump[t] * b.eta_motor[t]), to_units=pyunits.kW, )
def build(self): super().build() self._tech_type = "surface_discharge" build_pt(self) self._Q = Reference(self.properties[:].flow_vol) pump_electricity(self, self._Q) self.pipe_distance = Var(self.flowsheet().config.time, units=pyunits.miles, doc="Piping distance") self.pipe_diameter = Var(self.flowsheet().config.time, units=pyunits.inches, doc="Pipe diameter") self._fixed_perf_vars.append(self.pipe_distance) self._fixed_perf_vars.append(self.pipe_diameter) self._perf_var_dict["Pipe Distance"] = self.pipe_distance self._perf_var_dict["Pipe Diameter"] = self.pipe_diameter
def build(self): super().build() self._tech_type = "coag_and_floc" build_pt(self) self.alum_dose = Var(self.flowsheet().time, units=pyunits.mg / pyunits.L, bounds=(0, None), doc="Dosing rate of alum") self.polymer_dose = Var(self.flowsheet().time, units=pyunits.mg / pyunits.L, bounds=(0, None), doc="Dosing rate of polymer") self.anion_to_cation_polymer_ratio = Var( self.flowsheet().time, bounds=(0, None), units=pyunits.dimensionless, doc="Ratio of anionic to cationic polymer in dosage") self.anionic_polymer_dose = Var(self.flowsheet().config.time, bounds=(0, None), units=pyunits.mg / pyunits.L, doc="Dosing rate of anionic polymer") self.cationic_polymer_dose = Var(self.flowsheet().config.time, bounds=(0, None), units=pyunits.mg / pyunits.L, doc="Dosing rate of cationic polymer") self.chemical_flow_mass = Var( self.flowsheet().time, ["alum", "polymer"], units=pyunits.kg / pyunits.s, bounds=(0, None), doc="Mass flow rate of chemical solution") self.rapid_mix_retention_time = Var(self.flowsheet().config.time, units=pyunits.seconds, doc="Rapid Mix Retention Time") self.floc_retention_time = Var(self.flowsheet().config.time, units=pyunits.minutes, doc="Floc Retention Time") self.rapid_mix_basin_vol = Var(units=pyunits.m**3, doc="Rapid Mix Basin Volume") self.floc_basin_vol = Var(units=pyunits.m**3, doc="Floc Basin Volume") self.num_rapid_mixers = Var(units=pyunits.dimensionless, doc="Number of Rapid Mixers") self.num_floc_mixers = Var(units=pyunits.dimensionless, doc="Number of Floc Mixers") self.num_rapid_mix_processes = Var(units=pyunits.dimensionless, doc="Number of Rapid Mix Processes") self.num_floc_processes = Var(units=pyunits.dimensionless, doc="Number of Floc Processes") self.num_coag_processes = Var(units=pyunits.dimensionless, doc="Number of Coagulation Processes") self.num_floc_injection_processes = Var( units=pyunits.dimensionless, doc="Number of Floc Injection Processes") self.velocity_gradient_rapid_mix = Var( self.flowsheet().config.time, units=pyunits.s**-1, doc="Rapid Mix Velocity Gradient") self.velocity_gradient_floc = Var(self.flowsheet().config.time, units=pyunits.s**-1, doc="Floc Velocity Gradient") self.power_rapid_mix = Var(self.flowsheet().config.time, units=pyunits.kW, doc="Rapid Mix Power Consumption") self.power_floc = Var(self.flowsheet().config.time, units=pyunits.kW, doc="Floc Power Consumption") self.total_power = Var(self.flowsheet().config.time, units=pyunits.kW, doc="Total Power Consumption") self._fixed_perf_vars.append(self.alum_dose) self._fixed_perf_vars.append(self.polymer_dose) self._fixed_perf_vars.append(self.anion_to_cation_polymer_ratio) self._fixed_perf_vars.append(self.rapid_mix_retention_time) self._fixed_perf_vars.append(self.floc_retention_time) self._fixed_perf_vars.append(self.num_floc_injection_processes) self._fixed_perf_vars.append(self.num_floc_processes) self._fixed_perf_vars.append(self.num_rapid_mixers) self._fixed_perf_vars.append(self.num_coag_processes) self._fixed_perf_vars.append(self.num_floc_mixers) self._fixed_perf_vars.append(self.num_rapid_mix_processes) self._fixed_perf_vars.append(self.velocity_gradient_rapid_mix) self._fixed_perf_vars.append(self.velocity_gradient_floc) self._perf_var_dict["Alum Dosage (mg/L)"] = self.alum_dose self._perf_var_dict["Polymer Dosage (mg/L)"] = self.polymer_dose self._perf_var_dict["Alum Flow (kg/s)"] = self.chemical_flow_mass[ 0, "alum"] self._perf_var_dict["Polymer Flow (kg/s)"] = self.chemical_flow_mass[ 0, "polymer"] self._perf_var_dict[ "Rapid Mix Basin Volume (m^3)"] = self.rapid_mix_basin_vol self._perf_var_dict["Floc Basin Volume (m^3)"] = self.floc_basin_vol self._perf_var_dict[ "Rapid Mix Retention Time (s)"] = self.rapid_mix_retention_time self._perf_var_dict[ "Floc Retention Time (min)"] = self.floc_retention_time self._perf_var_dict[ "Rapid Mix Velocity Gradient (1/s)"] = self.velocity_gradient_rapid_mix self._perf_var_dict[ "Floc Velocity Gradient (1/s)"] = self.velocity_gradient_floc self._perf_var_dict["Rapid Mix Power (kW)"] = self.power_rapid_mix self._perf_var_dict["Floc Power (kW)"] = self.power_floc self._perf_var_dict["Total Power Consumption (kW)"] = self.total_power def rule_rapid_mix_basin_vol(blk): return (blk.rapid_mix_basin_vol == blk.properties[0].flow_vol * blk.rapid_mix_retention_time[0]) self.rapid_mix_basin_vol_constraint = Constraint( rule=rule_rapid_mix_basin_vol) def rule_floc_basin_vol(blk): return (blk.floc_basin_vol == pyunits.convert( blk.properties[0].flow_vol * blk.floc_retention_time[0], to_units=pyunits.m**3)) self.floc_basin_vol_constraint = Constraint(rule=rule_floc_basin_vol) def rule_chem_flow(blk, t, j): if j == 'alum': chemical_dosage = blk.alum_dose[t] elif j == 'polymer': chemical_dosage = blk.polymer_dose[t] return (blk.chemical_flow_mass[t, j] == pyunits.convert( chemical_dosage * blk.properties[t].flow_vol, to_units=pyunits.kg / pyunits.s)) self.chemical_flow_constraint = Constraint(self.flowsheet().time, ["alum", "polymer"], rule=rule_chem_flow) def rule_anionic_polymer_dose(blk, t): return (blk.anionic_polymer_dose[t] == blk.anion_to_cation_polymer_ratio[t] * blk.polymer_dose[t] / (blk.anion_to_cation_polymer_ratio[t] + 1)) self.anionic_polymer_dose_constraint = Constraint( self.flowsheet().config.time, rule=rule_anionic_polymer_dose) def rule_cationic_polymer_dose(blk, t): return (blk.cationic_polymer_dose[t] == blk.polymer_dose[t] / (blk.anion_to_cation_polymer_ratio[t] + 1)) self.cationic_polymer_dose_constraint = Constraint( self.flowsheet().config.time, rule=rule_cationic_polymer_dose) # TODO: WT3 doesn't include pump electricity. Consider adding after case study validation # pump_electricity(self, self.chemical_flow_vol) @self.Constraint(self.flowsheet().time, doc='Constraint for rapid mix power consumption') def rule_power_rapid_mix(b, t): return (b.power_rapid_mix[t] == pyunits.convert( b.num_rapid_mixers * b.properties[t].visc_d * b.rapid_mix_basin_vol * b.velocity_gradient_rapid_mix[t]**2, to_units=pyunits.kW)) @self.Constraint(self.flowsheet().time, doc='Constraint for floc power consumption') def rule_power_floc(b, t): return (b.power_floc[t] == pyunits.convert( b.num_floc_mixers * b.properties[t].visc_d * b.floc_basin_vol * b.velocity_gradient_floc[t]**2, to_units=pyunits.kW)) @self.Constraint(self.flowsheet().time, doc='Total power consumption') def total_power_constraint(b, t): return b.total_power[t] == b.power_floc[t] + b.power_rapid_mix[t]
def build(self): super().build() self._tech_type = "static_mixer" build_pt(self) constant_intensity(self)