Skip to content

Commit

Permalink
Use Black 23.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pengfei-Xu-1993 committed Dec 13, 2024
1 parent 5c2a12f commit e916ea0
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ def rule_molal_conc_solute_gen(b):

# MED Loop
if solve_nonideal:

# Add activity coefficient as a global variable in each evaporator.
m.fs.act_coeff = pyo.Var(
m.fs.set_evaporators,
Expand Down Expand Up @@ -426,7 +425,6 @@ def _eq_phase_equilibrium(b, e):

# AHP Loop
if solve_nonideal_AHP:

# Add activity coefficient as a global variable in each evaporator.
m.fs.act_coeff_gen = pyo.Var(
initialize=1, units=pyunits.dimensionless, bounds=(1e-5, 100)
Expand Down Expand Up @@ -590,7 +588,6 @@ def create_arcs(m):

# MED Loop
def add_enrtl_method_single(m, n_evap=None):

sb_enrtl = m.fs.enrtl_state[n_evap].properties[0] # renaming the block

# Populate eNRTL state block
Expand Down Expand Up @@ -674,7 +671,6 @@ def enrtl_flow_mass_ion_comp(b, j):


def add_enrtl_method_multi(m, n_evap=None):

sb_enrtl = m.fs.enrtl_state[n_evap].properties[0] # renaming the block

# Populate eNRTL state block
Expand Down Expand Up @@ -772,7 +768,6 @@ def enrtl_flow_mass_ion_comp(b, j):


def add_enrtl_method_AHP(m):

sb_enrtl_gen = m.fs.enrtl_state_gen.properties[0] # renaming the block

# Populate eNRTL state block
Expand Down Expand Up @@ -888,7 +883,6 @@ def set_scaling(m):


def set_model_inputs(m):

# Feed
# Assumed a constant feedflowrate of seawater to be 0.25kg/s
# TDS flowrate = [(TDS concentration=23,000ppm * Seawater feed flowrate=0.25)]/1.0e6
Expand Down Expand Up @@ -985,7 +979,6 @@ def set_model_inputs(m):


def initialize(m, solver=None, outlvl=idaeslog.NOTSET):

# Initialize feed
m.fs.feed_sw.properties[0].mass_frac_phase_comp["Liq", "TDS"]
solver.solve(m.fs.feed_sw)
Expand Down Expand Up @@ -1086,7 +1079,6 @@ def initialize(m, solver=None, outlvl=idaeslog.NOTSET):


def add_bounds(m):

for i in m.fs.set_evaporators:
m.fs.evaporator[i].area.setlb(10)
m.fs.evaporator[i].area.setub(None)
Expand All @@ -1096,7 +1088,6 @@ def add_bounds(m):


def print_results(m):

sw_blk_gen = m.fs.generator.properties_feed[0]
brine_blk_gen = m.fs.generator.properties_brine[0]
vapor_blk_gen = m.fs.generator.properties_vapor[0]
Expand Down Expand Up @@ -1737,7 +1728,6 @@ def water_recovery_lb(b):


if __name__ == "__main__":

optarg = {"max_iter": 500, "tol": 1e-8}
solver = get_solver("ipopt", optarg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
refined_enrtl_method = True

if refined_enrtl_method:

# Import refined eNRTL method
from refined_enrtl import rENRTL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ def define_metadata(cls, obj):

# This Class contains methods which should be applied to Property Blocks as a whole, rather than individual elements of indexed Property Blocks.
class _LiBrStateBlock(StateBlock):

def fix_initialization_states(self):
"""
Fixes state variables for state blocks.
Expand Down Expand Up @@ -1343,4 +1342,4 @@ def calculate_scaling_factors(self):
iscale.constraint_scaling_transform(c, sf)

# transforming constraints
transform_property_constraints(self)
transform_property_constraints(self)
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
refined_enrtl_method = True

if refined_enrtl_method:

# Import refined eNRTL method
from refined_enrtl import rENRTL

Expand Down

0 comments on commit e916ea0

Please sign in to comment.