mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Add README to describe usage of serialized source
This commit is contained in:
parent
67e846c4d5
commit
62e194e0d6
1 changed files with 22 additions and 0 deletions
22
examples/serialized_custom_source/README.md
Normal file
22
examples/serialized_custom_source/README.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Building a Serialised Custom Source
|
||||
|
||||
To run this example, you first need to compile the custom source library, which
|
||||
requires headers from OpenMC. A CMakeLists.txt file has been set up for you that
|
||||
will search for OpenMC and build the custom library. To build the source
|
||||
library, you can run:
|
||||
|
||||
mkdir build && cd build
|
||||
OPENMC_ROOT=<path_to_openmc_install> cmake ..
|
||||
make
|
||||
|
||||
After this, you can build the model by running `python build_xml.py`. In the XML
|
||||
files that are created, you should see a reference to build/libserialised_source.so,
|
||||
the custom source library that was built by CMake. The model is also set up with a
|
||||
mesh tally of the flux, so once you run `openmc`, you will get a statepoint file
|
||||
with the tally results in it. Running `python show_flux.py` will pull in the
|
||||
results from the statepoint file and display them. If all worked well, you
|
||||
should see a ring "imprint" as well as a higher flux to the right side (since
|
||||
the custom source has all particles moving in the positive x direction).
|
||||
|
||||
Once built, you can edit the serialised_source.xml file to change the radius of the
|
||||
sampled ring or the energy of the sampled particles.
|
||||
Loading…
Add table
Add a link
Reference in a new issue