From 0df73b79b4d2efccd772ea1a043077cfee56a4ba Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 25 Oct 2024 10:49:50 -0500 Subject: [PATCH 1/2] Adding python script for generating the hybrid CSG/CAD model.py --- tutorials/csg_to_cad/make_hybrid_model.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tutorials/csg_to_cad/make_hybrid_model.py diff --git a/tutorials/csg_to_cad/make_hybrid_model.py b/tutorials/csg_to_cad/make_hybrid_model.py new file mode 100644 index 000000000..50a059a5e --- /dev/null +++ b/tutorials/csg_to_cad/make_hybrid_model.py @@ -0,0 +1,17 @@ +#! python + +import openmc + +# create an object for the DAGMC model +dagmc_universe = openmc.DAGMCUniverse('krusty_fuel.h5m') + +model = openmc.Model.from_model_xml('original_model.xml') + +fuel_cell = model.geometry.get_cells_by_fill_name('U-7.65Mo Fuel')[0] + +print("Inserting the CAD model into the following cell:") +print(fuel_cell) + +fuel_cell.fill = dagmc_universe + +model.export_to_model_xml() From 93f988adafd966c759a884373da758053d3bc187 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 25 Oct 2024 11:09:49 -0500 Subject: [PATCH 2/2] Adding a note on the hybrid model for OpenMC --- doc/content/tutorials/csg_to_cad.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/content/tutorials/csg_to_cad.md b/doc/content/tutorials/csg_to_cad.md index 8e37b777f..9566af452 100644 --- a/doc/content/tutorials/csg_to_cad.md +++ b/doc/content/tutorials/csg_to_cad.md @@ -184,6 +184,11 @@ This mesh can now be exported for use in multiphysics copuling. Cubit> export mesh "/Users/pshriwise/krusty.e" ``` +A different OpenMC model is needed to apply the DAGMC model generated, this is +already present in the tutorial directory and will be used by Cardinal as it is +set to the default filename expected by OpenMC ("model.xml"). This hybrid +CSG/CAD model can also be produced by running the `make_hybrid_model.py` script. + ## Multiphysics Coupling We have built a hybrid [!ac](CAD) and [!ac](CSG) model of the KRUSTY reactor in OpenMC,