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

cad_geometry_example #29

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
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
42 changes: 42 additions & 0 deletions doc/content/bib/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,45 @@ @article{gall2024verification
year={2024},
publisher={ANS PBNC Conference}
}

@article{novak2022_cardinal,
author = {A.J. Novak and D. Andrs and P. Shriwise and J. Fang and H. Yuan and D. Shaver and E. Merzari and P.K. Romano and R.C. Martineau},
title = {{Coupled {Monte} {Carlo} and Thermal-Fluid Modeling of High Temperature Gas Reactors Using {Cardinal}}},
journal = {Annals of Nuclear Energy},
year = 2022,
volume = 177,
pages = {109310},
DOI = {10.1016/j.anucene.2022.109310},
url = {https://www.sciencedirect.com/science/article/pii/S0306454922003450}
}

@article{giudicelli2024moose,
title = {3.0 - {MOOSE}: Enabling massively parallel multiphysics simulations},
author = {Guillaume Giudicelli and Alexander Lindsay and Logan Harbour and Casey Icenhour and
Mengnan Li and Joshua E. Hansel and Peter German and Patrick Behne and Oana Marin and
Roy H. Stogner and Jason M. Miller and Daniel Schwen and Yaqi Wang and Lynn Munday and
Sebastian Schunert and Benjamin W. Spencer and Dewen Yushu and Antonio Recuero and
Zachary M. Prince and Max Nezdyur and Tianchen Hu and Yinbin Miao and
Yeon Sang Jung and Christopher Matthews and April Novak and Brandon Langley and
Timothy Truster and Nuno Nobre and Brian Alger and David Andr{\v{s}} and
Fande Kong and Robert Carlsen and Andrew E. Slaughter and John W. Peterson and
Derek Gaston and Cody Permann},
year = {2024},
journal = {{SoftwareX}},
volume = {26},
pages = {101690},
issn = {2352-7110},
doi = {https://doi.org/10.1016/j.softx.2024.101690},
url = {https://www.sciencedirect.com/science/article/pii/S235271102400061X},
keywords = {Framework, Finite-element, Finite-volume, Parallel, Multiphysics, Multiscale},
}

@Article{openmc,
author = {P.K. Romano and N.E. Horelik and B.R. Herman and A.G. Nelson and B. Forget and K. Smith},
title = {{OpenMC: A State-of-the-Art {Monte} {Carlo} Code for Research and Development}},
journal = {Annals of Nuclear Energy},
year = 2015,
volume = 82,
pages = {90--97},
DOI = {10.1016/j.anucene.2014.07.048}
}
Original file line number Diff line number Diff line change
@@ -1,64 +1,98 @@
# CAD-based Geometry Workflow for Multiphysics Fusion Problems Using OpenMC and MOOSE

This demonstration describes a workflow for modeling fusion problems in OpenMC and MOOSE using a computer aided design (CAD)-based geometry workflow.
It is based on the work published in [!cite](Eltawila2004_PNBC).
It is based on the work published in [!cite](Eltawila2024PBNC).

In this example, you'll learn how to:

- Couple OpenMC [!cite](openmc) and MOOSE [!cite](giudicelli2024moose) using Cardinal for fixed source Monte Carlo calculations.
- Use Cardinal [!cite](novak2022_cardinal) to tally values of interest such as tritium production and heating which would be used in MOOSE to solve for the temperature distribution

!media figures/transfers.png
id=transfers
caption=OpenMC and MOOSE Coupling
style=width:60%;margin-left:auto;margin-right:auto

In this example, you'll learn how to:
An extremely simplified tokamak was modeled in CAD and was considered for this example. The meshed geometry was prepared using direct accelerated geometry Monte Carlo (DAGMC) for particle transport, and a volumetric mesh was also prepared to be used in MOOSE’s finite element solver and to tally OpenMC results for heat source distribution and tritium production. Cardinal was used to run OpenMC Monte Carlo particle transport within MOOSE framework. The data transfer system transfered heat source and temperature distribution between OpenMC and MOOSE as shown in Figure 1, with coupling between neutron transport and heat conduction achieved via Picard iteration.
meltawila marked this conversation as resolved.
Show resolved Hide resolved

- Couple OpenMC and MOOSE using Cardinal for fixed source Monte Carlo calculations.
- Use Cardinal to tally values of interest such as tritium production and heating which would be used in MOOSE to solve for the temperature distribution
## Generating the meshes

An extremely simplified tokamak was modeled in CAD and was considered for this example. The meshed geometry was prepared using direct accelerated geometry Monte Carlo (DAGMC) for particle transport, and a volumetric mesh was also prepared to be used in MOOSE’s finite element solver and to tally OpenMC results for heat source distribution and tritium production. Cardinal was used to run OpenMC Monte Carlo particle transport within MOOSE framework. The data transfer system transfered heat source and temperature distribution between OpenMC and MOOSE, with coupling between neutron transport and heat conduction achieved via Picard iteration.
The CAD model was first developed in FUSION360 and was imported into Cubit to assign blocks, materials, and side sets and generate the mesh (Figure 2). A corresponding DAGMC surface mesh (Figure 3) was exported directly from the meshed geometry in Cubit (by loading the volumetric meshed geometry in Cubit and exporting a DAGMC surface mesh).
meltawila marked this conversation as resolved.
Show resolved Hide resolved

## Generating the meshes
In this example, `tmesh_1.e` (Figure 2) is the finite element mesh used in MOOSE on which the heat conduction physics is solved. `tmesh_1.h5m` (Figure 3) is the DAGMC surface mesh used for particle transport in OpenMC (which bounds the surfaces between different materials). Cardinal also allows for mesh tallying for tallying OpenMC results directly on the mesh overlayed on the OpenMC geometry which `tmesh_1.e` (Figure 2) could be used for as well as an unstructered volume mesh. This could be used by changing the tally type and adding a mesh template (`tally_type = mesh`, `mesh_template = tmesh_1.e`) in Cardinal input under Problem.
meltawila marked this conversation as resolved.
Show resolved Hide resolved

The CAD model was first developed in FUSION360 and was imported into Cubit to assign blocks, materials, and side sets and generate the mesh (tmesh_1.e). A corresponding DAGMC surface mesh (tmesh_1.h5m) was exported directly from the meshed geometry in Cubit (by loading the volumetric meshed geometry in Cubit and exporting a DAGMC surface mesh).
 

In this example, `tmesh_1.e` is the finite element mesh used in MOOSE on which the heat conduction physics is solved. `tmesh_1.h5m` is the DAGMC surface mesh used for particle transport in OpenMC (which bounds the surfaces between different materials). Cardinal also allows for mesh tallying for tallying OpenMC results directly on the mesh overlayed on the OpenMC geometry which `tmesh_1.e` could be used for as well as an unstructered volume mesh. This could be used by changing the tally type and adding a mesh template (`tally_type = mesh`, `mesh_template = tmesh_1.e`).
!row! style=display:inline-flex;
!col! small=12 medium=4 large=3

!media figures/mesh_1.png
id=volumetric_mesh
caption=Volumetric mesh [!citep](Eltawila2004_PNBC).
style=width:60%;margin-left:auto;margin-right:auto

!media figures/d1.png
id=dagmc
caption=DAGMC surface mesh [!citep](Eltawila2004_PNBC).
style=width:60%;margin-left:auto;margin-right:auto
!media figures/mesh_1.png style=width:130%;display:block;
id=volumetric_mesh caption=Volumetric mesh
meltawila marked this conversation as resolved.
Show resolved Hide resolved

!col-end!

!col! small=12 medium=4 large=3

!media figures/d1.png style=width:130%;display:block;
id=dagmc caption=DAGMC mesh
meltawila marked this conversation as resolved.
Show resolved Hide resolved

!col-end!
!row-end!

## OpenMC

!listing /input_files/model.py language=python
!listing /test/tests/cad_geometry_example/model.py language=python
meltawila marked this conversation as resolved.
Show resolved Hide resolved

## Cardinal

!listing /input_files/openmc.i
!listing /test/tests/cad_geometry_example/openmc.i
meltawila marked this conversation as resolved.
Show resolved Hide resolved

## MOOSE Heat transfer
meltawila marked this conversation as resolved.
Show resolved Hide resolved

!listing /input_files/solid.i
!listing /test/tests/cad_geometry_example/solid.i
meltawila marked this conversation as resolved.
Show resolved Hide resolved

## Results
## Execution

!media figures/Temps.png
id=temps
caption=Temperature distribution [!citep](Eltawila2004_PNBC).
style=width:60%;margin-left:auto;margin-right:auto

!media figures/tritium_production.png
id=h3production
caption=Tritium production rate density [!citep](Eltawila2004_PNBC).
style=width:60%;margin-left:auto;margin-right:auto
To run the coupled calculation:

```
mpiexec -np 2 cardinal-opt -i solid.i --n-threads=2
meltawila marked this conversation as resolved.
Show resolved Hide resolved
```

This will run both MOOSE and OpenMC with 2 MPI processes and 2 OpenMP threads per rank. To run the simulation faster, you can increase the parallel processes/threads, or simply decrease the number of particles used in OpenMC. When the simulation has completed, you will have created a number of different output files:
meltawila marked this conversation as resolved.
Show resolved Hide resolved

- `solid_out.e`, an Exodus output with the solid mesh and solution
meltawila marked this conversation as resolved.
Show resolved Hide resolved
- `solid_out_openmc0.e`, an Exodus output with the OpenMC solution and the data that was ultimately transferred in/out of OpenMC

## Results

 

meltawila marked this conversation as resolved.
Show resolved Hide resolved
!row! style=display:inline-flex;
!col! small=12 medium=4 large=3

!media figures/Temps.png style=width:130%;display:block;
id=temps caption=Temperature distribution
meltawila marked this conversation as resolved.
Show resolved Hide resolved

!col-end!

!col! small=12 medium=4 large=3

!media figures/tritium_production.png style=width:130%;display:block;
id=h3production caption=Tritium production rate density
meltawila marked this conversation as resolved.
Show resolved Hide resolved

!col-end!
!row-end!

 

!table id=results caption=Results summary
| Armor Max. Temp. [K]| 1062.4 |
| First Wall Max. Temp. [K]| 1057.6 |
| Breeder Max. Temp. [K]| 987.4 |
| Heat Source [W] | 2.44 × 10^5 ± 3 × 10^3 |
| Tritium Production [atoms/s] | 4.70 × 10^13 ± 8 × 10^11 |

| Parameter | Value |
meltawila marked this conversation as resolved.
Show resolved Hide resolved
| :- | :- |
| Armor Max. Temp. (K) | 1062.4 |
| First Wall Max. Temp. (K) | 1057.6 |
| Breeder Max. Temp. (K) | 987.4 |
| Heat Source (W) | 2.44 × 10^5^ ± 3 × 10^3^ |
| Tritium Production (atoms/s) | 4.70 × 10^13^ ± 8 × 10^11^ |

 
8 changes: 1 addition & 7 deletions doc/content/verification_validation_examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,5 @@ FENIX is under active development and does not currently have any benchmarking c

# List of example cases

!col! small=12 medium=4 large=4 icon=assessment
## [CAD-based geometry workflow example](cad_geometry_model/cad_model.md) class=center style=font-weight:200;font-size:150%;

!style halign=center
CAD-based geometry workflow example for Fusion problems using OpenMC and MOOSE.
!col-end!
!row-end!
[CAD-based geometry workflow example](cad_geometry_model/cad_model.md)
meltawila marked this conversation as resolved.
Show resolved Hide resolved

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
lowest_cell_level = 0
temperature_blocks = '1 2 3'
check_tally_sum = false
source_strength = 1e18
source_strength = 1e18 # Particles/sec.
meltawila marked this conversation as resolved.
Show resolved Hide resolved
volume_calculation = vol
tally_score = 'heating_local H3_production'
tally_trigger = 'rel_err none'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[Variables]
[temp]
initial_condition = 800.0
initial_condition = 800.0 # [K]
[]
[]

Expand Down Expand Up @@ -35,26 +35,26 @@
type = DirichletBC
variable = temp
boundary = 1
value = 800.0
value = 800.0 # [K]
[]
[]

[Materials]
[k_1]
type = GenericConstantMaterial
prop_values = '1.64'
prop_values = '1.64' # [W/m.K]
prop_names = 'thermal_conductivity'
block = 'Armour'
[]
[k_2]
type = GenericConstantMaterial
prop_values = '0.45'
prop_values = '0.45' # [W/m.K]
prop_names = 'thermal_conductivity'
block = 'FW'
[]
[k_3]
type = GenericConstantMaterial
prop_values = '0.65'
prop_values = '0.65' # [W/m.K]
prop_names = 'thermal_conductivity'
block = 'BM'
[]
Expand Down