teflow.kappa module

class teflow.kappa.Variable(tag, *args, **kwargs)

基类:object

A singleton class based on the ‘tag’ attribute to represent a variable that notifies subscribers upon value changes, used for synchronizing variables across models.

参数:
  • tag (str) – Sets the tag attribute.

  • initial (float, optional) – The initial guess of value attribute, defaults to 1.

  • lower (float, optional) – Sets the lower attribute, defaults to 0.

  • upper (float, optional) – Sets the upper attribute, defaults to 1000.

  • scale (float, optional) – Sets the scale attribute, defaults to 1.

  • constraint (callable, optional) – A callable object used to compute the value of the current variable from other dependent variables.

  • depends (list or tuple of Variables, optional) – Variables required by the constraint.

抛出:

ValueError – If the initial value is not between the lower and upper bounds, or if constraint is provided but is not a callable, or if any element in depends is not an instance of Variable.

property constrained

Constraint status (read-only).

property value

The current value of the variable. Manually setting a new value will automatically trigger the notify() method.

抛出:

ValueError – If the new value is not between the lower and upper bounds.

register(subscriber, name: str)

Registers a subscriber that will be notified of value changes.

参数:
  • instance (object) – The instance to notify when the variable changes.

  • name (str) – The name of parameter that will be updated.

notify()

Notifies all registered subscribers about the updated value.

class teflow.kappa.Parameters(**parameters)

基类:OrderedDict

A dictionary-like container for managing model parameters, automatically synchronizing with any contained Variable instances. Note that, the communication with Variable instances is designed to be passive to enhance performance of code. As such, changes to Variable will reflect in all registered Parameters instances, but direct modifications to Parameters only affect itself.

class teflow.kappa.BaseKappaModel(**parameters)

基类:ABC

Abstract base class for kappa models.

This class serves as a template for kappa models, providing a framework for implementing model-specific calculations and fitting procedures.

paras

All parameters of the model.

Type:

Parameters

参数:

**parameters (dict) – A dictionary of parameters to initialize the model. These parameters are managed by a Parameters instance, allowing for synchronization with Variable objects if used.

fit(dataT, dataK, *, variables=(), **kwargs)

Fits the model to the provided data using specified variables. In the absence of specified variables, this method directly calculates and returns the kappa values for the given temperatures based on the current parameters. This method primarily utilizes the scipy.optimize.curve_fit function, with kwargs providing additional options to tailor the fitting process. However, note that ‘p0’ and ‘bounds’ parameters are superseded by the settings in the Variable instances, and should be adjusted through their respective attributes, not via kwargs.

class teflow.kappa.KappaDebye(vs, td, components)

基类:BaseKappaModel

\[\kappa = \frac{1}{3} \int_0^{\omega_D} \tau v_s^2 g(\omega) \hbar \omega \frac{\partial f}{\partial T} d\omega\]
参数:
  • vs (float) – Sound velocity (\(v_s\)), in km/s.

  • td (float) – Debye temperature (\(\Theta\)), in Kelvin.

  • components (list) – Components of the model, such as scattering mechanism.

tag = 'DEBYE'
property wd

Debye cut-off (angular) frequency \(\omega_D\) (given by \(\hbar \omega_D = k_B \Theta\)) in rad/ps.

scattering(w, T, with_total=True)

Scattering rate, in THz.

spectral(w, T, accumulate=True)

Spectral thermal conductivity \(\kappa_s(\omega)\) in ps.W/(m.K):

\[\kappa_s(\omega) = \tau \frac{\omega ^2}{2 v_s \pi ^2} k_B \left ( \frac{\hbar \omega}{k_B T}\right )^2 \cfrac{\exp \left( \cfrac{\hbar \omega}{k_B T} \right )}{ \left [ \exp \left( \cfrac{\hbar \omega}{k_B T} - 1\right) \right ]^2 } \text{, then } \kappa = \int_0^{\omega_D} \kappa_s(\omega) d\omega\]
参数:
  • w (ndarray) – Phonon angular frequency in rad/ps.

  • T (ndarray) – Temperatures in K.

cumulative(w, T, accumulate=True, axis=-1)

Cumulative thermal conductivity \(\kappa_c(\omega)\) in W/(m.K):

\[\kappa_c(\omega) = \int_0^{\omega} \kappa_s(\omega) d\omega\]
cumulative_mfp_t(mfp, T: float, accumulate=True, nbatch: int = 1000)

Calculates the cumulative thermal conductivity (in W/(m.K)) across phonon mean-free-path (\(\lambda\), in nm) at a specified temperature point:

\[\kappa_c(\lambda; T) = \int_{\lambda(\omega; T) \le \lambda} \kappa_s(\omega; T) d\omega\]
classmethod vs_to_td(vs, Va)
\[\Theta = \frac{\hbar\omega_D}{k_B} = \frac{\hbar}{k_B} \left( \frac{6\pi^2}{V_a} \right) ^ {1/3} v_s\]
参数:
  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • Va (float) – Average volume per atom (\(V_a\)), in cubic angstroms (A^3).

返回:

Debye temperature (\(\Theta\)), in Kelvin.

返回类型:

float

static vs_to_gm(v1, v2)
\[\gamma = \frac{3}{2} \frac{1+\mu}{2-3\mu} \text{, where } \frac{v_1}{v_2} = \sqrt{\frac{2-2\mu}{1-2\mu}}\]

Ref: D. S. Sanditov et al., Tech. Phys., 56 1619, 2011.

参数:
  • v1 (float) – Longitudinal sound velocity in km/s.

  • v2 (float) – Transverse sound velocity in km/s.

返回:

Gruneisen parameter (\(\gamma\)).

返回类型:

float

static vs_mean(v1, v2, p: int = -3)
\[v_{s,p} = \left( \frac{v_1^p+2v_2^p}{3} \right)^{1/p}\]
参数:
  • v1 (float) – Longitudinal sound velocity in km/s.

  • v2 (float) – Transverse sound velocity in km/s.

  • p (int, optional) – The exponent, by default -3.

返回:

Generalized mean of sound velocities.

返回类型:

float

class teflow.kappa.BaseScattering(**parameters)

基类:ABC

Abstract base class for scattering rate (in THz, i.e. 1/ps) model \(\tau_i^{-1}(\omega, T)\).

paras

All parameters of the model.

Type:

Parameters

参数:

**parameters (dict) – A dictionary of parameters to initialize the model. These parameters are managed by a Parameters instance, allowing for synchronization with Variable objects if used.

class teflow.kappa.ThreePhonon(gm=None, vs=None, Va=None, Ma=None, A=1, Theta=0, *, coef=None)

基类:BaseScattering

\[\tau_i^{-1} = A \frac{k_B V_a^{1/3} \gamma^2}{M_0 M_a v_s^3} \omega ^2 T \exp \left( -\frac{[\Theta]}{3T} \right) = A^{\prime} \omega ^2 T \exp \left( -\frac{[\Theta]}{3T} \right)\]

Hint: To diable the exponential term, simply set Theta (\([\Theta]\)) to 0, even though it typically signifies the Debye temperature.

参数:
  • gm (float) – Gruneisen parameter (\(\gamma\)), dimensionless.

  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • Va (float) – Average volume per atom (\(V_a\)), in cubic angstroms (A^3).

  • Ma (float) – Average atomic mass per atom (\(M_a\)), in atomic mass units (amu).

  • A (float, optional) – Dimensionless adjustable parameter, by default 1.

  • Theta (float, optional) – Debye temperature (\([\Theta]\)) in Kelvin. If set to 0 (default), the exponential term will be disabled.

  • coef (float, optional) – A comprehensive adjustable parameter (\(A^{\prime}\)). When set, all parameters except Theta become non-effective. Typically, its magnitude is around 10^(-18). By default, it is None.

tag = 'PH'
property coef

Value of \(A^{\prime}\)

class teflow.kappa.PointDefect(vs=None, Va=None, G=None, *, coef=None)

基类:BaseScattering

\[\tau_i^{-1} = \frac{V_a \Gamma}{4 \pi v_s^3} \omega ^4 = B^{\prime} \omega ^4\]
参数:
  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • Va (float) – Average volume per atom (\(V_a\)), in cubic angstroms (A^3).

  • G (float) – Dimensionless disorder scattering parameter (\(\Gamma\))

  • coef (float, optional) – A comprehensive adjustable parameter (\(B^{\prime}\)). When set, all parameters (vs, Va, and G) become non-effective. Typically, its magnitude is around 10^(-41). By default, it is None.

tag = 'PD'
property coef

Value of \(B^{\prime}\)

class teflow.kappa.GrainBoundary(vs, L, alpha=1)

基类:BaseScattering

\[\tau_i^{-1} = \alpha \frac{v_s}{L}\]
参数:
  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • L (float) – Average grain size (\(L\)), in um.

  • alpha (float, optional) – Dimensionless adjustable parameter (\(\alpha\)), by default 1.

tag = 'GB'
class teflow.kappa.Nanoparticles(vs, R, phi, D0, D1, Y0=1, Y1=1, alpha=1)

基类:BaseScattering

\[\tau_i^{-1} = v_s \left( \sigma_{geometrical}^{-1} + \sigma_{Rayleigh}^{-1} \right)^{-1}N_1\]
\[\sigma_{geometrical} = 2 \pi R^2\]
\[\sigma_{Rayleigh} = \frac{16}{9} \pi R^2 \left[ \alpha^2 \left(\frac{D_1-D_0}{4D_0}\right)^2 + 3 \alpha^8 \left(\frac{Y_1-Y_0}{Y_0}\right)^2 \right] \left(\frac{\omega R}{v_s}\right)^4\]
\[N_1 = \frac{\phi}{\overline{V_1}} = \cfrac{\phi}{\cfrac{4}{3}\pi R^3}\]

Hints:

1. \(Y_0\) and \(Y_1\) indicate the force constants of the host and nanoparticle, respectively, as defined in the original reference (W. Kim et al., J. Appl. Phys., 99, 084306, 2006). Practically, they can approximately be replaced by the Young’s modulus.

2. \(\alpha\), designated as the trigonometric ratio in the original paper, is typically assumed to be 1 in subsequent comprehensive works.

参数:
  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • R (float) – Average radius of the nanoparticles (\(R\)), in nm.

  • phi (float) – Volume fraction of the nanoparticles (\(\phi\)), in the range (0, 1) theoretically.

  • D0 (float) – Mass density of the host material (\(D_0\)), in g/cm^3.

  • D1 (float) – Mass density of the nanoparticles (\(D_1\)), in g/cm^3.

  • Y0 (float, optional) – Young modulus of the host material (\(Y_0\)) in GPa, by default 1.

  • Y1 (float, optional) – Young modulus of the nanoparticles (\(Y_1\)) in GPa, by default 1.

  • alpha (float, optional) – The trigonometric ratio (\(\alpha\)), by default 1.

tag = 'NP'
class teflow.kappa.Dislocations(Nd, vs, Va, Bd, gm, F=1, alpha=0.55)

基类:BaseScattering

\[\tau_i^{-1} = \tau_{DC}^{-1} + \tau_{DS}^{-1}\]
\[\tau_{DC}^{-1} = \alpha N_d \frac{V_a^{4/3}}{v_s^2} \omega^3\]
\[\tau_{DS}^{-1} = \frac{2^{11/2}}{3^{7/2}} \alpha F N_d B_d^2 \gamma^2 \omega\]
\[F = \frac{1}{2} + \frac{1}{24} \left( \frac{1-2\mu}{1-\mu} \right)^2 \left[ 1 + \sqrt{2} \left( \frac{v_1}{v_2} \right)^2 \right]^2\]

Hints:

1. \(\alpha\) is a weight factor to account for the mutual orientation of the direction of the temperature gradient and the dislocation line. For dislocations perpendicular to the temperature gradient \(\alpha=1\), while for those parallel to the gradient \(\alpha=0\). If dislocation lines are orientated at random with respect to the temperature gradient, the average value found by integration is \(\alpha=0.55\) (ref: P. G. Klemens, Proc. Phys. Soc. A 68 1113, 1955).

2. Note that the parameter \(F\) is directly determined by the Poisson’s ratio (\(\mu\)) and the ratio of longitudinal to transverse sound velocities (\({v_1}/{v_2}\)). To simplify further, we can consider the relationship \(\left( {v_1}/{v_2} \right)^2 = ({2-2\mu})/({1-2\mu})\). For common bulk materials, \(\mu\) typically ranges between 1/5 and 1/3, corresponding to \(F\) values between 0.962 and 1.034. Therefore, in the absence of detailed material properties, it is reasonable to approximate \(F\) as 1.

3. In the expression for \(\tau_{DS}^{-1}\), representing phonon scattering by the static strain field, the constant of proportionality has seen variations in Klement’s research. In the original 1955 publication (P. G. Klemens, Proc. Phys. Soc. A 68 1113, 1955), the value was calculated to be \(2^{3/2}/3^{7/2}(\approx 0.06)\). This was subsequently revised in 1958 by a factor of 16, resulting in \(2^{11/2}/3^{7/2}(\approx 0.97)\), primarily to address the underestimation of the dislocation strain field in the initial value (P. G. Klemens, Solid State Phys. Adv. Res. Appl. 7, 1-98, 1958). In the current program, the revised value is adopted. If different considerations are required, the magnitude of \(\tau_{DS}^{-1}\) can be directly adjusted by modifying the parameter \(F\).

参数:
  • Nd (float) – The number of dislocation lines per unit area (\(N_d\)), in 1E10 cm^(-2).

  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • Va (float) – Average volume per atom (\(V_a\)), in cubic angstroms (A^3).

  • Bd (float) – The magnitudes of Burgers vector (\(B_d\)), in angstroms.

  • gm (float) – Effective Gruneisen parameter (\(\gamma\)), dimensionless.

  • F (float, optional) – A material-dependent parameter (\(F\)), by default 1.

  • alpha (float, optional) – The weight factor (\(\alpha\)), by default 0.55.

tag = 'DL'
class teflow.kappa.StackingFaults(Nsf, vs, Va, gm, alpha=0.7)

基类:BaseScattering

\[\tau_i^{-1} = \alpha N_{sf} \frac{V_a^{2/3}}{v_s} \gamma^2 \omega^2\]

Hint: The constant of proportionality (\(\alpha\)) varies across different publications. In the original 1957 publication (P. G. Klemens, Can. J. Phys., 35 441, 1957), the value was derived as \(1/18 \times 4/3 (\approx 0.074)\). This value was later revised to 0.7 (P. G. Klemens, Solid State Phys. Adv. Res. Appl. 7, 1-98, 1958), which is also the default value adopted by the current program.

参数:
  • Nsf (float) – The number of stacking faults crossing a line of unit length (\(N_{sf}\)), in 10^6 m^(-1), also known as 1/um.

  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • Va (float) – Average volume per atom (\(V_a\)), in cubic angstroms (A^3).

  • gm (float) – Effective Gruneisen parameter (\(\gamma\)), dimensionless.

  • alpha (float, optional) – Dimensionless adjustable parameter (\(\alpha\)), by default 0.7.

tag = 'SF'
class teflow.kappa.FreeElectrons(vs=None, md=None, EF=None, Ed=None, D0=None, *, Rep=None, coef=None)

基类:BaseScattering

\[\tau_i^{-1} = \frac{(E_d m_d^\ast)^2}{2 \pi \hbar^3 D_0 v_s} R_{ep}\ \omega = C^\prime R_{ep} \ \omega\]
\[R_{ep} = 1-\frac{k_BT}{\hbar \omega} \ln \frac{ 1+\exp[(\frac{\hbar^2 \omega^2}{8m_d^\ast v_s^2} + \frac{1}{2}m_d^\ast v_s^2 + \frac{1}{2}\hbar\omega - E_F)/k_BT] }{ 1+\exp[(\frac{\hbar^2 \omega^2}{8m_d^\ast v_s^2} + \frac{1}{2}m_d^\ast v_s^2 - \frac{1}{2}\hbar\omega - E_F)/k_BT] }\]

Ref: J. M. Ziman, Philos. Mag. 1, 191, 1956.

参数:
  • vs (float) – Average sound velocity (\(v_s\)), in km/s.

  • md (float) – Density-of-state effective mass (\(m_d^\ast\)), in \(m_e\).

  • EF (float) – Fermi energy (\(E_F\)), in eV.

  • Ed (float) – Deformation potential (\(E_d\)), in eV.

  • D0 (float) – Mass density of the material (\(D_0\)), in g/cm^3.

  • Rep (float, optional) – A dimensionless parameter (\(R_{ep}\)) in the range of (0, 1) related to Fermi level (or doping concentration). At ultra-high carrier concentrations, it tends towards 1. The default is None, indicating that it will be calculated based on Fermi level EF. If set, EF become non-effective.

  • coef (float, optional) – A comprehensive adjustable parameter (\(C^{\prime}\)). When set, all parameters except Rep become non-effective. By default, it is None.

tag = 'EP'
property coef

Value of \(C^{\prime}\)

Rep(w, T)

Returen the provided Rep, or the value calculated by EF if not provided.

class teflow.kappa.CahillScattering(alpha=1)

基类:BaseScattering

\[\tau_i^{-1} = \alpha \frac{\omega}{\pi}\]
参数:

alpha (float, optional) – Dimensionless adjustable parameter (\(\alpha\)), by default 1.

tag = 'CAHILL'
class teflow.kappa.KappaSlack(td, gm, Ma, Va, N=1, A=1e-06)

基类:BaseKappaModel

\[\kappa = A \frac{M_a V_a^{1/3} \Theta^3}{\gamma^2 N^{2/3}T}\]

Hint: Here \(\Theta\) refers to the “traditional” Debye temperature (namely, that determined from the elastic constants or specific heat), not the acoustic-mode Debye temperature \(\Theta_a\). Their relationship is \(\Theta^3 = N \cdot \Theta_a^3\), where \(N\) is the number of atoms per unit cell.

参数:
  • td (float) – Debye temperature (\(\Theta\)), in Kelvin.

  • gm (float) – Gruneisen parameter (\(\gamma\)), dimensionless.

  • Ma (float) – Average atomic mass per atom (\(M_a\)), in atomic mass units (amu).

  • Va (float) – Average volume per atom (\(V_a\)), in cubic angstroms (A^3).

  • N (int, optional) – The number of atoms per unit cell, by default 1.

  • A (float or str, optional) – Adjustable parameter \(A\) in the model, which can be set as either a constant value or the name of a predefined model for computation during initialization. The default value is 1E-6, which is its typical magnitude as well. To customize a new model, inherit from this class and implement a property named coef_<modelname>, then it will be automatically invoked.

tag = 'SLACK'
property coef

The value of parameter \(A\) in the model.

property coef_Julian
\[A = \frac{2.43 \times 10^{-6}}{1-0.514/\gamma+0.228/\gamma^2}\]

Ref: C. L. Julian, Physical Review, 137 A128, 1965.

property coef_Qin
\[A = \frac{1}{1+1/\gamma + 8.3 \times 10^5/\gamma^{2.4}}\]

Ref: G. Qin et al., Mater. Adv., 3 6683, 2022.

property coef_Constant

This property works when the parameter A is specified as a numerical value during initialization, and returns the provided value of A directly.

class teflow.kappa.KappaBipolar(Kbp, Eg, p=1)

基类:BaseKappaModel

\[\kappa_{bip} = \kappa_{bp} \left ( \frac{T}{T_{amb}} \right ) ^p \exp \left( -\frac{E_g}{2k_BT} \right) \text{, where } T_{amb} = 300 K\]

Ref: O. C. Yelgel et al., Phys. Rev. B, 85 125207, 2012.

参数:
  • Kbp (float) – Adjustable parameter (\(\kappa_{bp}\)), in W/(m.K).

  • Eg (float) – Band gap, in eV.

  • p (float, optional) – Adjustable parameter, by default 1.

tag = 'BIPOLAR'
class teflow.kappa.KappaPowerLaw(Kamb, n=-1, K0=0)

基类:BaseKappaModel

\[\kappa = \kappa_{amb} \left ( \frac{T}{T_{amb}} \right ) ^n + \kappa_0 \text{, where } T_{amb} = 300 K\]
参数:
  • Kamb (float) – Ambient thermal conductivity (\(\kappa_{amb}\)), corresponds to the thermal conductivity at the ambient temperature (300 K) with the background offset excluded.

  • n (float, optional) – The exponent in the expression, by default -1.

  • K0 (float, optional) – Background offset (\(\kappa_0\)), by default 0.

tag = 'POWERLAW'
class teflow.kappa.KappaKlemens(Kpure, vs, td, G0, Va)

基类:BaseKappaModel

\[\frac{\kappa(x)}{\kappa_{pure}} = \frac{\tan^{-1}(u)}{u} \text{, where } u^2 = \cfrac{\pi \Theta V_a}{2\hbar v_s^2} \kappa_{pure}\Gamma_0 \cdot x (1-x)\]

Ref: P. G. Klemens, Phys. Rev., 119 507-509, 1960.

参数:
  • Kpure (float) – Kappa of the crystal with disorder (\(\kappa_{pure}\)), in W/(m.K).

  • vs (float) – Sound velocity (\(v_s\)), in km/s.

  • td (float) – Debye temperature (\(\Theta\)), in Kelvin.

  • G0 (float) – The factor of disorder scaling parameter (\(\Gamma_0\)).

  • Va (float) – Average volume per atom (\(V_a\)), in cubic angstroms (A^3).

tag = 'KLEMENS'
u2(X)

Calculates \(u^2\) from \(x\) based on model parameters. Users can customize the expression as needed by overriding this method.

fit(dataX, dataK, *, variables=(), **kwargs)

Overrides BaseKappaModel: Fits dataX rather than dataT.

teflow.kappa.parse_KappaFit(filename, specify=None)

Parse kappa model from configuration file