mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
notebooks
This commit is contained in:
parent
9bcc4de16a
commit
032e21ec43
4 changed files with 35 additions and 119 deletions
|
|
@ -1984,7 +1984,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 58,
|
||||
"execution_count": 66,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -2005,7 +2005,7 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 59,
|
||||
"execution_count": 67,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
|
@ -2016,12 +2016,12 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Now we can run OpenMC in plotting mode by calling the `plot_geometry()` function. Under the hood this is calling `openmc --plot`."
|
||||
"Now we can run OpenMC in plotting mode by calling the `plot_geometry()` function."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 60,
|
||||
"execution_count": 69,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
|
|
@ -2057,7 +2057,7 @@
|
|||
" License | https://docs.openmc.org/en/latest/license.html\n",
|
||||
" Version | 0.14.1-dev\n",
|
||||
" Git SHA1 | 14ce3cec4b388ae8b7ec5b28db57dbcbff06f147\n",
|
||||
" Date/Time | 2024-03-27 19:42:15\n",
|
||||
" Date/Time | 2024-03-28 08:25:05\n",
|
||||
" MPI Processes | 1\n",
|
||||
" OpenMP Threads | 8\n",
|
||||
"\n",
|
||||
|
|
@ -2065,14 +2065,26 @@
|
|||
" WARNING: Other XML file input(s) are present. These files may be ignored in\n",
|
||||
" favor of the model.xml file.\n",
|
||||
" Preparing distributed cell instances...\n",
|
||||
" Reading plot XML file...\n",
|
||||
"\n",
|
||||
" =======================> PLOTTING SUMMARY <========================\n",
|
||||
"\n"
|
||||
"\n",
|
||||
"Plot ID: 8\n",
|
||||
"Plot file: pinplot.png\n",
|
||||
"Universe depth: -1\n",
|
||||
"Plot Type: Slice\n",
|
||||
"Origin: 0 0 0\n",
|
||||
"Width: 1.4427 1.4427\n",
|
||||
"Coloring: Materials\n",
|
||||
"Basis: XY\n",
|
||||
"Pixels: 200 200\n",
|
||||
"\n",
|
||||
" Processing plot 8: pinplot.png...\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"openmc.plot_geometry()"
|
||||
"model.plot_geometry()"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -2084,68 +2096,36 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 62,
|
||||
"execution_count": 70,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"CMakeLists.txt \u001b[1m\u001b[36mcmake\u001b[m\u001b[m pyproject.toml\r\n",
|
||||
"CODEOWNERS csg_half.png pytest.ini\r\n",
|
||||
"CODE_OF_CONDUCT.md \u001b[1m\u001b[36mdocs\u001b[m\u001b[m \u001b[1m\u001b[36mscripts\u001b[m\u001b[m\r\n",
|
||||
"CONTRIBUTING.md \u001b[1m\u001b[36mexamples\u001b[m\u001b[m \u001b[31msetup.py\u001b[m\u001b[m\r\n",
|
||||
"Dockerfile \u001b[1m\u001b[36minclude\u001b[m\u001b[m \u001b[1m\u001b[36msrc\u001b[m\u001b[m\r\n",
|
||||
"LICENSE \u001b[1m\u001b[36mman\u001b[m\u001b[m statepoint.100.h5\r\n",
|
||||
"MANIFEST.in materials.xml summary.h5\r\n",
|
||||
"Pincell-solution.ipynb mc_bcs.png \u001b[1m\u001b[36mtests\u001b[m\u001b[m\r\n",
|
||||
"Pincell.ipynb model.xml \u001b[1m\u001b[36mtools\u001b[m\u001b[m\r\n",
|
||||
"README.md \u001b[1m\u001b[36mopenmc\u001b[m\u001b[m \u001b[1m\u001b[36mvendor\u001b[m\u001b[m\r\n",
|
||||
"bcs.png \u001b[1m\u001b[36mopenmc.egg-info\u001b[m\u001b[m\r\n",
|
||||
"\u001b[1m\u001b[36mbuild\u001b[m\u001b[m pincell.png\r\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ename": "FileNotFoundError",
|
||||
"evalue": "No such file or directory: 'pinplot.png'",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/display.py:1045\u001b[0m, in \u001b[0;36mImage._data_and_metadata\u001b[0;34m(self, always_both)\u001b[0m\n\u001b[1;32m 1044\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1045\u001b[0m b64_data \u001b[38;5;241m=\u001b[39m \u001b[43mb2a_base64\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnewline\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mdecode(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mascii\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1046\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
||||
"\u001b[0;31mTypeError\u001b[0m: a bytes-like object is required, not 'str'",
|
||||
"\nThe above exception was the direct cause of the following exception:\n",
|
||||
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/formatters.py:974\u001b[0m, in \u001b[0;36mMimeBundleFormatter.__call__\u001b[0;34m(self, obj, include, exclude)\u001b[0m\n\u001b[1;32m 971\u001b[0m method \u001b[38;5;241m=\u001b[39m get_real_method(obj, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprint_method)\n\u001b[1;32m 973\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m method \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 974\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mmethod\u001b[49m\u001b[43m(\u001b[49m\u001b[43minclude\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minclude\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexclude\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexclude\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 975\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 976\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/display.py:1035\u001b[0m, in \u001b[0;36mImage._repr_mimebundle_\u001b[0;34m(self, include, exclude)\u001b[0m\n\u001b[1;32m 1033\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39membed:\n\u001b[1;32m 1034\u001b[0m mimetype \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_mimetype\n\u001b[0;32m-> 1035\u001b[0m data, metadata \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_data_and_metadata\u001b[49m\u001b[43m(\u001b[49m\u001b[43malways_both\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 1036\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m metadata:\n\u001b[1;32m 1037\u001b[0m metadata \u001b[38;5;241m=\u001b[39m {mimetype: metadata}\n",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/display.py:1047\u001b[0m, in \u001b[0;36mImage._data_and_metadata\u001b[0;34m(self, always_both)\u001b[0m\n\u001b[1;32m 1045\u001b[0m b64_data \u001b[38;5;241m=\u001b[39m b2a_base64(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdata, newline\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\u001b[38;5;241m.\u001b[39mdecode(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mascii\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1046\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m-> 1047\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mFileNotFoundError\u001b[39;00m(\n\u001b[1;32m 1048\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo such file or directory: \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdata)) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 1049\u001b[0m md \u001b[38;5;241m=\u001b[39m {}\n\u001b[1;32m 1050\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmetadata:\n",
|
||||
"\u001b[0;31mFileNotFoundError\u001b[0m: No such file or directory: 'pinplot.png'"
|
||||
]
|
||||
},
|
||||
{
|
||||
"ename": "FileNotFoundError",
|
||||
"evalue": "No such file or directory: 'pinplot.png'",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/display.py:1045\u001b[0m, in \u001b[0;36mImage._data_and_metadata\u001b[0;34m(self, always_both)\u001b[0m\n\u001b[1;32m 1044\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1045\u001b[0m b64_data \u001b[38;5;241m=\u001b[39m \u001b[43mb2a_base64\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnewline\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mdecode(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mascii\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1046\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
||||
"\u001b[0;31mTypeError\u001b[0m: a bytes-like object is required, not 'str'",
|
||||
"\nThe above exception was the direct cause of the following exception:\n",
|
||||
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/formatters.py:344\u001b[0m, in \u001b[0;36mBaseFormatter.__call__\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 342\u001b[0m method \u001b[38;5;241m=\u001b[39m get_real_method(obj, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprint_method)\n\u001b[1;32m 343\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m method \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 344\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mmethod\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 345\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 346\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/display.py:1067\u001b[0m, in \u001b[0;36mImage._repr_png_\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1065\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_repr_png_\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 1066\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39membed \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mformat \u001b[38;5;241m==\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_FMT_PNG:\n\u001b[0;32m-> 1067\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_data_and_metadata\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
|
||||
"File \u001b[0;32m/usr/local/opt/ipython/libexec/lib/python3.11/site-packages/IPython/core/display.py:1047\u001b[0m, in \u001b[0;36mImage._data_and_metadata\u001b[0;34m(self, always_both)\u001b[0m\n\u001b[1;32m 1045\u001b[0m b64_data \u001b[38;5;241m=\u001b[39m b2a_base64(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdata, newline\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m)\u001b[38;5;241m.\u001b[39mdecode(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mascii\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 1046\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m-> 1047\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mFileNotFoundError\u001b[39;00m(\n\u001b[1;32m 1048\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo such file or directory: \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdata)) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 1049\u001b[0m md \u001b[38;5;241m=\u001b[39m {}\n\u001b[1;32m 1050\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmetadata:\n",
|
||||
"\u001b[0;31mFileNotFoundError\u001b[0m: No such file or directory: 'pinplot.png'"
|
||||
"CMakeLists.txt csg_half.png plots.xml\r\n",
|
||||
"CODEOWNERS \u001b[1m\u001b[36mdocs\u001b[m\u001b[m pyproject.toml\r\n",
|
||||
"CODE_OF_CONDUCT.md \u001b[1m\u001b[36mexamples\u001b[m\u001b[m pytest.ini\r\n",
|
||||
"CONTRIBUTING.md geometry.xml \u001b[1m\u001b[36mscripts\u001b[m\u001b[m\r\n",
|
||||
"Dockerfile \u001b[1m\u001b[36minclude\u001b[m\u001b[m settings.xml\r\n",
|
||||
"LICENSE \u001b[1m\u001b[36mman\u001b[m\u001b[m \u001b[31msetup.py\u001b[m\u001b[m\r\n",
|
||||
"MANIFEST.in materials.xml \u001b[1m\u001b[36msrc\u001b[m\u001b[m\r\n",
|
||||
"Pincell-solution.ipynb mc_bcs.png statepoint.100.h5\r\n",
|
||||
"Pincell.ipynb model.xml summary.h5\r\n",
|
||||
"README.md \u001b[1m\u001b[36mopenmc\u001b[m\u001b[m \u001b[1m\u001b[36mtests\u001b[m\u001b[m\r\n",
|
||||
"bcs.png \u001b[1m\u001b[36mopenmc.egg-info\u001b[m\u001b[m \u001b[1m\u001b[36mtools\u001b[m\u001b[m\r\n",
|
||||
"\u001b[1m\u001b[36mbuild\u001b[m\u001b[m pincell.png \u001b[1m\u001b[36mvendor\u001b[m\u001b[m\r\n",
|
||||
"\u001b[1m\u001b[36mcmake\u001b[m\u001b[m pinplot.png\r\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAIAAAAiOjnJAAAGjklEQVR4nO3dzXIbNxBF4WYq7+WsnbWfMutoHT+ZsoCLGpkiB5jB7R/M+dapROk5bMAkVb6ZvRsw2x/RPwDWRFiQICxIEBYkCAsShAUJwoIEYUGCsCBBWJAgLEgQFiQICxKEBQnCggRhQYKwIEFYkCAsSBAWJAgLEoQFCcKCxJ/RP0Be//73Y/ef+fuvfxx+kopu/MJqT0CjCO6iYSlieuaakV0oLM+YnrlOZOuHlaGnR8sXtmxYOXt6tGphC4ZVJamt9fJaKqyKSW2tlNciYVVPamuNvMqHtVJSW9XzKhzW9KS+fzv7LN9+Tv6R6uZVMqxZST0p6XboX/bFGGd1VjGvemGdr+qhp2MlvfZpqucLK9dWpbBOJvW5J0VMz3xM+GRhhfIqE9bhquJ6ejShsCptFQhrRlKxPT36NfOF88oe1oGqMq2o104tsORtpQ7rRFWZe3r0bsu1lTes0apqJrV1JK+0bSUNa6iqxHepUUfuXjnbShfW9RbVoxVWV66wDi2qlZLaGs4rVVuJfv2Lqj672eDHl6k+j8+ysfqHstCNqsfwrSvJ3koR1nhVV0hqa+xYzNBWoqNw11WrsgPHYrj4sDrX1YWragbaynDZCg6LqkZUaivyjjVS1cWT+s17530r8LIVtrGo6oRb/r0VExZVnZa9rfjL+zNUtae3rRABYfW8hjKPLJWeQYUsLe+wRqpiXe3q/XOif1vpjkKqGpT0vVPXsHZfN1R1SFdbzkvLL6zu/zGqOqBraJ5tJToKE+7zWlIN0CksDkG9XAdioo1FVaclGqBHWH3rKtFQKtt/19RnacVvrFQ3gzVkGKk8rL7XB+tqov1hOiyt4I2V4bW1pPDBasNiXQWJX1qRG4s7u1Lwdx+EYb1+TYTv6it4PWTp0oq9Y7GupCLHqwor/Mv86KF7TDEbi3PQTdSoA49CzkEHYUOWhMW1PZWQK3zUxmJduYkZdfxnhVjS/LA4BxPyPw1DNhbnoLOAgXMUQsI1LM7BQM7DnxxWx2nNORhiZ+zTr1kchZDwC4tzMJznI2BjQWJmWFywcnO9ZrGxIEFYkHAKi5t7Em4Pgo0FCc+wuLmH83sEbCxIEBYkpoXFr+UsYOJDZGNBgrAgQViQICxIEBYkCAsShAUJwoIEYUGCsCBBWJCYFlbgX5iOWSY+RDYWJAgLEp5hvTv+t/Alv0fAxoKEU1hvP/kaYApuD4KNBQnCgsTMsDreBeH+Hmhn+HPfiWRjQcIvLO7v4TwfARsLEpPD4pqVlesFy5w3FqdhIOfhcxRCIiQsTkNnAQOfH9br05rTMMTrsSu+S8dRCImosDgN3cSMWhIWp2Eq/ueghR6FLC0HYUOOCYul5SZq1Kqw+KWdEnSPKfZPhZyGUpHjFYbFFT5cyLW9idxYbz9/sLRk3mNfutqw+l4TtDXd/kjVl+Dgd945EEXCBysPi6XlLn5dWfjGsgSvrfVkGKlHWLuvD27x8+zf2X3eYozfWBu0dVKiATqF1be0LNVoqnm3jkPQ7RORRBsrw82gtFQD9Aur+7XC0jqga2ieH+C6biwORI1ch2CT6ChsaGtQV1X+vMPqed3QVrfeqvy/xRSwsUbawo6cVVnCo/COd033BH9/4bWYsDpfQ7T1XG9VUV/lDdtYtHVC9qrM7Bb72Dr/2vTv39qAbtIfpoKBPwPG/tpB8B1rZG/Z5VdXmaosPCyjrV6VqrIMYfW7cFtJ3wV9IfiOddd52bKP+5Zd48r16+n0V5VhXVmesGykLbvKdX54USWpylIdhUNDucCxWLgqS7WxmqG9ZWuuriM3qlRVWcKwmkPHotXPa/hGZfmSapKGZVdcXSssqru8Ydl4W1Y1r4PvJqStypKHZafaajIX9jH5xaqy/GHZobaaxHevI3epreRVWYmwmhl5WXRhp1ZUkz+ppkxYdqKtJq6wCT01VaqyWmE1J/Oy3wszTWSfpnr+Y75CSTX1wrIZbTUPhTXHOvtijLM+Ni5XlRUNq5mV192TzgZM/wJCxaSawmE10/NKom5STfmwmpXyqp5Us0hYTfW81kiqWSqspmJeKyXVLBhWUyWv9ZJqlg3rLmdhq/Z0t35YdxkKW76nuwuFteUZ2XVi2rpoWFuKyK4Z0xZhPdUTHAE9Q1iQSPTrX1gJYUGCsCBBWJAgLEgQFiQICxKEBQnCggRhQYKwIEFYkCAsSBAWJAgLEoQFCcKCBGFBgrAgQViQICxIEBYkCAsS/wMmEHBNh1IH6gAAAABJRU5ErkJggg==",
|
||||
"text/plain": [
|
||||
"<IPython.core.display.Image object>"
|
||||
]
|
||||
},
|
||||
"execution_count": 62,
|
||||
"execution_count": 70,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
|
|
@ -2156,70 +2136,6 @@
|
|||
"from IPython.display import Image\n",
|
||||
"Image(\"pinplot.png\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"OpenMC also provides us with a method on the `Plot` class that simplifies the workflow."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"plot.to_ipython_image()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## `Model` class\n",
|
||||
"\n",
|
||||
"So far, we've seen that to create and simulate a model, we had to create an instance of `Geometry`, `Materials`, and `Settings` and call the `export_to_xml` method on each of them. OpenMC also provides a `Model` class that aggregates these classes together an provides a single `export_to_xml` method that will export all files."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Combine the three classes into a single model\n",
|
||||
"model = openmc.Model()\n",
|
||||
"model.geometry = geometry\n",
|
||||
"model.materials = materials\n",
|
||||
"model.settings = settings\n",
|
||||
"\n",
|
||||
"# Export all at once\n",
|
||||
"model.export_to_xml()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The `Model` class also has `run` method that will both export XML files *and* run a simulation, returning the name of the last statepoint file that was written:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"model.run()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"As we'll see later, the `Model` class has other useful features and is also needed for performing depletion/activation calculations."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
|
|
|
|||
BIN
csg_half.png
Normal file
BIN
csg_half.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
BIN
mc_bcs.png
Normal file
BIN
mc_bcs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
pincell.png
Normal file
BIN
pincell.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
Loading…
Add table
Add a link
Reference in a new issue