예제 #1
0
        # VA is a vectorial field
        # Advection append from the center of the source to the edges of the simulation
        if (X[xi] >= x_center):
            VA[e][xi] = +va[e][xi]
        else:
            VA[e][xi] = -va[e][xi]

        if (nml.in_damping):
            # gamma_in[e][xi]       = in_damping.get('wi')
            gamma_in[e][xi] = g_in[e][xi]
        if (nml.lz_damping):
            # gamma_lazarian[e][xi] = -dp.damping_lazarian(xi, E[e], ism_values)
            gamma_lazarian[e][xi] = g_lz[e][xi]
        if (nml.nlld_damping):
            gamma_nlld[e][xi] = -dp.non_linear_landau_damping(
                T[xi], Ip[e][xi], Im[e][xi], mi[xi], cst.e, B[xi], E[e])
        gamma_tot[e][
            xi] = gamma_in[e][xi] + gamma_lazarian[e][xi] + gamma_nlld[e][xi]
        # Background CRs spectra
        Pcr[e][xi] = nml.Pcr_1GeV * (E[e] / cst.GeV)**(-2.7)
        Pe[e][xi] = nml.Pe_1GeV * (E[e] / cst.GeV)**(-3.1)

###############################################################################
#    END : INITIAL ISM CONDITIONS                                             #
###############################################################################

###############################################################################
#      WRITE THE INITAL CONDITIONS                                            #
###############################################################################
print("Writing Initial Conditions")
# !!! Do not modify this part !!! #
예제 #2
0
     wI_Alfven_o1[e] = in_damping.get("wi")
     
     in_damping = dp.IN_damping_approx_2(E[e], phases[pi], theta = 0)
     wR_Alfven_o2[e] = in_damping.get("wr")
     wI_Alfven_o2[e] = in_damping.get("wi")
     Ep = in_damping.get("Ep")
     Em = in_damping.get("Em")
     
     if (pi > 1) : 
         lz_damping = dp.damping_lazarian_nopos(E[e], phases[pi])
         Gamma_lz[e] = lz_damping[0]
         lz_min      = lz_damping[1]
     
     Iinf = 1e-4 
     Isup = 1e-1
     Gamma_nlld_inf[e] = dp.non_linear_landau_damping(phases[pi].get("T"), Iinf, Iinf, 
                                                      phases[pi].get("mi"), cst.e, phases[pi].get("B"), E[e])
     Gamma_nlld_sup[e] = dp.non_linear_landau_damping(phases[pi].get("T"), Isup, Isup, 
                                                      phases[pi].get("mi"), cst.e, phases[pi].get("B"), E[e])
     
     
     
 
 # plt.figure(figsize = (12, 8))
 ax = fig.add_subplot(gs[pos_1[pi], pos_2[pi]])
 
 ax.loglog(E/cst.GeV, wR_Alfven, c="blue")
 ax.loglog(E/cst.GeV, -wI_Alfven, c="black")
 
 ax.loglog(E/cst.GeV, wR_Alfven_o1, c="blue", ls='--')
 ax.loglog(E/cst.GeV, wI_Alfven_o1, c="black", ls='--')