Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #34 from fusion-energy/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
shimwell authored Aug 17, 2021
2 parents c2b82fa + bdba16d commit b9b6892
Show file tree
Hide file tree
Showing 27 changed files with 604 additions and 809 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:
- run:
name: run test_NeutronicModel
command:
pytest tests/test_NeutronicModel.py -v --cov=paramak_neutronics --cov-append --cov-report term --cov-report xml
pytest tests/test_neutronic_model.py -v --cov=paramak_neutronics --cov-append --cov-report term --cov-report xml

- run:
name: run test_Reactor_neutronics
name: run test_shape_neutronics
command:
pytest tests/test_Reactor_neutronics.py -v --cov=paramak_neutronics --cov-append --cov-report term --cov-report xml
pytest tests/test_shape_neutronics.py -v --cov=paramak_neutronics --cov-append --cov-report term --cov-report xml

- run:
name: run test_Shape_neutronics
name: run test_reactor_neutronics
command:
pytest tests/test_Shape_neutronics.py -v --cov=paramak_neutronics --cov-append --cov-report term --cov-report xml
pytest tests/test_reactor_neutronics.py -v --cov=paramak_neutronics --cov-append --cov-report term --cov-report xml

- run:
name: run test_neutronics_utils
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 \
CC=/usr/bin/mpicc CXX=/usr/bin/mpicxx \
DEBIAN_FRONTEND=noninteractive

RUN apt-get --allow-releaseinfo-change update
RUN apt-get update -y && \
apt-get upgrade -y

Expand Down Expand Up @@ -126,7 +127,8 @@ RUN git clone --shallow-submodules --single-branch --branch main --depth 1 https
RUN mkdir DAGMC && \
cd DAGMC && \
# git clone --single-branch --branch 3.2.0 --depth 1 https://github.com/svalinn/DAGMC.git && \
git clone --shallow-submodules --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git && \
# git clone --shallow-submodules --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git && \
git clone --shallow-submodules --single-branch --branch dd_bbox --depth 1 https://github.com/pshriwise/DAGMC.git && \
mkdir build && \
cd build && \
cmake ../DAGMC -DBUILD_TALLY=ON \
Expand Down Expand Up @@ -165,15 +167,14 @@ ENV OPENMC_CROSS_SECTIONS=/nuclear_data/cross_sections.xml
ENV PATH="/MOAB/build/bin:${PATH}"
ENV PATH="/DAGMC/bin:${PATH}"

RUN pip install paramak

FROM dependencies as final

COPY run_tests.sh run_tests.sh
COPY paramak_neutronics paramak_neutronics/
COPY setup.py setup.py
COPY examples examples/
COPY tests tests/
COPY README.md README.md
COPY tests tests/
COPY examples examples/

RUN python setup.py install
28 changes: 11 additions & 17 deletions examples/ball_reactor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This example makes a reactor geometry and a neutronics model. A homogenised material made of enriched lithium lead and eurofer is being used as the blanket material for this simulation in order to demonstrate the use of more complex materials."
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import neutronics_material_maker as nmm\n",
"import openmc\n",
Expand Down Expand Up @@ -61,7 +63,7 @@
"\n",
"# makes the neutronics material\n",
"neutronics_model = paramak_neutronics.NeutronicsModel(\n",
" geometry=my_reactor,\n",
" h5m_filename=my_reactor.export_h5m(),\n",
" source=source,\n",
" materials={\n",
" 'inboard_tf_coils_mat': 'copper',\n",
Expand All @@ -80,28 +82,20 @@
"\n",
"# prints the results to screen\n",
"print('TBR', neutronics_model.results['TBR'])"
],
"outputs": [],
"metadata": {}
]
}
],
"metadata": {
"interpreter": {
"hash": "71893251c0b0cd78b546a9c905312457257aecf63dc5b51c6968316964f80317"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"display_name": "Python 3.8.10 64-bit ('cq': conda)",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": ""
}
},
"nbformat": 4,
Expand Down
32 changes: 13 additions & 19 deletions examples/ball_reactor_minimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is a minimal example that obtains the TBR (Tritium Breeding Ratio) for a parametric ball reactor"
],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import openmc\n",
"import paramak\n",
Expand Down Expand Up @@ -49,7 +51,7 @@
"\n",
"# makes the neutronics model from the geometry and material allocations\n",
"neutronics_model = paramak_neutronics.NeutronicsModel(\n",
" geometry=my_reactor,\n",
" h5m_filename=my_reactor.export_h5m(),\n",
" source=source,\n",
" materials={\n",
" 'inboard_tf_coils_mat': 'eurofer',\n",
Expand All @@ -66,35 +68,27 @@
"# simulate the neutronics model\n",
"neutronics_model.simulate()\n",
"print(neutronics_model.results)\n"
],
"outputs": [],
"metadata": {}
]
},
{
"cell_type": "code",
"execution_count": null,
"source": [],
"metadata": {},
"outputs": [],
"metadata": {}
"source": []
}
],
"metadata": {
"interpreter": {
"hash": "71893251c0b0cd78b546a9c905312457257aecf63dc5b51c6968316964f80317"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"display_name": "Python 3.8.10 64-bit ('cq': conda)",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": ""
}
},
"nbformat": 4,
Expand Down
20 changes: 7 additions & 13 deletions examples/ball_reactor_source_plot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"\n",
"# makes the neutronics material\n",
"neutronics_model = paramak_neutronics.NeutronicsModel(\n",
" geometry=my_reactor,\n",
" h5m_filename=my_reactor.export_h5m(),\n",
" source=source,\n",
" materials={\n",
" 'inboard_tf_coils_mat': 'copper',\n",
Expand Down Expand Up @@ -132,24 +132,18 @@
}
],
"metadata": {
"interpreter": {
"hash": "71893251c0b0cd78b546a9c905312457257aecf63dc5b51c6968316964f80317"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"display_name": "Python 3.8.10 64-bit ('cq': conda)",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": ""
}
},
"nbformat": 4,
"nbformat_minor": 4
}
}
20 changes: 7 additions & 13 deletions examples/center_column_study_reactor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
" # makes the neutronics model and assigns basic materials to each\n",
" # component\n",
" neutronics_model = paramak_neutronics.NeutronicsModel(\n",
" geometry=my_reactor,\n",
" h5m_filename=my_reactor.export_h5m(),\n",
" source=source,\n",
" materials={\n",
" 'DT_plasma': 'DT_plasma',\n",
Expand Down Expand Up @@ -91,24 +91,18 @@
}
],
"metadata": {
"interpreter": {
"hash": "71893251c0b0cd78b546a9c905312457257aecf63dc5b51c6968316964f80317"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"display_name": "Python 3.8.10 64-bit ('cq': conda)",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": ""
}
},
"nbformat": 4,
"nbformat_minor": 4
}
}
20 changes: 7 additions & 13 deletions examples/center_column_study_reactor_minimal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"\n",
"# creates a neutronics model from the geometry and assigned materials\n",
"neutronics_model = paramak_neutronics.NeutronicsModel(\n",
" geometry=my_reactor,\n",
" h5m_filename=my_reactor.export_h5m(),\n",
" source=source,\n",
" materials={\n",
" 'inboard_tf_coils_mat': 'eurofer',\n",
Expand Down Expand Up @@ -75,24 +75,18 @@
}
],
"metadata": {
"interpreter": {
"hash": "71893251c0b0cd78b546a9c905312457257aecf63dc5b51c6968316964f80317"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"display_name": "Python 3.8.10 64-bit ('cq': conda)",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": ""
}
},
"nbformat": 4,
"nbformat_minor": 4
}
}
2 changes: 1 addition & 1 deletion examples/component_based_mesh_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def main():

# converts the geometry into a neutronics geometry
my_model = paramak.NeutronicsModel(
geometry=my_shape,
h5m_filename=my_shape.export_h5m(),
source=source,
materials={'center_column_shield_mat': 'WB'}, # WB is tungsten boride
cell_tallies=['heating', 'TBR'],
Expand Down
20 changes: 7 additions & 13 deletions examples/component_based_parameter_study.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"\n",
" # converts the geometry into a neutronics geometry\n",
" my_model = paramak_neutronics.NeutronicsModel(\n",
" geometry=my_shape,\n",
" h5m_filename=my_shape.export_h5m(),\n",
" source=source,\n",
" materials={\n",
" 'center_column_shield_mat': 'WB'},\n",
Expand Down Expand Up @@ -87,24 +87,18 @@
}
],
"metadata": {
"interpreter": {
"hash": "71893251c0b0cd78b546a9c905312457257aecf63dc5b51c6968316964f80317"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"display_name": "Python 3.8.10 64-bit ('cq': conda)",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": ""
}
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Loading

0 comments on commit b9b6892

Please sign in to comment.