Skip to content

Commit 4a6fee2

Browse files
authored
Merge pull request #17 from dassh-dev/develop
Merge develop into master
2 parents 8f65cf4 + aac831b commit 4a6fee2

File tree

5 files changed

+19
-34
lines changed

5 files changed

+19
-34
lines changed

dassh/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# permissions and limitations under the License.
1515
########################################################################
1616
"""
17-
date: 2023-02-28
17+
date: 2023-03-02
1818
author: Milos Atz, Micheal Smith
1919
"""
2020
########################################################################
@@ -46,4 +46,4 @@
4646
np.set_printoptions(threshold=sys.maxsize, linewidth=500)
4747

4848

49-
__version__ = '0.12.0'
49+
__version__ = '0.12.1'

dassh/__main__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# permissions and limitations under the License.
1515
########################################################################
1616
"""
17-
date: 2022-12-19
17+
date: 2023-03-02
1818
author: matz
1919
Main DASSH calculation procedures
2020
"""
@@ -59,7 +59,7 @@ def main(args=None):
5959
print(dassh._ascii._ascii_title)
6060
in_path = os.path.split(args.inputfile)[0]
6161
dassh_logger = dassh.logged_class.init_root_logger(in_path, 'dassh')
62-
dassh_logger.info("DASSH logger initialized")
62+
dassh_logger.info(f"DASSH v{dassh.__version__} logger initialized")
6363

6464
# Pre-processing
6565
# Read input file and set up DASSH input object

dassh/hotspot.py

+13-17
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# permissions and limitations under the License.
1515
########################################################################
1616
"""
17-
date: 2023-02-28
17+
date: 2023-03-02
1818
author: matz
1919
comment: Hot spot analysis via the semistatistical horizontal method
2020
"""
@@ -128,26 +128,29 @@ def analyze(r_obj):
128128
# Collect assembly IDs that match the name
129129
ids = [a.id for a in r_obj.assemblies if a.name == asm_name]
130130
n_asm = len(ids)
131-
# Do each hotspot calc
132-
for k in _REGIONS:
133-
131+
for k in _REGIONS: # Do each hotspot calc
134132
if k in hs.keys():
135133
# Add assembly IDs/names to relevant list
136134
asm_ids[k] += ids
137135
asm_names[k] += [asm_name for i in range(n_asm)]
136+
# Pull dT from the assembly
138137
dT = _get_peak_dt(r_obj, asm_name, k)
139-
cols = _COLS_NEEDED[k]
140-
subf, expr = _read_hcf_table(hs[k]['subfactors'], cols)
138+
# Read the HCF from the table at the specified path
139+
subf, expr = _read_hcf_table(
140+
hs[k]['subfactors'],
141+
_COLS_NEEDED[k])
142+
# Split the clad OD-MW and MW-ID subfactors
141143
if k in ('clad_id', 'fuel_od', 'fuel_cl'):
142144
subf, expr = _split_clad_subfactors(subf, expr)
143145
subf = _evaluate_hcf_expr(subf, expr, dT)
146+
# Crop the subfactors table based on the size of dT
147+
for typ in subf.keys():
148+
subf[typ] = subf[typ][:, :, :dT.shape[1]]
149+
# Do the calculations
144150
peak_temps[k].append(
145151
calculate_temps(r_obj.inlet_temp, dT, subf,
146152
IN_sigma=hs[k]['input_sigma'],
147153
OUT_sigma=hs[k]['output_sigma']))
148-
# else:
149-
# empty_fill = np.zeros(n_asm)
150-
# peak_temps[k].append(empty_fill)
151154

152155
# Need to sort! Create lists of ids, names, and temps. Sort
153156
# all according to ids. Then write into output table
@@ -163,14 +166,7 @@ def analyze(r_obj):
163166
order = np.argsort(asm_ids[k])
164167
asm_ids[k] = [asm_ids[k][i] for i in order]
165168
asm_names[k] = [asm_names[k][i] for i in order]
166-
try:
167-
# peak_temps[k] = np.hstack(peak_temps[k])
168-
peak_temps[k] = np.vstack(peak_temps[k])
169-
except:
170-
print(k)
171-
for x in peak_temps[k]:
172-
print(x.shape)
173-
raise
169+
peak_temps[k] = np.vstack(peak_temps[k])
174170
peak_temps[k] = peak_temps[k][order]
175171
# return peak_temps, asm_ids, asm_names
176172
return peak_temps, asm_ids

dassh/reactor.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# permissions and limitations under the License.
1515
########################################################################
1616
"""
17-
date: 2023-02-28
17+
date: 2023-03-02
1818
author: matz
1919
Object to hold and control DASSH components and execute simulations
2020
"""
@@ -744,21 +744,12 @@ def _setup_core(self, inp_obj):
744744
gap_fr = inp_obj.data['Core']['bypass_fraction'] * self.flow_rate
745745

746746
# Estimate outlet temperature based on core power
747-
# print(t_in, self.total_power, total_fr)
748747
cool_mat = inp_obj.data['Core']['coolant_material'].lower()
749-
# print(self.total_power, self.inlet_temp, self.flow_rate)
750748
t_out = dassh.utils.Q_equals_mCdT(self.total_power,
751749
self.inlet_temp,
752750
self.materials[cool_mat],
753751
mfr=self.flow_rate)
754752

755-
# Instantiate and load core object
756-
# core_obj = dassh.core.Core(
757-
# geodst,
758-
# gap_fr,
759-
# self.materials[inp_obj.data['Core']['coolant_material'].lower()],
760-
# inlet_temperature=self.inlet_temp,
761-
# model=inp_obj.data['Core']['gap_model'])
762753
_asm = np.ones(len(inp_obj.data['Assignment']['ByPosition']))
763754
_asm *= np.nan
764755
for a in self.assemblies:
@@ -1597,7 +1588,6 @@ def _write_asm_pin_table(self, list_asm_id, list_ax_pos, datatype):
15971588

15981589
# Load data for postprocessing
15991590
f = os.path.join(self.path, 'temp_pin.csv')
1600-
print(list_ax_pos)
16011591
temps = dassh.plot._load_data(f, list_ax_pos, list_asm_id_b0)
16021592

16031593
# Initialize array for each assembly being dumped

dassh/region_rodded.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# permissions and limitations under the License.
1515
########################################################################
1616
"""
17-
date: 2022-12-20
17+
date: 2023-03-02
1818
author: matz
1919
Methods to describe the components of hexagonal fuel typical of
2020
liquid metal fast reactors
@@ -124,7 +124,6 @@ def make(inp, name, mat, fr, se2geo=False, update_tol=0.0, gravity=False):
124124
0.86, 0.86, 4.0 + 0.16 * p2d**5]
125125
inp['PinModel']['pin_material'] = \
126126
[x.clone() for x in mat['pin']]
127-
print(inp['PinModel'])
128127
rr.pin_model = PinModel(inp['pin_diameter'],
129128
inp['clad_thickness'],
130129
mat['clad'],

0 commit comments

Comments
 (0)