Skip to content

Commit 0614367

Browse files
committed
addressing new comments
1 parent 50185b6 commit 0614367

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

doc/user_manual/code_interfaces/melcor.tex

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ \subsubsection{Models}
111111
code before executing. Once the \xmlNode{preexec} node is inputted, the execution of MELGEN is performed automatically by the Interface.
112112
Two addtional nodes need to be specified: the first one (i.e., \xmlNode{CodePlotFile}) indicates the name of the MELCOR plot file.
113113
The second one (i.e., \xmlNode{MelcorOutput}) specifies the name of the MELCOR message file.
114+
Note that only one file can be specified in each of these two nodes (i.e., \xmlNode{MelcorOutput} and \xmlNode{CodePlotFile}).
114115
\\In addition, if some command line parameters need to be passed to MELCOR, the user might use (optionally) the \xmlNode{clargs} XML nodes.
115116
\\Lastly, the \xmlNode{variables} node should contain a list of comma separated variables generated by MELCOR that should retrieved
116117
by the RAVEN-MELCOR interface.

ravenframework/CodeInterfaceClasses/MELCOR/melcorCombinedInterface.py

+15-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"""
1515
Created on April 18, 2017
1616
@author: Matteo D'Onorio (Sapienza University of Rome)
17-
Andrea Alfonsi (INL)
17+
Andrea Alfonsi (Nucube)
1818
"""
1919

2020
import os
@@ -29,6 +29,16 @@ class Melcor(CodeInterfaceBase):
2929
This class is used a part of a code dictionary to specialize Model. Code for different MELCOR versions
3030
like MELCOR 2.2x, MELCOR 1.86, MELCOR for fusion applications
3131
"""
32+
def initialize(self, runInfo, oriInputFiles):
33+
"""
34+
Method to initialize the run of a new step
35+
@ In, runInfo, dict, dictionary of the info in the <RunInfo> XML block
36+
@ In, oriInputFiles, list, list of the original input files
37+
@ Out, None
38+
"""
39+
self.melcOut = 'OUTPUT_MELCOR'
40+
self.goodWord = "Normal termination" # This is for MELCOR 2.2 (todo: list for other MELCOR versions)
41+
3242

3343
def _readMoreXML(self,xmlNode):
3444
"""
@@ -52,8 +62,8 @@ def _readMoreXML(self,xmlNode):
5262
raise IOError("Please enter MELCOR message file name")
5363

5464
self.varList = [var.strip() for var in varNode.text.split(",")]
55-
self.melcorPlotFile = [var.strip() for var in plotNode.text.split(",")][0]
56-
self.melcorOutFile = [var.strip() for var in melNode.text.split(",")][0]
65+
self.melcorPlotFile = plotNode.text
66+
self.melcorOutFile = melNode.text
5767

5868
def findInps(self,currentInputFiles):
5969
"""
@@ -89,15 +99,14 @@ def generateCommand(self, inputFiles, executable, clargs=None, fargs=None, preEx
8999
"""
90100
found = False
91101

92-
melcOut = 'OUTPUT_MELCOR'
93102
melcin = self.findInps(inputFiles)
94103
if clargs:
95104
precommand = executable + clargs['text']
96105
else:
97106
precommand = executable
98107
melgCommand = str(preExec) + ' ' + melcin.getFilename()
99108
melcCommand = str(precommand) + ' ' + melcin.getFilename()
100-
returnCommand = [('serial',melgCommand + ' && ' + melcCommand +' ow=o ')],melcOut
109+
returnCommand = [('serial',melgCommand + ' && ' + melcCommand +' ow=o ')],self.melcOut
101110

102111
return returnCommand
103112

@@ -170,11 +179,10 @@ def checkForOutputFailure(self,output,workingDir):
170179
@ Out, failure, bool, True if the job is failed, False otherwise
171180
"""
172181
failure = True
173-
goodWord = "Normal termination" # This is for MELCOR 2.2 (todo: list for other MELCOR versions)
174182
with open(os.path.join(workingDir,self.melcorOutFile),"r") as outputToRead:
175183
readLines = outputToRead.readlines()
176184
lastRow = readLines[-1]
177-
if goodWord in lastRow:
185+
if self.goodWord in lastRow:
178186
failure = False
179187
outputToRead.close()
180188
return failure

0 commit comments

Comments
 (0)