Skip to content

Commit

Permalink
fix up eos
Browse files Browse the repository at this point in the history
  • Loading branch information
MTCam committed Sep 7, 2024
1 parent 90a6b9a commit 6a2da92
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions mirgecom/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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."""
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit 6a2da92

Please sign in to comment.