thermal_conductivity_nbti Function

public function thermal_conductivity_nbti(c_pt, T, B) result(thermal_conductivity) bind(C)

Arguments

Type IntentOptional Attributes Name
type(c_ptr), value :: c_pt
real(kind=dp), value :: T
real(kind=dp), value :: B

Return Value real(kind=dp)


Source Code

  function thermal_conductivity_nbti(c_pt,T,B) result(thermal_conductivity) bind(C)
      type(c_ptr), value :: c_pt
      real(dp), value :: T,B
      real(dp) :: thermal_conductivity
      real(dp) :: tmin,tmax,TT,a0,a1,a2,a3,a4,a5,a6
      real(dp) :: T_CUT,k_cut,slope_cut
      type(nbti_cfg_t), pointer :: nbti_ptr
      call c_f_pointer(c_pt,nbti_ptr)

      tmin=1.0d0
      tmax=1000.0d0
    
      TT=min(T,tmax)
      TT=max(TT,tmin)

      a0=6.60e-2_dp
      a1=4.56e-2_dp
      a2=3.00e-4_dp
      a3=-3.00e-6_dp
      a4=6.00e-9_dp
      a5=1.5e-11_dp
      a6=-5.0e-14_dp

      T_CUT     = 200.0_dp
      k_cut     = a0 + a1*T_CUT + a2*T_CUT**2 + a3*T_CUT**3 &
                + a4*T_CUT**4 + a5*T_CUT**5 + a6*T_CUT**6
      slope_cut = a1 + 2.0_dp*a2*T_CUT + 3.0_dp*a3*T_CUT**2 + 4.0_dp*a4*T_CUT**3 &
                + 5.0_dp*a5*T_CUT**4 + 6.0_dp*a6*T_CUT**5

      if (TT <= T_CUT) then
          thermal_conductivity=a0+a1*TT+a2*TT**2+a3*TT**3+a4*TT**4+a5*TT**5+a6*TT**6
      else
          thermal_conductivity = k_cut + slope_cut * (TT - T_CUT)
      end if
  end function thermal_conductivity_nbti