This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
forked from garrelt/C2-Ray1D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcgsconstants.f90
107 lines (89 loc) · 3.96 KB
/
cgsconstants.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
!>
!! \brief This module contains physical constants and conversion factors
!!
!! Module for Capreole / C2-Ray (f90)
!!
!! \b Author: Garrelt Mellema
!!
!! \b Date:
!!
!! \b Version: cgs units
!!
module cgsconstants
use precision, only: dp
use mathconstants, only: pi
implicit none
! A collection of physical constants and conversion factors
! Units: cgs
!> proton mass
real(kind=dp), parameter :: m_p=1.672661e-24_dp
!> speed of light
real(kind=dp), parameter :: c=2.997925e+10_dp
!> Planck constant
real(kind=dp), parameter :: hplanck=6.6260755e-27_dp
!> Stefan-Boltzmann constant
real(kind=dp), parameter :: sigmasb=5.670e-5_dp
!> Boltzmann constant
real(kind=dp), parameter :: kb=1.381e-16_dp
!> Gravitational constant
real(kind=dp), parameter :: G_grav=6.6732e-8_dp
!> ev2k - conversion factor between evs and kelvins
real(kind=dp),parameter :: ev2k=1.0_dp/8.617e-05_dp
!> ev2erg - conversion factor between evs and ergs
real(kind=dp),parameter :: ev2erg=1.602e-12_dp
!> ev2j - conversion factor between ergs and Joules
real(kind=dp),parameter :: erg2j=1e-7_dp
! The following are scaled to frequency scaling
!> Frequency scaling factor,
!! this scaling parameter is independent of any main program scaling
!! (see scaling.f90), and may only be used in the radiation physics
!! subroutines (currently switched off)
real(kind=dp),parameter :: sclfre=1.0e15_dp
!> conversion between evs and frequency
real(kind=dp),parameter :: ev2fr=0.241838e15_dp!/sclfre
! h/k, Planck/Boltzm
! Check this number, seems scaled
!real(kind=dp),parameter :: hoverk=47979.72484
!> Planck constant scaled
real(kind=dp),parameter :: hscl=hplanck!*sclfre
!> tpic2 - 2*pi/c^2 times scaling factors needed for the integral cores
real(kind=dp),parameter :: tpic2=2.0_dp*pi/(c*c)
!> two_pi_c2 - 2*pi/c^2 times scaling factors needed for the integral cores
real(kind=dp),parameter :: two_pi_c2=2.0_dp*pi/(c*c)!*sclfre**3
!> Hydrogen recombination parameter (power law index)
real(kind=dp),parameter :: albpow=-0.7_dp !in the old code -0.79
!> Hydrogen recombination parameter (value at 10^4 K)
real(kind=dp),parameter :: bh00=2.59e-13_dp ! OTS value, alpha_B
!> Helium0 recombination parameter (power law index)
real(kind=dp), parameter :: alcpow=-0.672_dp
!> Helium0 recombination parameter (value at 10^4 K)
real(kind=dp), parameter :: bhe00=4.26e-13_dp !alpha_b+alpha_1
!> Helium1 recombination parameter (value at 10^4 K)
real(kind=dp), parameter :: bhe10=1.53e-12_dp !different in the book!
!here it was 5.91e-12 I replace with book value of 2*1.1e-12
!> Hydrogen ionization energy (in eV)
real(kind=dp), parameter :: eth0=13.598_dp
!> Hydrogen ionization energy (in erg)
real(kind=dp),parameter :: hionen=eth0*ev2erg
!> Hydrogen ionization energy expressed in K
real(kind=dp),parameter :: temph0=eth0*ev2k
!> Hydrogen collisional ionization parameter 1
real(kind=dp),parameter :: xih0=1.0_dp
!> Hydrogen collisional ionization parameter 2
real(kind=dp),parameter :: fh0=0.83_dp
!> Hydrogen collisional ionization parameter
real(kind=dp),parameter :: colh0=1.3e-8_dp*fh0*xih0/(eth0*eth0)
!> Helium ionization energy (in eV)
real(kind=dp), dimension(0:1), parameter :: ethe=(/24.587_dp,54.416_dp/)
!> Helium ionization energy (in erg)
real(kind=dp), dimension(0:1), parameter :: heionen=(/ethe(0)*ev2erg,ethe(1)*ev2erg/)
!> Helium ionization energy expressed in K
real(kind=dp), dimension(0:1), parameter :: temphe=(/ethe(0)*ev2k,ethe(1)*ev2k/)
!> Helium collisional ionization parameter 1
real(kind=dp),dimension(0:1),parameter :: xihe=(/2.0_dp,1.0_dp/)
!> Helium collisional ionization parameter 2
real(kind=dp),dimension(0:1),parameter :: fhe=(/0.63_dp,1.30_dp/)
!> Helium collisional ionization parameter
real(kind=dp),dimension(0:1),parameter :: colhe=(/1.3e-8_dp*fhe(0)*xihe(0)/(ethe(0)*ethe(0)), &
1.3e-8_dp*fhe(1)*xihe(1)/(ethe(1)*ethe(1))/)
end module cgsconstants