Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanation for translation entropy constants #1077

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/mctc/convert.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module xtb_mctc_convert
! convert Hartree (a.u.) to Joule and back
real(wp), public, parameter :: autoj = 4.3597447222071e-18_wp
real(wp), public, parameter :: jtoau = 1.0_wp / autoj
! convert Hartree to reciproce centimeters/wavenumbers and back
! convert Hartree to reciprocal centimeters/wavenumbers and back
real(wp), public, parameter :: autorcm = 219474.63067_wp
real(wp), public, parameter :: autowav = autorcm
real(wp), public, parameter :: rcmtoau = 1.0_wp / autorcm
Expand All @@ -63,6 +63,16 @@ module xtb_mctc_convert
! Debye to atomic units
real(wp), public, parameter :: autod = autoc * lightspeed * autoaa**2 * fstoau * 1.0e+16_wp
real(wp), public, parameter :: dtoau = 1.0_wp / autod
! Pressure
! atm -> Pascal
! au -> Pascal
! atm -> au
real(wp), public, parameter :: atmtopa = 101325.0_wp
real(wp), public, parameter :: patoatm = 1.0_wp / atmtopa
real(wp), public, parameter :: autopa = 2.9421015697e13_wp
real(wp), public, parameter :: patoau = 1.0_wp / autopa
real(wp), public, parameter :: atmtoau = atmtopa * patoau
real(wp), public, parameter :: autoatm = 1.0_wp / atmtoau

!> ----- DIPOLE DERIVATIVE UNITS -----
! Dipole derivatives along mass-weighted normal mode coordinates (a.u.) to km/mol (IR int.)
Expand Down Expand Up @@ -110,6 +120,7 @@ function m4bykgtoang4byamu() result(sitoang4byamu)
real(wp) :: sitoang4byamu
sitoang4byamu = (1.0e+10_wp)**4 / kgtoamu ! 16605390400000.0
end function m4bykgtoang4byamu

marcelmbn marked this conversation as resolved.
Show resolved Hide resolved
!> ----------------------------------

end module xtb_mctc_convert
1 change: 0 additions & 1 deletion src/mctc/mctc_constants.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module xtb_mctc_constants
implicit none
private
real(wp),public,parameter :: pi = 3.1415926535897932384626433832795029_wp
real(wp),public,parameter :: pi4 = 3.1415926535897932384626433832795029_wp*4._wp
! √π
real(wp),public,parameter :: sqrtpi = sqrt(pi)
! 2×π
Expand Down
20 changes: 13 additions & 7 deletions src/thermo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@ subroutine thermodyn(iunit,A_rcm,B_rcm,C_rcm,avmom_si,linear,atom,sym,molmass, &
logical, intent(in) :: linear !< is linear
logical, intent(in) :: atom !< only one atom
logical, intent(in) :: pr !< clutter the screen with printout
real(wp),parameter :: R = 1.98726D0 ! GAS CONSTANT IN CALORIES/MOLE
real(wp),parameter :: R = 1.98726D0 ! GAS CONSTANT IN CALORIES/(MOLE*K)
real(wp),parameter :: H = 6.626176D-27 ! PLANCK'S CONSTANT IN ERG-SECONDS
real(wp),parameter :: AK = 1.3807D-16 ! BOLTZMANN CONSTANT IN ERG/DEGREE
real(wp),parameter :: AK = 1.3807D-16 ! BOLTZMANN CONSTANT IN ERG/K
real(wp),parameter :: conv3 = amutokg*1000 ! 1.6606d-24
real(wp),parameter :: magic4 = 2.2868d0 ! unknown
real(wp),parameter :: magic5 = 2.3135d0 ! unknown
real(wp),parameter :: magic4 = 2.2868d0 ! R*ln(10)/2
real(wp),parameter :: magic5 = 2.3135d0 ! R*(ln[(kb/P°)*(2pi * kB * amutokg/h)^(3/2)] + 5/2)
! All terms in `magic5` in SI units (excluding R)
! P° corresponds to 1 atm in Pascals.
marcelmbn marked this conversation as resolved.
Show resolved Hide resolved
real(wp),parameter :: caltoj = autokj/autokcal

integer :: i
real(wp) :: s_tr,s_rot,s_vib,s_int,s_tot
real(wp) :: s_tr,s_rot,s_vib,s_int,s_tot,s_tr_old
real(wp) :: h_tr,h_rot,h_vib,h_int,h_tot
real(wp) :: q_tr,q_rot,q_vib,q_int,q_tot
real(wp) :: cptr,cprot,cpvib,cpint,cptot
Expand All @@ -122,7 +124,7 @@ subroutine thermodyn(iunit,A_rcm,B_rcm,C_rcm,avmom_si,linear,atom,sym,molmass, &
real(wp) :: sv_ho,sv_rr
!*******************************************************************

! convert EVERYTHING to atomic units NOW and avoid horror and dispair later
! convert EVERYTHING to atomic units NOW and avoid horror and despair later
beta=1.0_wp/kB/T ! beta in 1/Eh
!c1=h*ac/ak/T ! beta in cm
sthr = sthr_rcm * rcmtoau ! sthr in Eh
Expand Down Expand Up @@ -219,7 +221,11 @@ subroutine thermodyn(iunit,A_rcm,B_rcm,C_rcm,avmom_si,linear,atom,sym,molmass, &
! this is 3/2rt+pv=5/2rt
h_tr=5.0_wp*R*T/2.0_wp
cptr=5.0_wp*R/2.0_wp
s_tr=magic4*(5.0_wp*log10(t)+3.0_wp*log10(molmass))-magic5
! Computed at standard pressure of 1 atm
s_tr_old=magic4*(5.0_wp*log10(t)+3.0_wp*log10(molmass))-magic5
s_tr=R*((2.5_wp*log(t*kB)&
& +1.5_wp*log(amutoau*molmass/(twopi))&
& -log(atmtoau) + 2.5_wp))
! *** CONSTRUCT TOTALS ***
cptot=cptr+cpint
s_tot=s_tr+s_int
Expand Down
Loading