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

Identify flow devices and walls in graphviz reactor network illustrations #212

Closed
ischoegl opened this issue Aug 9, 2024 · 3 comments · Fixed by Cantera/cantera#1792
Closed
Labels
work-in-progress An enhancement that someone is currently working on

Comments

@ischoegl
Copy link
Member

ischoegl commented Aug 9, 2024

Abstract

The recently added reactor network visualization (see #180) does a great job visualizing reactor networks, but omits blocks representing flow devices (Valve, MassFlowController, etc) and walls (Wall). Having those connectors visualized would ensure a better understanding of a network setup. As an aside, the "Gas Splitter" and "Gas Mixer" blocks in the CHEMKIN example shown in #180 may be a loose equivalent.

Edit: Based on feedback, I am amending this feature request to simply display names of walls and flow devices along the edges.

Motivation

Describe the need for the proposed change:

  • What problem is it trying to solve? ... improve a recent Cantera enhancement
  • Who is affected by the change? ... anyone interested in the new ReactorNet.draw() method
  • Why is this a good solution? ... adds important information that is currently missing

Possible Solutions

Add additional blocks representing flow devices to the implementation introduced by @Naikless in Cantera/cantera#1624.

References

@ischoegl ischoegl added the feature-request New feature request label Aug 9, 2024
@Naikless
Copy link

I have been a bit out of the loop in the last couple of months, but I believe this is first of all a question of design choice.

In classical graph terminology, when I introduced the visualization, I envisioned the flow devices and the walls as "edges" that each connect two "nodes" that are reactors or reservoirs. So now they are represented as arrows of different shape and color. This way, the direction of both material and energy flow can be indicated relatively easily. Their main property (the amount of flow) is still displayed.

Having them represented as nodes could imo quickly lead to very cluttered networks, especially since there are quite a few scenarios conceivable where two reactors have a multitude of connections to one another. But I am happy to hear your arguments on this.

@ischoegl
Copy link
Member Author

@Naikless ... thanks for your comments. I think that using flow devices and walls as 'edges' to reduce clutter is a fair argument, and I will update my feature request on top accordingly. I had not paid close attention to #180 earlier, but came across some of the visualizations while I was working on Cantera/cantera#1765 (which fixes a problem with name attributes of walls getting lost). From where I stand, it would still be nice to see what those edges represent. Simply adding labels with wall/flow device names to edges would likely be sufficient.

@ischoegl ischoegl changed the title Add flow device and wall blocks to graphviz reactor network illustrations Identify flow devices and walls in graphviz reactor network illustrations Aug 10, 2024
@ischoegl ischoegl added work-in-progress An enhancement that someone is currently working on and removed feature-request New feature request labels Sep 1, 2024
@ischoegl
Copy link
Member Author

ischoegl commented Sep 10, 2024

@speth ... reposting from your review from Cantera/cantera#1788

Regarding the extension of the graph idiom, I think there's a simplification that may be worth considering. Instead of seeing just Reactor and ReactorSurface objects as nodes in the graph, you could also see valves and flow devices as nodes, with the edges of the graph just being the abstract connections among all of the entities that make up the reactor network. This way, there's only the need for one new base class, and no need for anything to sit between a Reactor and a ReactorSurface. This also gets closer to the original intent of #212, and may work better as the amount of information you might want to display about a connector increases, given some of the limitations of how Graphviz handles (or doesn't) text associated with edges. That said, I do like the Connector class as a generalization combining walls and flow devices, and there's probably some further room to adjust this idea.

This is indeed an alternative viewpoint. At the moment, I am still leaning towards @Naikless's argument. There are cases where the implementation becomes a little murky (example: two flow controllers in parallel between two reactors), but I'm not sure that we need to accommodate these edge cases; ensuring that all arrows are accounted for is another solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress An enhancement that someone is currently working on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants