WallGo.hydrodynamicsTemplateModel.HydrodynamicsTemplateModel

class HydrodynamicsTemplateModel(thermodynamics, rtol=1e-06, atol=1e-10)[source]

Bases: object

Class for solving the matching equations and computing vw in LTE by fitting to the template model, where the speeds of sound are assumed to be constant. This generally offers a good approximation to realistic models, while being much faster to treat.

References

[GKSvdV20]

Felix Giese, Thomas Konstandin, Kai Schmitz and Jorinde van de Vis Model-independent energy budget for LISA arXiv:2010.09744 (2020)

[ALvdV23] (1,2,3,4,5)

Wen-Yuan Ai, Benoit Laurent, and Jorinde van de Vis. Model-independent bubble wall velocities in local thermal equilibrium. arXiv:2303.10171 (2023).

NOTE: We use the conventions that the velocities are always positive, even in the wall frame (vp and vm). These conventions are consistent with the literature, e.g. with arxiv:1004.4187. These conventions differ from the conventions used in the EOM and Boltzmann part of the code. The conversion is made in findHydroBoundaries.

Initialize the HydroTemplateModel class. Computes \(\alpha_n,\ \Psi_n,\ c_s,\ c_b\) and other thermodynamics quantities (see [ALvdV23] for the definitions of these variables).

Parameters:
  • thermodynamics (class)

  • rtol (float, optional) – Default value is 1e-6.

  • atol (float, optional) – Default value is 1e-10.

Return type:

None

__init__(thermodynamics, rtol=1e-06, atol=1e-10)[source]

Initialize the HydroTemplateModel class. Computes \(\alpha_n,\ \Psi_n,\ c_s,\ c_b\) and other thermodynamics quantities (see [ALvdV23] for the definitions of these variables).

Parameters:
  • thermodynamics (class)

  • rtol (float, optional) – Default value is 1e-6.

  • atol (float, optional) – Default value is 1e-10.

Return type:

None

Methods

__init__(thermodynamics[, rtol, atol])

Initialize the HydroTemplateModel class.

detonationVAndT(vw)

Computes \(v_-,\ v_+,\ T_-,\ T_+\) for a detonation solution.

efficiencyFactor(vw)

Computes the efficiency factor \(\kappa=\frac{4}{v_w^3 \alpha_n w_n}\int d\xi \xi^2 v^2\gamma^2 w\)..

findHydroBoundaries(vwTry)

Returns \(c_1, c_2, T_+, T_-\) for a given wall velocity and nucleation temperature.

findJouguetVelocity([alN])

Finds the Jouguet velocity, corresponding to the phase transition strength \(\alpha_n\), using \(v_J = c_b \frac{1 + \sqrt{3 \alpha_n(1 - c_b^2 + 3 c_b^2 \alpha_n)}} {1+ 3 c_b^2 \alpha_n}\) (eq.

findMatching(vw)

Computes \(v_-,\ v_+,\ T_-,\ T_+\) for a deflagration or hybrid solution when the wall velocity is vw.

findvwLTE()

Computes the wall velocity for a deflagration or hybrid solution.

getVp(vm, al[, branch])

Solves the matching equation for \(v_+\).

integratePlasma(v0, vw, wp[, shockWave])

Integrates the fluid equations in the shock wave until it reaches the shock front.

matchDeflagOrHybInitial(vw, vp)

Returns initial guess [Tp, Tm] for the solver in the Hydrodynamics.matchDeflagOrHyb function by computing the corresponding quantities in the template models.

maxAl([upperLimit])

Computes the highest value of \(\alpha_n\) at which a hybrid solution can be found by finding the value that gives a solution with \(v_w=v_J\).

minVelocity()

Finds the minimum velocity that is possible for a given nucleation temperature.

solveAlpha(vw[, constraint])

Finds the value of \(\alpha_+\) that solves the matching equation at the wall by varying \(v_-\).

wFromAlpha(al)

Finds the enthlapy \(w_+\) corresponding to \(\alpha_+\) using the equation of state of the template model.

detonationVAndT(vw)[source]

Computes \(v_-,\ v_+,\ T_-,\ T_+\) for a detonation solution.

Parameters:

vw (float) – Wall velocity.

Returns:

  • vp (float) – Plasma velocity in front of the wall.

  • vm (float) – Plasma velocity behind the wall.

  • Tp (float) – Temperature in front of the wall.

  • Tm (float) – Temperature behind the wall.

Return type:

tuple[float, …]

efficiencyFactor(vw)[source]

Computes the efficiency factor \(\kappa=\frac{4}{v_w^3 \alpha_n w_n}\int d\xi \xi^2 v^2\gamma^2 w\)..

Parameters:

vw (float) – Wall velocity.

Returns:

Value of the efficiency factor \(\kappa\).

Return type:

float

findHydroBoundaries(vwTry)[source]

Returns \(c_1, c_2, T_+, T_-\) for a given wall velocity and nucleation temperature.

NOTE: the sign of c1 is chosen to match the convention for the fluid velocity used in EquationOfMotion and Hydrodynamics. In those conventions, vp would be negative, and therefore c1 has to be negative as well.

Parameters:

vwTry (float) – Wall velocity

Returns:

Tuple containing c1, c2, Tp, Tm and velocityMid. If the solver wasn’t able to find a solution, returns a tuple of None.

Return type:

tuple[float | None, …]

findJouguetVelocity(alN=None)[source]

Finds the Jouguet velocity, corresponding to the phase transition strength \(\alpha_n\), using \(v_J = c_b \frac{1 + \sqrt{3 \alpha_n(1 - c_b^2 + 3 c_b^2 \alpha_n)}} {1+ 3 c_b^2 \alpha_n}\) (eq. (25) of [ALvdV23]).

Parameters:

alN (float or None) – phase transition strength at the nucleation temperature, \(\alpha_n\). If \(\alpha_n\) is not specified, the value defined by the model is used. Default is None.

Returns:

vJ – The value of the Jouguet velocity.

Return type:

float

findMatching(vw)[source]

Computes \(v_-,\ v_+,\ T_-,\ T_+\) for a deflagration or hybrid solution when the wall velocity is vw.

Parameters:

vw (float) – Wall velocity at which to solve the matching equation.

Returns:

Tuple containing \(v_+\), \(v_-\), \(T_+\), \(T_-\) and velocityMid. If the solver wasn’t able to find a solution, returns a tuple of None.

Return type:

tuple[float | None, …]

findvwLTE()[source]

Computes the wall velocity for a deflagration or hybrid solution. Uses the method described in [ALvdV23].

Returns:

vwLTE – Wall velocity in local thermal equilibrium.

Return type:

float

getVp(vm, al, branch=-1)[source]

Solves the matching equation for \(v_+\).

Parameters:
  • vm (float) – Plasma velocity in the wall frame right behind the wall \(v_-\).

  • al (float) – phase transition strength at the temperature right in front of the wall \(\alpha_+\).

  • branch (int, optional) – Select the branch of the matching equation’s solution. Can either be 1 for detonation or -1 for deflagration/hybrid. Default is -1.

Returns:

vp – Plasma velocity in the wall frame right in front of the the wall \(v_+\).

Return type:

float

integratePlasma(v0, vw, wp, shockWave=True)[source]

Integrates the fluid equations in the shock wave until it reaches the shock front.

Parameters:
  • v0 (float) –

    Plasma velocity just in front of the wall (in the frame of the bubble’s

    center).

  • vw (float) – Wall velocity.

  • wp (float) – Enthalpy just in front of the wall.

  • shockWave (bool, optional) – If True, the integration happens in the shock wave. If False, it happens in the rarefaction wave. Default is True.

Returns:

  • Bunch object returned by the scipy function integrate.solve_ivp containing the

  • solution of the fluid equations.

Return type:

OptimizeResult

matchDeflagOrHybInitial(vw, vp)[source]

Returns initial guess [Tp, Tm] for the solver in the Hydrodynamics.matchDeflagOrHyb function by computing the corresponding quantities in the template models. See Refs. [GKSvdV20] and [ALvdV23] for details.

Parameters:
  • vw (float) – Wall velocity.

  • vp (float or None) – Plasma velocity in front of the wall \(v_+\). If None, vp is determined from conservation of entropy.

Returns:

List containing Tp and Tm, the temperature in front and behind the wall.

Return type:

list[float]

maxAl(upperLimit=100.0)[source]

Computes the highest value of \(\alpha_n\) at which a hybrid solution can be found by finding the value that gives a solution with \(v_w=v_J\).

Parameters:

upperLimit (float, optional) – Largest value of \(\alpha_n\) at which the solver will look. Default is 100.

Returns:

Maximal value for \(\alpha_n\). If the true value is above upperLimit, returns upperLimit.

Return type:

float

minVelocity()[source]

Finds the minimum velocity that is possible for a given nucleation temperature. It is found by shooting in vp with \(\alpha_+ = 1/3\) at the wall. This is the maximum value of \(\alpha_+\) possible. The wall velocity which yields \(\alpha_+ = 1/3\) for a given \(\alpha_N\) is the minimum possible wall velocity.

It is possible that no solution can be found, in this case there is no minimum value of the wall velocity and the function returns zero.

Returns:

vmin – The minimum value of the wall velocity for which a solution can be found

Return type:

float

solveAlpha(vw, constraint=True)[source]

Finds the value of \(\alpha_+\) that solves the matching equation at the wall by varying \(v_-\).

Parameters:
  • vw (float) – Wall velocity at which to solve the matching equation.

  • constraint (bool, optional) – If True, imposes \(v_+<\min(c_s^2/v_w,v_w)\) on the solution. Otherwise, the constraint \(v_+<v_-\) is used instead. Default is True.

Returns:

alp – Value of \(\alpha_+\) that solves the matching equation.

Return type:

float

wFromAlpha(al)[source]

Finds the enthlapy \(w_+\) corresponding to \(\alpha_+\) using the equation of state of the template model.

Parameters:

al (float) – alpha parameter at the temperature \(T_+\) in front of the wall \(\alpha_+\).

Returns:

\(w_+\).

Return type:

float