Internal profiles in a SMB: what's the best way to plot independently of SMB configuration

Hi

Would like to know if anyone has input on how to do the following in a better way, since it seems unnecessarily complicated as I am approaching it. :stuck_out_tongue:

I’m trying to plot the internal profiles inside the SMB. I managed to do it in a very explicit way by setting:

column = LumpedRateModelWithoutPores(component_system, name='column')
# ...
column.solution_recorder.write_solution_bulk = True

and then grabbing the data from each column, e.g. simulation_results.solution.column_0.bulk.solution, simulation_results.solution.column_1.bulk.solution, …

This works and I managed to create the plot I want.

Problem is, this is specific for a certain number of columns, since I’m getting the data manually. What would the best option be for creating a function that builds the internal profiles independently of the number of columns or SMB configuration? I’m sure there is a better way that I am missing.

What comes to mind is:

  • going through simulation_results.solution keys
  • find all column_X keys while ignoring others
  • make the plot from there

This works but does not look like the best approach.

Hey José and sorry for the late reply, I was taking some time off lately but now things are back to “normal” (whatever that means! :nerd_face:).

If you constructed your SMB using the CarouselBuilder there is an undocumented CarouselSolutionBulk that takes a CarouselBuilder, as well as the SimulationResults as arguments in the __init__ and then provides a plot_at_time method.

Please let me know if that helps.

We are also having Office Hours tomorrow, so maybe we can have a discussion then? If not, I’m sure we can find another date to catch up.

All the best

Jo