Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulation with CSTR does not terminate #309

Closed
ronald-jaepel opened this issue Oct 31, 2024 · 0 comments · Fixed by #310
Closed

Simulation with CSTR does not terminate #309

ronald-jaepel opened this issue Oct 31, 2024 · 0 comments · Fixed by #310
Labels

Comments

@ronald-jaepel
Copy link
Collaborator

ronald-jaepel commented Oct 31, 2024

Simulation with inlet->CSTR or inlet->CSTR->outlet does not terminate. Same setup works on CADET v4.4.0

MRE:


from CADETProcess.processModel import ComponentSystem

component_system = ComponentSystem(2)

from CADETProcess.processModel import Linear

binding_model = Linear(component_system, name='linear')
binding_model.is_kinetic = False
binding_model.adsorption_rate = [0.5, 2]
binding_model.desorption_rate = [1, 1]

from CADETProcess.processModel import Inlet, Cstr, Outlet

inlet = Inlet(component_system, name='inlet')
inlet.c = [[0, 1, 0, 0], [0, 1, 0, 0]]
inlet.flow_rate = 1e-3

outlet = Outlet(component_system, "outlet")

reactor = Cstr(component_system, name='reactor')
reactor.binding_model = binding_model

reactor.init_liquid_volume = 5e-4
reactor.const_solid_volume = 5e-4
reactor.c = [0.0, 0.0]
reactor.q = [0.0, 0.0]  # optional


reactor.solution_recorder.write_solution_bulk = True
reactor.solution_recorder.write_solution_solid = True

from CADETProcess.processModel import FlowSheet

flow_sheet = FlowSheet(component_system)

flow_sheet.add_unit(inlet)
flow_sheet.add_unit(reactor)
flow_sheet.add_unit(outlet)

flow_sheet.add_connection(inlet, reactor)
flow_sheet.add_connection( reactor, outlet)


from CADETProcess.processModel import Process

process = Process(flow_sheet, 'process')
process.cycle_time = 10

from CADETProcess.simulator import Cadet
simulator = Cadet()
sim_results = simulator.run(process, file_path="cstr_bug.h5")

hdf5 file as zip archive

Specifications

  • Version: 5
  • Platform: Windows
  • Subsystem:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants