@@ -272,10 +272,15 @@ def run_case(self,restart=False):
272
272
'temperature' : tables .Float64Col (pos = 1 ),
273
273
'pressure' : tables .Float64Col (pos = 2 ),
274
274
'volume' : tables .Float64Col (pos = 3 ),
275
- 'mass_fractions' : tables .Float64Col (
276
- shape = (self .reac .thermo .n_species ), pos = 4
277
- ),
278
275
}
276
+ if self .kind == 'ignition delay' :
277
+ table_def ['mass_fractions' ]= tables .Float64Col (
278
+ shape = (self .reac .thermo .n_species ), pos = 4
279
+ )
280
+ elif self .kind == 'species profile' :
281
+ table_def ['mole_fractions' ]= tables .Float64Col (
282
+ shape = (self .reac .thermo .n_species ), pos = 4
283
+ )
279
284
280
285
with tables .open_file (self .meta ['save-file' ], mode = 'w' ,
281
286
title = self .meta ['id' ]
@@ -526,7 +531,7 @@ def __init__(self,*args,target_species_name):
526
531
527
532
def jsr (self ,model_file ,species_key ,path = '' ):
528
533
self .gas = super (JSRSimulation ,self ).setup_case (model_file ,species_key ,path )
529
- self .maxsimulationtime = 60
534
+ self .time_end = 60
530
535
self .pressurevalcof = 0.01
531
536
self .maxpressurerise = 0.01
532
537
# Reactor volume needed in m^3 for Cantera
@@ -550,7 +555,8 @@ def jsr(self,model_file,species_key,path=''):
550
555
file_path = os .path .join (path , self .meta ['id' ] + '.h5' )
551
556
self .meta ['save-file' ] = file_path
552
557
self .meta ['target-species-index' ] = self .gas .species_index (species_key [self .target_species_name ])
553
-
558
+ def run (self ,restart = False ):
559
+ super (self .__class__ ,self ).run_case (restart = restart )
554
560
def process_jsr (self ):
555
561
table = super (JSRSimulation ,self ).process_results ()
556
562
return table .col ('mole_fractions' )[:,self .meta ['target-species-index' ]][- 1 ]
0 commit comments