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

Update OAT sensitivity analysis #144

Merged
merged 18 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
1,900 changes: 1,205 additions & 695 deletions input/haleu/sensitivity-analysis/oat/OAT_Analysis.ipynb

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions input/haleu/sensitivity-analysis/oat/mmr/mmr_share_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
duration,
reactor_prototypes,
demand_equation,
'MMR',
int(params['mmr']))
{'MMR':int(params['mmr'])})
Copy link
Contributor

Choose a reason for hiding this comment

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

You're passing a dictionary with an entry for each 'version' of the MMR, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The dictionary here defines the build share percent (the value) for each specified prototype (the key). This change is because of the updates to the determine_deployment_scheme function in scripts/create_AR_DeployInst.py in PR #143. This does not change the lifetime or any parameters about the MMR prototype.

cdi.write_deployinst(deploy_schedule,
"./cyclus-files/mmr_" +
str(int(params['mmr'])) + "_deployinst.xml")
Expand All @@ -52,4 +51,4 @@
# ----------------------------
# Return the results to Dakota
# ----------------------------
results = oup.get_all_results(results, output_sqlite)
results = oup.get_all_results(results, output_sqlite)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<facility>
<name>MMR</name>
<lifetime>120</lifetime>
<config>
<Reactor>
<fuel_incommods> <val>fresh_uox</val> </fuel_incommods>
<fuel_inrecipes> <val>fresh_MMR_haleu</val> </fuel_inrecipes>
<fuel_outcommods> <val>spent_MMR_haleu</val> </fuel_outcommods>
<fuel_outrecipes> <val>spent_MMR_haleu</val> </fuel_outrecipes>
<cycle_time>120</cycle_time>
<refuel_time>0</refuel_time>
<assem_size>1510.786</assem_size>
<n_assem_core>1</n_assem_core>
<n_assem_batch>1</n_assem_batch>
<power_cap>5</power_cap>
</Reactor>
</config>
</facility>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<facility>
<name>MMR</name>
<lifetime>180</lifetime>
<config>
<Reactor>
<fuel_incommods> <val>fresh_uox</val> </fuel_incommods>
<fuel_inrecipes> <val>fresh_MMR_haleu</val> </fuel_inrecipes>
<fuel_outcommods> <val>spent_MMR_haleu</val> </fuel_outcommods>
<fuel_outrecipes> <val>spent_MMR_haleu</val> </fuel_outrecipes>
<cycle_time>180</cycle_time>
<refuel_time>0</refuel_time>
<assem_size>1510.786</assem_size>
<n_assem_core>1</n_assem_core>
<n_assem_batch>1</n_assem_batch>
<power_cap>5</power_cap>
</Reactor>
</config>
</facility>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<facility>
<name>MMR</name>
<lifetime>218</lifetime>
<config>
<Reactor>
<fuel_incommods> <val>fresh_uox</val> </fuel_incommods>
<fuel_inrecipes> <val>fresh_MMR_haleu</val> </fuel_inrecipes>
<fuel_outcommods> <val>spent_MMR_haleu</val> </fuel_outcommods>
<fuel_outrecipes> <val>spent_MMR_haleu</val> </fuel_outrecipes>
<cycle_time>218</cycle_time>
<refuel_time>0</refuel_time>
<assem_size>1510.786</assem_size>
<n_assem_core>1</n_assem_core>
<n_assem_batch>1</n_assem_batch>
<power_cap>5</power_cap>
</Reactor>
</config>
</facility>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<facility>
<name>MMR</name>
<lifetime>231</lifetime>
<config>
<Reactor>
<fuel_incommods> <val>fresh_uox</val> </fuel_incommods>
<fuel_inrecipes> <val>fresh_MMR_haleu</val> </fuel_inrecipes>
<fuel_outcommods> <val>spent_MMR_haleu</val> </fuel_outcommods>
<fuel_outrecipes> <val>spent_MMR_haleu</val> </fuel_outrecipes>
<cycle_time>231</cycle_time>
<refuel_time>0</refuel_time>
<assem_size>1510.786</assem_size>
<n_assem_core>1</n_assem_core>
<n_assem_batch>1</n_assem_batch>
<power_cap>5</power_cap>
</Reactor>
</config>
</facility>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<facility>
<name>MMR</name>
<lifetime>240</lifetime>
<config>
<Reactor>
<fuel_incommods> <val>fresh_uox</val> </fuel_incommods>
<fuel_inrecipes> <val>fresh_MMR_haleu</val> </fuel_inrecipes>
<fuel_outcommods> <val>spent_MMR_haleu</val> </fuel_outcommods>
<fuel_outrecipes> <val>spent_MMR_haleu</val> </fuel_outrecipes>
<cycle_time>240</cycle_time>
<refuel_time>0</refuel_time>
<assem_size>1510.786</assem_size>
<n_assem_core>1</n_assem_core>
<n_assem_batch>1</n_assem_batch>
<power_cap>5</power_cap>
</Reactor>
</config>
</facility>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<facility>
<name>MMR</name>
<lifetime>255</lifetime>
<config>
<Reactor>
<fuel_incommods> <val>fresh_uox</val> </fuel_incommods>
<fuel_inrecipes> <val>fresh_MMR_haleu</val> </fuel_inrecipes>
<fuel_outcommods> <val>spent_MMR_haleu</val> </fuel_outcommods>
<fuel_outrecipes> <val>spent_MMR_haleu</val> </fuel_outrecipes>
<cycle_time>255</cycle_time>
<refuel_time>0</refuel_time>
<assem_size>1510.786</assem_size>
<n_assem_core>1</n_assem_core>
<n_assem_batch>1</n_assem_batch>
<power_cap>5</power_cap>
</Reactor>
</config>
</facility>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<facility>
<name>MMR</name>
<lifetime>267</lifetime>
<config>
<Reactor>
<fuel_incommods> <val>fresh_uox</val> </fuel_incommods>
<fuel_inrecipes> <val>fresh_MMR_haleu</val> </fuel_inrecipes>
<fuel_outcommods> <val>spent_MMR_haleu</val> </fuel_outcommods>
<fuel_outrecipes> <val>spent_MMR_haleu</val> </fuel_outrecipes>
<cycle_time>267</cycle_time>
<refuel_time>0</refuel_time>
<assem_size>1510.786</assem_size>
<n_assem_core>1</n_assem_core>
<n_assem_batch>1</n_assem_batch>
<power_cap>5</power_cap>
</Reactor>
</config>
</facility>
37 changes: 37 additions & 0 deletions input/haleu/sensitivity-analysis/oat/mmr_burnup/dakota.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# One-at-a-time analysis for changing transition start time
# Multidimensional parameter study

environment,
tabular_data
tabular_data_file = 'mmr_burnup.dat'
output_file 'mmr_burnup.out'
write_restart 'mmr_burnup.rst'

method,
list_parameter_study
list_of_points = 41
62
74
78
82
86
90

Comment on lines +11 to +19
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain what this change is? I'm not understanding from the commit message. It could also be my lack of familiarity with dakota.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the other variations (transition start time, lwr lifetimes, and build shares) I am sweeping over a grid of evenly spaced points. However, the points I want to use for the burnup variations (applied to the MMR or Xe-100) are not evenly spaced. So I am telling Dakota to use these specific values instead of an even grid like I do when varying the parameters.


variables,
continuous_design = 1
descriptors 'mmr_burnup'

interface,
fork
asynchronous
evaluation_concurrency = 8
analysis_drivers = 'python mmr_burnup_driver.py'


responses,
descriptors = 'enr_u' 'haleu' 'swu' 'haleu_swu' 'waste' 'feed'
response_functions = 6
scalar_responses = 6
no_gradients
no_hessians
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import sys, os

import numpy as np
import dakota.interfacing as di

sys.path.append('../../../../../scripts')

import create_AR_DeployInst as cdi
import output_metrics as oup
import dakota_input as inp
# ----------------------------
# Parse Dakota parameters file
# ----------------------------

params, results = di.read_parameters_file()

# -------------------------------
# Convert and send to Cyclus
# -------------------------------

# Edit Cyclus input file
cyclus_template = 'mmr_burnup_input.xml.in'
scenario_name = 'mmr_burnup_' + str(int(params['mmr_burnup']))
Copy link
Contributor

Choose a reason for hiding this comment

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

good naming scheme

variable_dict = {'handle': scenario_name,
'mmr_burnup': str(int(params['mmr_burnup']))}
output_xml = './cyclus-files/' + scenario_name + '.xml'
output_sqlite = './cyclus-files/' + scenario_name + '.sqlite'

inp.render_input(cyclus_template, variable_dict, output_xml)

# Create DeployInst for advanced reactors
duration = 1500
mmr_lifetimes = {41:120, 62:180, 74:218, 78:231, 82:240, 86:255, 90:267}
reactor_prototypes = {'Xe-100': (76, 720),
'MMR': (5,mmr_lifetimes[int(params['mmr_burnup'])]),
'VOYGR': (73, 720)}
demand_equation = np.zeros(duration)
demand_equation[721:] = 87198.156
lwr_DI = cdi.convert_xml_to_dict(
"../../../inputs/united_states/buildtimes/UNITED_STATES_OF_AMERICA/deployinst.xml")

deploy_schedule = cdi.write_AR_deployinst(lwr_DI,
"../../../inputs/united_states/reactors/",
duration,
reactor_prototypes,
demand_equation)
cdi.write_deployinst(deploy_schedule,
"./cyclus-files/mmr_burnup_" +
str(int(params['mmr_burnup'])) + "_deployinst.xml")

# Run Cyclus with edited input file
oup.run_cyclus(output_sqlite, output_xml)

# ----------------------------
# Return the results to Dakota
# ----------------------------
results = oup.get_all_results(results, output_sqlite)
Loading