Skip to content

Commit

Permalink
Merge branch 'physical-av' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson2981 committed Mar 29, 2023
2 parents e7416ea + 19182b6 commit 390d18c
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 34 deletions.
52 changes: 39 additions & 13 deletions mirgecom/boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,9 @@ def adiabatic_slip_wall_state(
"""
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)
"""
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=state_minus.temperature)
Expand Down Expand Up @@ -667,7 +669,9 @@ def inviscid_wall_flux(self, dcoll, dd_bdry, gas_model, state_minus,
"""
wall_state = make_fluid_state(cv=wall_cv, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)
"""
wall_state = make_fluid_state(cv=wall_cv, gas_model=gas_model,
temperature_seed=state_minus.temperature)
Expand Down Expand Up @@ -827,7 +831,9 @@ def adiabatic_noslip_state(
species_mass=state_minus.species_mass_density)
return make_fluid_state(cv=cv, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def adiabatic_noslip_grad_av(self, grad_av_minus, **kwargs):
"""Get the exterior solution on the boundary for artificial viscosity."""
Expand Down Expand Up @@ -880,7 +886,9 @@ def isothermal_noslip_state(
tseed = state_minus.temperature if state_minus.is_mixture else None
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=tseed,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def temperature_bc(self, state_minus, **kwargs):
r"""Get temperature value to weakly prescribe wall bc.
Expand Down Expand Up @@ -959,7 +967,9 @@ def farfield_state(self, dcoll, dd_bdry, gas_model, state_minus, **kwargs):

return make_fluid_state(cv=cv_infinity, gas_model=gas_model,
temperature_seed=free_stream_temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def temperature_bc(self, state_minus, **kwargs):
"""Return farfield temperature for use in grad(temperature)."""
Expand Down Expand Up @@ -1081,7 +1091,9 @@ def outflow_state(self, dcoll, dd_bdry, gas_model, state_minus, **kwargs):

return make_fluid_state(cv=cv_outflow, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def outflow_state_for_diffusion(self, dcoll, dd_bdry, gas_model,
state_minus, **kwargs):
Expand Down Expand Up @@ -1264,7 +1276,9 @@ def inflow_state(self, dcoll, dd_bdry, gas_model, state_minus, **kwargs):

return make_fluid_state(cv=boundary_cv, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)


class RiemannOutflowBoundary(PrescribedFluidBoundary):
Expand Down Expand Up @@ -1413,7 +1427,9 @@ def isothermal_wall_state(
)
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def inviscid_wall_flux(self, dcoll, dd_bdry, gas_model, state_minus,
numerical_flux_func=inviscid_facial_flux_rusanov, **kwargs):
Expand All @@ -1427,7 +1443,9 @@ def inviscid_wall_flux(self, dcoll, dd_bdry, gas_model, state_minus,
species_mass=state_minus.species_mass_density)
wall_state = make_fluid_state(cv=wall_cv, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

state_pair = TracePair(dd_bdry, interior=state_minus, exterior=wall_state)

Expand Down Expand Up @@ -1526,7 +1544,9 @@ def adiabatic_wall_state_for_advection(self, dcoll, dd_bdry, gas_model,
)
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def adiabatic_wall_state_for_diffusion(self, dcoll, dd_bdry, gas_model,
state_minus, **kwargs):
Expand All @@ -1540,7 +1560,9 @@ def adiabatic_wall_state_for_diffusion(self, dcoll, dd_bdry, gas_model,
)
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def inviscid_wall_flux(self, dcoll, dd_bdry, gas_model, state_minus,
numerical_flux_func=inviscid_facial_flux_rusanov, **kwargs):
Expand Down Expand Up @@ -1672,7 +1694,9 @@ def adiabatic_wall_state_for_advection(self, dcoll, dd_bdry, gas_model,
)
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def adiabatic_wall_state_for_diffusion(self, dcoll, dd_bdry, gas_model,
state_minus, **kwargs):
Expand All @@ -1699,7 +1723,9 @@ def adiabatic_wall_state_for_diffusion(self, dcoll, dd_bdry, gas_model,
)
return make_fluid_state(cv=cv_plus, gas_model=gas_model,
temperature_seed=state_minus.temperature,
smoothness_mu=state_minus.smoothness_mu)
smoothness_mu=state_minus.smoothness_mu,
smoothness_kappa=state_minus.smoothness_kappa,
smoothness_beta=state_minus.smoothness_beta)

def inviscid_wall_flux(self, dcoll, dd_bdry, gas_model, state_minus,
numerical_flux_func=inviscid_facial_flux_rusanov, **kwargs):
Expand Down
32 changes: 26 additions & 6 deletions mirgecom/eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,16 @@ class GasDependentVars:
.. attribute:: pressure
.. attribute:: speed_of_sound
.. attribute:: smoothness_mu
.. attribute:: smoothness_kappa
.. attribute:: smoothness_kappa
"""

temperature: DOFArray
pressure: DOFArray
speed_of_sound: DOFArray
smoothness_mu: DOFArray
smoothness_kappa: DOFArray
smoothness_beta: DOFArray


@dataclass_array_container
Expand Down Expand Up @@ -171,7 +175,9 @@ def get_internal_energy(self, temperature, species_mass_fractions=None):
def dependent_vars(
self, cv: ConservedVars,
temperature_seed: Optional[DOFArray] = None,
smoothness_mu: Optional[DOFArray] = None) -> GasDependentVars:
smoothness_mu: Optional[DOFArray] = None,
smoothness_kappa: Optional[DOFArray] = None,
smoothness_beta: Optional[DOFArray] = None) -> GasDependentVars:
"""Get an agglomerated array of the dependent variables.
Certain implementations of :class:`GasEOS` (e.g. :class:`MixtureEOS`)
Expand All @@ -180,15 +186,21 @@ def dependent_vars(
"""
temperature = self.temperature(cv, temperature_seed)
# MJA, it doesn't appear that we can have a None field embedded inside DV,
# make a dummy smoothness_mu in this case
# make a dummy smoothness in this case
if smoothness_mu is None:
smoothness_mu = 0. * cv.mass
if smoothness_kappa is None:
smoothness_kappa = 0. * cv.mass
if smoothness_beta is None:
smoothness_beta = 0. * cv.mass

return GasDependentVars(
temperature=temperature,
pressure=self.pressure(cv, temperature),
speed_of_sound=self.sound_speed(cv, temperature),
smoothness_mu=smoothness_mu
smoothness_mu=smoothness_mu,
smoothness_kappa=smoothness_kappa,
smoothness_beta=smoothness_beta
)


Expand Down Expand Up @@ -240,7 +252,9 @@ def get_species_source_terms(self, cv: ConservedVars, temperature: DOFArray):
def dependent_vars(
self, cv: ConservedVars,
temperature_seed: Optional[DOFArray] = None,
smoothness_mu: Optional[DOFArray] = None) -> MixtureDependentVars:
smoothness_mu: Optional[DOFArray] = None,
smoothness_kappa: Optional[DOFArray] = None,
smoothness_beta: Optional[DOFArray] = None) -> MixtureDependentVars:
"""Get an agglomerated array of the dependent variables.
Certain implementations of :class:`GasEOS` (e.g. :class:`MixtureEOS`)
Expand All @@ -249,16 +263,22 @@ def dependent_vars(
"""
temperature = self.temperature(cv, temperature_seed)
# MJA, it doesn't appear that we can have a None field embedded inside DV,
# make a dummy smoothness_mu in this case
# make a dummy smoothness in this case
if smoothness_mu is None:
smoothness_mu = 0. * cv.mass
if smoothness_kappa is None:
smoothness_kappa = 0. * cv.mass
if smoothness_beta is None:
smoothness_beta = 0. * cv.mass

return MixtureDependentVars(
temperature=temperature,
pressure=self.pressure(cv, temperature),
speed_of_sound=self.sound_speed(cv, temperature),
species_enthalpies=self.species_enthalpies(cv, temperature),
smoothness_mu=smoothness_mu
smoothness_mu=smoothness_mu,
smoothness_kappa=smoothness_kappa,
smoothness_beta=smoothness_beta
)


Expand Down
Loading

0 comments on commit 390d18c

Please sign in to comment.