44import numpy as np
55
66
7- def sod (g , v , gamma , U , params ): # pylint: disable=W0613
7+ def sod (g , v , U , params ): # pylint: disable=W0613
88 """Initial conditions for the classic Sod shock tube problem
99
1010 Parameters
@@ -13,18 +13,19 @@ def sod(g, v, gamma, U, params): # pylint: disable=W0613
1313 the grid object
1414 v : FluidVars
1515 the fluid variables object
16- gamma : float
17- the ratio of specific heats
1816 U : ndarray
1917 the conserved state array
2018 params : dict
21- a dictionary of parameters (not used)
19+ a dictionary of parameters.
20+ We expect gamma to be provided here
2221
2322 Returns
2423 -------
2524 None
2625 """
2726
27+ gamma = params ["gamma" ]
28+
2829 # setup initial conditions -- this is Sod's problem
2930 rho_l = 1.0
3031 u_l = 0.0
@@ -45,7 +46,7 @@ def sod(g, v, gamma, U, params): # pylint: disable=W0613
4546 U [idx_r , v .uener ] = p_r / (gamma - 1.0 ) + 0.5 * rho_r * u_r ** 2
4647
4748
48- def acoustic_pulse (g , v , gamma , U , params ): # pylint: disable=W0613
49+ def acoustic_pulse (g , v , U , params ): # pylint: disable=W0613
4950 """The acoustic pulse problem from McCorquodale & Colella 2011
5051
5152 Parameters
@@ -54,18 +55,19 @@ def acoustic_pulse(g, v, gamma, U, params): # pylint: disable=W0613
5455 the grid object
5556 v : FluidVars
5657 the fluid variables object
57- gamma : float
58- the ratio of specific heats
5958 U : ndarray
6059 the conserved state array
6160 params : dict
6261 a dictionary of parameters (not used)
62+ We expect gamma to be provided here
6363
6464 Returns
6565 -------
6666 None
6767 """
6868
69+ gamma = params ["gamma" ]
70+
6971 xcenter = 0.5 * (g .xmin + g .xmax )
7072
7173 rho0 = 1.4
@@ -82,17 +84,14 @@ def acoustic_pulse(g, v, gamma, U, params): # pylint: disable=W0613
8284 U [:, v .uener ] = p / (gamma - 1.0 ) + 0.5 * rho * u ** 2
8385
8486
85- def hse (grid , v , gamma , U , params ):
87+ def hse (grid , v , U , params ):
8688 """An isothermal hydrostatic atmosphere.
87-
8889 Parameters
8990 ----------
9091 grid : FVGrid
9192 the grid object
9293 v : FluidVars
9394 the fluid variables object
94- gamma : float
95- the ratio of specific heats
9695 U : ndarray
9796 the conserved state array
9897 params : dict
@@ -101,6 +100,7 @@ def hse(grid, v, gamma, U, params):
101100 * `base_density` : the density at the lower boundary
102101 * `base_pressure` : the pressure at the lower boundary
103102 * `g_const` : the gravitational acceleration
103+ * `gamma` : the ratio of specific heats
104104
105105 Returns
106106 -------
@@ -110,6 +110,7 @@ def hse(grid, v, gamma, U, params):
110110 rho_base = params ["base_density" ]
111111 pres_base = params ["base_pressure" ]
112112 g = params ["g_const" ]
113+ gamma = params ["gamma" ]
113114
114115 verbose = params .get ("verbose" , False )
115116
0 commit comments