Skip to content

Commit

Permalink
Merge pull request #144 from abachma2/sensitivity-analysis
Browse files Browse the repository at this point in the history
Update OAT sensitivity analysis
  • Loading branch information
yardasol authored Nov 10, 2022
2 parents 866b9f0 + 041cf1c commit ebc7ee5
Show file tree
Hide file tree
Showing 25 changed files with 2,181 additions and 702 deletions.
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'])})
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


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']))
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

0 comments on commit ebc7ee5

Please sign in to comment.