Skip to content
54 changes: 16 additions & 38 deletions source/user/tutorial/add_arche.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ where ``lib`` is the library in which the archetype came from and ``name`` is
the archetype name. You need one `spec` block in the archetypes section
for each archetype you use in your simulation.
Let's build the archetypes block in our input file.
Using the template below and the table below,
Using the template above and the table below,
fill in the template with the variables listed in the table below.

+-------------+------------------+----------------------------+
Expand All @@ -161,56 +161,34 @@ fill in the template with the variables listed in the table below.
| ``arch4`` | ``Sink`` | Name of archetype |
+-------------+------------------+----------------------------+

The order of the archetypes in this block is of no consequence. Once complete, append the archetypes section under the control section of input file [#f1]_.

Check: Complete Archetypes block
+++++++++++++++++++++++++++++++++++++++

The archetypes section of your input file should now look like:

Archetype Block Template
------------------------
.. code-block:: XML

<archetypes>
<archetypes>
<spec>
<lib>lib1</lib>
<name>arch1</name>
<lib>cycamore</lib>
<name>Enrichment</name>
</spec>
<spec>
<lib>lib2</lib>
<name>arch2</name>
<lib>cycamore</lib>
<name>Reactor</name>
</spec>
<spec>
<lib>lib3</lib>
<name>arch3</name>
<lib>cycamore</lib>
<name>Source</name>
</spec>
<spec>
<lib>lib4</lib>
<name>arch4</name>
<lib>cycamore</lib>
<name>Sink</name>
</spec>
</archetypes>


Once complete, your ``archetypes`` block should look like:

.. code-block:: XML

<archetypes>
<spec>
<lib>cycamore</lib>
<name>Enrichment</name>
</spec>
<spec>
<lib>cycamore</lib>
<name>Reactor</name>
</spec>
<spec>
<lib>cycamore</lib>
<name>Source</name>
</spec>
<spec>
<lib>cycamore</lib>
<name>Sink</name>
</spec>
</archetypes>

The order of the archetypes in this block is of no consequence. Once complete, append the archetypes section under the control section of input file [#f1]_.

.. rubric:: Footnotes

.. [#f1] The exact order of the sections in a |Cyclus| input file are of minor consequence. The ``control`` sequence must go first, but the other sequences can go in any order that makes sense to the user. The traditional organization of an input file is: control, archetypes, commodities, facilities, regions/institutions, and recipes.
234 changes: 72 additions & 162 deletions source/user/tutorial/add_commod_recipe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,48 +112,6 @@ template.
| com4 | tails | 1.0 |
+-------------+-------------+---------------------+

1. Let's start with ``u_ore``. In the ``<name>`` line replace ``com1`` with ``u_ore``
inside a ``commodity`` block.

.. code-block:: XML

<commodity>
<name>u_ore</name>
</commodity>

2. In the ``<solution_priority>`` section replace ``val1`` with ``1.0``.

.. code-block:: XML


<commodity>
<name>u_ore</name>
<solution_priority>1.0</solution_priority>
</commodity>



3. Repeat this process for the other three commodities. Your final result should look like:

.. code-block:: XML

<commodity>
<name>u_ore</name>
<solution_priority>1.0</solution_priority>
</commodity>
<commodity>
<name>fresh_uox</name>
<solution_priority>1.0</solution_priority>
</commodity>
<commodity>
<name>tails</name>
<solution_priority>1.0</solution_priority>
</commodity>
<commodity>
<name>spent_uox</name>
<solution_priority>1.0</solution_priority>
</commodity>

Once complete, append the commodities section under the archetypes section [#f1]_.

Understanding Recipes
Expand Down Expand Up @@ -207,8 +165,8 @@ Activity: Creating a Recipe
++++++++++++++++++++++++++++


Using the tables below, fill out the recipe
template for natural uranium, fresh fuel, and spent fuel.
Using the tables below, fill out three recipe
templates for natural uranium, fresh fuel, and spent fuel.

+---------------------+--------------------+--------------------+
| Natural Uranium Composition |
Expand Down Expand Up @@ -244,124 +202,7 @@ template for natural uranium, fresh fuel, and spent fuel.
| :math:`^{137}`\ Cs | 55137 | 0.04 |
+---------------------+--------------------+--------------------+

1. Let's start with the Natural Uranium recipe. Start by placing a ``<recipe>``
block to signify that this is a recipe and tab in and place the fill
``<name>`` tag such as:

.. code-block:: XML

<recipe>
<name>nat_u</name>
</recipe>

2. To signify that the composition of this recipe is in terms of Mass, fill the
``<basis>`` tag with ``mass``.

.. code-block:: XML

<recipe>
<name>nat_u</name>
<basis>mass</basis>
</recipe>

3. To add a nuclide to this recipe, call the ``nuclide`` tag, tab in, add the
``<id>`` and ``<comp>`` tags:

.. code-block:: XML

<recipe>
<name>nat_u</name>
<basis>mass</basis>
<nuclide>
<id>id1</id>
<comp>comp1</comp>
</nuclide>
</recipe>

4. We will fill the ``<id>`` tag with the uranium-235 ``Nuc Id``, ``92235``, and
fill the composition tag with its mass composition, ``0.00711``.

.. code-block:: XML

<recipe>
<name>nat_u</name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.00711</comp>
</nuclide>
</recipe>

5. Following the same procedure, we can add uranium-238 to this recipe such as:

.. code-block:: XML

<recipe>
<name>nat_u</name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.00711</comp>
</nuclide>
<nuclide>
<id>92238</id>
<comp>0.99289</comp>
</nuclide>
</recipe>

6. We can add other recipes in separate ``recipe`` blocks.
The recipe section of this tutorial is placed below.

.. code-block:: XML

<recipe>
<name>nat_u</name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.00711</comp>
</nuclide>
<nuclide>
<id>92238</id>
<comp>0.99289</comp>
</nuclide>
</recipe>

<recipe>
<name>fresh_uox</name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.04</comp>
</nuclide>
<nuclide>
<id>92238</id>
<comp>0.96</comp>
</nuclide>
</recipe>

<recipe>
<name>spent_uox</name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.011</comp>
</nuclide>
<nuclide>
<id>92238</id>
<comp>0.94</comp>
</nuclide>
<nuclide>
<id>94239</id>
<comp>0.009</comp>
</nuclide>
<nuclide>
<id>55137</id>
<comp>0.04</comp>
</nuclide>
</recipe>

Once complete, append this facility under the commodity section of your input file [#f1]_.
Once complete, append these recipes under the commodity section of your input file [#f1]_.


Let's take a look at the ``fresh_uox`` fuel recipe (note that ``-`` is an illegal character for
Expand All @@ -373,5 +214,74 @@ names in cyclus and ``_`` should be used instead):
The recipe name ``fresh_uox`` is specified, as are the isotope nuclide IDs and the
corresponding mass fraction of each nuclide. The ``fresh_uox`` is composed of 4% U-235 and 96% U-238.

Check: Complete Commodity and Recipe blocks
+++++++++++++++++++++++++++++++++++++++++++++++

The commodity and recipe sections of you input file should now look like:

.. code-block:: XML

<commodity>
<name>u_ore</name>
<solution_priority>1.0</solution_priority>
</commodity>
<commodity>
<name>fresh_uox</name>
<solution_priority>1.0</solution_priority>
</commodity>
<commodity>
<name>spent_uox</name>
<solution_priority>1.0</solution_priority>
</commodity>
<commodity>
<name>tails</name>
<solution_priority>1.0</solution_priority>
</commodity>

<recipe>
<name>nat_u</name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.00711</comp>
</nuclide>
<nuclide>
<id>92238</id>
<comp>0.99289</comp>
</nuclide>
</recipe>
<recipe>
<name>fresh_uox</name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.04</comp>
</nuclide>
<nuclide>
<id>92238</id>
<comp>0.96</comp>
</nuclide>
</recipe>
<recipe>
<name>spent_uox<name>
<basis>mass</basis>
<nuclide>
<id>92235</id>
<comp>0.011</comp>
</nuclide>
<nuclide>
<id>92238</id>
<comp>0.94</comp>
</nuclide>
<nuclide>
<id>94239</id>
<comp>0.009</comp>
</nuclide>
<nuclide>
<id>55137</id>
<comp>0.04</comp>
</nuclide>
</recipe>

.. rubric:: Footnotes
.. [#f1] The exact order of the sections in a |Cyclus| input file are of minor consequence. The ``control`` sequence must go first, but the other sequences can go in any order that makes sense to the user. The traditional organization of an input file is: control, archetypes, commodities, facilities, regions/institutions, and recipes.
Loading