NcHIPertTwoFluids

NcHIPertTwoFluids — Perturbation object for a two fluids system.

Types and Values

Object Hierarchy

    GEnum
    ╰── NcHIPertTwoFluidsVars
    GObject
    ╰── NcHIPert
        ╰── NcHIPertTwoFluids

Description

This object provides the computation of the two fluid system of cosmological perturbations. This problem is decribed by two fluids with energy density and pressure given respectively by $\bar{\rho}_i$ and $\bar{p}_i$ for $i = 1,2$.

The system is written in terms of the gauge invariant variable $$\zeta \equiv \Psi - \frac{2\bar{K}}{\kappa(\bar{\rho} + \bar{p})} + E\mathcal{V},$$ and the entropy mode $$S = \frac{\kappa\varpi}{x^3 H}(\mathcal{U}_1 - \mathcal{U}_2),$$ where $\mathcal{U}_i \equiv \psi + E\mathcal{V}_i$ and $$\varpi \equiv \frac{(\bar{\rho}_1+\bar{p}_1)(\bar{\rho}_2+\bar{p}_2)}{\bar{\rho}+\bar{p}}.$$

Their momentum are \begin{split} P_\zeta &= \frac{2\bar{D}^2_\bar{K}\Psi}{x^3E}, \\ P_S &= \frac{\delta\rho_2}{\bar{\rho}_2+\bar{p}_2} - \frac{\delta\rho_1}{\bar{\rho}_1 + \bar{p}_1}. \end{split}

The equations of motion in their first order form are \begin{align} \zeta^\prime &= \frac{P_\zeta}{m_\zeta} + Y S, \\ P_\zeta^\prime &= -m_\zeta\mu_\zeta^2\zeta, \\ S^\prime &= \frac{P_S}{m_S} + Y \zeta, \\ P_S^\prime &= -m_S\mu_S^2S. \end{align} The mass $m_\zeta$ and the frequency $\mu_\zeta$ are defined by \begin{align} m_\zeta &= \frac{3\Delta_\bar{K}(\bar{\rho} + \bar{p})}{\rho_\text{crit0} N x^3 c_s^2 E^2}, \\ \mu_\zeta^2 &= x^2N^2c_s^2k^2, \\ m_S &= \frac{x^3}{c_m^2\varpi N}, \\ \mu_S^2 &= x^2N^2c_m^2k^2, \\ Y &= \frac{c_n^2}{c_s^2c_m^2}\frac{1}{m_\zeta m_S \Delta_\bar{K} N E}. \end{align} where $\bar{\rho} + \bar{p}$ is the background total energy density plus pressure, $E^2 = H^2/H_0^2$ is the dimensionless Hubble function squared (nc_hicosmo_E2()), $c_s^2$ the speed of sound, $N$ is the lapse function that in this case (using $\alpha$ as time variable) is $N \equiv \vert{}E\vert^{-1}$, $\rho_\text{crit0}$ is the critical density today defined by $\rho_\text{crit0} \equiv 3H_0^2/\kappa$ and $$\Delta_\bar{K} \equiv \frac{k^2}{k^2 + \Omega_{k0}}.$$

Functions

nc_hipert_two_fluids_new ()

NcHIPertTwoFluids *
nc_hipert_two_fluids_new (void);

Creates a new NcHIPertTwoFluids object.

Returns

a new NcHIPertTwoFluids.

[transfer full]


nc_hipert_two_fluids_ref ()

NcHIPertTwoFluids *
nc_hipert_two_fluids_ref (NcHIPertTwoFluids *ptf);

Increases the reference count of ptf .

Parameters

ptf

a NcHIPertTwoFluids.

 

Returns

ptf .

[transfer full]


nc_hipert_two_fluids_free ()

void
nc_hipert_two_fluids_free (NcHIPertTwoFluids *ptf);

Decreases the reference count of ptf .

Parameters

ptf

a NcHIPertTwoFluids.

 

nc_hipert_two_fluids_clear ()

void
nc_hipert_two_fluids_clear (NcHIPertTwoFluids **ptf);

Decreases the reference count of *ptf and sets *ptf to NULL.

Parameters

ptf

a NcHIPertTwoFluids.

 

nc_hipert_two_fluids_prepare_wkb_zeta ()

void
nc_hipert_two_fluids_prepare_wkb_zeta (NcHIPertTwoFluids *ptf,
                                       NcHICosmo *cosmo,
                                       gdouble prec,
                                       gdouble alpha_i,
                                       gdouble alpha_f);

Prepare the zeta component of the object for WKB calculations using the cosmology cosmo .

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

prec

Required precision.

 

alpha_i

initial log-redshift time.

 

alpha_f

final log-redshift time.

 

nc_hipert_two_fluids_prepare_wkb_S ()

void
nc_hipert_two_fluids_prepare_wkb_S (NcHIPertTwoFluids *ptf,
                                    NcHICosmo *cosmo,
                                    gdouble prec,
                                    gdouble alpha_i,
                                    gdouble alpha_f);

Prepare the zeta component of the object for WKB calculations using the cosmology cosmo .

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

prec

Required precision.

 

alpha_i

initial log-redshift time.

 

alpha_f

final log-redshift time.

 

nc_hipert_two_fluids_nuA ()

gdouble
nc_hipert_two_fluids_nuA (NcHIPertTwoFluids *ptf,
                          NcHICosmo *cosmo,
                          gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_nuB ()

gdouble
nc_hipert_two_fluids_nuB (NcHIPertTwoFluids *ptf,
                          NcHICosmo *cosmo,
                          gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_YAB ()

gdouble
nc_hipert_two_fluids_YAB (NcHIPertTwoFluids *ptf,
                          NcHICosmo *cosmo,
                          gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_LA ()

gdouble
nc_hipert_two_fluids_LA (NcHIPertTwoFluids *ptf,
                         NcHICosmo *cosmo,
                         gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_LB ()

gdouble
nc_hipert_two_fluids_LB (NcHIPertTwoFluids *ptf,
                         NcHICosmo *cosmo,
                         gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_nuzeta2 ()

gdouble
nc_hipert_two_fluids_nuzeta2 (NcHIPertTwoFluids *ptf,
                              NcHICosmo *cosmo,
                              gdouble alpha);

nc_hipert_two_fluids_nuS2 ()

gdouble
nc_hipert_two_fluids_nuS2 (NcHIPertTwoFluids *ptf,
                           NcHICosmo *cosmo,
                           gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_laq2 ()

gdouble
nc_hipert_two_fluids_laq2 (NcHIPertTwoFluids *ptf,
                           NcHICosmo *cosmo,
                           gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_lazeta2 ()

gdouble
nc_hipert_two_fluids_lazeta2 (NcHIPertTwoFluids *ptf,
                              NcHICosmo *cosmo,
                              gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_nuplus2 ()

gdouble
nc_hipert_two_fluids_nuplus2 (NcHIPertTwoFluids *ptf,
                              NcHICosmo *cosmo,
                              gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_numinus2 ()

gdouble
nc_hipert_two_fluids_numinus2 (NcHIPertTwoFluids *ptf,
                               NcHICosmo *cosmo,
                               gdouble alpha);

FIXME

Return: FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

nc_hipert_two_fluids_eom_full ()

void
nc_hipert_two_fluids_eom_full (NcHIPertTwoFluids *ptf,
                               NcHICosmo *cosmo,
                               gdouble alpha,
                               NcHIPertITwoFluidsEOM **eom_full);

FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

eom_full

Equation of motion variables.

[out][transfer none]

nc_hipert_two_fluids_wkb_zeta ()

void
nc_hipert_two_fluids_wkb_zeta (NcHIPertTwoFluids *ptf,
                               NcHICosmo *cosmo,
                               gdouble alpha,
                               gdouble *Re_zeta,
                               gdouble *Im_zeta);

Computes the WKB solution $\zeta_\text{WKB}$ for the mode $k$ at the time $\alpha$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

the log-redshift time.

 

Re_zeta

Real part of the wkb solution.

[out caller-allocates]

Im_zeta

Imaginary part of the wkb solution.

[out caller-allocates]

nc_hipert_two_fluids_wkb_zeta_Pzeta ()

void
nc_hipert_two_fluids_wkb_zeta_Pzeta (NcHIPertTwoFluids *ptf,
                                     NcHICosmo *cosmo,
                                     gdouble alpha,
                                     gdouble *Re_zeta,
                                     gdouble *Im_zeta,
                                     gdouble *Re_Pzeta,
                                     gdouble *Im_Pzeta);

Computes the WKB solution $\zeta_\text{WKB}$ and its momentum for the mode $k$ at the time $\alpha$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

the log-redshift time.

 

Re_zeta

Real part of the wkb solution.

[out caller-allocates]

Im_zeta

Imaginary part of the wkb solution.

[out caller-allocates]

Re_Pzeta

Real part of the wkb solution momentum.

[out caller-allocates]

Im_Pzeta

Imaginary part of the wkb solution momentum.

[out caller-allocates]

nc_hipert_two_fluids_wkb_Q ()

void
nc_hipert_two_fluids_wkb_Q (NcHIPertTwoFluids *ptf,
                            NcHICosmo *cosmo,
                            gdouble alpha,
                            gdouble *Re_Q,
                            gdouble *Im_Q);

Computes the WKB solution $Q_\text{WKB}$ for the mode $k$ at the time $\alpha$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

the log-redshift time.

 

Re_Q

Real part of the wkb solution.

[out caller-allocates]

Im_Q

Imaginary part of the wkb solution.

[out caller-allocates]

nc_hipert_two_fluids_wkb_Q_PQ ()

void
nc_hipert_two_fluids_wkb_Q_PQ (NcHIPertTwoFluids *ptf,
                               NcHICosmo *cosmo,
                               gdouble alpha,
                               gdouble *Re_Q,
                               gdouble *Im_Q,
                               gdouble *Re_PQ,
                               gdouble *Im_PQ);

Computes the WKB solution $Q_\text{WKB}$ and its momentum for the mode $k$ at the time $\alpha$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

the log-redshift time.

 

Re_Q

Real part of the wkb solution.

[out caller-allocates]

Im_Q

Imaginary part of the wkb solution.

[out caller-allocates]

Re_PQ

Real part of the wkb solution momentum.

[out caller-allocates]

Im_PQ

Imaginary part of the wkb solution momentum.

[out caller-allocates]

nc_hipert_two_fluids_wkb_full_zeta ()

void
nc_hipert_two_fluids_wkb_full_zeta (NcHIPertTwoFluids *ptf,
                                    NcHICosmo *cosmo,
                                    gdouble alpha,
                                    gdouble **vars);

Computes the approximated solution for the mode $Q$ and its momentum for the mode $k$ at the time $\alpha$ using the solution for the mode $\zeta$ present in vars .

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

the log-redshift time.

 

vars

Perturbations variables conforming to NcHIPertTwoFluidsVars.

[inout][array fixed-size=8][element-type double]

nc_hipert_two_fluids_wkb_full_Q ()

void
nc_hipert_two_fluids_wkb_full_Q (NcHIPertTwoFluids *ptf,
                                 NcHICosmo *cosmo,
                                 gdouble alpha,
                                 gdouble **vars);

Computes the approximated solution for the mode $\zeta$ and its momentum for the mode $k$ at the time $\alpha$ using the solution for the mode $Q$ present in vars .

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

the log-redshift time.

 

vars

Perturbations variables conforming to NcHIPertTwoFluidsVars.

[inout][array fixed-size=8][element-type double]

nc_hipert_two_fluids_wkb_zeta_maxtime ()

gdouble
nc_hipert_two_fluids_wkb_zeta_maxtime (NcHIPertTwoFluids *ptf,
                                       NcHICosmo *cosmo,
                                       gdouble alpha0,
                                       gdouble alpha1);

Search for the root of $\nu_A^2$ between $\alpha_0$ and $\alpha_1$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha0

the initial log-redshift time.

 

alpha1

the final log-redshift time.

 

Returns

the root of $\nu_A^2$ between $\alpha_0$ and $\alpha_1$ or NaN if not found.


nc_hipert_two_fluids_wkb_S_maxtime ()

gdouble
nc_hipert_two_fluids_wkb_S_maxtime (NcHIPertTwoFluids *ptf,
                                    NcHICosmo *cosmo,
                                    gdouble alpha0,
                                    gdouble alpha1);

Search for the root of $\nu_B^2$ between $\alpha_0$ and $\alpha_1$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha0

the initial log-redshift time.

 

alpha1

the final log-redshift time.

 

Returns

the root of $\nu_B^2$ between $\alpha_0$ and $\alpha_1$ or NaN if not found.


nc_hipert_two_fluids_wkb_zeta_maxtime_prec ()

gdouble
nc_hipert_two_fluids_wkb_zeta_maxtime_prec
                               (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                NcHIPertWKBCmp cmp,
                                gdouble prec,
                                gdouble alpha0,
                                gdouble alpha1);

Search for the instant at which the WKB approximation starts to fails within the asked precision.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

cmp

Comparison type.

 

prec

Required precision.

 

alpha0

the initial log-redshift time.

 

alpha1

the final log-redshift time.

 

Returns

the instant $\alpha$ between $\alpha_0$ and $\alpha_1$ or NaN if not found.


nc_hipert_two_fluids_wkb_S_maxtime_prec ()

gdouble
nc_hipert_two_fluids_wkb_S_maxtime_prec
                               (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                NcHIPertWKBCmp cmp,
                                gdouble prec,
                                gdouble alpha0,
                                gdouble alpha1);

Search for the instant at which the WKB approximation starts to fails within the asked precision.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

cmp

Comparison type.

 

prec

Required precision.

 

alpha0

the initial log-redshift time.

 

alpha1

the final log-redshift time.

 

Returns

the instant $\alpha$ between $\alpha_0$ and $\alpha_1$ or NaN if not found.


nc_hipert_two_fluids_set_init_cond ()

void
nc_hipert_two_fluids_set_init_cond (NcHIPertTwoFluids *ptf,
                                    NcHICosmo *cosmo,
                                    gdouble alphai,
                                    gdouble *vars);

Sets the initial conditions for the two fluids system evolution.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alphai

the log-redshift time.

 

vars

Perturbations variables conforming to NcHIPertTwoFluidsVars.

[in][array fixed-size=8][element-type double]

nc_hipert_two_fluids_set_init_cond_wkb_zeta ()

void
nc_hipert_two_fluids_set_init_cond_wkb_zeta
                               (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                gdouble alphai);

Sets the initial conditions for the system evolution using the value of the WKB solution at alphai with main mode $\zeta$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alphai

the log-redshift time.

 

nc_hipert_two_fluids_set_init_cond_wkb_Q ()

void
nc_hipert_two_fluids_set_init_cond_wkb_Q
                               (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                gdouble alphai);

Sets the initial conditions for the system evolution using the value of the WKB solution at alphai with main mode $Q$.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alphai

the log-redshift time.

 

nc_hipert_two_fluids_evolve ()

void
nc_hipert_two_fluids_evolve (NcHIPertTwoFluids *ptf,
                             NcHICosmo *cosmo,
                             gdouble alphaf);

Evolve the system until alphaf .

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alphaf

the final log-redshift time.

 

nc_hipert_two_fluids_get_values ()

void
nc_hipert_two_fluids_get_values (NcHIPertTwoFluids *ptf,
                                 gdouble *alphai,
                                 gdouble **vars);

Get the current time and values of the numerical solution.

Parameters

ptf

a NcHIPertTwoFluids.

 

alphai

Current time.

[out caller-allocates]

vars

Perturbations variables conforming to NcHIPertTwoFluidsVars.

[inout][array fixed-size=8][element-type double]

Types and Values

enum NcHIPertTwoFluidsVars

Perturbation variables enumerator.

Members

NC_HIPERT_TWO_FLUIDS_RE_ZETA

$\text{Re}(\zeta)$

 

NC_HIPERT_TWO_FLUIDS_IM_ZETA

$\text{Im}(\zeta)$

 

NC_HIPERT_TWO_FLUIDS_RE_PZETA

$\text{Re}(P_\zeta)$

 

NC_HIPERT_TWO_FLUIDS_IM_PZETA

$\text{Im}(P_\zeta)$

 

NC_HIPERT_TWO_FLUIDS_RE_Q

$\text{Re}(Q)$

 

NC_HIPERT_TWO_FLUIDS_IM_Q

$\text{Im}(Q)$

 

NC_HIPERT_TWO_FLUIDS_RE_PQ

$\text{Re}(P_Q)$

 

NC_HIPERT_TWO_FLUIDS_IM_PQ

$\text{Im}(P_Q)$