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

Adding the KRUSTY tutorial to the Cardinal website #883

Open
wants to merge 25 commits into
base: devel
Choose a base branch
from

Conversation

MendesMichael
Copy link
Contributor

Please review the first version of the KRUSTY tutorial Coupling of OpenMC and MOOSE without Sockeye

@aprilnovak
Copy link
Collaborator

Thanks, Michael! I will take a closer look over the next few days -- but one initial comment is that the mesh files are too big to version control in Cardinal. They will slow down the git clone operation and, if we end up needing to change the files in the future, the git history doesn't "free" memory from old file versions, so the repo can get bloated.

I've moved your files here: https://anl.app.box.com/folder/263952628262

Can you please update the tutorial to instruct the reader that they need to download files from Box? There are other Cardinal tutorials which also follow this pattern.

@aprilnovak
Copy link
Collaborator

You'll also need to link the new markdown file you made from somewhere else inside Cardinal, in order for it to get rendered on the website. For instance, you'll probably want to add that link on the markdown file corresponding to this page: https://cardinal.cels.anl.gov/tutorials/openmc_solid.html

@MendesMichael
Copy link
Contributor Author

Thank you! I've updated the tutorial and also linked the new markdown file into openmc_solid.md

@@ -0,0 +1,24 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to version control this file, as we frequently change the Sawtooth instructions when modules change. Let's please delete it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've just deleted it!

@aprilnovak
Copy link
Collaborator

Have you tested if the documentation builds locally? You'll want to make sure that the rendered website looks good, format-wise.

cd cardinal/doc
./moosedocs.py build --serve

This will print out an HTML link which you can paste into a browser to look at a draft of the website. Give it a try, let me know if you run into any issues:

[I 240515 10:25:39 server:335] Serving on http://127.0.0.1:8000

You'll see something like this, copy that http... thing into a web browser.

@MendesMichael
Copy link
Contributor Author

Have you tested if the documentation builds locally? You'll want to make sure that the rendered website looks good, format-wise.

cd cardinal/doc
./moosedocs.py build --serve

This will print out an HTML link which you can paste into a browser to look at a draft of the website. Give it a try, let me know if you run into any issues:

[I 240515 10:25:39 server:335] Serving on http://127.0.0.1:8000

You'll see something like this, copy that http... thing into a web browser.

Thanks, I did not knew about that. I just checked and I have some shortcut link errors and some figures that are too big. I will fix that now!

@aprilnovak aprilnovak changed the title WIP: Adding the KRUSTY tutorial to the Cardinal website Adding the KRUSTY tutorial to the Cardinal website May 20, 2024
@aprilnovak
Copy link
Collaborator

I removed the WIP marker so that the test suite will run.

@moosebuild
Copy link
Collaborator

moosebuild commented May 20, 2024

Job Documentation on 309797a wanted to post the following:

View the site here

This comment will be updated on new commits.

@moosebuild
Copy link
Collaborator

moosebuild commented May 21, 2024

Job Coverage on 309797a wanted to post the following:

Coverage

Coverage did not change

Full coverage report

This comment will be updated on new commits.

@MendesMichael MendesMichael force-pushed the patch-1 branch 3 times, most recently from 8d0dea3 to b1902ae Compare May 21, 2024 18:05
@moosebuild
Copy link
Collaborator

Job Precheck on 364ba1a wanted to post the following:

Warning: This PR changes repo size by 31.65 MiB.

@MendesMichael MendesMichael force-pushed the patch-1 branch 4 times, most recently from 15ee8c9 to 4cfb6f4 Compare May 21, 2024 20:21
@aprilnovak
Copy link
Collaborator

For all images which were not generated by you/Mahmoud, please be sure to include a citation.


## Geometry and Computational Models

This model consists of a multiphysics simulation of the KRUSTY reactor, one of the simplest space power reactor concepts ever proposed. The relevant dimensions are summarized in [table1] and in [krusty_solid_mesh] shows the geometry and gap thicknesses.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to add a few sentences which discuss the geometric simplifications you are making (e.g., what is being neglected compared to the real system?). I'd also suggest to add a sentence with something along the lines of "Ongoing work benchmarking Cardinal against KRUSTY will relax these simplifications."


## Geometry and Computational Models

This model consists of a multiphysics simulation of the KRUSTY reactor, one of the simplest space power reactor concepts ever proposed. The relevant dimensions are summarized in [table1] and in [krusty_solid_mesh] shows the geometry and gap thicknesses. The basic components are the fuel, heat pipes, control, reflectors and shield. For the sake of simplification, we will only simulate the components within the region spanning from the bottom axial reflector to the top axial reflector along the z-direction, which entails neglecting components outside of this region, the control rod insertion is also being disregarded.The fuel is high enriched uranium U-7.65 Mo with a total length of 25 cm, an outer diameter of 11 cm, and the core contains a 4 cm hole to allow $B_4C$ control insertion.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disregarded.The -> add space before The


### MOOSE Heat Conduction Model

The MOOSE heat transfer module is used to solve for steady-state heat conduction
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace this equation and the variable definitions with

The MOOSE heat transfer module is used to solve for
[energy conservation in the solid](theory/heat_eqn.md).

That will provide a link to the solid equation. We do this just for consistency with the other tutorials.

\end{equation}
where $k_s$ is the solid thermal conductivity, $T_s$ is the solid temperature, and $\dot{q}_s$ is a volumetric heat source in the solid.

[krusty_mesh] shows the mesh used in this example. The geometry was build using FUSION360, where the CAD file was exported into Cubit, where the mesh was build. Cubit can create meshes with user-defined geometry and customizable boundary layers. The Cubit script used to generate the solid mesh can be found in the directory `cardinal/tutorials/krusty/meshes`, where you will find two files, a `.sat` file that you will import into cubit, which will generate the geometry of KRUSTY, however in order to generete the mesh you will need to run the scripts in the `.txt` file in the cubit terminal, and then you can export the `.e` mesh file, which is the format that MOOSE can read. You can find the `.e` files in this box link: [box](https://anl.app.box.com/s/irryqrx97n5vi4jmct1e3roqgmhzic89/folder/141527707499). Do not forget to place the `e.` mesh files in the same directory as your `.i` files.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build -> built

built is the correct past tense

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported -> imported

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can refer to the meshes directory using the relative path, like "in the meshes directory"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e. -> .e


### OpenMC Model

The OpenMC model is built using CSG, which are cells created from regions of space formed by half-space of various common surfaces. First, we define materials for each component of the reactor. Next, we define our geometric parameters, so we can start building our surfaces and manipulate them to create the geometry of each component of the KRUSTY reactor. Then, we need to create cells for each component and fill them with the materials that we previously created, so we can create a universe containg all the cells using `openmc.Universe`. This geometry can be seen in [krusty_solid_mesh].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use acronym for CSG

[!ac](CSG)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The geometry is a CSG-type geometry -- to visualize it, you'd need to do slice plots in OpenMC. Technically, the mesh in [krusty_solid_mesh] is not the geometry OpenMC runs on (this may feel pedantic, but soon OpenMC will actually be able to transport particles through a mesh geometry, so the distinction is important).


We will use a linear-linear stochastic interpolation between the two cross section data sets nearest to the imposed temperature by setting the `method` parameter on `settings.temperature` to `interpolation`. When OpenMC is initialized, the cross section data is loaded for a temperature range specified by `range` in `settings`.

!listing /tutorials/krusty/KRUSTY/model03.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor suggestion -- can we rename the file to just model.py? I know we had several other models internally, but people might be wondering what the 03 means.

| 617, instance 0 (of 1) | 29815 | 0 | 0 | 0 | 6.205e-04 | |
| 618, instance 0 (of 1) | 24836 | 0 | 0 | 0 | 8.822e-04 | |
| 619, instance 0 (of 1) | 21965 | 0 | 0 | 0 | 1.981e-04 | |
| 620, instance 0 (of 1) | 21483 | 0 | 0 | 0 | 2.256e-04 | |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So many cells! Where do these all come from? I thought this was a CSG model?


```

This shows the OpenMC cells mapped to the MOOSE elements. The above message also shows the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a stochastic volume calculation? The last column in the table looks empty here

problem, each cell only has a single instance. Since we added a stochastic volume
calculation, the last column (`Actual Vol`) is populated with OpenMC's stochastic
estimates for the cell volumes. You can increase the number of samples to drive the error
lower to get more refined estimates of volumes. We cab also see the auxiliary variables and material mapping for OpenMC
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cab -> can

type = FileMeshGenerator
file = krusty_scale.e
[]
# [scale]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove anything which is commented out -- for part B, we can just add more input files. People often get confused by commented-out stuff

scaling = 100.0
output = 'unrelaxed_tally_std_dev'
# temperature_blocks = 'cavity_center clamp core gap_clamp gap_ref gap_sleeve gap_vaccan mli ref_bottom ref_top sleeve vacuum_can'
temperature_blocks = '12 5 14 4 11 9 6 7 13 15 10 8'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use subdomain names instead of numbers? I find this is a bit more intuitive

# Radial geometry
# Envelope outer
R_hp_o = 1.27e-2
D_hp_o = '${fparse 2.0 * R_hp_o}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @MendesMichael pointed out earlier, heat pipe outer diameter should be 1.27e-2 cm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants