diff --git a/exposan/bsm1/README.rst b/exposan/bsm1/README.rst index 59c8a15e..78c32634 100644 --- a/exposan/bsm1/README.rst +++ b/exposan/bsm1/README.rst @@ -4,7 +4,7 @@ bsm1: Benchmark Simulation Model No. 1 Summary ------- -This module implements the Benchmark Simulation Model No. 1 (BSM1). [1]_ The code for process modeling and dynamic simulation has been verified against the MATLAB/Simulink [2]_ implementation developed by International Water Association (IWA) Task Group on Benchmarking of Control Strategies. The ``data`` folder contains the outputs from MATLAB/Simulink results (``matlab_exported_data.xlsx`` and ``matlab_workspace.mat``) for comparison. +This module implements the Benchmark Simulation Model No. 1 (BSM1). [1]_ The code for process modeling and dynamic simulation has been verified against the MATLAB/Simulink [2]_ implementation developed by International Water Association (IWA) Task Group on Benchmarking of Control Strategies. The ``data`` folder contains the outputs from MATLAB/Simulink results (``matlab_exported_data_asm1.xlsx`` and ``matlab_workspace_asm1.mat``) for comparison. .. figure:: ./readme_figures/bsm1.png diff --git a/exposan/bsm1/data/initial_conditions.xlsx b/exposan/bsm1/data/initial_conditions_asm1.xlsx similarity index 100% rename from exposan/bsm1/data/initial_conditions.xlsx rename to exposan/bsm1/data/initial_conditions_asm1.xlsx diff --git a/exposan/bsm1/data/initial_conditions_asm2d.xlsx b/exposan/bsm1/data/initial_conditions_asm2d.xlsx new file mode 100644 index 00000000..a17c83be Binary files /dev/null and b/exposan/bsm1/data/initial_conditions_asm2d.xlsx differ diff --git a/exposan/bsm1/data/matlab_exported_data.xlsx b/exposan/bsm1/data/matlab_exported_data_asm1.xlsx similarity index 100% rename from exposan/bsm1/data/matlab_exported_data.xlsx rename to exposan/bsm1/data/matlab_exported_data_asm1.xlsx diff --git a/exposan/bsm1/data/matlab_saved_workspace.mat b/exposan/bsm1/data/matlab_saved_workspace_asm1.mat similarity index 100% rename from exposan/bsm1/data/matlab_saved_workspace.mat rename to exposan/bsm1/data/matlab_saved_workspace_asm1.mat diff --git a/exposan/bsm1/model.py b/exposan/bsm1/model.py index af2bd960..08fc348c 100644 --- a/exposan/bsm1/model.py +++ b/exposan/bsm1/model.py @@ -19,13 +19,15 @@ from exposan.bsm1 import ( biomass_IDs, create_system, - default_init_conds as _ic, + default_init_conds, results_path, Q, Q_was, V_an, V_ae, ) __all__ = ('create_model', 'run_uncertainty', 'run_wdiff_init',) +_ic = default_init_conds['asm1'] + #%% diff --git a/exposan/bsm1/system.py b/exposan/bsm1/system.py index f463d19c..9d262ce2 100644 --- a/exposan/bsm1/system.py +++ b/exposan/bsm1/system.py @@ -21,7 +21,9 @@ __all__ = ( 'biomass_IDs', 'create_system', - 'default_asm_kwargs', 'default_inf_kwargs', 'default_init_conds', + 'default_asm_kwargs', + 'default_inf_kwargs', + 'default_init_conds', 'Q', 'Q_ras', 'Q_was', 'Temp', 'V_an', 'V_ae', ) @@ -47,7 +49,9 @@ # aer.B = 1750.286 # aer.C = 235.0 -default_inf_kwargs = { +valid_models = ('asm1', 'asm2d') +default_inf_kwargs = dict.fromkeys(valid_models) +default_inf_kwargs['asm1'] = { 'concentrations': { 'S_S':69.5, 'X_BH':28.17, @@ -62,7 +66,29 @@ 'units': ('m3/d', 'mg/L'), } -default_asm_kwargs = dict( +default_inf_kwargs ['asm2d'] = { + 'concentrations': { + 'S_I': 14, + 'X_I': 26.5, + 'S_F': 20.1, + 'S_A': 94.3, + 'X_S': 409.75, + 'S_NH4': 31, + 'S_N2': 0, + 'S_NO3': 0.266, + 'S_PO4': 2.8, + 'X_PP': 0.05, + 'X_PHA': 0.5, + 'X_H': 0.15, + 'X_AUT': 0, + 'X_PAO': 0, + 'S_ALK':7*12, + }, + 'units': ('m3/d', 'mg/L'), + } + +default_asm_kwargs = dict.fromkeys(valid_models) +default_asm_kwargs['asm1'] = dict( Y_A=0.24, Y_H=0.67, f_P=0.08, i_XB=0.08, i_XP=0.06, mu_H=4.0, K_S=10.0, K_O_H=0.2, K_NO=0.5, b_H=0.3, eta_g=0.8, eta_h=0.8, k_h=3.0, K_X=0.1, mu_A=0.5, @@ -70,23 +96,56 @@ path=os.path.join(data_path, '_asm1.tsv'), ) -default_init_conds = { - 'S_S':5, - 'X_I':1000, - 'X_S':100, - 'X_BH':500, - 'X_BA':100, - 'X_P':100, - 'S_O':2, - 'S_NO':20, - 'S_NH':2, - 'S_ND':1, - 'X_ND':1, - 'S_ALK':7*12, +default_asm_kwargs['asm2d'] = dict( + iN_SI=0.01, iN_SF=0.03, iN_XI=0.02, iN_XS=0.04, iN_BM=0.07, + iP_SI=0.0, iP_SF=0.01, iP_XI=0.01, iP_XS=0.01, iP_BM=0.02, + iTSS_XI=0.75, iTSS_XS=0.75, iTSS_BM=0.9, + f_SI=0.0, Y_H=0.625, f_XI_H=0.1, + Y_PAO=0.625, Y_PO4=0.4, Y_PHA=0.2, f_XI_PAO=0.1, + Y_A=0.24, f_XI_AUT=0.1, + K_h=3.0, eta_NO3=0.6, eta_fe=0.4, K_O2=0.2, K_NO3=0.5, K_X=0.1, + mu_H=6.0, q_fe=3.0, eta_NO3_H=0.8, b_H=0.4, K_O2_H=0.2, K_F=4.0, + K_fe=4.0, K_A_H=4.0, K_NO3_H=0.5, K_NH4_H=0.05, K_P_H=0.01, K_ALK_H=0.1, + q_PHA=3.0, q_PP=1.5, mu_PAO=1.0, eta_NO3_PAO=0.6, b_PAO=0.2, b_PP=0.2, + b_PHA=0.2, K_O2_PAO=0.2, K_NO3_PAO=0.5, K_A_PAO=4.0, K_NH4_PAO=0.05, + K_PS=0.2, K_P_PAO=0.01, K_ALK_PAO=0.1, + K_PP=0.01, K_MAX=0.34, K_IPP=0.02, K_PHA=0.01, + mu_AUT=1.0, b_AUT=0.15, K_O2_AUT=0.5, K_NH4_AUT=1.0, K_ALK_AUT=0.5, K_P_AUT=0.01, + k_PRE=1.0, k_RED=0.6, K_ALK_PRE=0.5, + ) + +default_init_conds = dict.fromkeys(valid_models) +default_init_conds['asm1'] = { + 'S_S':5, + 'X_I':1000, + 'X_S':100, + 'X_BH':500, + 'X_BA':100, + 'X_P':100, + 'S_O':2, + 'S_NO':20, + 'S_NH':2, + 'S_ND':1, + 'X_ND':1, + 'S_ALK':7*12, + } + +default_init_conds['asm2d'] = { + 'S_F':5, + 'S_A':2, + 'X_I':1000, + 'X_S':100, + 'X_H':500, + 'X_AUT':100, + #'X_P':100, + 'S_O2':2, + 'S_NO3':20, + 'S_NH4':2, + 'S_ALK':7*12, } -def batch_init(sys, path, sheet): - df = load_data(path, sheet) + +def batch_init(sys, df): dct = df.to_dict('index') u = sys.flowsheet.unit # unit registry for k in [u.A1, u.A2, u.O1, u.O2, u.O3]: @@ -105,16 +164,52 @@ def batch_init(sys, path, sheet): # Benchmark Simulation Model No. 1 # ============================================================================= -def create_system(flowsheet=None, inf_kwargs={}, asm_kwargs={}, init_conds={}, - aeration_processes=()): +def create_system( + flowsheet=None, + suspended_growth_model='ASM1', + inf_kwargs={}, + asm_kwargs={}, + init_conds=None, + aeration_processes=(), + ): + ''' + Create the system as described in Benchmark Simulation Model No.1. + + Parameters + ---------- + flowsheet : obj + Flowsheet where this system will be created on. + suspended_growth_model : str + Either "ASM1" using Activated Sludge Model No. 1, + or "ASM2d" using Activated Sludge Model No. 2d. + inf_kwargs : dict + Keyword arguments for influent. + asm_kwargs : dict + Keyword arguments for the ASM model (ASM1 or ASM2d). + init_conds : dict or DataFrame + For a dict, keyword arguments for initial conditions for all bioreactors in the system + (the same initial conditions will be used), + or a pandas.DataFrame that contains initial conditions for each unit. + Default initial conditions will be used if not given. + ''' flowsheet = flowsheet or qs.Flowsheet('bsm1') qs.main_flowsheet.set_flowsheet(flowsheet) # Components and stream - pc.create_asm1_cmps() + kind = suspended_growth_model.lower().replace('-', '').replace('_', '') + if kind == 'asm1': + pc.create_asm1_cmps() + asm = pc.ASM1(**default_asm_kwargs[kind]) + DO_ID = 'S_O' + elif kind == 'asm2d': + pc.create_asm2d_cmps() + asm = pc.ASM2d(**default_asm_kwargs[kind]) + DO_ID = 'S_O2' + else: raise ValueError('`suspended_growth_model` can only be "ASM1" or "ASM2d", ' + f'not {suspended_growth_model}.') wastewater = WasteStream('wastewater', T=Temp) - inf_kwargs = inf_kwargs or default_inf_kwargs + inf_kwargs = inf_kwargs or default_inf_kwargs[kind] wastewater.set_flow_by_concentration(Q, **inf_kwargs) effluent = WasteStream('effluent', T=Temp) @@ -126,27 +221,25 @@ def create_system(flowsheet=None, inf_kwargs={}, asm_kwargs={}, init_conds={}, if aeration_processes: aer1, aer2, aer3 = aeration_processes else: - aer1 = aer2 = pc.DiffusedAeration('aer1', 'S_O', KLa=240, DOsat=8.0, V=V_ae) - aer3 = pc.DiffusedAeration('aer3', 'S_O', KLa=84, DOsat=8.0, V=V_ae) - asm_kwargs = asm_kwargs or default_asm_kwargs - asm1 = pc.ASM1(**asm_kwargs) + aer1 = aer2 = pc.DiffusedAeration('aer1', DO_ID, KLa=240, DOsat=8.0, V=V_ae) + aer3 = pc.DiffusedAeration('aer3', DO_ID, KLa=84, DOsat=8.0, V=V_ae) # Create unit operations A1 = su.CSTR('A1', ins=[wastewater, RWW, RAS], V_max=V_an, - aeration=None, suspended_growth_model=asm1) + aeration=None, suspended_growth_model=asm) A2 = su.CSTR('A2', A1-0, V_max=V_an, - aeration=None, suspended_growth_model=asm1) + aeration=None, suspended_growth_model=asm) O1 = su.CSTR('O1', A2-0, V_max=V_ae, aeration=aer1, - DO_ID='S_O', suspended_growth_model=asm1) + DO_ID=DO_ID, suspended_growth_model=asm) O2 = su.CSTR('O2', O1-0, V_max=V_ae, aeration=aer2, - DO_ID='S_O', suspended_growth_model=asm1) + DO_ID=DO_ID, suspended_growth_model=asm) O3 = su.CSTR('O3', O2-0, [RWW, 'treated'], split=[0.6, 0.4], V_max=V_ae, aeration=aer3, - DO_ID='S_O', suspended_growth_model=asm1) + DO_ID=DO_ID, suspended_growth_model=asm) C1 = su.FlatBottomCircularClarifier('C1', O3-1, [effluent, RAS, WAS], underflow=Q_ras, wastage=Q_was, surface_area=1500, @@ -170,8 +263,14 @@ def create_system(flowsheet=None, inf_kwargs={}, asm_kwargs={}, init_conds={}, # sys = System('bsm1_sys', path=(bio, C1, S1), recycle=(RAS,)) if init_conds: - for i in [A1, A2, O1, O2, O3]: i.set_init_conc(**init_conds) - else: batch_init(sys, os.path.join(data_path, 'initial_conditions.xlsx'), 'default') + if type(init_conds) is dict: + for i in [A1, A2, O1, O2, O3]: i.set_init_conc(**init_conds) + else: + df = init_conds + else: + path = os.path.join(data_path, f'initial_conditions_{kind}.xlsx') + df = load_data(path, sheet='default') + batch_init(sys, df) sys.set_dynamic_tracker(A1, effluent) sys.set_tolerance(rmol=1e-6) diff --git a/exposan/bsm2/__init__.py b/exposan/bsm2/__init__.py index d0ba8de4..e5ecc2f7 100644 --- a/exposan/bsm2/__init__.py +++ b/exposan/bsm2/__init__.py @@ -18,7 +18,8 @@ bsm2_path = os.path.dirname(__file__) module = os.path.split(bsm2_path)[-1] -data_path, results_path = _init_modules(module, include_data_path=True) +data_path, results_path, figures_path = \ + _init_modules(module, include_data_path=True, include_figures_path=True) # %% @@ -52,6 +53,7 @@ def __getattr__(name): __all__ = ( 'bsm2_path', + 'figures_path', 'results_path', *system.__all__, ) \ No newline at end of file diff --git a/exposan/bsm2/data/data.xlsx b/exposan/bsm2/data/data.xlsx new file mode 100644 index 00000000..f259dcb2 Binary files /dev/null and b/exposan/bsm2/data/data.xlsx differ diff --git a/exposan/bsm2/system.py b/exposan/bsm2/system.py index 7d382638..c78734b9 100644 --- a/exposan/bsm2/system.py +++ b/exposan/bsm2/system.py @@ -6,7 +6,7 @@ Yalin Li - Saumitra Rai + # Saumitra Rai Joy Zhang @@ -16,21 +16,207 @@ ''' import os, numpy as np, qsdsan as qs -from qsdsan import processes as pc, sanunits as su, WasteStream, System - -__all__ = ('create_components',) - -def create_components(): - asm2d_cmps = pc.create_asm2d_cmps() - asm2d_cmps.X_S.f_BOD5_COD = 0.54 - CO2 = qs.Component('S_CO2', search_ID='CO2', particle_size='Dissolved gas', - degradability='Undegradable', organic=False) - CH4 = qs.Component('S_CH4', search_ID='CH4', particle_size='Dissolved gas', - degradability='Undegradable', organic=False) - H2 = qs.Component('S_H2', search_ID='H2', particle_size='Dissolved gas', - degradability='Undegradable', organic=False) - cmps1 = qs.Components.load_default() - ash = cmps1.X_Ig_ISS.copy('ash') - cmps = qs.Components([*asm2d_cmps, CO2, CH4, H2, ash]) - cmps.compile() - return cmps +from qsdsan import ( + processes as pc, + sanunits as su, + WasteStream, + ) +#!!! Need to verify system settings +from exposan.bsm1 import ( + default_init_conds, + ) + +from exposan.bsm2 import figures_path, results_path +from exposan.adm import default_init_conds as default_adm1_init_conds + +__all__ = ('create_system',) + + +# %% + + +# def create_components(): +# asm2d_cmps = pc.create_asm2d_cmps() +# asm2d_cmps.X_S.f_BOD5_COD = 0.54 +# S_CO2 = qs.Component('S_CO2', search_ID='CO2', particle_size='Dissolved gas', +# degradability='Undegradable', organic=False) +# cmps1 = qs.Components.load_default() +# # CH4 = qs.Component('S_CH4', search_ID='CH4', particle_size='Dissolved gas', +# # degradability='Readily', organic=True) +# # H2 = qs.Component('S_H2', search_ID='H2', particle_size='Dissolved gas', +# # degradability='Readily', organic=False) +# S_CH4 = cmps1.S_CH4.copy('S_CH4') +# S_H2 = cmps1.S_H2.copy('S_H2') +# Ash = cmps1.X_Ig_ISS.copy('Ash') +# cmps = qs.Components([*asm2d_cmps, S_CO2, S_CH4, S_H2, Ash]) +# cmps.compile() +# return cmps + +#!!! Not sure if this is already provided as the steady state +# Qin0 = 20648; +Q = 20648.361 # influent flowrate [m3/d] +Q_intr = 3 * Q #!!! what is this? +Q_ras = Q # recycle sludge flowrate +Q_was = 300 # sludge wastage flowrate +Temp = 273.15+14.85808 # temperature [K] +V_an = 1500 # anoxic zone tank volume +V_ae = 3000 # aerated zone tank volume + +# Parameters for AS system at 15 degC, based on BSM1 +default_asm_kwargs = dict( + mu_H=4.0, #6.0; + K_S=10.0, #20; + K_O_H=0.2, # K_OH = 0.2; + K_NO=0.5, + b_H=0.3, #0.62; + mu_A=0.5, #0.8; + K_NH=1.0, + K_O_A=0.4, # K_OA = 0.4; + b_A=0.05, #0.2; + eta_g=0.8, # ny_g + k_a=0.05, #0.08; + k_h=3.0, + K_X=0.1, #0.03; + eta_h=0.8, # ny_h #0.4; + Y_H=0.67, + Y_A=0.24, + f_P=0.08, + i_XB=0.08, #0.086; + i_XP=0.06, + fr_SS_COD=0.75, # X_I2TSS, X_S2TSS, X_BH2TSS, X_BA2TSS, X_P2TSS + # path=os.path.join(data_path, '_asm1.tsv'), + ) + + +# O2 saturation concentration at 15 degC, based on BSM1 +SOSAT1 = 8; + +default_inf_kwargs = { + 'concentrations': { + 'S_I': 27.226191, + 'S_S': 58.176186, + 'X_I': 92.499001, + 'X_S': 363.94347, + 'X_BH': 50.683288, + 'S_NH': 23.859466, + 'S_ND': 5.651606, + 'X_ND': 16.129816, + 'S_ALK': 7*12, + }, + 'units': ('m3/d', 'mg/L'), + } + +# default_adm_kwargs = dict( +# Y_A=0.24, Y_H=0.67, f_P=0.08, i_XB=0.08, i_XP=0.06, +# mu_H=4.0, K_S=10.0, K_O_H=0.2, K_NO=0.5, b_H=0.3, +# eta_g=0.8, eta_h=0.8, k_h=3.0, K_X=0.1, mu_A=0.5, +# K_NH=1.0, b_A=0.05, K_O_A=0.4, k_a=0.05, fr_SS_COD=0.75, +# ) + +# def __new__(cls, components=None, path=None, N_xc=2.686e-3, N_I=4.286e-3, N_aa=7e-3, +# f_ch_xc=0.2, f_pr_xc=0.2, f_li_xc=0.3, f_xI_xc=0.2, +# f_fa_li=0.95, f_bu_su=0.13, f_pro_su=0.27, f_ac_su=0.41, +# f_va_aa=0.23, f_bu_aa=0.26, f_pro_aa=0.05, f_ac_aa=0.4, +# f_ac_fa=0.7, f_pro_va=0.54, f_ac_va=0.31, f_ac_bu=0.8, f_ac_pro=0.57, +# Y_su=0.1, Y_aa=0.08, Y_fa=0.06, Y_c4=0.06, Y_pro=0.04, Y_ac=0.05, Y_h2=0.06, +# q_dis=0.5, q_ch_hyd=10, q_pr_hyd=10, q_li_hyd=10, +# k_su=30, k_aa=50, k_fa=6, k_c4=20, k_pro=13, k_ac=8, k_h2=35, +# K_su=0.5, K_aa=0.3, K_fa=0.4, K_c4=0.2, K_pro=0.1, K_ac=0.15, K_h2=7e-6, +# b_su=0.02, b_aa=0.02, b_fa=0.02, b_c4=0.02, b_pro=0.02, b_ac=0.02, b_h2=0.02, +# KI_h2_fa=5e-6, KI_h2_c4=1e-5, KI_h2_pro=3.5e-6, KI_nh3=1.8e-3, KS_IN=1e-4, +# pH_limits_aa=(4,5.5), pH_limits_ac=(6,7), pH_limits_h2=(5,6), +# T_base=298.15, pKa_base=[14, 9.25, 6.35, 4.76, 4.88, 4.82, 4.86], +# Ka_dH=[55900, 51965, 7646, 0, 0, 0, 0], +# kLa=200, K_H_base=[7.8e-4, 1.4e-3, 3.5e-2], +# K_H_dH=[-4180, -14240, -19410], +# **kwargs): + +def create_system(flowsheet=None): + flowsheet = flowsheet or qs.Flowsheet('bsm2') + qs.main_flowsheet.set_flowsheet(flowsheet) + unit = flowsheet.unit + + # ASM1 components and process model + cmps_asm1 = pc.create_asm1_cmps() + thermo_asm1 = qs.get_thermo() + DO_ID = 'S_O' + asm1 = pc.ASM1(**default_asm_kwargs['asm1']) + # The O2 saturation concentration of 8 is at 15 degC, based on BSM1 + aer1 = aer2 = pc.DiffusedAeration('aer1', DO_ID, KLa=240, DOsat=8.0, V=V_ae) + aer3 = pc.DiffusedAeration('aer3', DO_ID, KLa=84, DOsat=8.0, V=V_ae) + + # Influent + wastewater = WasteStream('wastewater', T=Temp) + wastewater.set_flow_by_concentration(Q, **default_inf_kwargs) + + # Primary clarifier using the Otterpohl-Freund model + C1 = su.PrimaryClarifierBSM2( + 'C1', + ins=(wastewater, 'thickener_recycle', 'storage_recycle'), + outs=('C1_eff', 'C1_underflow'), + isdynamic=True, + ) + + # Unit operations in BSM1 + A1 = su.CSTR('A1', ins=[C1-0, 'RAS'], V_max=V_an, + aeration=None, suspended_growth_model=asm1) + + A2 = su.CSTR('A2', A1-0, V_max=V_an, + aeration=None, suspended_growth_model=asm1) + + O1 = su.CSTR('O1', A2-0, V_max=V_ae, aeration=aer1, + DO_ID=DO_ID, suspended_growth_model=asm1) + + O2 = su.CSTR('O2', O1-0, V_max=V_ae, aeration=aer2, + DO_ID=DO_ID, suspended_growth_model=asm1) + + O3 = su.CSTR('O3', O2-0, # [RWW, 'treated'], split=[0.6, 0.4], + V_max=V_ae, aeration=aer3, + DO_ID=DO_ID, suspended_growth_model=asm1) + + # 10-layer one-dimensional settler model + C2 = su.FlatBottomCircularClarifier( + 'C2', O3-0, ['effluent', 1-A1, 'WAS'], + underflow=Q_ras, wastage=Q_was, surface_area=1500, + height=4, N_layer=10, feed_layer=5, + X_threshold=3000, v_max=474, v_max_practical=250, + rh=5.76e-4, rp=2.86e-3, fns=2.28e-3, + ) + TC1 = su.Thickener('TC1', C2-2, outs=['thickened_sludge', 1-C1], + thickener_perc=7, TSS_removal_perc=97.14) + M1 = su.Mixer('M1', ins=(C1-1, TC1-0)) + + # Switch to ADM1 components for the anaerobic digester + cmps_adm1 = pc.create_adm1_cmps() + thermo_adm1 = qs.get_thermo() + adm1 = qs.processes.ADM1() + cmps_adm1.X_I.i_N = cmps_asm1.X_I.i_N + + J1 = su.ASMtoADM('J1', upstream=M1-0, thermo=thermo_adm1, isdynamic=True, adm1_model=adm1) # WAS is C1.outs[2] + AD1 = su.AnaerobicCSTR('AD1', ins=J1.outs[0], outs=('biogas', 'AD_eff'), isdynamic=True ,model=adm1, + retain_cmps=[i for i in cmps_adm1.IDs if i.startswith('X_')]) + AD1.set_init_conc(**default_adm1_init_conds) + # Switch back to ASM1 components + J2 = su.ADMtoASM('J2', upstream=AD1-1, thermo=thermo_asm1, isdynamic=True, adm1_model=adm1) + qs.set_thermo(thermo_asm1) + + C3 = su.Centrifuge(ID='C3', ins=J2-0, outs=['digested_sludge', 'C3_eff'], + thickener_perc=27, TSS_removal_perc=96.29) + + #!!! Should be a stroage tank with HRT = 1 + T1 = su.HydraulicDelay('T1', C3-1, outs='liquid_recycle', t_delay=1) + T1-0-2-C1 + + sys = flowsheet.create_system('bsm2_sys') + sys.set_tolerance(mol=1e-5, rmol=1e-5) + sys.maxiter = 5000 + sys.set_dynamic_tracker(unit.A1, unit.C1, J1, AD1, J2) + + return sys + + +# %% + +if __name__ == '__main__': + bsm2_sys = create_system() + bsm2_sys.diagram(file=os.path.join(figures_path, 'bsm2_sys'), format='png') \ No newline at end of file diff --git a/exposan/bsm2/system_to_be_deleted.py b/exposan/bsm2/system_legacy_interface.py similarity index 100% rename from exposan/bsm2/system_to_be_deleted.py rename to exposan/bsm2/system_legacy_interface.py