Skip to content

Simulation with CSTR does not terminate #309

@ronald-jaepel

Description

@ronald-jaepel

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions