class LandfillZOData(ZeroOrderBaseData): """ Zero-Order model for a landfill unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() 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
class UVZOData(ZeroOrderBaseData): """ Zero-Order model for a UV unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "uv" build_siso(self) constant_intensity(self) self.uv_reduced_equivalent_dose = Var(self.flowsheet().time, units=pyunits.mJ/pyunits.cm**2, doc="Reduced equivalent dosage") self.uv_transmittance_in = Var(self.flowsheet().time, units=pyunits.dimensionless, doc="UV transmittance of solution at UV reactor inlet") self.recovery_frac_mass_H2O.fix(1) self._fixed_perf_vars.append(self.uv_reduced_equivalent_dose) self._fixed_perf_vars.append(self.uv_transmittance_in) self._perf_var_dict["UV Reduced Equivalent Dosage (mJ/cm^2)"] = self.uv_reduced_equivalent_dose self._perf_var_dict["UV Transmittance of Feed"] = self.uv_transmittance_in
class SurfaceDischargeData(ZeroOrderBaseData): """ Zero-Order model for a surface discharge unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() 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
class WellFieldZOData(ZeroOrderBaseData): """ Zero-Order model for a well field unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "well_field" 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 (miles)"] = self.pipe_distance self._perf_var_dict["Pipe Diameter (inches)"] = self.pipe_diameter
class DeepWellInjectionZOData(ZeroOrderBaseData): """ Zero-Order model for a deep well injection unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() 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
class ChlorinationZOData(ZeroOrderBaseData): """ Zero-Order model for a Chlorination unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "chlorination" build_siso(self) constant_intensity(self) self.initial_chlorine_demand = Var( self.flowsheet().time, units=pyunits.mg / pyunits.liter, doc="Initial chlorine demand", ) self.contact_time = Var(self.flowsheet().time, units=pyunits.hour, doc="Chlorine contact time") self.concentration_time = Var( self.flowsheet().time, units=(pyunits.mg * pyunits.minute) / pyunits.liter, doc="CT value for chlorination", ) self.chlorine_decay_rate = Var( self.flowsheet().time, units=pyunits.mg / (pyunits.L * pyunits.hour), doc="Chlorine decay rate", ) self.recovery_frac_mass_H2O.fix(1) self._fixed_perf_vars.append(self.initial_chlorine_demand) self._fixed_perf_vars.append(self.contact_time) self._fixed_perf_vars.append(self.concentration_time) self._fixed_perf_vars.append(self.chlorine_decay_rate) self.chlorine_dose = Var(self.flowsheet().time, units=pyunits.mg / pyunits.L, doc="Chlorine dose") @self.Constraint(self.flowsheet().time, doc="Chlorine dose constraint") def chlorine_dose_constraint(b, t): return b.chlorine_dose[t] == self.initial_chlorine_demand[ t] + self.chlorine_decay_rate[t] * self.contact_time[t] + ( self.concentration_time[t] / pyunits.convert( self.contact_time[t], to_units=pyunits.minute)) self._perf_var_dict["Chlorine Dose (mg/L)"] = self.chlorine_dose self._perf_var_dict[ "Initial Chlorine Demand (mg/L)"] = self.initial_chlorine_demand self._perf_var_dict["Contact Time (hr)"] = self.contact_time self._perf_var_dict["CT Value ((mg*min)/L)"] = self.concentration_time self._perf_var_dict[ "Chlorine Decay Rate (mg/(L*hr))"] = self.chlorine_decay_rate
class IonExchangeZOData(ZeroOrderBaseData): """ Zero-Order model for an Ion exchange unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "ion_exchange" build_siso(self) self._Q = Reference(self.properties_in[:].flow_vol) pump_electricity(self, self._Q) # mutable parameter; default value found in WT3 for anion exchange self.eta_pump.set_value(0.8) # mutable parameter; default value of 2 bar converted to feet head self.lift_height.set_value(69.91052 * pyunits.feet) self.recovery_frac_mass_H2O.fix(1) # Add variables and constraints for material requirements self.NaCl_flowrate = Var(self.flowsheet().time, initialize=1, units=pyunits.kg / pyunits.s, bounds=(0, None), doc="Flowrate of NaCl addition") self.NaCl_dose = Var(units=pyunits.kg / pyunits.m**3, bounds=(0, None), doc="Dosage of NaCl addition") self._fixed_perf_vars.append(self.NaCl_dose) self._perf_var_dict["NaCl Addition"] = self.NaCl_flowrate @self.Constraint(self.flowsheet().time) def NaCl_constraint(blk, t): return (blk.NaCl_flowrate[t] == blk.NaCl_dose * blk.properties_in[t].flow_vol) self.resin_demand = Var(self.flowsheet().time, initialize=1, units=pyunits.kg / pyunits.s, bounds=(0, None), doc="Replacement rate of ion exchange resin") self.resin_replacement = Var( units=pyunits.kg / pyunits.m**3, bounds=(0, None), doc="Resin replacement as a fuction of flow") self._fixed_perf_vars.append(self.resin_replacement) self._perf_var_dict["Resin Demand"] = self.resin_demand @self.Constraint(self.flowsheet().time) def resin_constraint(blk, t): return (blk.resin_demand[t] == blk.resin_replacement * blk.properties_in[t].flow_vol)
class ChemicalAdditionZOData(ZeroOrderBaseData): """ Zero-Order model for a chemical addition unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() 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)
class StaticMixerZOData(ZeroOrderBaseData): """ Zero-Order model for a static mixer unit. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "static_mixer" build_pt(self) constant_intensity(self)
class ConstructedWetlandsZOData(ZeroOrderBaseData): """ Zero-Order model for constructed wetlands. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "constructed_wetlands" build_siso(self)
class MediaFiltrationZOData(ZeroOrderBaseData): """ Zero-Order model for a Dual Media Filtration unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "media_filtration" build_sido(self) constant_intensity(self)
class BlendingReservoirZOData(ZeroOrderBaseData): """ Zero-Order model for a Blending Reservoir unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "blending_reservoir" build_pt(self) constant_intensity(self)
class PrimarySeparatorZOData(ZeroOrderBaseData): """ Zero-Order model for a primary separator unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "primary_separator" build_sido(self) constant_intensity(self)
class AnaerobicDigestionOxidationZOData(ZeroOrderBaseData): """ Zero-Order model for an Anaerobic Digestion Oxidation unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "anaerobic_digestion_oxidation" build_sido(self) constant_intensity(self)
class FeedWaterTankZOData(ZeroOrderBaseData): """ Zero-Order model for a Feed Water Tank unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "feed_water_tank" build_pt(self) constant_intensity(self)
class VFARecoveryZOData(ZeroOrderBaseData): """ Zero-Order model for a VFA recovery unit. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "vfa_recovery" build_sido(self) constant_intensity(self)
class SettlingPondZOData(ZeroOrderBaseData): """ Zero-Order model for a settling pond unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "settling_pond" build_sido(self) constant_intensity(self)
class MBRZOData(ZeroOrderBaseData): """ Zero-Order model for a membrane bioreactor unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "mbr" build_sido(self) constant_intensity(self)
class ClarifierZOData(ZeroOrderBaseData): """ Zero-Order model for a Clarifier unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "clarifier" build_sido(self) constant_intensity(self)
class BioActiveFiltrationZOData(ZeroOrderBaseData): """ Zero-Order model for a Biologically Active Filtration unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "bio_active_filtration" build_sido(self) constant_intensity(self)
class SludgeTankZOData(ZeroOrderBaseData): """ Zero-Order model for a sludge tank unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "sludge_tank" build_sido(self) constant_intensity(self)
class WalnutShellFilterZOData(ZeroOrderBaseData): """ Zero-Order model for a Walnut Shell Filter unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "walnut_shell_filter" build_sido(self) constant_intensity(self)
class ScreenZOData(ZeroOrderBaseData): """ Zero-Order model for a Screen unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "screen" build_sido(self) constant_intensity(self)
class PumpZOData(ZeroOrderBaseData): """ Zero-Order model for a pump unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "pump" build_pt(self) constant_intensity(self)
class MunicipalWWTPZOData(ZeroOrderBaseData): """ Zero-Order model for a municipal wastewater treatment plant unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "municipal_wwtp" build_pt(self) constant_intensity(self)
class TrampOilTankZOData(ZeroOrderBaseData): """ Zero-Order model for a tramp oil tank unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "tramp_oil_tank" build_pt(self) constant_intensity(self)
class InjectionWellDisposalZOData(ZeroOrderBaseData): """ Zero-Order model for a injection well disposal unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "injection_well_disposal" build_pt(self) constant_intensity(self)
class CoolingSupplyZOData(ZeroOrderBaseData): """ Zero-Order model for a Cooling Supply unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "cooling_supply" build_pt(self) constant_intensity(self)
class CASZOData(ZeroOrderBaseData): """ Zero-Order model for the conventional activated sludge process. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "conventional_activated_sludge" build_sido(self) constant_intensity(self)
class AirFlotationZOData(ZeroOrderBaseData): """ Zero-Order model for an Air Flotation unit operation. """ CONFIG = ZeroOrderBaseData.CONFIG() def build(self): super().build() self._tech_type = "air_flotation" build_sido(self) constant_intensity(self)