Skip to content

Consultation on wastewater treatment processes #186

@zasddsgg

Description

@zasddsgg

Hello. I created the wastewater treatment process with the code wwt_sys = create_conventional_wastewater_treatment_system(ins=’’, 'blowdown'], mockup=True). When the system was run twice, error ValueError: <ReverseOsmosis: S604> assignment destination is read-only was reported. May I ask how this should be solved. Thanks for your help.

The detailed error information is as follows:

File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_system.py:2631, in System.simulate(self, update_configuration, units, design_and_cost, **kwargs)
   2611 def simulate(self, update_configuration: Optional[bool]=None, units=None, 
   2612              design_and_cost=None, **kwargs):
   2613     """
   2614     If system is dynamic, run the system dynamically. Otherwise, converge 
   2615     the path of unit operations to steady state. After running/converging 
   (...)
   2629         
   2630     """
-> 2631     with self.flowsheet.temporary():
   2632         specifications = self._specifications
   2633         if specifications and not self._running_specifications:

File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_flowsheet.py:38, in TemporaryFlowsheet.__exit__(self, type, exception, traceback)
     36 def __exit__(self, type, exception, traceback):
     37     main_flowsheet.set_flowsheet(self.original)
---> 38     if exception: raise exception

File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_system.py:2687, in System.simulate(self, update_configuration, units, design_and_cost, **kwargs)
   2681         outputs = self.simulate(
   2682             update_configuration=True, 
   2683             design_and_cost=design_and_cost,
   2684             **kwargs
   2685         )
   2686     else:
-> 2687         raise error
   2688 else:
   2689     if (not update_configuration # Avoid infinite loop
   2690         and self._connections != [i.get_connection() for i in self.streams]):
   2691         # Connections has been updated within simulation.

File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_system.py:2674, in System.simulate(self, update_configuration, units, design_and_cost, **kwargs)
   2672 else:
   2673     try:
-> 2674         outputs = self.converge(**kwargs)
   2675         if design_and_cost: self._summary()
   2676     except Exception as error:

File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_system.py:2374, in System.converge(self, recycle_data, update_recycle_data)
   2372     for i in range(self._N_runs): method()
   2373 else:
-> 2374     method()
   2375 if update_recycle_data:
   2376     try: recycle_data.update()

File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_system.py:2258, in System.run_sequential_modular(self)
   2256 f = try_method_with_object_stamp
   2257 for i in self._path:
-> 2258     if isa(i, Unit): f(i, i.run)
   2259     elif isa(i, System): f(i, i.converge)
   2260     else: raise RuntimeError('path elements must be either a unit or a system')

File D:\anaconda\envs\zddd\lib\site-packages\thermosteam\exceptions.py:94, in try_method_with_object_stamp(object, method, args)
     92     raise StampedKeyError(message_with_object_stamp(object, repr(error.args[0])))
     93 except Exception as error:
---> 94     raise_error_with_object_stamp(object, error)

File D:\anaconda\envs\zddd\lib\site-packages\thermosteam\exceptions.py:84, in raise_error_with_object_stamp(object, error)
     82     error.args = (message_with_object_stamp(object, msg), *args)
     83 except: pass
---> 84 raise error

File D:\anaconda\envs\zddd\lib\site-packages\thermosteam\exceptions.py:88, in try_method_with_object_stamp(object, method, args)
     86 def try_method_with_object_stamp(object, method, args=()):
     87     try:
---> 88         return method(*args)
     89     except StampedKeyError as error:
     90         raise StampedKeyError(message_with_object_stamp(object, error.args[0]))

File D:\anaconda\envs\zddd\lib\site-packages\thermosteam\network.py:1459, in AbstractUnit.run(self)
   1457         if self.run_after_specifications: self._run()
   1458 else:
-> 1459     self._run()

File D:\anaconda\envs\zddd\lib\site-packages\biosteam\wastewater\conventional.py:506, in ReverseOsmosis._run(self)
    504 water_recovered = self.water_recovery * water_flow
    505 water.mol[water_index] = water_recovered
--> 506 brine.mol[water_index] = water_flow - water_recovered

File D:\anaconda\envs\zddd\lib\site-packages\thermosteam\base\sparse.py:1646, in SparseVector.__setitem__(self, index, value)
   1645 def __setitem__(self, index, value):
-> 1646     if self.read_only: raise ValueError('assignment destination is read-only')
   1647     dct = self.dct
   1648     if index.__class__ is tuple:

ValueError: <ReverseOsmosis: S604> assignment destination is read-only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions