@@ -16,23 +16,26 @@ def setup(self):
16
16
spec = self .options ['spec' ]
17
17
composition = self .options ['composition' ]
18
18
19
- if composition is None :
19
+ if composition is None :
20
20
composition = TAB_AIR_FUEL_COMPOSITION
21
21
22
22
sorted_compo = sorted (composition .keys ())
23
23
24
24
interp = om .MetaModelStructuredComp (method = interp_method , extrapolate = True )
25
- self .add_subsystem ('tab' , interp , promotes_inputs = ['P' , 'T' ],
25
+ self .add_subsystem ('tab' , interp , promotes_inputs = ['P' , 'T' ],
26
26
promotes_outputs = ['h' , 'S' , 'gamma' , 'Cp' , 'Cv' , 'rho' , 'R' ])
27
27
28
- for i , param in enumerate (sorted_compo ):
28
+ for i , param in enumerate (sorted_compo ):
29
29
interp .add_input (param , composition [param ], training_data = spec [param ])
30
30
self .promotes ('tab' , inputs = [(param , 'composition' )], src_indices = [i ,])
31
31
self .set_input_defaults ('composition' , src_shape = len (composition ))
32
32
33
33
interp .add_input ('P' , 101325.0 , units = 'Pa' , training_data = spec ['P' ])
34
34
interp .add_input ('T' , 273.0 , units = 'degK' , training_data = spec ['T' ])
35
35
36
+ if len (sorted_compo ) == 1 and interp_method == 'slinear' :
37
+ interp .options ['method' ] = '3D-slinear'
38
+
36
39
interp .add_output ('h' , 1.0 , units = 'J/kg' , training_data = spec ['h' ])
37
40
interp .add_output ('S' , 1.0 , units = 'J/kg/degK' , training_data = spec ['S' ])
38
41
interp .add_output ('gamma' , 1.4 , units = None , training_data = spec ['gamma' ])
@@ -42,6 +45,6 @@ def setup(self):
42
45
interp .add_output ('R' , 287.0 , units = 'J/kg/degK' , training_data = spec ['R' ])
43
46
44
47
# required part of the SetTotalTP API for flow setup
45
- # use a sorted list of keys, so dictionary hash ordering doesn't bite us
48
+ # use a sorted list of keys, so dictionary hash ordering doesn't bite us
46
49
# loop over keys and create a vector of mass fractions
47
50
self .composition = [composition [k ] for k in sorted_compo ]
0 commit comments