Skip to content

Commit

Permalink
update docs at commit: Merge pull request #177 from yardasol/openmc-d…
Browse files Browse the repository at this point in the history
…epletion-settings

Add OpenMC depletion settings to input file 5b4e60c
  • Loading branch information
samgdotson committed Jan 19, 2023
1 parent d726841 commit a0d8580
Show file tree
Hide file tree
Showing 123 changed files with 2,750 additions and 723 deletions.
2 changes: 1 addition & 1 deletion master/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 1ff49285590fd46f177665f26e696189
config: b66f194b026492e884015d0d026fe2fa
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified master/.doctrees/devguide/contributing.doctree
Binary file not shown.
Binary file modified master/.doctrees/devguide/index.doctree
Binary file not shown.
Binary file modified master/.doctrees/environment.pickle
Binary file not shown.
Binary file modified master/.doctrees/examples.doctree
Binary file not shown.
Binary file modified master/.doctrees/fileformatspec/databasefile.doctree
Binary file not shown.
Binary file not shown.
Binary file modified master/.doctrees/fileformatspec/index.doctree
Binary file not shown.
Binary file removed master/.doctrees/fileformatspec/inputfile.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified master/.doctrees/index.doctree
Binary file not shown.
Binary file modified master/.doctrees/installation.doctree
Binary file not shown.
Binary file modified master/.doctrees/overview.doctree
Binary file not shown.
Binary file modified master/.doctrees/releasenotes/index.doctree
Binary file not shown.
Binary file modified master/.doctrees/releasenotes/template.doctree
Binary file not shown.
Binary file modified master/.doctrees/releasenotes/v0.3.0.doctree
Binary file not shown.
Binary file modified master/.doctrees/releasenotes/v0.4.0.doctree
Binary file not shown.
Binary file modified master/.doctrees/releasenotes/v0.5.0.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/index.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/modules.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.abc.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.app.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.materialflow.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.openmc_depcode.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.openmc_deplete.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.process.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.reactor.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.separator.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.serpent_depcode.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.simulation.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.sparger.doctree
Binary file not shown.
Binary file modified master/.doctrees/src/saltproc.version.doctree
Binary file not shown.
8 changes: 4 additions & 4 deletions master/_modules/saltproc/abc.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h1>Source code for saltproc.abc</h1><div class="highlight"><pre>
<span class="n">output_path</span><span class="p">,</span>
<span class="n">exec_path</span><span class="p">,</span>
<span class="n">template_input_file_path</span><span class="p">,</span>
<span class="n">geo_files</span><span class="p">):</span>
<span class="n">geo_file_paths</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Initialize a Depcode object.</span>

<span class="sd"> Parameters</span>
Expand All @@ -124,7 +124,7 @@ <h1>Source code for saltproc.abc</h1><div class="highlight"><pre>
<span class="sd"> the input type (e.g. material, geometry, settings, etc.) as a</span>
<span class="sd"> string are keys, and the path to the input file are values.</span>
<span class="sd"> Type depends on depletion code in use.</span>
<span class="sd"> geo_files : str or list, optional</span>
<span class="sd"> geo_file_paths : str or list, optional</span>
<span class="sd"> Path to file that contains the reactor geometry.</span>
<span class="sd"> List of `str` if reactivity control by</span>
<span class="sd"> switching geometry is `On` or just `str` otherwise.</span>
Expand All @@ -134,7 +134,7 @@ <h1>Source code for saltproc.abc</h1><div class="highlight"><pre>
<span class="bp">self</span><span class="o">.</span><span class="n">output_path</span> <span class="o">=</span> <span class="n">output_path</span>
<span class="bp">self</span><span class="o">.</span><span class="n">exec_path</span> <span class="o">=</span> <span class="n">exec_path</span>
<span class="bp">self</span><span class="o">.</span><span class="n">template_input_file_path</span> <span class="o">=</span> <span class="n">template_input_file_path</span>
<span class="bp">self</span><span class="o">.</span><span class="n">geo_files</span> <span class="o">=</span> <span class="n">geo_files</span>
<span class="bp">self</span><span class="o">.</span><span class="n">geo_file_paths</span> <span class="o">=</span> <span class="n">geo_file_paths</span>
<span class="bp">self</span><span class="o">.</span><span class="n">neutronics_parameters</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">step_metadata</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">runtime_inputfile</span> <span class="o">=</span> <span class="kc">None</span>
Expand Down Expand Up @@ -192,7 +192,7 @@ <h1>Source code for saltproc.abc</h1><div class="highlight"><pre>
<div class="viewcode-block" id="Depcode.switch_to_next_geometry"><a class="viewcode-back" href="../../src/saltproc.abc.html#saltproc.abc.Depcode.switch_to_next_geometry">[docs]</a> <span class="nd">@abstractmethod</span>
<span class="k">def</span> <span class="nf">switch_to_next_geometry</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Changes the geometry used in the depletion code simulation to the</span>
<span class="sd"> next geometry file in ``geo_files``</span>
<span class="sd"> next geometry file in ``geo_file_paths``</span>
<span class="sd"> &quot;&quot;&quot;</span></div>

<div class="viewcode-block" id="Depcode.write_runtime_input"><a class="viewcode-back" href="../../src/saltproc.abc.html#saltproc.abc.Depcode.write_runtime_input">[docs]</a> <span class="nd">@abstractmethod</span>
Expand Down
198 changes: 124 additions & 74 deletions master/_modules/saltproc/app.html

Large diffs are not rendered by default.

74 changes: 40 additions & 34 deletions master/_modules/saltproc/openmc_depcode.html

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions master/_modules/saltproc/reactor.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ <h1>Source code for saltproc.reactor</h1><div class="highlight"><pre>
<span class="n">volume</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span>
<span class="n">mass_flowrate</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span>
<span class="n">power_levels</span><span class="o">=</span><span class="p">[</span><span class="mf">0.0</span><span class="p">],</span>
<span class="n">dep_step_length_cumulative</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">]):</span>
<span class="n">depletion_timesteps</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
<span class="n">timestep_type</span><span class="o">=</span><span class="s1">&#39;stepwise&#39;</span><span class="p">,</span>
<span class="n">timestep_units</span><span class="o">=</span><span class="s1">&#39;d&#39;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Initializes the class.</span>

<span class="sd"> Parameters</span>
Expand All @@ -95,15 +97,21 @@ <h1>Source code for saltproc.reactor</h1><div class="highlight"><pre>
<span class="sd"> Total mass flowrate through reactor core (g/s).</span>
<span class="sd"> power_levels : array [:math:`N_{steps}` x1]</span>
<span class="sd"> Normalized power level for each depletion step (W).</span>
<span class="sd"> dep_step_length_cumulative : array [:math:`N_{steps}` x1]</span>
<span class="sd"> Cumulative depletion time (d).</span>
<span class="sd"> depletion_timesteps : array [:math:`N_{steps}` x1]</span>
<span class="sd"> Array of timesteps.</span>
<span class="sd"> timestep_type: str</span>
<span class="sd"> &#39;cumulative&#39;, &#39;stepwise&#39;.</span>
<span class="sd"> timestep_units : str</span>
<span class="sd"> Timestep units</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># initialize all object attributes</span>
<span class="bp">self</span><span class="o">.</span><span class="n">volume</span> <span class="o">=</span> <span class="n">volume</span>
<span class="bp">self</span><span class="o">.</span><span class="n">mass_flowrate</span> <span class="o">=</span> <span class="n">mass_flowrate</span>
<span class="bp">self</span><span class="o">.</span><span class="n">power_levels</span> <span class="o">=</span> <span class="n">power_levels</span>
<span class="bp">self</span><span class="o">.</span><span class="n">dep_step_length_cumulative</span> <span class="o">=</span> <span class="n">dep_step_length_cumulative</span></div></div>
<span class="bp">self</span><span class="o">.</span><span class="n">depletion_timesteps</span> <span class="o">=</span> <span class="n">depletion_timesteps</span>
<span class="bp">self</span><span class="o">.</span><span class="n">timestep_units</span> <span class="o">=</span> <span class="n">timestep_units</span>
<span class="bp">self</span><span class="o">.</span><span class="n">timestep_type</span> <span class="o">=</span> <span class="n">timestep_type</span></div></div>
</pre></div>

</div>
Expand Down
38 changes: 20 additions & 18 deletions master/_modules/saltproc/serpent_depcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h1>Source code for saltproc.serpent_depcode</h1><div class="highlight"><pre>
<span class="n">output_path</span><span class="p">,</span>
<span class="n">exec_path</span><span class="p">,</span>
<span class="n">template_input_file_path</span><span class="p">,</span>
<span class="n">geo_files</span><span class="p">):</span>
<span class="n">geo_file_paths</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Initialize a SerpentDepcode object.</span>

<span class="sd"> Parameters</span>
Expand All @@ -129,7 +129,7 @@ <h1>Source code for saltproc.serpent_depcode</h1><div class="highlight"><pre>
<span class="sd"> Path to Serpent2 executable.</span>
<span class="sd"> template_input_file_path : str</span>
<span class="sd"> Path to user input file for Serpent2</span>
<span class="sd"> geo_files : str or list, optional</span>
<span class="sd"> geo_file_paths : str or list, optional</span>
<span class="sd"> Path to file that contains the reactor geometry.</span>
<span class="sd"> List of `str` if reactivity control by</span>
<span class="sd"> switching geometry is `On` or just `str` otherwise.</span>
Expand All @@ -139,7 +139,7 @@ <h1>Source code for saltproc.serpent_depcode</h1><div class="highlight"><pre>
<span class="n">output_path</span><span class="p">,</span>
<span class="n">exec_path</span><span class="p">,</span>
<span class="n">template_input_file_path</span><span class="p">,</span>
<span class="n">geo_files</span><span class="p">)</span>
<span class="n">geo_file_paths</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">runtime_inputfile</span> <span class="o">=</span> \
<span class="nb">str</span><span class="p">((</span><span class="n">output_path</span> <span class="o">/</span> <span class="s1">&#39;runtime_input.serpent&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">resolve</span><span class="p">())</span>
<span class="bp">self</span><span class="o">.</span><span class="n">runtime_matfile</span> <span class="o">=</span> <span class="nb">str</span><span class="p">((</span><span class="n">output_path</span> <span class="o">/</span> <span class="s1">&#39;runtime_mat.ini&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">resolve</span><span class="p">())</span></div>
Expand Down Expand Up @@ -334,7 +334,7 @@ <h1>Source code for saltproc.serpent_depcode</h1><div class="highlight"><pre>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">lines</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="c1"># Inserts on 6th line</span>
<span class="s1">&#39;include </span><span class="se">\&quot;</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">geo_files</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span> <span class="s1">&#39;</span><span class="se">\&quot;\n</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="s1">&#39;include </span><span class="se">\&quot;</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">geo_file_paths</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span> <span class="s1">&#39;</span><span class="se">\&quot;\n</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">lines</span></div>

<div class="viewcode-block" id="SerpentDepcode.read_depleted_materials"><a class="viewcode-back" href="../../src/saltproc.serpent_depcode.html#saltproc.serpent_depcode.SerpentDepcode.read_depleted_materials">[docs]</a> <span class="k">def</span> <span class="nf">read_depleted_materials</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">read_at_end</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
Expand Down Expand Up @@ -456,9 +456,7 @@ <h1>Source code for saltproc.serpent_depcode</h1><div class="highlight"><pre>
<span class="n">file_lines</span><span class="p">,</span>
<span class="n">reactor</span><span class="p">,</span>
<span class="n">step_idx</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Add power load attributes in a :class:`Reactor` object to the</span>
<span class="sd"> ``set power P dep daystep DEPSTEP`` line in the Serpent2 runtime input</span>
<span class="sd"> file.</span>
<span class="sd">&quot;&quot;&quot;Set the power for the current depletion step</span>

<span class="sd"> Parameters</span>
<span class="sd"> ----------</span>
Expand All @@ -479,20 +477,24 @@ <h1>Source code for saltproc.serpent_depcode</h1><div class="highlight"><pre>

<span class="n">line_idx</span> <span class="o">=</span> <span class="mi">8</span> <span class="c1"># burnup setting line index by default</span>
<span class="n">current_power</span> <span class="o">=</span> <span class="n">reactor</span><span class="o">.</span><span class="n">power_levels</span><span class="p">[</span><span class="n">step_idx</span><span class="p">]</span>
<span class="k">if</span> <span class="n">step_idx</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">step_length</span> <span class="o">=</span> <span class="n">reactor</span><span class="o">.</span><span class="n">dep_step_length_cumulative</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">step_length</span> <span class="o">=</span> \
<span class="n">reactor</span><span class="o">.</span><span class="n">dep_step_length_cumulative</span><span class="p">[</span><span class="n">step_idx</span><span class="p">]</span> <span class="o">-</span> \
<span class="n">reactor</span><span class="o">.</span><span class="n">dep_step_length_cumulative</span><span class="p">[</span><span class="n">step_idx</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span>

<span class="n">step_length</span> <span class="o">=</span> <span class="n">reactor</span><span class="o">.</span><span class="n">depletion_timesteps</span><span class="p">[</span><span class="n">step_idx</span><span class="p">]</span>

<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">file_lines</span><span class="p">:</span>
<span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s1">&#39;set power &#39;</span><span class="p">):</span>
<span class="n">line_idx</span> <span class="o">=</span> <span class="n">file_lines</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
<span class="k">del</span> <span class="n">file_lines</span><span class="p">[</span><span class="n">line_idx</span><span class="p">]</span>

<span class="n">file_lines</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="n">line_idx</span><span class="p">,</span> <span class="c1"># Insert on 9th line</span>
<span class="s1">&#39;set power </span><span class="si">%5.9E</span><span class="s1"> dep daystep </span><span class="si">%7.5E</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span>
<span class="p">(</span><span class="n">current_power</span><span class="p">,</span> <span class="n">step_length</span><span class="p">))</span>
<span class="k">if</span> <span class="n">reactor</span><span class="o">.</span><span class="n">timestep_units</span> <span class="o">==</span> <span class="s1">&#39;MWd/kg&#39;</span><span class="p">:</span>
<span class="n">step_type</span> <span class="o">=</span> <span class="s1">&#39;bu&#39;</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">step_type</span> <span class="o">=</span> <span class="s1">&#39;day&#39;</span>

<span class="n">step_type</span> <span class="o">+=</span> <span class="s1">&#39;step&#39;</span>

<span class="n">file_lines</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="n">line_idx</span><span class="p">,</span>
<span class="sa">f</span><span class="s1">&#39;set power %5.9E dep %s %7.5E</span><span class="se">\n</span><span class="s1">&#39;</span> <span class="o">%</span>
<span class="p">(</span><span class="n">current_power</span><span class="p">,</span> <span class="n">step_type</span><span class="p">,</span> <span class="n">step_length</span><span class="p">))</span>
<span class="k">return</span> <span class="n">file_lines</span></div>

<div class="viewcode-block" id="SerpentDepcode.run_depletion_step"><a class="viewcode-back" href="../../src/saltproc.serpent_depcode.html#saltproc.serpent_depcode.SerpentDepcode.run_depletion_step">[docs]</a> <span class="k">def</span> <span class="nf">run_depletion_step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cores</span><span class="p">,</span> <span class="n">nodes</span><span class="p">):</span>
Expand Down Expand Up @@ -560,9 +562,9 @@ <h1>Source code for saltproc.serpent_depcode</h1><div class="highlight"><pre>
<span class="n">lines</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">readlines</span><span class="p">()</span>

<span class="n">current_geo_file</span> <span class="o">=</span> <span class="n">lines</span><span class="p">[</span><span class="n">geo_line_n</span><span class="p">]</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\&quot;</span><span class="s1">&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
<span class="n">current_geo_idx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">geo_files</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">current_geo_file</span><span class="p">)</span>
<span class="n">current_geo_idx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">geo_file_paths</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">current_geo_file</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">new_geo_file</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">geo_files</span><span class="p">[</span><span class="n">current_geo_idx</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
<span class="n">new_geo_file</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">geo_file_paths</span><span class="p">[</span><span class="n">current_geo_idx</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span>
<span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;No more geometry files available </span><span class="se">\</span>
<span class="s1"> and the system went subcritical </span><span class="se">\n\n</span><span class="s1">&#39;</span><span class="p">)</span>
Expand Down
Loading

0 comments on commit a0d8580

Please sign in to comment.