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

bluemira/fuel_cycle/cycle.py Needs cleanup, add units and documentation #2894

Open
30 tasks
OceanNuclear opened this issue Dec 20, 2023 · 3 comments
Open
30 tasks
Labels
📜 Papercut Papercut bug

Comments

@OceanNuclear
Copy link
Contributor

OceanNuclear commented Dec 20, 2023

Describe the bug

  1. A lot of units are missing from that file making it hard to verify correctness e.g. it is not clear what units are self.brate and self.grate, therefore not clear what mb = 1000 * max(self.brate) or m_gas = 1000 * max(self.grate) represent.
  2. Lots of commented out, unused codes.

This was discovered while attempting to fix #2855.

Suggested fix

  1. Trace back all of the variables to their creation, and add the appropriate units back into the docstrings (& create the docstrings if they don't already exist)
  2. Delete all of the unused lines (Consult @CoronelBuendia to check that they are actually no longer needed).

useful checklist of variables that needs to have its units specified/renaming

  • self.max_T
  • self.min_T
  • self.m_T
  • self.m_dot_release
  • self.m_T_in
  • self.m_T_req
  • self.m_T_start
  • self.M_T_bred
  • self.M_T_stack
  • self.M_T_burnt
  • self.I_blanket
  • self.I_plasma
  • self.I_stack
  • self.I_tfv
  • self.grate
  • self.brate
  • self.prate
  • self.DEMO_rt
  • self.DEMO_t
  • self.DD_rate
  • self.DT_rate
  • self.bci
  • self.arg_t_d
  • self.arg_t_infl
  • self.t
  • self.t_d
  • self.t_infl
  • m_gas
  • m_in
  • (And any other: Add more in the comments/editing this post)
@OceanNuclear OceanNuclear added bug Something isn't working 📜 Papercut Papercut bug labels Dec 20, 2023
@OceanNuclear
Copy link
Contributor Author

Furthermore, once these units are determined, the local variables inside calc_m_release needs to be checked to make sure that the unit conversions are done correctly.

@OceanNuclear OceanNuclear removed the bug Something isn't working label Dec 21, 2023
@CoronelBuendia
Copy link
Contributor

This fuel cycle module is something I wrote back in 2016-2017 or thereabouts. Frankly this part of the code it is quite poorly written, and could do with a broader overhaul. I did at one point have a think about how it could be made more like a block flock diagram, but decided it would be too much of a pain, for relatively little gain. Ever since Chris Day et al (KIT) have come up with the DIR fuel cycle design with metal foil pumps, there is basically nothing better in terms of architecture, and it is pretty agnostic of things like fusion power or machine size.

However this module could do with a serious clean-up. I'd also like to add the functionality to be able to run in a deterministic manner which should be a faster way to get an idea of some average response to a parameter change.

Also needs to be lined up in terms of life-cycle / timeline stuff with Tiago's power cycle stuff.

In other words, units and source code documentation are the least of our worries!

@CoronelBuendia
Copy link
Contributor

OH, and, as discussed yesterday, could do with using Parameters here too...

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

No branches or pull requests

2 participants