diff --git a/mirgecom/eos.py b/mirgecom/eos.py index 0ff6778f6..3aa342cf3 100644 --- a/mirgecom/eos.py +++ b/mirgecom/eos.py @@ -424,7 +424,7 @@ def internal_energy(self, cv: ConservedVars) -> DOFArray: e = \rho{E} - \frac{1}{2\rho}(\rho\vec{V} \cdot \rho\vec{V}) """ - return (cv.energy - self.kinetic_energy(cv)) + return (cv.energy - self.kinetic_energy(cv)) # type: ignore def pressure(self, cv: ConservedVars, temperature: Optional[DOFArray] = None) -> DOFArray: @@ -520,7 +520,7 @@ def total_energy(self, cv: ConservedVars, pressure: DOFArray, + self.kinetic_energy(cv)) def get_internal_energy(self, temperature: DOFArray, - species_mass_fractions: Optional[DOFArray] = None) -> DOFArray: + species_mass_fractions: Optional[np.ndarray] = None) -> DOFArray: r"""Get the gas thermal energy from temperature. The gas internal energy $e$ is calculated from: @@ -601,7 +601,7 @@ def __init__(self, pyrometheus_mech, temperature_guess=300.0): self._tguess = temperature_guess def get_temperature_seed(self, ary: Optional[DOFArray] = None, - temperature_seed: Optional[DOFArray] = None) -> DOFArray: + temperature_seed: Optional[Union[float, DOFArray]] = None) -> DOFArray: """Get a *cv*-shaped array with which to seed temperature calcuation. Parameters @@ -626,7 +626,7 @@ def get_temperature_seed(self, ary: Optional[DOFArray] = None, else: if ary is None: raise ValueError("Requires *ary* for shaping temperature seed.") - return tseed * (0*ary + 1.0) + return tseed * (0. * ary + 1.0) # type: ignore def heat_capacity_cp(self, cv: ConservedVars, temperature: DOFArray) -> DOFArray: r"""Get mixture-averaged specific heat capacity at constant pressure.""" @@ -692,7 +692,7 @@ def internal_energy(self, cv: ConservedVars) -> DOFArray: e = \rho{E} - \frac{1}{2\rho}(\rho\vec{V} \cdot \rho\vec{V}) """ - return (cv.energy - self.kinetic_energy(cv)) + return (cv.energy - self.kinetic_energy(cv)) # type: ignore def get_density(self, pressure: DOFArray, # type: ignore[override] temperature: DOFArray, species_mass_fractions: np.ndarray) -> DOFArray: @@ -770,7 +770,7 @@ def sound_speed(self, cv: ConservedVars, temperature: DOFArray) -> DOFArray: c = \sqrt{\frac{\gamma_{\mathtt{mix}}{p}}{\rho}} """ actx = cv.array_context - return actx.np.sqrt((self.gamma(cv, temperature) + return actx.np.sqrt((self.gamma(cv, temperature) # type: ignore * self.pressure(cv, temperature)) / cv.mass) @@ -799,7 +799,7 @@ def temperature(self, cv: ConservedVars, tseed = self.get_temperature_seed(cv.mass, temperature_seed) y = cv.species_mass_fractions - e = self.internal_energy(cv) / cv.mass + e = self.internal_energy(cv) / cv.mass # type: ignore return self._pyrometheus_mech.get_temperature(e, tseed, y) def temperature_from_enthalpy(self, enthalpy: DOFArray, @@ -852,7 +852,7 @@ def total_energy(self, cv: ConservedVars, pressure: DOFArray, inversion interfaces. """ y = cv.species_mass_fractions - return (cv.mass * self.get_internal_energy(temperature, y) + return (cv.mass * self.get_internal_energy(temperature, y) # type: ignore + self.kinetic_energy(cv)) def get_species_source_terms(self, cv: ConservedVars, temperature: DOFArray): @@ -867,9 +867,9 @@ def get_species_source_terms(self, cv: ConservedVars, temperature: DOFArray): w = self.get_species_molecular_weights() dim = cv.dim species_sources = w * omega - rho_source = 0 * cv.mass - mom_source = 0 * cv.momentum - energy_source = 0 * cv.energy + rho_source = 0. * cv.mass + mom_source = 0. * cv.momentum + energy_source = 0. * cv.energy return make_conserved(dim, rho_source, energy_source, mom_source, species_sources)