get_solvent_dielectric Function

private pure function get_solvent_dielectric(solvent_name) result(eps)

Get dielectric constant for a named solvent

Returns the static dielectric constant (relative permittivity) for common solvents. Returns -1.0 if the solvent is not found.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: solvent_name

Return Value real(kind=wp)


Called by

proc~~get_solvent_dielectric~~CalledByGraph proc~get_solvent_dielectric get_solvent_dielectric proc~add_solvation_to_calc add_solvation_to_calc proc~add_solvation_to_calc->proc~get_solvent_dielectric proc~xtb_calc_energy xtb_method_t%xtb_calc_energy proc~xtb_calc_energy->proc~add_solvation_to_calc proc~xtb_calc_gradient xtb_method_t%xtb_calc_gradient proc~xtb_calc_gradient->proc~add_solvation_to_calc proc~xtb_calc_hessian xtb_method_t%xtb_calc_hessian proc~xtb_calc_hessian->proc~xtb_calc_gradient

Variables

Type Visibility Attributes Name Initial
integer, private :: i
character(len=32), private :: name_lower

Source Code

   pure function get_solvent_dielectric(solvent_name) result(eps)
      !! Get dielectric constant for a named solvent
      !!
      !! Returns the static dielectric constant (relative permittivity) for common solvents.
      !! Returns -1.0 if the solvent is not found.
      character(len=*), intent(in) :: solvent_name
      real(wp) :: eps

      character(len=32) :: name_lower
      integer :: i

      ! Convert to lowercase for case-insensitive matching
      name_lower = solvent_name
      do i = 1, len_trim(name_lower)
         if (name_lower(i:i) >= 'A' .and. name_lower(i:i) <= 'Z') then
            name_lower(i:i) = char(ichar(name_lower(i:i)) + 32)
         end if
      end do

      select case (trim(name_lower))
         ! Water
      case ('water', 'h2o')
         eps = 78.4_wp
         ! Alcohols
      case ('methanol', 'ch3oh')
         eps = 32.7_wp
      case ('ethanol', 'c2h5oh')
         eps = 24.6_wp
      case ('1-propanol', 'propanol')
         eps = 20.1_wp
      case ('2-propanol', 'isopropanol')
         eps = 19.9_wp
      case ('1-butanol', 'butanol')
         eps = 17.5_wp
      case ('2-butanol')
         eps = 15.8_wp
      case ('1-octanol', 'octanol')
         eps = 9.9_wp
         ! Polar aprotic
      case ('acetone')
         eps = 20.7_wp
      case ('acetonitrile', 'ch3cn')
         eps = 37.5_wp
      case ('dmso', 'dimethylsulfoxide')
         eps = 46.7_wp
      case ('dmf', 'dimethylformamide')
         eps = 36.7_wp
      case ('thf', 'tetrahydrofuran')
         eps = 7.6_wp
      case ('formamide')
         eps = 109.5_wp
         ! Aromatics
      case ('benzene')
         eps = 2.3_wp
      case ('toluene')
         eps = 2.4_wp
      case ('pyridine')
         eps = 12.4_wp
      case ('aniline')
         eps = 6.9_wp
      case ('nitrobenzene')
         eps = 34.8_wp
      case ('chlorobenzene')
         eps = 5.6_wp
         ! Halogenated
      case ('chloroform', 'chcl3')
         eps = 4.8_wp
      case ('dichloromethane', 'ch2cl2', 'dcm')
         eps = 8.9_wp
      case ('carbon tetrachloride', 'ccl4')
         eps = 2.2_wp
         ! Ethers
      case ('diethylether', 'ether')
         eps = 4.3_wp
      case ('dioxane')
         eps = 2.2_wp
      case ('furan')
         eps = 2.9_wp
         ! Alkanes
      case ('pentane')
         eps = 1.8_wp
      case ('hexane', 'n-hexane')
         eps = 1.9_wp
      case ('cyclohexane')
         eps = 2.0_wp
      case ('heptane', 'n-heptane')
         eps = 1.9_wp
      case ('octane', 'n-octane')
         eps = 1.9_wp
      case ('decane')
         eps = 2.0_wp
      case ('hexadecane')
         eps = 2.0_wp
         ! Other
      case ('nitromethane')
         eps = 35.9_wp
      case ('cs2', 'carbondisulfide')
         eps = 2.6_wp
      case ('ethyl acetate', 'ethylacetate')
         eps = 6.0_wp
      case ('acetic acid', 'aceticacid')
         eps = 6.2_wp
      case ('formic acid', 'formicacid')
         eps = 51.1_wp
      case ('phenol')
         eps = 9.8_wp
      case ('woctanol')
         eps = 8.1_wp
         ! Infinite dielectric (conductor)
      case ('inf')
         eps = 1.0e10_wp
      case default
         eps = -1.0_wp  ! Unknown solvent
      end select
   end function get_solvent_dielectric