diff --git a/tasks/task_14_variance_reduction/5_shielded_room_fw_cadis_ww.ipynb b/tasks/task_14_variance_reduction/5_shielded_room_fw_cadis_ww.ipynb index dfbacbf..fccb4c5 100644 --- a/tasks/task_14_variance_reduction/5_shielded_room_fw_cadis_ww.ipynb +++ b/tasks/task_14_variance_reduction/5_shielded_room_fw_cadis_ww.ipynb @@ -34,10 +34,19 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 34, "id": "3448d1db-4328-42e3-8960-50d53896f541", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/jon/openmc_fork/openmc/config.py:65: UserWarning: '/nuclear_data/cross_sections.xml' does not exist.\n", + " warnings.warn(f\"'{value}' does not exist.\")\n" + ] + } + ], "source": [ "import time # used to time the simulation\n", "import numpy as np\n", @@ -63,7 +72,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 35, "id": "47cb21c7-0afa-446c-9a6b-76c8dfb2f93e", "metadata": {}, "outputs": [], @@ -101,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 36, "id": "a72dc5e3-cb8e-41c2-9cfb-f8f7489c7f44", "metadata": {}, "outputs": [], @@ -211,7 +220,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 37, "id": "94c41f17", "metadata": {}, "outputs": [ @@ -250,7 +259,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 38, "id": "fd4986b0", "metadata": {}, "outputs": [], @@ -272,7 +281,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 39, "id": "5b9f6123", "metadata": {}, "outputs": [ @@ -280,11 +289,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=236.\n", + "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=256.\n", " warn(msg, IDWarning)\n", - "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=204.\n", + "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=224.\n", " warn(msg, IDWarning)\n", - "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=213.\n", + "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=233.\n", " warn(msg, IDWarning)\n" ] }, @@ -321,7 +330,7 @@ " License | https://docs.openmc.org/en/latest/license.html\n", " Version | 0.15.1-dev\n", " Git SHA1 | 27f3afefa472567304588edfb6fe18ab8362aa9e\n", - " Date/Time | 2025-01-28 12:43:58\n", + " Date/Time | 2025-01-29 17:36:48\n", " OpenMP Threads | 22\n", "\n", " Reading model XML file 'model.xml' ...\n", @@ -366,34 +375,34 @@ " Maximum neutron data temperature: 294 K\n", " Preparing distributed cell instances...\n", " Writing summary.h5 file...\n", - " Maximum neutron transport energy: 20000000 eV for N15\n", - "\n", - " ===============> FIXED SOURCE TRANSPORT SIMULATION <===============\n", - "\n", - " Simulating batch 1\n", - " Simulating batch 2\n", - " Simulating batch 3\n", - " Simulating batch 4\n", - " Simulating batch 5\n", - " Creating state point statepoint.5.h5...\n", - "\n", - " =======================> TIMING STATISTICS <=======================\n", - "\n", - " Total time for initialization = 8.5333e-01 seconds\n", - " Reading cross sections = 8.4568e-01 seconds\n", - " Total time in simulation = 1.7744e-02 seconds\n", - " Time in transport only = 1.3422e-02 seconds\n", - " Time in active batches = 1.7744e-02 seconds\n", - " Time accumulating tallies = 2.0849e-03 seconds\n", - " Time writing statepoints = 2.1786e-03 seconds\n", - " Total time for finalization = 1.5825e-04 seconds\n", - " Total time elapsed = 8.7420e-01 seconds\n", - " Calculation Rate (active) = 22542.6 particles/second\n", - "\n", - " ============================> RESULTS <============================\n", - "\n", - " Leakage Fraction = 0.00250 +/- 0.00250\n", - "\n" + "HDF5-DIAG: Error detected in HDF5 (1.10.10) thread 1:\n", + " #000: ../../../src/H5F.c line 349 in H5Fcreate(): unable to create file\n", + " major: File accessibility\n", + " minor: Unable to open file\n", + " #001: ../../../src/H5Fint.c line 1734 in H5F_open(): unable to lock the file\n", + " major: File accessibility\n", + " minor: Unable to lock file\n", + " #002: ../../../src/H5FD.c line 1624 in H5FD_lock(): driver lock request failed\n", + " major: Virtual File Layer\n", + " minor: Unable to lock file\n", + " #003: ../../../src/H5FDsec2.c line 1001 in H5FD__sec2_lock(): unable to lock file, errno = 11, error message = 'Resource temporarily unavailable'\n", + " major: Virtual File Layer\n", + " minor: Unable to lock file\n", + " ERROR: Failed to open HDF5 file with mode 'w': summary.h5\n" + ] + }, + { + "ename": "RuntimeError", + "evalue": "Failed to open HDF5 file with mode 'w': summary.h5", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[39], line 45\u001b[0m\n\u001b[1;32m 41\u001b[0m settings\u001b[38;5;241m.\u001b[39mbatches \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m5\u001b[39m\n\u001b[1;32m 43\u001b[0m model \u001b[38;5;241m=\u001b[39m openmc\u001b[38;5;241m.\u001b[39mModel(geometry, materials, settings, tallies)\n\u001b[0;32m---> 45\u001b[0m mg_statepoint \u001b[38;5;241m=\u001b[39m \u001b[43mmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/openmc_fork/openmc/model/model.py:720\u001b[0m, in \u001b[0;36mModel.run\u001b[0;34m(self, particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based, export_model_xml, apply_tally_results, **export_kwargs)\u001b[0m\n\u001b[1;32m 718\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexport_to_xml(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mexport_kwargs)\n\u001b[1;32m 719\u001b[0m path_input \u001b[38;5;241m=\u001b[39m export_kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[0;32m--> 720\u001b[0m \u001b[43mopenmc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparticles\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mthreads\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgeometry_debug\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrestart_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 721\u001b[0m \u001b[43m \u001b[49m\u001b[43mtracks\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mPath\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m.\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mopenmc_exec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmpi_args\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 722\u001b[0m \u001b[43m \u001b[49m\u001b[43mevent_based\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath_input\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 724\u001b[0m \u001b[38;5;66;03m# Get output directory and return the last statepoint written\u001b[39;00m\n\u001b[1;32m 725\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msettings\u001b[38;5;241m.\u001b[39moutput \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msettings\u001b[38;5;241m.\u001b[39moutput:\n", + "File \u001b[0;32m~/openmc_fork/openmc/executor.py:314\u001b[0m, in \u001b[0;36mrun\u001b[0;34m(particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based, path_input)\u001b[0m\n\u001b[1;32m 261\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Run an OpenMC simulation.\u001b[39;00m\n\u001b[1;32m 262\u001b[0m \n\u001b[1;32m 263\u001b[0m \u001b[38;5;124;03mParameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 305\u001b[0m \n\u001b[1;32m 306\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 308\u001b[0m args \u001b[38;5;241m=\u001b[39m _process_CLI_arguments(\n\u001b[1;32m 309\u001b[0m volume\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, geometry_debug\u001b[38;5;241m=\u001b[39mgeometry_debug, particles\u001b[38;5;241m=\u001b[39mparticles,\n\u001b[1;32m 310\u001b[0m restart_file\u001b[38;5;241m=\u001b[39mrestart_file, threads\u001b[38;5;241m=\u001b[39mthreads, tracks\u001b[38;5;241m=\u001b[39mtracks,\n\u001b[1;32m 311\u001b[0m event_based\u001b[38;5;241m=\u001b[39mevent_based, openmc_exec\u001b[38;5;241m=\u001b[39mopenmc_exec, mpi_args\u001b[38;5;241m=\u001b[39mmpi_args,\n\u001b[1;32m 312\u001b[0m path_input\u001b[38;5;241m=\u001b[39mpath_input)\n\u001b[0;32m--> 314\u001b[0m \u001b[43m_run\u001b[49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcwd\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/openmc_fork/openmc/executor.py:125\u001b[0m, in \u001b[0;36m_run\u001b[0;34m(args, output, cwd)\u001b[0m\n\u001b[1;32m 122\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mOpenMC aborted unexpectedly.\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 123\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(error_msg\u001b[38;5;241m.\u001b[39msplit())\n\u001b[0;32m--> 125\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(error_msg)\n", + "\u001b[0;31mRuntimeError\u001b[0m: Failed to open HDF5 file with mode 'w': summary.h5" ] } ], @@ -407,9 +416,11 @@ "# Disable transport correction\n", "mgxs_lib.correction = None\n", "\n", - "# Specify needed cross sections for random ray\n", - "mgxs_lib.mgxs_types = ['total', 'absorption', 'nu-fission', 'fission',\n", - " 'nu-scatter matrix', 'multiplicity matrix', 'chi']\n", + "# Specify needed cross sections for random ray, fixed source does not actually make use of all of these but openmc currently expects to find them so we add them to avoid an error. \n", + "mgxs_lib.mgxs_types = [\n", + " 'total', 'absorption', 'nu-fission', 'fission',\n", + " 'nu-scatter matrix', 'multiplicity matrix', 'chi'\n", + "]\n", "\n", "# Specify a \"cell\" domain type for the cross section tally filters\n", "mgxs_lib.domain_type = \"material\"\n", @@ -440,13 +451,12 @@ "\n", "model = openmc.Model(geometry, materials, settings, tallies)\n", "\n", - "mg_statepoint = model.run()\n", - "# openmc.config['mg_cross_sections'] = '/d'" + "mg_statepoint = model.run()\n" ] }, { "cell_type": "code", - "execution_count": 87, + "execution_count": null, "id": "39147b76", "metadata": {}, "outputs": [], @@ -487,7 +497,8 @@ "mgxs_file = mgxs_lib.create_mg_library(xs_type='macro', xsdata_names=names)\n", "\n", "# Write the file to disk using the default filename of \"mgxs.h5\"\n", - "# mgxs_file.export_to_hdf5(\"mgxs.h5\")" + "mgxs_file.export_to_hdf5(\"mgxs.h5\")\n", + "openmc.config['mg_cross_sections'] = 'mgxs.h5'" ] }, { @@ -501,26 +512,13 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": null, "id": "9d7bbee6", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=1.\n", - " warn(msg, IDWarning)\n", - "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Filter instance already exists with id=2.\n", - " warn(msg, IDWarning)\n", - "/home/jon/openmc_fork/openmc/mixin.py:70: IDWarning: Another Tally instance already exists with id=42.\n", - " warn(msg, IDWarning)\n" - ] - } - ], + "outputs": [], "source": [ "mesh = openmc.RegularMesh().from_domain(geometry)\n", - "mesh.dimension = (500, 500, 1)\n", + "mesh.dimension = (100, 100, 50)\n", "\n", "mesh_filter = openmc.MeshFilter(mesh, filter_id=1)\n", "particle_filter = openmc.ParticleFilter('neutron', filter_id=2)\n", @@ -544,11 +542,13 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 23, "id": "ea32fb73", "metadata": {}, "outputs": [], "source": [ + "import numpy as np\n", + "\n", "settings = openmc.Settings()\n", "\n", "settings.run_mode = \"fixed source\"\n", @@ -559,8 +559,8 @@ "settings.output = {'tallies': False}\n", "settings.random_ray['adjoint'] = True\n", "settings.energy_mode = 'multi-group'\n", - "settings.random_ray['distance_inactive'] = 40.0\n", - "settings.random_ray['distance_active'] = 400.0\n", + "settings.random_ray['distance_inactive'] = np.sqrt(np.sum(geometry.bounding_box.width))\n", + "settings.random_ray['distance_active'] = np.sqrt(np.sum(geometry.bounding_box.width)) * 2\n", "\n", "pitch = 1.26\n", "lower_left = (-pitch, -pitch, -pitch)\n", @@ -580,7 +580,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 25, "id": "6d8042a5", "metadata": {}, "outputs": [], @@ -599,7 +599,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 26, "id": "05d44467", "metadata": {}, "outputs": [], @@ -636,69 +636,10 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": null, "id": "2a9f077f", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " %%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%\n", - " ############### %%%%%%%%%%%%%%%%%%%%%%%%\n", - " ################## %%%%%%%%%%%%%%%%%%%%%%%\n", - " ################### %%%%%%%%%%%%%%%%%%%%%%%\n", - " #################### %%%%%%%%%%%%%%%%%%%%%%\n", - " ##################### %%%%%%%%%%%%%%%%%%%%%\n", - " ###################### %%%%%%%%%%%%%%%%%%%%\n", - " ####################### %%%%%%%%%%%%%%%%%%\n", - " ####################### %%%%%%%%%%%%%%%%%\n", - " ###################### %%%%%%%%%%%%%%%%%\n", - " #################### %%%%%%%%%%%%%%%%%\n", - " ################# %%%%%%%%%%%%%%%%%\n", - " ############### %%%%%%%%%%%%%%%%\n", - " ############ %%%%%%%%%%%%%%%\n", - " ######## %%%%%%%%%%%%%%\n", - " %%%%%%%%%%%\n", - "\n", - " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2024 MIT, UChicago Argonne LLC, and contributors\n", - " License | https://docs.openmc.org/en/latest/license.html\n", - " Version | 0.15.1-dev\n", - " Git SHA1 | 27f3afefa472567304588edfb6fe18ab8362aa9e\n", - " Date/Time | 2025-01-28 12:07:48\n", - " OpenMP Threads | 22\n", - "\n", - " Reading model XML file 'model.xml' ...\n", - " ERROR: No mgxs.h5 file was specified in materials.xml or in the\n", - " OPENMC_MG_CROSS_SECTIONS environment variable. OpenMC needs such a file\n", - " to identify where to find MG cross section libraries. Please consult the\n", - " user's guide at https://docs.openmc.org for information on how to set up\n", - " MG cross section libraries.\n" - ] - }, - { - "ename": "RuntimeError", - "evalue": "No mgxs.h5 file was specified in materials.xml or in the OPENMC_MG_CROSS_SECTIONS environment variable. OpenMC needs such a file to identify where to find MG cross section libraries. Please consult the user's guide at https://docs.openmc.org for information on how to set up MG cross section libraries.", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[66], line 4\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# this helps time the simulation\u001b[39;00m\n\u001b[1;32m 2\u001b[0m t0 \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[0;32m----> 4\u001b[0m no_ww_statepoint_filename \u001b[38;5;241m=\u001b[39m \u001b[43mmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtotal time without weight windows \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mint\u001b[39m(time\u001b[38;5;241m.\u001b[39mtime()\u001b[38;5;241m-\u001b[39mt0)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124ms\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 8\u001b[0m plot_mesh_tally(no_ww_statepoint_filename, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mno_ww_statepoint_filename.png\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", - "File \u001b[0;32m~/openmc_fork/openmc/model/model.py:720\u001b[0m, in \u001b[0;36mModel.run\u001b[0;34m(self, particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based, export_model_xml, apply_tally_results, **export_kwargs)\u001b[0m\n\u001b[1;32m 718\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexport_to_xml(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mexport_kwargs)\n\u001b[1;32m 719\u001b[0m path_input \u001b[38;5;241m=\u001b[39m export_kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[0;32m--> 720\u001b[0m \u001b[43mopenmc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparticles\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mthreads\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgeometry_debug\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrestart_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 721\u001b[0m \u001b[43m \u001b[49m\u001b[43mtracks\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mPath\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m.\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mopenmc_exec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmpi_args\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 722\u001b[0m \u001b[43m \u001b[49m\u001b[43mevent_based\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath_input\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 724\u001b[0m \u001b[38;5;66;03m# Get output directory and return the last statepoint written\u001b[39;00m\n\u001b[1;32m 725\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msettings\u001b[38;5;241m.\u001b[39moutput \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msettings\u001b[38;5;241m.\u001b[39moutput:\n", - "File \u001b[0;32m~/openmc_fork/openmc/executor.py:314\u001b[0m, in \u001b[0;36mrun\u001b[0;34m(particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based, path_input)\u001b[0m\n\u001b[1;32m 261\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Run an OpenMC simulation.\u001b[39;00m\n\u001b[1;32m 262\u001b[0m \n\u001b[1;32m 263\u001b[0m \u001b[38;5;124;03mParameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 305\u001b[0m \n\u001b[1;32m 306\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 308\u001b[0m args \u001b[38;5;241m=\u001b[39m _process_CLI_arguments(\n\u001b[1;32m 309\u001b[0m volume\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, geometry_debug\u001b[38;5;241m=\u001b[39mgeometry_debug, particles\u001b[38;5;241m=\u001b[39mparticles,\n\u001b[1;32m 310\u001b[0m restart_file\u001b[38;5;241m=\u001b[39mrestart_file, threads\u001b[38;5;241m=\u001b[39mthreads, tracks\u001b[38;5;241m=\u001b[39mtracks,\n\u001b[1;32m 311\u001b[0m event_based\u001b[38;5;241m=\u001b[39mevent_based, openmc_exec\u001b[38;5;241m=\u001b[39mopenmc_exec, mpi_args\u001b[38;5;241m=\u001b[39mmpi_args,\n\u001b[1;32m 312\u001b[0m path_input\u001b[38;5;241m=\u001b[39mpath_input)\n\u001b[0;32m--> 314\u001b[0m \u001b[43m_run\u001b[49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcwd\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/openmc_fork/openmc/executor.py:125\u001b[0m, in \u001b[0;36m_run\u001b[0;34m(args, output, cwd)\u001b[0m\n\u001b[1;32m 122\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mOpenMC aborted unexpectedly.\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 123\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(error_msg\u001b[38;5;241m.\u001b[39msplit())\n\u001b[0;32m--> 125\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(error_msg)\n", - "\u001b[0;31mRuntimeError\u001b[0m: No mgxs.h5 file was specified in materials.xml or in the OPENMC_MG_CROSS_SECTIONS environment variable. OpenMC needs such a file to identify where to find MG cross section libraries. Please consult the user's guide at https://docs.openmc.org for information on how to set up MG cross section libraries." - ] - } - ], + "outputs": [], "source": [ "# this helps time the simulation\n", "t0 = time.time()\n", @@ -758,65 +699,10 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "e6f60d98", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " %%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%\n", - " %%%%%%%%%%%%%%%%%%%%%%%%\n", - " ############### %%%%%%%%%%%%%%%%%%%%%%%%\n", - " ################## %%%%%%%%%%%%%%%%%%%%%%%\n", - " ################### %%%%%%%%%%%%%%%%%%%%%%%\n", - " #################### %%%%%%%%%%%%%%%%%%%%%%\n", - " ##################### %%%%%%%%%%%%%%%%%%%%%\n", - " ###################### %%%%%%%%%%%%%%%%%%%%\n", - " ####################### %%%%%%%%%%%%%%%%%%\n", - " ####################### %%%%%%%%%%%%%%%%%\n", - " ###################### %%%%%%%%%%%%%%%%%\n", - " #################### %%%%%%%%%%%%%%%%%\n", - " ################# %%%%%%%%%%%%%%%%%\n", - " ############### %%%%%%%%%%%%%%%%\n", - " ############ %%%%%%%%%%%%%%%\n", - " ######## %%%%%%%%%%%%%%\n", - " %%%%%%%%%%%\n", - "\n", - " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2024 MIT, UChicago Argonne LLC, and contributors\n", - " License | https://docs.openmc.org/en/latest/license.html\n", - " Version | 0.15.1-dev\n", - " Git SHA1 | 27f3afefa472567304588edfb6fe18ab8362aa9e\n", - " Date/Time | 2025-01-28 11:46:41\n", - " OpenMP Threads | 22\n", - "\n", - " Reading model XML file 'model.xml' ...\n", - " ERROR: FW-CADIS can only be run in random ray solver mode.\n" - ] - }, - { - "ename": "RuntimeError", - "evalue": "FW-CADIS can only be run in random ray solver mode.", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[18], line 4\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# this helps time the simulation\u001b[39;00m\n\u001b[1;32m 2\u001b[0m t0 \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[0;32m----> 4\u001b[0m ww_statepoint_filename \u001b[38;5;241m=\u001b[39m \u001b[43mmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m t1 \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtotal time with weight windows \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mint\u001b[39m(t1\u001b[38;5;241m-\u001b[39mt0)\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124ms\u001b[39m\u001b[38;5;124m'\u001b[39m)\n", - "File \u001b[0;32m~/openmc_fork/openmc/model/model.py:720\u001b[0m, in \u001b[0;36mModel.run\u001b[0;34m(self, particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based, export_model_xml, apply_tally_results, **export_kwargs)\u001b[0m\n\u001b[1;32m 718\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexport_to_xml(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mexport_kwargs)\n\u001b[1;32m 719\u001b[0m path_input \u001b[38;5;241m=\u001b[39m export_kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[0;32m--> 720\u001b[0m \u001b[43mopenmc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43mparticles\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mthreads\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgeometry_debug\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrestart_file\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 721\u001b[0m \u001b[43m \u001b[49m\u001b[43mtracks\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mPath\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m.\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mopenmc_exec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmpi_args\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 722\u001b[0m \u001b[43m \u001b[49m\u001b[43mevent_based\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath_input\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 724\u001b[0m \u001b[38;5;66;03m# Get output directory and return the last statepoint written\u001b[39;00m\n\u001b[1;32m 725\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msettings\u001b[38;5;241m.\u001b[39moutput \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpath\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msettings\u001b[38;5;241m.\u001b[39moutput:\n", - "File \u001b[0;32m~/openmc_fork/openmc/executor.py:314\u001b[0m, in \u001b[0;36mrun\u001b[0;34m(particles, threads, geometry_debug, restart_file, tracks, output, cwd, openmc_exec, mpi_args, event_based, path_input)\u001b[0m\n\u001b[1;32m 261\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Run an OpenMC simulation.\u001b[39;00m\n\u001b[1;32m 262\u001b[0m \n\u001b[1;32m 263\u001b[0m \u001b[38;5;124;03mParameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 305\u001b[0m \n\u001b[1;32m 306\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 308\u001b[0m args \u001b[38;5;241m=\u001b[39m _process_CLI_arguments(\n\u001b[1;32m 309\u001b[0m volume\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, geometry_debug\u001b[38;5;241m=\u001b[39mgeometry_debug, particles\u001b[38;5;241m=\u001b[39mparticles,\n\u001b[1;32m 310\u001b[0m restart_file\u001b[38;5;241m=\u001b[39mrestart_file, threads\u001b[38;5;241m=\u001b[39mthreads, tracks\u001b[38;5;241m=\u001b[39mtracks,\n\u001b[1;32m 311\u001b[0m event_based\u001b[38;5;241m=\u001b[39mevent_based, openmc_exec\u001b[38;5;241m=\u001b[39mopenmc_exec, mpi_args\u001b[38;5;241m=\u001b[39mmpi_args,\n\u001b[1;32m 312\u001b[0m path_input\u001b[38;5;241m=\u001b[39mpath_input)\n\u001b[0;32m--> 314\u001b[0m \u001b[43m_run\u001b[49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcwd\u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/openmc_fork/openmc/executor.py:125\u001b[0m, in \u001b[0;36m_run\u001b[0;34m(args, output, cwd)\u001b[0m\n\u001b[1;32m 122\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mOpenMC aborted unexpectedly.\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 123\u001b[0m error_msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(error_msg\u001b[38;5;241m.\u001b[39msplit())\n\u001b[0;32m--> 125\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mRuntimeError\u001b[39;00m(error_msg)\n", - "\u001b[0;31mRuntimeError\u001b[0m: FW-CADIS can only be run in random ray solver mode." - ] - } - ], + "outputs": [], "source": [ "# this helps time the simulation\n", "t0 = time.time()\n",