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

Can't simulate LRMP with ncols = 1 #176

Open
ronald-jaepel opened this issue Oct 31, 2024 · 0 comments
Open

Can't simulate LRMP with ncols = 1 #176

ronald-jaepel opened this issue Oct 31, 2024 · 0 comments

Comments

@ronald-jaepel
Copy link
Collaborator

ronald-jaepel commented Oct 31, 2024

setting discretization.ncol = 1 for the LRMP

MRE:

from CADETProcess.processModel import ComponentSystem, Linear,  LumpedRateModelWithoutPores, FlowSheet, Process
from CADETProcess.simulator import Cadet

component_system = ComponentSystem(1)

binding_model = Linear(component_system, name="linear")
binding_model.is_kinetic = True
binding_model.adsorption_rate = [2]
binding_model.desorption_rate = [1]

reactor = LumpedRateModelWithoutPores(component_system, name="reactor")
reactor.binding_model = binding_model

reactor.c = [1]
reactor.q = [0]
reactor.total_porosity = 0.5
reactor.length = 1e-1
reactor.diameter = 1e-2
reactor.axial_dispersion = 1e-20
reactor.discretization.ncol = 1

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

flow_sheet = FlowSheet(component_system)

flow_sheet.add_unit(reactor)

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

simulator = Cadet()
sim_results = simulator.run(process)

gives this error:

Traceback (most recent call last):
  File "C:\Users\ronal\PycharmProjects\CADET-Process\CADETProcess\dataStructure\parameter.py", line 1194, in _prepare
    self.check_size(instance, np.array(value))
  File "C:\Users\ronal\PycharmProjects\CADET-Process\CADETProcess\dataStructure\parameter.py", line 1035, in check_size
    raise ValueError(f"Expected size {expected_size}")
ValueError: Expected size (11, 1)

And I can't figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant