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

Deterministic neutron transport in FUSE #389

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
411c707
First commit of coupling functions to NeutronTransport
kevinm387 May 23, 2023
a622634
Tune circular simulation, update deps
kevinm387 Jun 1, 2023
9ff42b1
Fix geometry creation mistake.
kevinm387 Jun 1, 2023
00c6ed8
Merge branch 'master' into neutron_transport_coupling
kevinm387 Jun 15, 2023
68fbaa4
Add write_neutron_flux_vtk() function
kevinm387 Jun 19, 2023
f12dffa
Prevent division by zero volumes
kevinm387 Jun 20, 2023
b3b3c0d
Tweak simulation parameters
kevinm387 Jun 21, 2023
daba4fd
Create simple neutron transport example
kevinm387 Jun 21, 2023
ed43b25
Adjust file location handling
kevinm387 Jun 21, 2023
910f3e9
Use concrete typed xss vector
bclyons12 Jun 28, 2023
16bfed3
Merge branch 'master' into neutron_transport_coupling
kevinm387 Jul 19, 2023
8861f7b
Fix material naming, add neutron_transport_1d()
kevinm387 Jul 24, 2023
c5785a2
Merge branch 'master' into neutron_transport_coupling
kevinm387 Jul 24, 2023
c833bf3
First attempt, 2D problem setup
kevinm387 Jul 26, 2023
cb89408
Merge branch 'master' into neutron_transport_coupling
kevinm387 Aug 3, 2023
f5ef751
Merge branch 'master' into neutron_transport_coupling
kevinm387 Aug 3, 2023
a8a101e
Organize
kevinm387 Aug 7, 2023
ab01db5
Merge branch 'master' into neutron_transport_coupling
kevinm387 Aug 7, 2023
89d0536
Correct layer definition. Don't use FW (temporary)
kevinm387 Aug 7, 2023
5e82583
Add 2D transport function. Mesh improvements.
kevinm387 Aug 7, 2023
6e2de4d
Remove _in_ layers
kevinm387 Aug 7, 2023
07109e5
Add 2d get_tbr() function, add OH, fix vtk write
kevinm387 Aug 9, 2023
7a58ca1
Adding example notebook.
kevinm387 Aug 10, 2023
fc650b1
Fix material identification in get_tbr()
kevinm387 Aug 10, 2023
da9ded3
Update 1D neutron transport example
kevinm387 Aug 10, 2023
da41337
Merge branch 'master' into neutron_transport_coupling
kevinm387 Aug 10, 2023
5314382
Consolidate to single function neutron_transport_2d()
kevinm387 Aug 15, 2023
6f75954
Make neutron source in center of plasma.
kevinm387 Aug 17, 2023
d40f3f6
Use plasma major radius for source, increase tracks.
kevinm387 Aug 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Fortran90Namelists = "8fb689aa-71ff-4044-8071-0cffc910b57d"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
FusionMaterials = "4c86da02-02c8-4634-8460-96566129f8e0"
GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
GridapGmsh = "3025c34a-b394-11e9-2a55-3fee550c04c8"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
IMAS = "13ead8c1-b7d1-41bb-a6d0-5b8b65ed587a"
IMASDD = "06b86afa-9f21-11ec-2ef8-e51b8960cfc5"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Expand All @@ -41,6 +44,7 @@ Metaheuristics = "bcdb8e00-2c21-11e9-3065-2b553b22f898"
MillerExtendedHarmonic = "c82744c2-dc08-461a-8c37-87ab04d0f9b8"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
NNeutronics = "a9424c20-d414-11ec-167b-9106c24d956c"
NeutronTransport = "161f4978-d3bb-4696-90f4-058341551711"
NumericalIntegration = "e7bfaba1-d571-5449-8927-abc22e82249b"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Expand All @@ -52,13 +56,18 @@ ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
QED = "8bcbec86-48c7-11ec-16a6-c1bc83299373"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RayTracing = "3007c720-8091-40db-9339-e09e4eb4c7ea"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SimulationParameters = "32ab26d3-25d6-405d-a295-367385e16093"
SnoopPrecompile = "66db9d55-30c0-4569-8b51-7e840670fc0c"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TAUENN = "4f5ffc88-c87f-11eb-142e-4d2ba0394a67"
TEQUILA = "a60c9cbd-e72f-4185-96b6-b8fc312c4d37"
TGLFNN = "558c7b13-fd9f-4806-b461-592296cfa9d0"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
VacuumFields = "9d9223b5-c5da-4bf4-abee-2a8bb6775a49"
Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"

Expand Down
90 changes: 90 additions & 0 deletions playground/2d_neutron_transport_example.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "a1c50669",
"metadata": {},
"outputs": [],
"source": [
"using Revise\n",
"using FUSE"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "009f8417",
"metadata": {},
"outputs": [],
"source": [
"ini, act = FUSE.case_parameters(:FPP; version=:v1_demount, init_from=:scalars);\n",
"dd = FUSE.init(ini, act; do_plot=false);"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "02231999",
"metadata": {},
"outputs": [],
"source": [
"data_path=\"/fusion/projects/ird/ptp/mclaughlink/\"\n",
"data_filename=\"combined_mgxs_lib.h5\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7f81ec0c",
"metadata": {},
"outputs": [],
"source": [
"@time sol = FUSE.neutron_transport_2d(dd, data_path, data_filename)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a6195600",
"metadata": {},
"outputs": [],
"source": [
"FUSE.get_tbr(sol, dd, data_path, data_filename)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e6d8682a",
"metadata": {},
"outputs": [],
"source": [
"FUSE.write_neutron_flux_vtk(sol)"
]
},
{
"cell_type": "markdown",
"id": "931b8a69",
"metadata": {},
"source": [
"You can now use Paraview or a similar program to view the fluxes.vtu file. If running on Omega, you can type `/fusion/projects/codes/neutronics/ParaView-5.11.1-MPI-Linux-Python3.9-x86_64/bin/paraview` in your terminal window to launch Paraview."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.2",
"language": "julia",
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.2"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
101 changes: 101 additions & 0 deletions playground/neutron_transport_example.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"using Revise\n",
"using FUSE"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Build an arbitrary 1D geometry using `FUSE.concentric_cylinders()`"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"layer_thicknesses = [100, 0.5,20,1] # eventually replace with dd.build.layer.ΔR ?\n",
"material_names = [\"DT_plasma\", \"Tungsten\", \"lithium-lead-Li6enrich=90\",\"eurofer\"] # eventually replace with dd.build.layer.material\n",
"layers = [\"plasma\", \"First Wall\", \"Breeder\", \"Back wall\"]\n",
"mat_tags = Dict(zip(layers, material_names))\n",
"data_path = \"/fusion/projects/ird/ptp/mclaughlink/\"\n",
"data_filename= \"combined_mgxs_lib.h5\"\n",
"save_path = data_path\n",
"save_filename = \"concentric_circles\"\n",
"sol = FUSE.concentric_circles(layer_thicknesses, material_names, layers, data_path, data_filename, save_path, save_filename)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"tbr = FUSE.get_tbr(sol, mat_tags, data_path, data_filename)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Or, to build a 1D simulation based on FUSE's midplane layer thicknesses, use `FUSE.neutron_transport_1d()`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ini, act = FUSE.case_parameters(:FPP; version=:v1_demount, init_from=:scalars);\n",
"dd = FUSE.init(ini, act; do_plot=false);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sol = FUSE.neutron_transport_1d(dd, data_path, data_filename)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"tbr = FUSE.get_tbr(sol, dd, data_path, data_filename)"
]
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"kernelspec": {
"display_name": "Julia (10 threads) 1.9.0",
"language": "julia",
"name": "julia-_10-threads_-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.0"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
1 change: 1 addition & 0 deletions src/FUSE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ include(joinpath("actors", "build", "cx_actor.jl"))

include(joinpath("actors", "nuclear", "blanket_actor.jl"))
include(joinpath("actors", "nuclear", "neutronics_actor.jl"))
include(joinpath("actors", "nuclear", "neutron_transport_actor.jl"))

include(joinpath("actors", "current", "qed_actor.jl"))
include(joinpath("actors", "current", "steadycurrent_actor.jl"))
Expand Down
Loading
Loading