Skip to content

Commit

Permalink
Cosmetic changes; fix header docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tulioricci committed Jan 7, 2024
1 parent dc8c5aa commit 91468e7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mirgecom/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class MixtureAveragedTransport(TransportModel):

def __init__(self, pyrometheus_mech, alpha=0.6, factor=1.0, lewis=None,
epsilon=1e-4, singular_diffusivity=1e-6):
r"""Initialize power law coefficients and parameters.
r"""Initialize mixture averaged transport coefficients and parameters.
Parameters
----------
Expand Down
34 changes: 34 additions & 0 deletions test/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def inf_norm(x):
for pressin in ([0.25, 1.0]):
for tempin in ([300.0, 600.0, 900.0, 1200.0, 1500.0, 1800.0, 2100.0]):

<<<<<<< Updated upstream
print(f"Testing (t,P) = ({tempin}, {pressin})")

# Loop over each individual species by making a single-species mixture
Expand All @@ -108,6 +109,17 @@ def inf_norm(x):
cantera_soln.Y = name + ":1"

can_t, can_rho, can_y = cantera_soln.TDY
=======
cantera_soln.TP = tempin, pressin*cantera.one_atm
print(f"Testing (T, P) = ({cantera_soln.T}, {cantera_soln.P})")

# Loop over each individual species by making a single-species mixture
for i, name in enumerate(cantera_soln.species_names):
cantera_soln.Y = name + ":1"

can_t, can_rho, can_y = cantera_soln.TDY
can_p = cantera_soln.P
>>>>>>> Stashed changes
tin = can_t * ones
rhoin = can_rho * ones
yin = can_y * ones
Expand All @@ -119,10 +131,20 @@ def inf_norm(x):

fluid_state = make_fluid_state(cv, gas_model, tin)

<<<<<<< Updated upstream
# Viscosity
mu = fluid_state.tv.viscosity
mu_ct = cantera_soln.species_viscosities
err_mu = inf_norm(mu - mu_ct[i])
=======
assert inf_norm(fluid_state.temperature - tempin)/tempin < 1e-12
assert inf_norm(fluid_state.pressure - can_p)/can_p < 1e-12

# Viscosity
mu = fluid_state.tv.viscosity
mu_ct = cantera_soln.species_viscosities
err_mu = inf_norm(mu) - mu_ct[i]
>>>>>>> Stashed changes
assert err_mu < 1.0e-12

# Thermal conductivity
Expand Down Expand Up @@ -170,18 +192,30 @@ def inf_norm(x):
# Viscosity
mu = fluid_state.tv.viscosity
mu_ct = cantera_soln.viscosity
<<<<<<< Updated upstream
err_mu = inf_norm(mu - mu_ct)
assert err_mu < 1.0e-12
=======
assert inf_norm(mu - mu_ct) < 1.0e-12
>>>>>>> Stashed changes

# Thermal conductivity
kappa = fluid_state.tv.thermal_conductivity
kappa_ct = cantera_soln.thermal_conductivity
<<<<<<< Updated upstream
err_kappa = inf_norm(kappa - kappa_ct)
assert err_kappa < 1.0e-12
=======
assert inf_norm(kappa - kappa_ct) < 1.0e-12
>>>>>>> Stashed changes

# Species diffusivities
diff = fluid_state.tv.species_diffusivity
diff_ct = cantera_soln.mix_diff_coeffs
for i in range(nspecies):
<<<<<<< Updated upstream
err_diff = inf_norm(diff[i] - diff_ct[i])
assert err_diff < 1.0e-11
=======
assert inf_norm(diff[i] - diff_ct[i]) < 1.0e-11
>>>>>>> Stashed changes

0 comments on commit 91468e7

Please sign in to comment.