[ck2cti] Import the resulting mechanism to complete validation
This relaxes the need to perform redundant validation in ck2cti.
This commit is contained in:
parent
c29ae666c0
commit
be9882a765
1 changed files with 17 additions and 0 deletions
|
|
@ -1899,6 +1899,23 @@ def main(argv):
|
|||
parser.convertMech(inputFile, thermoFile, transportFile, phaseName,
|
||||
outName, permissive=permissive)
|
||||
|
||||
# Do full validation by importing the resulting mechanism
|
||||
try:
|
||||
import cantera as ct
|
||||
except ImportError:
|
||||
print('WARNING: Unable to import Cantera Python module. Output '
|
||||
'mechanism has not been validated')
|
||||
sys.exit(0)
|
||||
|
||||
try:
|
||||
print('Validating mechanism...', end='')
|
||||
gas = ct.Solution(outName)
|
||||
print('PASSED.')
|
||||
except RuntimeError as e:
|
||||
print('FAILED.')
|
||||
print(e)
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
main(sys.argv[1:])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue