NcHIPertTwoFluids

NcHIPertTwoFluids — Perturbation object for a two fluids system.

Functions

Types and Values

Object Hierarchy

    GEnum
    ╰── NcHIPertTwoFluidsCross
    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_eom ()

void
nc_hipert_two_fluids_eom (NcHIPertTwoFluids *ptf,
                          NcHICosmo *cosmo,
                          gdouble alpha,
                          NcHIPertITwoFluidsEOM **eom);

FIXME

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alpha

log-redshift time.

 

eom

Equation of motion variables.

[out callee-allocates][transfer none]

nc_hipert_two_fluids_get_init_cond_QP ()

void
nc_hipert_two_fluids_get_init_cond_QP (NcHIPertTwoFluids *ptf,
                                       NcHICosmo *cosmo,
                                       gdouble alpha,
                                       guint main_mode,
                                       const gdouble beta_R,
                                       NcmVector *init_cond);

Calculates the initial condition for the $(Q,\,P)$ system with initial phase for the R solution $\beta_R = $ beta_R . The variable main_mode chooses which mode is excited (1 or 2).

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

alpha

the log-redshift time

 

main_mode

main mode

 

beta_R

mode $R$ initial phase

 

init_cond

a NcmVector (size >= 8) where to put the initial conditions

 

nc_hipert_two_fluids_get_init_cond_zetaS ()

void
nc_hipert_two_fluids_get_init_cond_zetaS
                               (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                gdouble alpha,
                                guint main_mode,
                                const gdouble beta_R,
                                NcmVector *init_cond);

Calculates the initial condition for the $\zeta{}S$ system with initial phase for the R solution $\beta_R = $ beta_R . The variable main_mode chooses which mode is excited (1 or 2).

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

alpha

the log-redshift time

 

main_mode

main mode

 

beta_R

mode $R$ initial phase

 

init_cond

a NcmVector (size >= 8) where to put the initial conditions

 

nc_hipert_two_fluids_set_init_cond ()

void
nc_hipert_two_fluids_set_init_cond (NcHIPertTwoFluids *ptf,
                                    NcHICosmo *cosmo,
                                    gdouble alpha,
                                    guint main_mode,
                                    gboolean useQP,
                                    NcmVector *init_cond);

Sets the initial conditions for the two fluids system evolution.

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

alpha

the log-redshift time

 

main_mode

main mode

 

useQP

whether to use the $(Q,\,P)$ system

 

init_cond

a NcmVector (size >= 8) containing the initial conditions

 

nc_hipert_two_fluids_to_zeta_s ()

void
nc_hipert_two_fluids_to_zeta_s (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                gdouble alpha,
                                NcmVector *state);

Transform in-place the variables init_cond from $(Q,\,P)$ to $(\zeta,\,S)$, assuming they are calculated at $\alpha$ = alpha .

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

alpha

the log-redshift time

 

state

a NcmVector (size >= 8) current state in $(Q,\,P)$ variables

 

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_peek_state ()

NcmVector *
nc_hipert_two_fluids_peek_state (NcHIPertTwoFluids *ptf,
                                 NcHICosmo *cosmo,
                                 gdouble *alpha);

Get the current time and values of the numerical solution.

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

alpha

current time.

[out]

Returns

current solution state.

[transfer none]


nc_hipert_two_fluids_evolve_array ()

NcmMatrix *
nc_hipert_two_fluids_evolve_array (NcHIPertTwoFluids *ptf,
                                   NcHICosmo *cosmo,
                                   gdouble alphaf);

Evolve the system until alphaf and store the results in an array.

Parameters

ptf

a NcHIPertTwoFluids.

 

cosmo

a NcHICosmo.

 

alphaf

the final log-redshift time.

 

Returns

a NcmMatrix.

[transfer full]


nc_hipert_two_fluids_set_init_cond_mode1sub ()

void
nc_hipert_two_fluids_set_init_cond_mode1sub
                               (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                gdouble alpha,
                                NcmVector *init_cond);

Sets the initial conditions for the two fluids system evolution.

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

alpha

the log-redshift time

 

init_cond

a NcmVector (size >= 4) containing the initial conditions

 

nc_hipert_two_fluids_evolve_mode1sub ()

void
nc_hipert_two_fluids_evolve_mode1sub (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_state_mod ()

gdouble
nc_hipert_two_fluids_get_state_mod (NcHIPertTwoFluids *ptf);

Get the current module for the solution.

Parameters

Returns

state module.


nc_hipert_two_fluids_get_cross_time ()

gdouble
nc_hipert_two_fluids_get_cross_time (NcHIPertTwoFluids *ptf,
                                     NcHICosmo *cosmo,
                                     NcHIPertTwoFluidsCross cross,
                                     gdouble alpha_i,
                                     gdouble prec);

Get the initial time where the approximate solution is valid within precision prec .

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

cross

a NcHIPertTwoFluidsCross

 

alpha_i

initial try

 

prec

precision

 

Returns

initial time $\alpha_i$.


nc_hipert_two_fluids_compute_zeta_spectrum ()

NcmSpline *
nc_hipert_two_fluids_compute_zeta_spectrum
                               (NcHIPertTwoFluids *ptf,
                                NcHICosmo *cosmo,
                                guint mode,
                                gdouble alpha_i,
                                gdouble alpha,
                                gdouble ki,
                                gdouble kf,
                                guint nnodes);

Compute the spectra for the two fluids system.

Parameters

ptf

a NcHIPertTwoFluids

 

cosmo

a NcHICosmo

 

mode

the mode

 

alpha_i

the initial log-redshift time

 

alpha

the log-redshift time

 

ki

the initial k

 

kf

the final k

 

nnodes

number of knots

 

Returns

a NcmSpline.

[transfer full]


NC_HIPERT_TWO_FLUIDS_A2Q()

#define NC_HIPERT_TWO_FLUIDS_A2Q(Ai) (cimag (Ai))

NC_HIPERT_TWO_FLUIDS_A2P()

#define NC_HIPERT_TWO_FLUIDS_A2P(Ai) (creal (Ai))

NC_HIPERT_TWO_FLUIDS_QP2A()

#define NC_HIPERT_TWO_FLUIDS_QP2A(Q, P) ((P) + I * (Q))

Types and Values

enum NcHIPertTwoFluidsCross

FIXME

Members

NC_HIPERT_TWO_FLUIDS_CROSS_MODE1MAIN

FIXME

 

NC_HIPERT_TWO_FLUIDS_CROSS_MODE2MAIN

FIXME

 

NC_HIPERT_TWO_FLUIDS_CROSS_MODE1SUB

FIXME

 

NC_HIPERT_TWO_FLUIDS_CROSS_MODE2SUB

FIXME