polysim_core/properties/thermal.rs
1use crate::polymer::PolymerChain;
2
3/// Estimates the glass transition temperature (K) using the Fox equation.
4///
5/// # Arguments
6///
7/// `components` — slice of `(weight_fraction, Tg_homopolymer_K)` pairs,
8/// one per distinct repeat unit. Weight fractions must sum to 1.0.
9///
10/// # Reference
11///
12/// Fox, T. G. (1956). *Bull. Am. Phys. Soc.* **1**, 123.
13///
14/// # Example
15///
16/// ```rust
17/// use polysim_core::properties::thermal::tg_fox;
18///
19/// // 50/50 blend of PS (Tg ≈ 373 K) and PMMA (Tg ≈ 378 K)
20/// let tg = tg_fox(&[(0.5, 373.0), (0.5, 378.0)]);
21/// assert!((tg - 375.4).abs() < 0.2);
22/// ```
23pub fn tg_fox(components: &[(f64, f64)]) -> f64 {
24 let inv_tg: f64 = components.iter().map(|(wi, tgi)| wi / tgi).sum();
25 1.0 / inv_tg
26}
27
28/// Estimates Tg (K) using the Van Krevelen group-contribution method.
29///
30/// # Reference
31///
32/// Van Krevelen, D. W. & te Nijenhuis, K. (2009).
33/// *Properties of Polymers*, 4th ed., Elsevier. Chapter 6.
34pub fn tg_van_krevelen(_chain: &PolymerChain) -> f64 {
35 todo!("Van Krevelen group-contribution Tg")
36}
37
38/// Qualitative tendency of a polymer chain to crystallise.
39#[derive(Debug, Clone, Copy, PartialEq, Eq)]
40pub enum CrystallizationTendency {
41 /// Highly regular chain — expected to crystallise readily (e.g. PE, isotactic PP).
42 High,
43 /// Moderate regularity — partial crystallisation possible (e.g. syndiotactic PS).
44 Medium,
45 /// Low regularity — unlikely to crystallise significantly.
46 Low,
47 /// Fully amorphous — no crystallisation expected (e.g. atactic PS, PMMA).
48 Amorphous,
49}
50
51/// Estimates the crystallisation tendency of a polymer chain based on its
52/// structural regularity and symmetry.
53pub fn crystallization_tendency(_chain: &PolymerChain) -> CrystallizationTendency {
54 todo!("estimate crystallisation tendency from SMILES regularity/symmetry")
55}