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

✨ 2D Neutronics feature branch #2656

Merged
merged 32 commits into from
May 14, 2024
Merged

✨ 2D Neutronics feature branch #2656

merged 32 commits into from
May 14, 2024

Conversation

je-cook
Copy link
Contributor

@je-cook je-cook commented Sep 27, 2023

Description

Feature branch for 2D neutronics.

This PR currently creates a new environment bluemira-openmc and should be used for the neutronics developement until we merge this branch into develop

to get up and running

mamba env create --file conda/environment.yml
conda activate bluemira-openmc
pip install git+ssh://git@github.com/Fusion-Power-Plant-Framework/pps-isotropic.git --config-settings=setup-args="-DOPENMC=~/mambaforge/envs/bluemira-openmc"

And then run the download script

python scripts/openmc_data_download/neutronics_data_downloader.py

This will create a bluemira_openmc_data folder by default with a cross_sections.xml file. In the example
examples/radiation_transport/neutronics.ex.py change the CROSS_SECTIONS variable to the path of this file and run with

python neutronics.ex.py

Interface Changes

None really just new features

Checklist

I confirm that I have completed the following checks:

  • Tests run locally and pass pytest tests --reactor
  • Code quality checks run locally and pass pre-commit run --from-ref develop --to-ref HEAD
  • Documentation built locally and checked sphinx-build -W documentation/source documentation/build

@je-cook je-cook added the neutronics Tasks relating to the neutronics module label Sep 27, 2023
@je-cook je-cook requested review from a team as code owners September 27, 2023 15:28
@je-cook je-cook force-pushed the feature/neutronics branch 2 times, most recently from b6b5690 to d1fed31 Compare November 15, 2023 08:17
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: Patch coverage is 1.04414% with 2085 lines in your changes are missing coverage. Please review.

Project coverage is 74.25%. Comparing base (cdb757f) to head (8284662).
Report is 7 commits behind head on develop.

Files Patch % Lines
bluemira/codes/openmc/make_csg.py 0.00% 590 Missing ⚠️
...ra/radiation_transport/neutronics/make_pre_cell.py 0.00% 237 Missing ⚠️
bluemira/radiation_transport/neutronics/slicing.py 0.00% 214 Missing ⚠️
bluemira/codes/openmc/solver.py 0.00% 207 Missing ⚠️
bluemira/codes/openmc/output.py 0.00% 116 Missing ⚠️
...mira/radiation_transport/neutronics/radial_wall.py 0.00% 113 Missing ⚠️
...on_transport/neutronics/neutronics_axisymmetric.py 0.00% 107 Missing ⚠️
...ira/radiation_transport/neutronics/blanket_data.py 0.00% 99 Missing ⚠️
bluemira/radiation_transport/neutronics/wires.py 0.00% 83 Missing ⚠️
bluemira/codes/openmc/material.py 0.00% 65 Missing ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2656      +/-   ##
===========================================
- Coverage    80.34%   74.25%   -6.10%     
===========================================
  Files          224      242      +18     
  Lines        24724    26816    +2092     
===========================================
+ Hits         19865    19912      +47     
- Misses        4859     6904    +2045     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Nov 15, 2023

⚠️ Warning Report

Found 0 new warnings, 1 fixed warning. 🎉

All warnings (5)

On runtest

  • /home/runner/miniconda3/envs/bluemira/lib/python3.10/site-packages/ffcx/element_interface.py:26: DeprecationWarning: Converting elements created in UFL to Basix elements is deprecated. You should create the elements directly using basix.ufl.element instead
  • /home/runner/miniconda3/envs/bluemira/lib/python3.10/site-packages/ffcx/element_interface.py:23: DeprecationWarning: Use of elements created by UFL is deprecated. You should create elements directly using Basix.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.10/site-packages/ufl/core/expr.py:275: DeprecationWarning: Expr.ufl_domain() is deprecated, please use extract_unique_domain(expr) instead.
  • /home/runner/miniconda3/envs/bluemira/lib/python3.10/site-packages/basix/ufl.py:1909: DeprecationWarning: Converting elements created in UFL to Basix elements is deprecated. You should create the elements directly using basix.ufl.element instead

On collect

  • /home/runner/miniconda3/envs/bluemira/lib/python3.10/site-packages/ufl/core/ufl_type.py:56: DeprecationWarning: attach_operators_from_hash_data deprecated, please use UFLObject instead.

@oliverfunk oliverfunk requested a review from a team as a code owner November 27, 2023 12:04
@je-cook je-cook requested a review from a team as a code owner December 1, 2023 08:19
@je-cook je-cook requested a review from a team as a code owner December 1, 2023 09:01
@je-cook je-cook force-pushed the feature/neutronics branch 3 times, most recently from d9958e3 to fe120ed Compare December 4, 2023 13:18
Copy link
Contributor

@CoronelBuendia CoronelBuendia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this was a quick whistlestop tour, but there are still some things that I think should be changed and improved.

I will pick up again tomorrow and see if I can propose a more concrete way to improve the geometry creation.

bluemira/materials/material.py Outdated Show resolved Hide resolved
bluemira/materials/material.py Outdated Show resolved Hide resolved
bluemira/neutronics/params.py Outdated Show resolved Hide resolved
examples/radiation_transport/neutronics.ex.py Outdated Show resolved Hide resolved
examples/radiation_transport/neutronics.ex.py Outdated Show resolved Hide resolved
bluemira/neutronics/params.py Outdated Show resolved Hide resolved
bluemira/neutronics/params.py Outdated Show resolved Hide resolved
examples/radiation_transport/neutronics.ex.py Outdated Show resolved Hide resolved
bluemira/neutronics/make_geometry.py Outdated Show resolved Hide resolved
bluemira/neutronics/constants.py Outdated Show resolved Hide resolved
@je-cook je-cook force-pushed the feature/neutronics branch 2 times, most recently from 976e7af to 68030e9 Compare December 15, 2023 16:02
@je-cook je-cook requested a review from a team as a code owner December 20, 2023 13:57
@je-cook je-cook force-pushed the feature/neutronics branch 2 times, most recently from 232e9df to 5469e74 Compare January 5, 2024 10:48
Copy link

sonarcloud bot commented Jan 8, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

57 New issues
0 Security Hotspots
No data about Coverage
0.9% Duplication on New Code

See analysis details on SonarCloud

@je-cook je-cook added this to the Version 1.10.0 milestone Feb 13, 2024
@je-cook je-cook force-pushed the feature/neutronics branch 2 times, most recently from 910a83c to f900feb Compare March 6, 2024 11:42
OceanNuclear and others added 7 commits May 2, 2024 11:47
* :Changed params.py according to Matti's suggestion

* Made temporary script

* Added json data to be loaded as test case bluemirawires

* Added post_init checks.

* Created basic script to translate from existing dataclass TokamakGeometry (make_csg)

* WIP: making pre-cell.

* WIP: making pre-cell.

* Bodging serializing issue - fix later.

* Deleted failed files.

* Test script in attempt to replace the magic numbers/magic procedure to something more generalizable

* quick commit

* Script to load the divertor.

* Added capability to automatically slice up the blanket according to the first wall panels

* Updated script for creating neutronics csg

* extended the functionality of signed distance to check points as well.

* Added function based on signed_distance to check for overlaps.

* Add tolerance to account for low sampling rate/ float errors.

* Adding module to optimally slice the neutronics model.

* Updated module that chooses better surfaces for faster neutronics runs.

* Made the volume optimization converge.

* Made a better approximation of the reactor. Added tools necessary to make such approximation

* Added better documentations. Formatting.

* Made a very rigorous structure to create openmc.Cells.

* removed unused code

* Updated test case

* Half-working state

* Finally finished the blanket bug fix.

* Updated docstrings

* Updated equations

* Updated comment

* Interited from collections.abc.Sequence to avoid having to make def __iter__().

* Cleaned up excess code

* minor changes to naming and docstring

* Updated the run modes into context managers.

* Enforced self.setup() to be ran before self.run() in the contextmanagers.

* Added ability to slice divertor wire

* Variable renaming

* Removed redundant checks

* Improved typing (Iterables vs Sequence), and added classes to prepare for tallying.

* Added tallying functionality

* Developing divertor cells automatic conversion into pre-cells...

* Added type hints for return types.

* Fixed import

* Successfully exported into DivertorPreCellArray.

* Updated script correspondingly

* split up WireInfo etc. into its own file.

* Made make_divertor_pre_cell_array more robust (able to straighten out the cell walls better before passing onto DivertorPreCell).

* Typing and docstring improvement

* Added function to flip a direction vector if it is pointing the wrong way; Moved plane functionalities to geometry/plane.py

* Removed plane creation functionality (migrated to bluemira.geometry.plane)

* Minor change to type hinting in make_csg.py

* Minor changes to type hints in radial_wall.py

* Slight change to variable name

* Added plan to make the divertor slicing more robust.

* Moved the warning to an appropriate place

* Improved the interior_wire_offset method

* Fixed minor mistake in direction

* Working version: produces pre-cell arrays for both divertor and blanket

* Pointed the chord in the correct direction again

* Removed unused data loading files.

* Improved file structure so each class has separate responsibility. Surfaces that aren't shared among different BlanketCell stacks won't be created in BlanketCellArray.

* Minor bug fixes related to types and WireInfo

* Moved constants into constants.py

* Docstring updates

* Simplified boolean expression; made plasma cell.

* Deleted unused statement.

* updated test script to plot better.

* Named file more sensibly.

* Fixed some ID control issues

* docstring rearrangement

* Fixed up the get_all_hollow_merged_cells method so the test script won't have to write something as long to plot the overall-cells.

* Fixed the thickness issue - now instead we have absolute thickness.

* Got as far as getting some segfaults out of openmc.

* Finally working. Tallies need fixing

* Fixed floating point issue

* Added missing conversion function

* Changed thickness.

* Modified to allow for a variable number of batches.

* Delete some of the obsolete classes

* Updated TODO tags in test script.

* Updated TODOs

* Added missing method back in

* Updated documentations slightly to make it more readable.

* Updated docstring to conform usage of anti- vs counter-

* Ensured backward (neutronics.ex.py) compatibility

* Calculated volumes without relying on openmc.

* Added function to support volume calculation of the openmc.Cell's .volumes.

* Optimized volume calculation (commented them out where they're not needed)

* Working version.

* Added TODO on reducing the number of negated regions.

* ruff fixes

* Some updates to how surfaces are get

* fixed ONE TODO tag.

* Updated zip strict = True almost everywhere, pairwise where applicable.

* Cleaned up code slightly at make_csg

* We can now control the thickness of the central solenoid from parameter frame directly.

* Attempting to use vacuum vessel wire as well.

* Further attempt at incorporating the vacuum vessel interior curve into the pre-cells

* VV now successfully sandwhiched between the two curvesgit add .

* Minor formatting updates

* Finished porting over the materials library

* Cleaned out all low-lying fruit TODO tags

* Made note about convexity.
* 🚧 OpenMC designer

* 🚧 Working designer

* ✨ Openmc solver

* ✨ Fixup from upstream

* 🚚 Move stuff
* 🌐 Bye Z

* ♻️ Initial cleanup

* ♻️ More cleanup

* ♻️ More cleanup

* ♻️ More cleanup

* 🔥 Destroying Vertices pt1

* 🔥 Destroying Vertices pt2

* ♻️ More cleanup

* 🔥 Remove Sequence inheritance

* 🎨 Types

* 🚨 Remove ruff ignores

* ♻️ More cleanup

* ♻️ Remove global hangar variable

* ♻️ More cleanup

* ♻️ More cleanup

* 🚨 More cleanup

* 📝 Docs cleanup

* 📝 Docs cleanup

* 🐛 Fix double counting of divertor material

* 🐛 Fix 0 volumetric heating

* 🎨 Convert SingleNullTokamak to a function

* 🏷️ Typing and general cleanup

* ♻️ Cleanup dimensions

* 🎨 Order functions
je-cook and others added 2 commits May 9, 2024 10:57
* 🎨 Neutronics PreCell / openmc separation

* 🚚 Move stuff about

* 🎨 Reduce surface that requires openmc

* 🚚 Move materials about

* 🎨 Initial material rearrangement

* 🌐 More internationalisation

* ♻️ Neutronics material movement

* 🎨 More materials stuff

* ♻️ Cleanup

* 🎨 Materials cleanup
* inital go

* Saving

* hard part done

* pass vals to Solver

* Updated WireInfoList so it doesn't use horrible mixed types.

* expected div wire

* Fixed the issue of 'sometimes misordering wires', and used recursion to shorted the break_wire_into_convex_chunks method for better readability with no loss in speed.

* 🚧 Tmp get it working

* Fixed the .reverse() method, which didn't flip the sign of the tangent.

* Improved plotting in plot_2d and plot_surfaces (mainly used for debugging)

* 🐛 Fix inner panel point

* 🔥 Reduce interface

* ♻️ More cleanup

* 🎨 More cleanup

* 🎨 Remove while loop from break wire into convex chunks

* 🎨 Reduce interface

* 🎨 More cleanup

* 🔥 Remove readme

* 🐛 Typing and divertor start point fix

* 🎨 Fix extra error and cleanup some reactor mechanics

* 🎨 Improve file save location

* 🎨 Only pass in ivcshapes not divertor

* 🎨 Feed in correct blanket cut point

* 🎨 Cleanup runmode

* Fixed leaking plasma void.

* 🎨 Cleanup inputs

* Added the the half_bounding_box function to get the minimum positive r.

* 🔥 Remove old data files

* ♻️ Run through cleanup

* Fixed the final overlap issue at the bottom of the divertor

* 🚚 Move some geometry functions to geometry

* 🐛 Fix tfcoil size

* 🐛 Fix blanket test

* 🚨 Linter fix

* 🚚 Move some things about

* 🚚 Move openmc to codes

* 🎨 Isolate eudemo from openmc

* 🚚 Move neutronics under radiation_transport

* Added volume tag

* Added checks to ensure convexity.

* Forced the pair of first and last pre-cells in the blanket to mate with the first and last pre-cell pair of divertor.

* Fixed the convexity proble; but a different issue arose: floating point precision of the exterior points are all wrong.

* Removed debug statement

* Added tolerances back in

* Floating point precision issue FIXEDgit add make_pre_cell.py openmc/make_csg.py  Now we can use tighter tolerances.

* 🔥 Remove old examples

* integrated rad shield into the neutronics run

* move set_volumes to CellStage

---------

Co-authored-by: ocean <OceanWongUK@gmail.com>
Co-authored-by: james <james.cook1@ukaea.uk>
@je-cook je-cook requested a review from a team as a code owner May 13, 2024 15:33
je-cook and others added 3 commits May 13, 2024 17:25
* 🎨 Allow custom filter for tallies

* 🐛 Fix tally function for eudemo run

* 🐛 Fix remove reindex to avoid nans

* Changed tallies to get the required data (need to multiply by appropriate constants in output.py to finish the job)

* minor bug fix (missed a variable)

* 🐛 Fix filter creation

* 🐛 Fix output for temporary output

---------

Co-authored-by: ocean <OceanWongUK@gmail.com>
@je-cook
Copy link
Contributor Author

je-cook commented May 14, 2024

Future work:

  • Add tests (! 😢)
  • improve output dataclass
  • update radiation_shield material
  • replace wire/circle info with geometry parameterisations

@je-cook je-cook removed request for a team May 14, 2024 08:05
@je-cook je-cook enabled auto-merge (squash) May 14, 2024 08:07
Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed

Issues
52 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@oliverfunk oliverfunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @je-cook and @OceanNuclear!

This PR has been mostly reviewed and worked on along the way.

Future improvements will come up, as it is used and integrated more.

1 point that can be addressed in another PR:

  • The data download script needs some README instructions. A bash script could be good too, that would run the python script.

@je-cook je-cook disabled auto-merge May 14, 2024 13:30
@je-cook je-cook merged commit 6d64073 into develop May 14, 2024
5 of 7 checks passed
@je-cook je-cook deleted the feature/neutronics branch May 14, 2024 13:30
@je-cook je-cook mentioned this pull request Jun 10, 2024
6 tasks
OceanNuclear added a commit that referenced this pull request Jun 17, 2024
* 2D Neutronics module  (#2344)

* Initial commit to repository

* Create basic README.md

* Editing README.md

* Code styling: Black, isort and whitespace/trailing new lines (#1)

* blacken and isort

* whitespace and new lines

* Rearrage and refactor (#2)

* Adding plasma source, DCLL and WCLL. Material defintions and geometries still need tweaking.

* Changing from toroidal first wall profile to match points and adding extra source geometry plots.

* Adding source code for parametric plasma source

* Adjusting point too close to plasma.

* Minor format tidy up. Moving function.

* Passing geometry_variables to get_fw_points

* Update make_materials.py

Changing tungsten isotopes and tidying export_materials()

* Update make_materials.py

W isotopes corrected.

* Made most of it OOP, especially the summary, so that the data can be recalled.

* Added vscode into gitignore

* Finished reformatting the Summary object so now it prints the entire run properly. Not documented yet, and kwargs not passed on yet.

* Finished some reformatting. Todo list is at the top.

* Some work done on load_fw_points, but incomplete. TODO list updated.

* Added some documentations, but found a lot of magic numbers and 'things that don't belong in this module'. I'll deal with them later.

* Changed the ordering and naming of the arguments to make_geometry in make_geometry.py, and added some docstring.

* Fxied the types of Blankets available using BlanketType in make_materials.py.

* Fixed the naming for cells in quick_tbr_heating.py - renamed them to cells_and_cell_lists

* Updated the todo list

* Cleaned up create_tallies, and in the process, created MaterialsLibrary in make_materials.py so that it becomes modular enough for testing.

* Formatted the 'print_df' booleans away into a decorator - can change into printing to bluemira log later.

* Added documentations to the rest of the important classes.

* Updated todo list

* one line change to make pandas print more prettily, before merge commit

* moved all relevant files into the neutronics directory.

* Moved files from the 2d-neutronics repo to here.

* restored comment style fix

* moved the neutronics files to the correct directory.

* changed the import relative path

* relocated files to the correct directory

* changed the import path

* minor changes before complete overhaul (the latter is for adhering to bluemira code style)

* moved some constants to constants.py

* Finished one task: placed the relevant constants and conversion units into constants.py

* updated to-do list

* Further broke down the make_materials.py file into materials_definition.py file

* Refactored all of materials.

* updated .gitignore

* Moved the results formatting functions to a separate file

* removed unused file

* Improved styling

* Broke functions down into appropriate modules

* Split into appropriate modules

* Added typing information

* Updated the import diagram to reflect the import relationships between modules.

* Fixed all fixable formatting issues according to flake8

* Fixed all flake8 messages!

* installs script

* cleaned up script

* added complete apt install deps

* Updated install script, removed pps_api

* Updated to-do list, improved result presentation workflow

* .npy requires conversion to BluemiraWire

* ➕ Use ninja and install libopenmpi-dev

* ➕ Add openmc to conda

* ✨ Start using wire as input

* 🚨 Some ruff fixes

* 🎨 Move ifmain to example

* 🚚 Move npy

* 🎨 Fix example

* 🎨 Get constants from base

* 🎨 Fix imports

* 🚨 Some ruff fixes

* added openmc version to install script, added pps-isotropic package import to quick tbr

* removed my path from config

* 🎨 Cleanup printing

* 🎨 Unit fix

* 🎨 Unit fix2

* 🎨 Unit fix3

* 🎨 Use openmc enum

* Preparing for unit changes

* quick commit before rebase, units half-done

* 🙈 Remove noise

* 🔥 Remove so file

* Removed the not-sensible default constants and placed thme into neutronics.ex.py instead.

* Added TODO comment

* 🎨 Cell filter cleanup

* 🎨 Cleanup tallies

* Changed all units

* minor fix of import statement

* Monkey patched successfully

* monkeypatched successfully, and separated plasma geometry variables from tokamak geometry variables. This is the commit BEFORE applying the DataclassUnitConverter pattern.

* Minor update to add comments.

* Removed the duplicate codes inside params.py. This is the commit AFTER applying the DataclassUnitConverter pattern.

* Bug fix - missing 'self,' argument fixed.

* Updated todos

* 🎨 Change raw_uc percent use and runtime var

* 🚧 Make geometry dataclass refactor

* 🚧 Slight cleanup of params

* 🚨 Ignores

* 📝 Docs

* 📝 Fixes and docs

* 📝 Fix documentation build

* Update neutronics.ex.py

* Update pyproject.toml

* 🐛 Fix volume calculation

* 🎨 Cleanup vol calc

* 🚨 Fix black

* 🎨 Small fixes

* 🚚 Move quick tbr to neutronics_axisymmetric

* 🎨 Add stochastic volume to output results

* Added comments on why only two quantities are excluded in the conversion

* pps-isotropic's API changed, making appropriate changes here to maintain usability

* Added markdown docs on neutronics.ex.py

* 💩 Hack for old version of openmc

* 👥 Add contributors

---------

Co-authored-by: jamesnha <92076761+jamesnha@users.noreply.github.com>
Co-authored-by: je-cook <81617086+je-cook@users.noreply.github.com>
Co-authored-by: Oliver Funk <oli.funk@gmail.com>

* ✨ OpenMC data downloader (#2618)

* ✨ OpenMC data downloader

* 🎨 Parse known args

* 🎨 Ifmain

* 🎨 Rename file

* 🎨 Write them all then delete all

* 🐛 Overindent

* 🚨 Cleanup and linting

* 🐛 No output

* 🐛 Fix neutronics json location

* 🐛 Hack to force data into a given directory

* 🎨 Spelling

* 🏷️ Typing fix

* 🚨 Ruff fixes

* 🙈 Add to gitignore

* Minor error fixes to the outputted tables (#2689)

* Fixed unit conversion error in photon heat flux; and turned off Bremsstrahlung heating by default

* Undo accidental indent

* Kept all statepoint files' units as openmc as cgs, so that the conversion to SI is done purely in python. Fixed misinterpretation of photon flux.

* added comments to explain tally score choice.

* Minor bug fix to pass code quality checks

* 🚨 Ruff fixes

* first move to BM materials, lots of refactoring needed but the example runs

* 🎨 Basic cleanup

* 🎨 Dataclassify

* 🐛 Undo Be12Ti density change

* 💡 Minor fixes

* 📄 Copyright fixes after rebase

* ✨ Allow '*' to extract all XS data

* ⬆️ Openmc 0.13.3

* temperature docstring.

* removed rounding

* calculate the DT energy more accurately using plasma physics.

* Simplified code to use n_DT_reactions instead.

* 1. extracted (major_r, minor_r, elong, triang) into a different class than TokamakGeometry, and named this class PlasmaGeometry. 2. Removed the 'CGS' and 'PPS' from the 3 classes in params.py, and instead appended their baseclasses with 'Base', so that it becomes clearer that these dataclasses store SI units unless the .csg or .plasma_physics_units property is accessed.

* (minor bug fix)

* Updated the Shafranov shift description.

* 🚨 Fix linter

* Minor updates to docstrings

* 🚨 Ruff & python3.10 fixes

* Increase CSG speed without compromising on flexibility (#3079)

* :Changed params.py according to Matti's suggestion

* Made temporary script

* Added json data to be loaded as test case bluemirawires

* Added post_init checks.

* Created basic script to translate from existing dataclass TokamakGeometry (make_csg)

* WIP: making pre-cell.

* WIP: making pre-cell.

* Bodging serializing issue - fix later.

* Deleted failed files.

* Test script in attempt to replace the magic numbers/magic procedure to something more generalizable

* quick commit

* Script to load the divertor.

* Added capability to automatically slice up the blanket according to the first wall panels

* Updated script for creating neutronics csg

* extended the functionality of signed distance to check points as well.

* Added function based on signed_distance to check for overlaps.

* Add tolerance to account for low sampling rate/ float errors.

* Adding module to optimally slice the neutronics model.

* Updated module that chooses better surfaces for faster neutronics runs.

* Made the volume optimization converge.

* Made a better approximation of the reactor. Added tools necessary to make such approximation

* Added better documentations. Formatting.

* Made a very rigorous structure to create openmc.Cells.

* removed unused code

* Updated test case

* Half-working state

* Finally finished the blanket bug fix.

* Updated docstrings

* Updated equations

* Updated comment

* Interited from collections.abc.Sequence to avoid having to make def __iter__().

* Cleaned up excess code

* minor changes to naming and docstring

* Updated the run modes into context managers.

* Enforced self.setup() to be ran before self.run() in the contextmanagers.

* Added ability to slice divertor wire

* Variable renaming

* Removed redundant checks

* Improved typing (Iterables vs Sequence), and added classes to prepare for tallying.

* Added tallying functionality

* Developing divertor cells automatic conversion into pre-cells...

* Added type hints for return types.

* Fixed import

* Successfully exported into DivertorPreCellArray.

* Updated script correspondingly

* split up WireInfo etc. into its own file.

* Made make_divertor_pre_cell_array more robust (able to straighten out the cell walls better before passing onto DivertorPreCell).

* Typing and docstring improvement

* Added function to flip a direction vector if it is pointing the wrong way; Moved plane functionalities to geometry/plane.py

* Removed plane creation functionality (migrated to bluemira.geometry.plane)

* Minor change to type hinting in make_csg.py

* Minor changes to type hints in radial_wall.py

* Slight change to variable name

* Added plan to make the divertor slicing more robust.

* Moved the warning to an appropriate place

* Improved the interior_wire_offset method

* Fixed minor mistake in direction

* Working version: produces pre-cell arrays for both divertor and blanket

* Pointed the chord in the correct direction again

* Removed unused data loading files.

* Improved file structure so each class has separate responsibility. Surfaces that aren't shared among different BlanketCell stacks won't be created in BlanketCellArray.

* Minor bug fixes related to types and WireInfo

* Moved constants into constants.py

* Docstring updates

* Simplified boolean expression; made plasma cell.

* Deleted unused statement.

* updated test script to plot better.

* Named file more sensibly.

* Fixed some ID control issues

* docstring rearrangement

* Fixed up the get_all_hollow_merged_cells method so the test script won't have to write something as long to plot the overall-cells.

* Fixed the thickness issue - now instead we have absolute thickness.

* Got as far as getting some segfaults out of openmc.

* Finally working. Tallies need fixing

* Fixed floating point issue

* Added missing conversion function

* Changed thickness.

* Modified to allow for a variable number of batches.

* Delete some of the obsolete classes

* Updated TODO tags in test script.

* Updated TODOs

* Added missing method back in

* Updated documentations slightly to make it more readable.

* Updated docstring to conform usage of anti- vs counter-

* Ensured backward (neutronics.ex.py) compatibility

* Calculated volumes without relying on openmc.

* Added function to support volume calculation of the openmc.Cell's .volumes.

* Optimized volume calculation (commented them out where they're not needed)

* Working version.

* Added TODO on reducing the number of negated regions.

* ruff fixes

* Some updates to how surfaces are get

* fixed ONE TODO tag.

* Updated zip strict = True almost everywhere, pairwise where applicable.

* Cleaned up code slightly at make_csg

* We can now control the thickness of the central solenoid from parameter frame directly.

* Attempting to use vacuum vessel wire as well.

* Further attempt at incorporating the vacuum vessel interior curve into the pre-cells

* VV now successfully sandwhiched between the two curvesgit add .

* Minor formatting updates

* Finished porting over the materials library

* Cleaned out all low-lying fruit TODO tags

* Made note about convexity.

* Neutronics Solver interface (#3231)

* 🚧 OpenMC designer

* 🚧 Working designer

* ✨ Openmc solver

* ✨ Fixup from upstream

* 🚚 Move stuff

* Neutronics old code removal and architectural adjustments (#3232)

* 🌐 Bye Z

* ♻️ Initial cleanup

* ♻️ More cleanup

* ♻️ More cleanup

* ♻️ More cleanup

* 🔥 Destroying Vertices pt1

* 🔥 Destroying Vertices pt2

* ♻️ More cleanup

* 🔥 Remove Sequence inheritance

* 🎨 Types

* 🚨 Remove ruff ignores

* ♻️ More cleanup

* ♻️ Remove global hangar variable

* ♻️ More cleanup

* ♻️ More cleanup

* 🚨 More cleanup

* 📝 Docs cleanup

* 📝 Docs cleanup

* 🐛 Fix double counting of divertor material

* 🐛 Fix 0 volumetric heating

* 🎨 Convert SingleNullTokamak to a function

* 🏷️ Typing and general cleanup

* ♻️ Cleanup dimensions

* 🎨 Order functions

* ✨ Split of Neutroics pre cell csg and openmc running (#3243)

* 🎨 Neutronics PreCell / openmc separation

* 🚚 Move stuff about

* 🎨 Reduce surface that requires openmc

* 🚚 Move materials about

* 🎨 Initial material rearrangement

* 🌐 More internationalisation

* ♻️ Neutronics material movement

* 🎨 More materials stuff

* ♻️ Cleanup

* 🎨 Materials cleanup

* Neutronics EUDEMO integration (#3239)

* inital go

* Saving

* hard part done

* pass vals to Solver

* Updated WireInfoList so it doesn't use horrible mixed types.

* expected div wire

* Fixed the issue of 'sometimes misordering wires', and used recursion to shorted the break_wire_into_convex_chunks method for better readability with no loss in speed.

* 🚧 Tmp get it working

* Fixed the .reverse() method, which didn't flip the sign of the tangent.

* Improved plotting in plot_2d and plot_surfaces (mainly used for debugging)

* 🐛 Fix inner panel point

* 🔥 Reduce interface

* ♻️ More cleanup

* 🎨 More cleanup

* 🎨 Remove while loop from break wire into convex chunks

* 🎨 Reduce interface

* 🎨 More cleanup

* 🔥 Remove readme

* 🐛 Typing and divertor start point fix

* 🎨 Fix extra error and cleanup some reactor mechanics

* 🎨 Improve file save location

* 🎨 Only pass in ivcshapes not divertor

* 🎨 Feed in correct blanket cut point

* 🎨 Cleanup runmode

* Fixed leaking plasma void.

* 🎨 Cleanup inputs

* Added the the half_bounding_box function to get the minimum positive r.

* 🔥 Remove old data files

* ♻️ Run through cleanup

* Fixed the final overlap issue at the bottom of the divertor

* 🚚 Move some geometry functions to geometry

* 🐛 Fix tfcoil size

* 🐛 Fix blanket test

* 🚨 Linter fix

* 🚚 Move some things about

* 🚚 Move openmc to codes

* 🎨 Isolate eudemo from openmc

* 🚚 Move neutronics under radiation_transport

* Added volume tag

* Added checks to ensure convexity.

* Forced the pair of first and last pre-cells in the blanket to mate with the first and last pre-cell pair of divertor.

* Fixed the convexity proble; but a different issue arose: floating point precision of the exterior points are all wrong.

* Removed debug statement

* Added tolerances back in

* Floating point precision issue FIXEDgit add make_pre_cell.py openmc/make_csg.py  Now we can use tighter tolerances.

* 🔥 Remove old examples

* integrated rad shield into the neutronics run

* move set_volumes to CellStage

---------

Co-authored-by: ocean <OceanWongUK@gmail.com>
Co-authored-by: james <james.cook1@ukaea.uk>

* 🎨 Radiation shield initial material

* 📝 Remove neutronics example reference

* 📝 Add notice for use and update environment

* Improve tallies (#3275)

* 🎨 Allow custom filter for tallies

* 🐛 Fix tally function for eudemo run

* 🐛 Fix remove reindex to avoid nans

* Changed tallies to get the required data (need to multiply by appropriate constants in output.py to finish the job)

* minor bug fix (missed a variable)

* 🐛 Fix filter creation

* 🐛 Fix output for temporary output

---------

Co-authored-by: ocean <OceanWongUK@gmail.com>

* ⬆️ Upgrade openmc

---------

Co-authored-by: Ocean <OceanWongUK@gmail.com>
Co-authored-by: jamesnha <92076761+jamesnha@users.noreply.github.com>
Co-authored-by: Oliver Funk <oli.funk@gmail.com>
Co-authored-by: Oliver Funk <oliverfunk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neutronics Tasks relating to the neutronics module
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants