pttools.bubble.thermo

Thermodynamic quantities

The code for the integrals doesn’t have the pre-factor \(4\pi\), since the integrals are computed with respect to \(\xi^3\), which is equivalent.

The volume-averaged and bubble volume averaged quantities are different, and should not be confused with each other.

The integrals are computed using the trapezoidal rule and with respect to \(\xi^3\), since the functions are constant outside the bubble, where the functions are constant, but very few points are given. This scheme gives the correct results for these ranges, as the trapezoidal rule computes the integral of a constant function exactly, even when only the endpoints are given. If the integrals were with respect to \(\xi\), the functions would have the factor \(\xi^2\), which would break this useful property and require a more dense grid of points.

Functions

pttools.bubble.thermo.ebar(model, wn)

Energy is conserved, and therefore \(\bar{e}=e_n\).

Parameters:
  • model (Model)

  • wn (float)

Return type:

float

pttools.bubble.thermo.entropy_density_diff(model, w, xi, v_wall, phase=None)

Bubble volume averaged entropy density

\[\frac{3}{4\pi v_w^3} {s}_\text{avg}\]

Parameters:
Return type:

float

pttools.bubble.thermo.kappa(model, v, w, xi, v_wall, delta_e_theta=None)

Kinetic efficiency factor

\[\kappa = \frac{e_K}{\lvert\Delta {e}_\theta\rvert}\]

Parameters:
Return type:

float

Examples using pttools.bubble.thermo.kappa

Giese testing 3

Giese testing 3
pttools.bubble.thermo.kappa_approx(alpha_n)

Approximate kinetic efficiency factor

Parameters:

alpha_n (float | float64 | ndarray)

Return type:

float | float64 | ndarray

pttools.bubble.thermo.kinetic_energy_density(v, w, xi, v_wall)

Bubble volume averaged kinetic energy density

\[\frac{3}{4\pi {v}_w^3} \Delta {e}_Q\]

Parameters:
Return type:

float

Examples using pttools.bubble.thermo.kinetic_energy_density

Giese testing 3

Giese testing 3
pttools.bubble.thermo.kinetic_energy_fraction(ek_bva, eb)

Bubble volume averaged kinetic energy fraction

\[K_\text{bva} = \frac{e_{K,\text{bva}}}{\bar{e}}\]

Parameters:
  • ek_bva (float)

  • eb (float)

Return type:

float

pttools.bubble.thermo.mean_adiabatic_index(wb, eb)

Mean adiabatic index

\[\Gamma = \frac{\bar{w}}{\bar{e}}\]

Parameters:
Return type:

float | float64 | ndarray

pttools.bubble.thermo.omega(model, w, xi, v_wall, delta_e_theta=None)

Thermal efficiency factor

\[\omega = \frac{\Delta {e}_Q}{\Delta {e}_\theta}\]

Parameters:
Return type:

float

pttools.bubble.thermo.thermal_energy_density(v_wall, eqp)

Bubble volume averaged thermal energy density after the phase transition

\[{e}_Q' = {e}_Q + {e}_\theta - {e}_K' - {e}_\theta' = 4\pi \int_0^{{\xi}_\text{max}} d\xi \xi^2 \frac{3}{4} {w}_n - {e}_K' - \Delta {e}_\theta\]

Parameters:
  • v_wall (float)

  • eqp (float)

Return type:

float

pttools.bubble.thermo.thermal_energy_density_diff(w, xi, v_wall)

Bubble volume averaged thermal energy density difference

Parameters:
Return type:

float

pttools.bubble.thermo.thermal_energy_fraction(eq_bva, eb)

Thermal energy fraction \(\frac{e_Q'}{\bar{e}}\)

Parameters:
  • eq_bva (float | float64 | ndarray) – thermal energy density \(e_Q'\)

  • eb (float | float64 | ndarray) – average energy density \(\bar{e}\)

Returns:

thermal energy fraction

Return type:

float | float64 | ndarray

pttools.bubble.thermo.trace_anomaly_diff(model, w, xi, v_wall, phase=None)

Bubble volume averaged trace anomaly

\[\epsilon = \frac{3}{4\pi {v}_w^3} \Delta {e}_\theta\]

Parameters:
Return type:

float

pttools.bubble.thermo.ubarf2(v, w, xi, v_wall, ek_bva=None)

Enthalpy-weighted mean square fluid 4-velocity around the bubble

\[\bar{U}_f^2 = \frac{3}{4\pi \bar{w} v_w^3} e_K\]

Presumes that w[-1] = wn = wbar

Parameters:
Return type:

float

pttools.bubble.thermo.va_enthalpy_density(eq)

Volume-averaged enthalpy density

Parameters:

eq (float)

Return type:

float

pttools.bubble.thermo.va_entropy_density_diff(model, w, xi, v_wall, phase=None)

Volume-averaged entropy density

\[{s}_\text{avg} = \int d\xi \xi^2 (s(w,\phi) - s(w_n, \phi_s)\]

Parameters:
Return type:

float

pttools.bubble.thermo.va_kinetic_energy_density(v, w, xi)

Volume-averaged kinetic energy density

\[{e}_K = 4 \pi \int_0^{{\xi}_\text{max}} d\xi \xi^2 w \gamma^2 v^2\]
Each point is multiplied by \(v\), and therefore having \({\xi}_{max}\) too far does not affect the results. Hindmarsh et al., 2019 eq. B.22

Parameters:
Returns:

\(e_K\)

Return type:

float

pttools.bubble.thermo.va_kinetic_energy_fraction(ek_va, eb)

Volume-averaged kinetic energy fraction

\[K_\text{va} = \frac{e_{K,\text{va}}}{\bar{e}}\]

Parameters:
  • ek_va (float)

  • eb (float)

Return type:

float

pttools.bubble.thermo.va_thermal_energy_density(v_shock, wn, ek, delta_e_theta)

Volume-averaged thermal energy density after the phase transition

\[{e}_Q' = {e}_Q + {e}_\theta - {e}_K' - {e}_\theta' = 4\pi \int_0^{{\xi}_\text{max}} d\xi \xi^2 \frac{3}{4} {w}_n - {e}_K' - \Delta {e}_\theta\]

Parameters:
  • v_shock (float)

  • wn (float)

  • ek (float)

  • delta_e_theta (float)

Return type:

float

pttools.bubble.thermo.va_thermal_energy_density_diff(w, xi)

Volume-averaged thermal energy density

\[\Delta e_Q = 4 \pi \int_0^{\xi_\text{max}} d\xi \xi^2 \frac{3}{4} (w - w_n)\]

Parameters:
Return type:

float

pttools.bubble.thermo.va_thermal_energy_fraction(eq_va, eb)

Volume-averaged kinetic energy fraction

\[Q_\text{va} = \frac{e_{Q,\text{va}}}{\bar{e}}\]

Parameters:
  • eq_va (float)

  • eb (float)

pttools.bubble.thermo.va_trace_anomaly_diff(model, w, xi, v_wall, phase=None)

Volume-averaged trace anomaly difference

\[\Delta {e}_\theta = 4 \pi \int_0^{{\xi}_\text{max}} d\xi \xi^2 (\theta - {\theta}_n)\]

Parameters:
Return type:

float

Examples using pttools.bubble.thermo.va_trace_anomaly_diff

Giese testing 3

Giese testing 3
pttools.bubble.thermo.wbar(w, xi, v_wall, wn)

Average enthalpy density \(\bar{w}\)

Parameters:
Return type:

float