CAMB_sources : Tight coupling switch off with ionization perturbations

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Alex Hall
Posts: 5
Joined: March 25 2012
Affiliation: Institute for Astronomy, Edinburgh, UK

CAMB_sources : Tight coupling switch off with ionization per

Post by Alex Hall » April 02 2012

Hi Antony,

I'm trying to understand the part of the GaugeInterface_EvolveScal subroutine in CAMB_sources which switches off tight coupling. When Evolve_delta_xe is true, the switch time for tight coupling appears to be set to whichever of recombination_saha_tau and the tau_switch previously calculated by computing the opacity is lowest:

Code: Select all

           if (Evolve_delta_xe .and. tau_switch > recombination_saha_tau) then
                tau_switch = recombination_saha_tau
             end if 
Could you explain why the tight coupling switch is set to recombination_saha_tau rather than the usual tau_switch if recombination_saha_tau is lower?

Cheers,

Alex

Antony Lewis
Posts: 1945
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB_sources : Tight coupling switch off with ionization

Post by Antony Lewis » April 02 2012

I'm don't remember exactly, but probably to make the time switch ordering simpler (possibly this could be relaxed using the more general time switching of the latest non-sources CAMB, but that would be some work to update). There may also have been a better more physics reason that I can't now recall...

Alex Hall
Posts: 5
Joined: March 25 2012
Affiliation: Institute for Astronomy, Edinburgh, UK

CAMB_sources : Tight coupling switch off with ionization per

Post by Alex Hall » April 02 2012

OK.

On a related topic, in the same part of the code, in the time step where the radiation multipoles are switched off, and if Num_nu_massive = 0, any dark energy/21cm variables are shifted down the array:

Code: Select all

                if (CP%Num_Nu_massive == 0) then
                 EV%ScalEqsToPropagate=5
                 if (w_lam /= -1 .and. w_Perturb.and.y(1).lt.GRtrans) then
                  !actually DE perturbations probably irrelvant and could set to zero too
                    y(6)=y(EV%w_ix)
                    y(7)=y(EV%w_ix+1)
                    EV%w_ix = 6
                    EV%ScalEqsToPropagate=7                    
                 end if
                if (Evolve_baryon_cs) then
                   y(EV%ScalEqsToPropagate+1) = y(EV%line_ix)
                   EV%line_ix = EV%ScalEqsToPropagate+1
                   EV%ScalEqsToPropagate = EV%ScalEqsToPropagate+1
                end if
                if (Evolve_delta_xe) then
                   y(EV%ScalEqsToPropagate+1) = y(EV%xe_ix)
                   EV%xe_ix = EV%ScalEqsToPropagate+1
                   EV%ScalEqsToPropagate = EV%ScalEqsToPropagate+1
                end if

                if (Evolve_delta_Ts) then
                   y(EV%ScalEqsToPropagate+1) = y(EV%Ts_ix)
                   EV%Ts_ix = EV%ScalEqsToPropagate+1
                   EV%ScalEqsToPropagate = EV%ScalEqsToPropagate+1
                end if
               end if
Is this then consistent with the sources in output, where the expressions explicitly reference photon variables? For example sources(1) in output includes y(9), which would contain the ionization perturbation if w/=-1, Evolve_baryon_cs=T, and Evolve_detla_xe=T.

Is this shifting of the variables down the array necessary, or is it just to save memory?

I'm sure I'm missing something here...

Alex Hall
Posts: 5
Joined: March 25 2012
Affiliation: Institute for Astronomy, Edinburgh, UK

CAMB_sources : Tight coupling switch off with ionization per

Post by Alex Hall » April 02 2012

(ignore the '.and.y(1).lt.GRtrans' part of the seconds if statement, this is something I've put in myself)

Antony Lewis
Posts: 1945
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB_sources : Tight coupling switch off with ionization

Post by Antony Lewis » April 02 2012

Yes, probably not consistent. This has been fixed in CAMB a while ago, but I think the error is small (or maybe identically zero) because this switch is only used at late times for small-scale modes: precisely those that don't contribute to the CMB sources.

(You do save some time by not propagating large numbers of zero differential equations when you don't need them.)

Post Reply