pttools.bubble.quantities

Functions for calculating quantities derived from solutions

TODO: Should this be renamed as thermodynamics?

Functions

pttools.bubble.quantities.de_from_w_bag(w, xi, v_wall, alpha_n)

Calculates energy density difference de = e - e[-1] from enthalpy, assuming bag equation of state. Can get alpha_n = find_alpha_n_from_w_xi(w,xi,v_wall,alpha_p)

Parameters:
  • w (ndarray) – \(w\)

  • xi (ndarray) – \(\xi\)

  • v_wall (float) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

Returns:

energy density difference de

Return type:

ndarray

pttools.bubble.quantities.de_from_w_new_bag(v, w, xi, v_wall, alpha_n)

For exploring new methods of calculating energy density difference from velocity and enthalpy, assuming bag equation of state.

Parameters:
  • v (ndarray) – \(v\)

  • w (ndarray) – \(w\)

  • xi (ndarray) – \(\xi\)

  • v_wall (float) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

Returns:

energy density difference de

Return type:

ndarray

pttools.bubble.quantities.get_kappa_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT, verbosity=0)

Efficiency factor \(\kappa\) from \(v_\text{wall}\) and \(\alpha_n\).

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – number of \(\xi\) points

  • verbosity (int) – logging verbosity

Returns:

efficiency factor \(\kappa\)

Return type:

float | float64 | ndarray

pttools.bubble.quantities.get_kappa_de_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT, verbosity=0)

Calculates efficiency factor \(\kappa\) and fractional change in energy from \(v_\text{wall}\) and \(\alpha_n\). \(v_\text{wall}\) can be an array. Sum should be 0 (bag model).

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – number of \(\xi\) points

  • verbosity (int) – logging verbosity

Returns:

\(\kappa, de\)

Return type:

Tuple[float, float] | Tuple[ndarray, ndarray]

pttools.bubble.quantities.get_kappa_dq_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT, verbosity=0)

Calculates efficiency factor \(\kappa\) and fractional change in thermal energy from \(v_\text{wall}\) and \(\alpha_n\). \(v_\text{wall}\) can be an array. Sum should be 1. Thermal energy is defined as \(q = \frac{3}{4} \text{enthalpy}\).

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – number of \(\xi\) points

  • verbosity (int) – logging verbosity

Returns:

\(\kappa\), dq

Return type:

Tuple[float, float] | Tuple[ndarray, ndarray]

pttools.bubble.quantities.get_ke_de_frac_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT, verbosity=0)

Kinetic energy fraction and fractional change in energy from wall velocity array. Sum should be 0. Assumes bag model.

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – number of \(\xi\) points

  • verbosity (int) – logging verbosity

Returns:

kinetic energy fraction, fractional change in energy

Return type:

Tuple[float, float] | Tuple[ndarray, ndarray]

pttools.bubble.quantities.get_ke_frac_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT)

Determine kinetic energy fraction (of total energy). Bag equation of state only so far, as it takes \(e_n = \frac{3}{4} w_n (1 + \alpha_n)\). This assumes zero trace anomaly in broken phase.

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – number of \(\xi\) points

Returns:

kinetic energy fraction

Return type:

float | float64 | ndarray

pttools.bubble.quantities.get_ke_frac_new_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT, verbosity=0)

Determine kinetic energy fraction (of total energy). Bag equation of state only so far, as it takes \(e_n = \frac{3}{4} w_n (1 + \alpha_n)\). This assumes zero trace anomaly in broken phase.

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – number of \(\xi\) points

  • verbosity (int) – logging verbosity

Returns:

kinetic energy fraction

Return type:

float | float64 | ndarray

pttools.bubble.quantities.get_ubarf2_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT, verbosity=0)

Get mean square fluid velocity from \(v_\text{wall}\) and \(\alpha_n\).

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – number of \(\xi\) points

  • verbosity (int) – logging verbosity

Returns:

mean square fluid velocity

Return type:

float | float64 | ndarray | callable | CPUDispatcher

pttools.bubble.quantities.get_ubarf2_new_bag(v_wall, alpha_n, n_xi=const.N_XI_DEFAULT, verbosity=0)

Get mean square fluid velocity from \(v_\text{wall}\) and \(\alpha_n\).

Parameters:
  • v_wall (float | float64 | ndarray) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • n_xi (int) – not used

  • verbosity (int) – logging verbosity

Returns:

mean square fluid velocity

Return type:

float | float64 | ndarray

pttools.bubble.quantities.mean_energy_change_bag(v, w, xi, v_wall, alpha_n)

Bubble-averaged change in energy density in bubble relative to outside value.

Parameters:
  • v (ndarray) – \(v\)

  • w (ndarray) – \(w\)

  • xi (ndarray) – \(\xi\)

  • v_wall (float) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

Returns:

mean energy change

Return type:

float

pttools.bubble.quantities.mean_enthalpy_change(v, w, xi, v_wall)

Mean change in enthalpy in bubble relative to outside value.

Parameters:
  • v (ndarray) – \(v\)

  • w (ndarray) – \(w\)

  • xi (ndarray) – \(\xi\)

  • v_wall (float) – \(v_\text{wall}\)

Returns:

mean enthalpy change

Return type:

float

pttools.bubble.quantities.mean_kinetic_energy(v, w, xi, v_wall)

Kinetic energy of fluid in bubble, averaged over bubble volume, from fluid shell functions.

Parameters:
  • v (ndarray) – \(v\)

  • w (ndarray) – \(w\)

  • xi (ndarray) – \(\xi\)

  • v_wall (float) – \(v_\text{wall}\)

Returns:

mean kinetic energy

Return type:

float

pttools.bubble.quantities.part_integrate(func, v, w, xi, where_in)

Integrate a function func of arrays \(v, w, \xi\) over index selection where_in.

Parameters:
Return type:

float

pttools.bubble.quantities.split_integrate(func, v, w, xi, v_wall)

Split an integration of a function func of arrays \(v, w, \xi\) according to whether \(\xi\) is inside or outside the wall (expecting discontinuity there).

Parameters:
Return type:

Tuple[float, float]

pttools.bubble.quantities.ubarf_squared(v, w, xi, v_wall)

Enthalpy-weighted mean square space components of 4-velocity of fluid in bubble, from fluid shell functions.

Parameters:
  • v (ndarray) – \(v\)

  • w (ndarray) – \(w\)

  • xi (ndarray) – \(\xi\)

  • v_wall (float) – \(v_\text{wall}\)

Return type:

float