Skip to main content

section_properties/
fire.rs

1//! Fire resistance analysis per EN 1993-1-2, EN 1994-1-2, EN 1992-1-2.
2//!
3//! Provides section factor (A_m/V), temperature analysis, and
4//! load-bearing resistance in fire.
5
6use crate::material::Material;
7use crate::section::Section;
8use crate::section_properties::SectionProperties;
9
10/// Fire exposure curves.
11#[derive(Debug, Clone, Copy, PartialEq)]
12pub enum FireExposure {
13    /// Standard ISO 834 fire
14    Standard,
15    /// Hydrocarbon fire
16    Hydrocarbon,
17    /// External fire (EN 1991-1-2)
18    External,
19    /// Parametric fire
20    Parametric { opening_factor: f64, fire_load: f64 },
21}
22
23impl FireExposure {
24    /// Temperature at time t (minutes) for standard fire.
25    pub fn temperature(&self, t_min: f64) -> f64 {
26        match self {
27            FireExposure::Standard => {
28                // ISO 834: T = 20 + 345 * log10(8*t + 1)
29                20.0 + 345.0 * (8.0 * t_min + 1.0).log10()
30            }
31            FireExposure::Hydrocarbon => {
32                // Hydrocarbon: T = 20 + 1080 * (1 - 0.325*exp(-0.167*t) - 0.675*exp(-2.5*t))
33                20.0 + 1080.0
34                    * (1.0 - 0.325 * (-0.167 * t_min).exp() - 0.675 * (-2.5 * t_min).exp())
35            }
36            FireExposure::External => {
37                // Simplified external fire
38                20.0 + 660.0 * (1.0 - (-0.1 * t_min).exp())
39            }
40            FireExposure::Parametric {
41                opening_factor,
42                fire_load,
43            } => {
44                // Simplified parametric
45                let t_eq = fire_load / (opening_factor * 1000.0); // equivalent time
46                20.0 + 345.0 * (8.0 * t_eq + 1.0).log10()
47            }
48        }
49    }
50}
51
52/// Section factor A_m/V (heated perimeter / cross-sectional area).
53#[derive(Debug, Clone)]
54pub struct SectionFactor {
55    pub am_v: f64,            // [1/m] - section factor
56    pub am: f64,              // [m²/m] - heated perimeter per unit length
57    pub v: f64,               // `m²` - cross-sectional area
58    pub shadow_factor: f64,   // Shadow effect factor (k_sh)
59    pub box_protection: bool, // Box protection (k_sh = 1.0)
60}
61
62impl SectionFactor {
63    /// Compute section factor for a section.
64    pub fn from_section(section: &Section, fire_exposure: FireExposure) -> Self {
65        let props = SectionProperties::from_section(section);
66        let v = props.area;
67
68        // Heated perimeter depends on fire exposure
69        let am = match fire_exposure {
70            FireExposure::Standard | FireExposure::Hydrocarbon => {
71                // 3-sided or 4-sided exposure
72                section.heated_perimeter_3sided()
73            }
74            FireExposure::External => section.heated_perimeter_4sided(),
75            FireExposure::Parametric { .. } => section.heated_perimeter_4sided(),
76        };
77
78        let am_v = am / v;
79
80        // Shadow factor for I-sections
81        let shadow_factor = section.shadow_factor();
82
83        Self {
84            am_v,
85            am,
86            v,
87            shadow_factor,
88            box_protection: false,
89        }
90    }
91
92    /// For box protection (uniform heating all around).
93    pub fn with_box_protection(mut self) -> Self {
94        self.box_protection = true;
95        self.shadow_factor = 1.0;
96        self
97    }
98
99    /// For fire protection (intumescent, board, spray).
100    pub fn with_protection(
101        mut self,
102        thickness: f64,
103        conductivity: f64,
104        density: f64,
105        specific_heat: f64,
106    ) -> Self {
107        self.am_v =
108            self.am / self.v * (1.0 / (1.0 + thickness * conductivity / (density * specific_heat)));
109        self
110    }
111}
112
113/// Temperature distribution in section at given time.
114#[derive(Debug, Clone)]
115pub struct TemperatureProfile {
116    pub time: f64, // Time [min]
117    pub exposure: FireExposure,
118    pub temps: Vec<f64>, // Temperature at each fiber/node [°C]
119    pub max_temp: f64,
120    pub avg_temp: f64,
121}
122
123impl TemperatureProfile {
124    /// Uniform temperature (simplified).
125    pub fn uniform(temp: f64, time: f64, exposure: FireExposure) -> Self {
126        Self {
127            time,
128            exposure,
129            temps: vec![temp],
130            max_temp: temp,
131            avg_temp: temp,
132        }
133    }
134
135    /// Compute temperature profile using heat transfer analysis.
136    pub fn from_heat_transfer(
137        _section: &Section,
138        _material: &Material,
139        _section_factor: &SectionFactor,
140        exposure: FireExposure,
141        time: f64,
142        _time_step: f64,
143    ) -> Self {
144        // Simplified lumped capacitance method
145        // dT/dt = (h_net * A_m/V) * (T_g - T) / (rho * c_a)
146
147        let t_g = match exposure {
148            FireExposure::Standard => 345.0 * (8.0 * time + 1.0).log10(),
149            _ => 20.0 + 660.0 * (1.0 - (-0.1 * time).exp()),
150        };
151
152        // Use average temperature
153        let temp = t_g * (1.0 - (-time / 30.0).exp()) + 20.0;
154
155        Self::uniform(temp, time, exposure)
156    }
157}
158
159/// Material properties at elevated temperature.
160#[derive(Debug, Clone)]
161pub struct MaterialPropertiesAtTemp {
162    pub temperature: f64,
163    pub ky: f64, // Reduction factor for yield strength
164    pub kp: f64, // Reduction factor for proportional limit
165    pub ke: f64, // Reduction factor for Young's modulus
166    pub thermal_elongation: f64,
167}
168
169impl MaterialPropertiesAtTemp {
170    /// Carbon steel per EN 1993-1-2 Table 3.1.
171    pub fn carbon_steel(temp: f64) -> Self {
172        let (ky, kp, ke) = if temp <= 100.0 {
173            (1.0, 1.0, 1.0)
174        } else if temp <= 200.0 {
175            (1.0, 0.81, 0.9)
176        } else if temp <= 300.0 {
177            (1.0, 0.61, 0.8)
178        } else if temp <= 400.0 {
179            (1.0, 0.42, 0.7)
180        } else if temp <= 500.0 {
181            (0.78, 0.31, 0.6)
182        } else if temp <= 600.0 {
183            (0.47, 0.13, 0.31)
184        } else if temp <= 700.0 {
185            (0.23, 0.09, 0.13)
186        } else if temp <= 800.0 {
187            (0.11, 0.07, 0.09)
188        } else if temp <= 900.0 {
189            (0.06, 0.05, 0.07)
190        } else if temp <= 1000.0 {
191            (0.04, 0.04, 0.05)
192        } else {
193            (0.02, 0.02, 0.03)
194        };
195
196        let thermal_elongation = if temp <= 750.0 {
197            1.2e-5 * temp + 0.4e-8 * temp * temp - 2.416e-4
198        } else {
199            1.1e-2
200        };
201
202        Self {
203            temperature: temp,
204            ky,
205            kp,
206            ke,
207            thermal_elongation,
208        }
209    }
210
211    /// Stainless steel per EN 1993-1-2 Table C.1.
212    pub fn stainless_steel(temp: f64) -> Self {
213        // Simplified - similar to carbon but different curve
214        let ky = if temp <= 100.0 {
215            1.0
216        } else if temp <= 500.0 {
217            0.8
218        } else if temp <= 700.0 {
219            0.5
220        } else {
221            0.2
222        };
223        let kp = if temp <= 100.0 {
224            1.0
225        } else if temp <= 500.0 {
226            0.6
227        } else if temp <= 700.0 {
228            0.3
229        } else {
230            0.1
231        };
232        let ke = if temp <= 100.0 {
233            1.0
234        } else if temp <= 500.0 {
235            0.8
236        } else if temp <= 700.0 {
237            0.4
238        } else {
239            0.2
240        };
241
242        Self {
243            temperature: temp,
244            ky,
245            kp,
246            ke,
247            thermal_elongation: 0.0,
248        }
249    }
250
251    /// Concrete per EN 1992-1-2.
252    pub fn concrete(temp: f64, _fc20: f64) -> Self {
253        let kc = if temp <= 100.0 {
254            1.0
255        } else if temp <= 200.0 {
256            0.95
257        } else if temp <= 400.0 {
258            0.75
259        } else if temp <= 600.0 {
260            0.45
261        } else if temp <= 800.0 {
262            0.25
263        } else {
264            0.1
265        };
266
267        Self {
268            temperature: temp,
269            ky: kc,
270            kp: kc,
271            ke: kc,
272            thermal_elongation: 0.0,
273        }
274    }
275}
276
277/// Fire design method.
278#[derive(Debug, Clone, Copy, PartialEq)]
279pub enum FireDesignMethod {
280    /// Simple calculation model (EN 1993-1-2 4.2)
281    Simple,
282    /// Advanced calculation model (EN 1993-1-2 4.3)
283    Advanced,
284    /// Tabulated data (EN 1993-1-2 4.4)
285    Tabulated,
286}
287
288/// Fire analysis for a section.
289#[derive(Debug, Clone)]
290pub struct FireAnalysis {
291    pub section: Section,
292    pub material: Material,
293    pub exposure: FireExposure,
294    pub method: FireDesignMethod,
295    pub fire_protection: Option<FireProtection>,
296    pub critical_temp: Option<f64>,
297}
298
299/// Fire protection system.
300#[derive(Debug, Clone)]
301pub struct FireProtection {
302    pub protection_type: ProtectionType,
303    pub thickness: f64,        // [m]
304    pub conductivity: f64,     // [W/mK]
305    pub density: f64,          // [kg/m³]
306    pub specific_heat: f64,    // [J/kgK]
307    pub moisture_content: f64, // [kg/m³] for gypsum/board
308}
309
310#[derive(Debug, Clone, Copy, PartialEq)]
311pub enum ProtectionType {
312    None,
313    Intumescent,
314    Board,
315    Spray,
316    ConcreteEncasement,
317    HollowFilled, // Concrete-filled tube
318}
319
320impl FireAnalysis {
321    pub fn new(section: Section, material: Material) -> Self {
322        Self {
323            section,
324            material,
325            exposure: FireExposure::Standard,
326            method: FireDesignMethod::Simple,
327            fire_protection: None,
328            critical_temp: None,
329        }
330    }
331
332    pub fn with_exposure(mut self, exposure: FireExposure) -> Self {
333        self.exposure = exposure;
334        self
335    }
336
337    pub fn with_method(mut self, method: FireDesignMethod) -> Self {
338        self.method = method;
339        self
340    }
341
342    pub fn with_protection(mut self, protection: FireProtection) -> Self {
343        self.fire_protection = Some(protection);
344        self
345    }
346
347    /// Section factor A_m/V.
348    pub fn section_factor(&self) -> SectionFactor {
349        SectionFactor::from_section(&self.section, self.exposure)
350    }
351
352    /// Critical temperature for given load ratio.
353    pub fn critical_temperature(&self, load_ratio: f64) -> f64 {
354        // EN 1993-1-2 Eq 4.25 for carbon steel
355        if load_ratio <= 0.01 {
356            return 20.0;
357        }
358        if load_ratio >= 1.0 {
359            return 1200.0;
360        }
361
362        // Approximate: theta_cr = 39.19 * ln(1/(0.9674*mu0^3.833)) + 482
363        // where mu0 = load_ratio
364        let mu0 = load_ratio;
365        39.19 * (1.0 / (0.9674 * mu0.powf(3.833))).ln() + 482.0
366    }
367
368    /// Time to reach critical temperature.
369    pub fn fire_resistance_time(&self, load_ratio: f64) -> f64 {
370        let theta_cr = self.critical_temperature(load_ratio);
371        let section_factor = self.section_factor();
372
373        // With protection
374        if let Some(prot) = &self.fire_protection {
375            return self.protected_time(theta_cr, section_factor, prot);
376        }
377
378        // Unprotected - use section factor
379        self.unprotected_time(theta_cr, section_factor)
380    }
381
382    fn unprotected_time(&self, theta_cr: f64, sf: SectionFactor) -> f64 {
383        // Numerical integration of temperature rise
384        let dt = 1.0 / 60.0; // 1 second steps (in minutes)
385        let mut t = 0.0;
386        let mut theta_a = 20.0;
387
388        while theta_a < theta_cr && t < 300.0 {
389            // Max 5 hours
390            let theta_g = self.exposure.temperature(t); // t is in minutes
391
392            // Net heat flux
393            let h_net = 25.0; // W/m²K (convection + radiation)
394
395            // Steel properties
396            let rho_a = 7850.0; // kg/m³
397            let c_a = 600.0; // J/kgK (approx at 400°C)
398
399            // Temperature rise
400            let dtheta = h_net * sf.am_v / (rho_a * c_a) * (theta_g - theta_a) * dt * 60.0;
401            theta_a += dtheta;
402            t += dt;
403        }
404
405        t // Return in minutes
406    }
407
408    fn protected_time(&self, theta_cr: f64, sf: SectionFactor, prot: &FireProtection) -> f64 {
409        // EN 1993-1-2 Annex G - protected members
410        let dt = 1.0 / 60.0;
411        let mut t = 0.0;
412        let mut theta_a = 20.0;
413        let mut theta_p = 20.0; // Protection temperature
414
415        let rho_p = prot.density;
416        let c_p = prot.specific_heat;
417        let lambda_p = prot.conductivity;
418        let d_p = prot.thickness;
419
420        while theta_a < theta_cr && t < 300.0 {
421            let theta_g = self.exposure.temperature(t / 60.0);
422
423            // Heat flux through protection
424            let h_net = 25.0;
425            let phi = h_net * (theta_g - theta_p) / (1.0 + lambda_p / (h_net * d_p));
426
427            // Protection temperature
428            let dtheta_p = phi / (rho_p * c_p * d_p) * dt * 60.0;
429            theta_p += dtheta_p;
430
431            // Steel temperature
432            let rho_a = 7850.0;
433            let c_a = 600.0;
434            let dtheta_a = phi / (rho_a * c_a * sf.v) * dt * 60.0;
435            theta_a += dtheta_a;
436
437            t += dt;
438        }
439
440        t * 60.0
441    }
442
443    /// Load-bearing resistance at time t (simplified).
444    pub fn resistance_at_time(&self, t_min: f64, load_ratio: f64) -> FireResistanceResult {
445        let theta_cr = self.critical_temperature(load_ratio);
446        let theta_g = self.exposure.temperature(t_min);
447        let section_factor = self.section_factor();
448
449        // Section temperature
450        let temp_profile = TemperatureProfile::from_heat_transfer(
451            &self.section,
452            &self.material,
453            &section_factor,
454            self.exposure,
455            t_min,
456            1.0,
457        );
458
459        let theta_a = temp_profile.avg_temp;
460        let mat_props = MaterialPropertiesAtTemp::carbon_steel(theta_a);
461
462        // Reduced yield strength
463        let fy_theta = self.material.yield_strength * mat_props.ky;
464        let e_theta = self.material.youngs_modulus * mat_props.ke;
465
466        // Section properties at temperature (simplified - no degradation of geometry)
467        let props = SectionProperties::from_section(&self.section);
468
469        // Moment capacity at temperature
470        let m_rd_theta = props.ix / props.max_fiber_distance_y() * fy_theta;
471
472        // Axial capacity
473        let n_rd_theta = props.area * fy_theta;
474
475        // Utilization
476        let utilization = if load_ratio > 0.0 {
477            (theta_a - 20.0) / (theta_cr - 20.0)
478        } else {
479            0.0
480        };
481
482        FireResistanceResult {
483            time: t_min,
484            section_temp: theta_a,
485            gas_temp: theta_g,
486            fy_reduced: fy_theta,
487            e_reduced: e_theta,
488            moment_capacity: m_rd_theta,
489            axial_capacity: n_rd_theta,
490            utilization,
491            passed: utilization <= 1.0,
492        }
493    }
494}
495
496/// Fire resistance result.
497#[derive(Debug, Clone)]
498pub struct FireResistanceResult {
499    pub time: f64,            // Time [min]
500    pub section_temp: f64,    // Average section temperature [°C]
501    pub gas_temp: f64,        // Gas temperature [°C]
502    pub fy_reduced: f64,      // Reduced yield strength `Pa`
503    pub e_reduced: f64,       // Reduced Young's modulus `Pa`
504    pub moment_capacity: f64, // Moment capacity at temperature `Nm`
505    pub axial_capacity: f64,  // Axial capacity at temperature [N]
506    pub utilization: f64,     // Utilization ratio
507    pub passed: bool,         // Passed fire resistance?
508}
509
510/// Composite column fire resistance (EN 1994-1-2).
511pub mod composite {
512    use super::*;
513    use crate::material::Material;
514    use crate::section::Section;
515
516    /// Concrete-filled tube fire analysis.
517    pub struct CFTFireAnalysis {
518        pub steel_section: Section,
519        pub concrete_section: Section,
520        pub steel_material: Material,
521        pub concrete_material: Material,
522        pub exposure: FireExposure,
523        pub reinforcement: Option<Reinforcement>,
524    }
525
526    #[derive(Debug, Clone)]
527    pub struct Reinforcement {
528        pub area: f64,
529        pub distance_from_center: f64,
530        pub material: Material,
531    }
532
533    impl CFTFireAnalysis {
534        pub fn new(
535            steel: Section,
536            concrete: Section,
537            steel_mat: Material,
538            conc_mat: Material,
539        ) -> Self {
540            Self {
541                steel_section: steel,
542                concrete_section: concrete,
543                steel_material: steel_mat,
544                concrete_material: conc_mat,
545                exposure: FireExposure::Standard,
546                reinforcement: None,
547            }
548        }
549
550        /// Fire resistance per EN 1994-1-2.
551        pub fn fire_resistance(&self, n_ed: f64, m_ed: f64) -> FireResistanceResult {
552            // Simplified: use concrete core temperature
553            // Concrete protects steel tube
554
555            let section_factor = SectionFactor::from_section(&self.steel_section, self.exposure);
556            let theta_cr = self.critical_temperature_composite(n_ed);
557
558            // Time to reach critical temp
559            let t_fi = self.unprotected_time(theta_cr, section_factor);
560
561            FireResistanceResult {
562                time: t_fi,
563                section_temp: theta_cr,
564                gas_temp: self.exposure.temperature(t_fi / 60.0),
565                fy_reduced: self.steel_material.yield_strength * 0.5, // Approx
566                e_reduced: self.steel_material.youngs_modulus * 0.5,
567                moment_capacity: m_ed, // Placeholder
568                axial_capacity: n_ed,
569                utilization: 1.0,
570                passed: t_fi >= 30.0, // R30 minimum
571            }
572        }
573
574        fn critical_temperature_composite(&self, _n_ed: f64) -> f64 {
575            // Concrete contribution delays steel heating
576            // Approximate: 500-600°C for typical concrete-filled tubes
577            550.0
578        }
579
580        fn unprotected_time(&self, theta_cr: f64, sf: SectionFactor) -> f64 {
581            let dt = 1.0 / 60.0;
582            let mut t = 0.0;
583            let mut theta_a = 20.0;
584
585            while theta_a < theta_cr && t < 300.0 {
586                let theta_g = self.exposure.temperature(t / 60.0);
587                let h_net = 25.0;
588                let rho_a = 7850.0;
589                let c_a = 600.0;
590                let dtheta = h_net * sf.am_v / (rho_a * c_a) * (theta_g - theta_a) * dt * 60.0;
591                theta_a += dtheta;
592                t += dt;
593            }
594            t * 60.0
595        }
596    }
597}
598
599trait SectionFireProps {
600    fn heated_perimeter_3sided(&self) -> f64;
601    fn heated_perimeter_4sided(&self) -> f64;
602    fn shadow_factor(&self) -> f64;
603}
604
605impl SectionFireProps for Section {
606    fn heated_perimeter_3sided(&self) -> f64 {
607        // Perimeter exposed on 3 sides (bottom not exposed)
608        let bounds = self.bounds();
609        let h = bounds.3 - bounds.2; // max_y - min_y = height
610
611        let mut perimeter = 0.0;
612
613        for i in 0..self.outer.vertices.len() {
614            let v1 = self.outer.vertices[i];
615            let v2 = self.outer.vertices[(i + 1) % self.outer.vertices.len()];
616
617            let mid_y = (v1.y + v2.y) / 2.0;
618            if mid_y > bounds.2 + 0.01 * h {
619                let dx = v2.x - v1.x;
620                let dy = v2.y - v1.y;
621                perimeter += (dx * dx + dy * dy).sqrt();
622            }
623        }
624
625        perimeter.max(0.01)
626    }
627
628    fn heated_perimeter_4sided(&self) -> f64 {
629        let mut perimeter = 0.0;
630
631        for i in 0..self.outer.vertices.len() {
632            let v1 = self.outer.vertices[i];
633            let v2 = self.outer.vertices[(i + 1) % self.outer.vertices.len()];
634            let dx = v2.x - v1.x;
635            let dy = v2.y - v1.y;
636            perimeter += (dx * dx + dy * dy).sqrt();
637        }
638
639        perimeter
640    }
641
642    fn shadow_factor(&self) -> f64 {
643        // k_sh for I-sections (shadow effect)
644        // k_sh = 1 - (b / h) * (t_f / t_w) * 0.25 (simplified)
645        let bounds = self.bounds();
646        let h = bounds.3 - bounds.2;
647        let b = bounds.1 - bounds.0;
648
649        if h > b * 2.0 {
650            // I-section like
651            0.9
652        } else {
653            1.0
654        }
655    }
656}
657
658#[cfg(test)]
659mod tests {
660    use super::*;
661
662    use crate::material::presets::STEEL_S355;
663
664    use crate::section_library::ParametricSection;
665
666    #[test]
667    fn section_factor_i_section() {
668        let i = crate::section_library::steel::ISection::from_designation("IPE300").unwrap();
669        let section = i.build();
670
671        let sf = SectionFactor::from_section(&section, FireExposure::Standard);
672
673        assert!(sf.am_v > 0.0);
674        assert!(sf.am > 0.0);
675        assert!(sf.v > 0.0);
676    }
677
678    #[test]
679    fn section_factor_hollow() {
680        let rhs = crate::section_library::steel::RectangularHollowSection::new(
681            0.2, 0.1, 0.005, 0.008, 0.003,
682        );
683        let section = rhs.build();
684
685        let sf = SectionFactor::from_section(&section, FireExposure::Standard);
686
687        // Hollow sections have lower A_m/V
688        assert!(sf.am_v < 300.0);
689    }
690
691    #[test]
692    fn critical_temperature() {
693        let i = crate::section_library::steel::ISection::from_designation("IPE300").unwrap();
694        let section = i.build();
695
696        let analysis = FireAnalysis::new(section, STEEL_S355);
697
698        // Low load ratio -> high critical temp
699        let theta_cr_low = analysis.critical_temperature(0.1);
700        let theta_cr_high = analysis.critical_temperature(0.7);
701
702        assert!(theta_cr_low > theta_cr_high);
703        assert!(theta_cr_low > 600.0);
704        assert!(theta_cr_high < 600.0);
705    }
706
707    #[test]
708    fn fire_resistance_time() {
709        let i = crate::section_library::steel::ISection::from_designation("IPE300").unwrap();
710        let section = i.build();
711
712        let analysis = FireAnalysis::new(section, STEEL_S355);
713        let t_fi = analysis.fire_resistance_time(0.5);
714
715        // IPE300 unprotected ~15-20 min for 50% load
716        assert!(t_fi > 10.0);
717        assert!(t_fi < 60.0);
718    }
719
720    #[test]
721    fn fire_protection() {
722        let i = crate::section_library::steel::ISection::from_designation("IPE300").unwrap();
723        let section = i.build();
724
725        let protection = FireProtection {
726            protection_type: ProtectionType::Board,
727            thickness: 0.02, // 20mm
728            conductivity: 0.2,
729            density: 800.0,
730            specific_heat: 1000.0,
731            moisture_content: 0.0,
732        };
733
734        let analysis = FireAnalysis::new(section, STEEL_S355).with_protection(protection);
735        let t_fi = analysis.fire_resistance_time(0.5);
736
737        // With 20mm board protection -> 60+ minutes
738        assert!(t_fi > 45.0);
739    }
740
741    #[test]
742    fn material_props_at_temp() {
743        let props_20 = MaterialPropertiesAtTemp::carbon_steel(20.0);
744        assert_eq!(props_20.ky, 1.0);
745        assert_eq!(props_20.ke, 1.0);
746
747        let props_600 = MaterialPropertiesAtTemp::carbon_steel(600.0);
748        assert!(props_600.ky < 0.5);
749        assert!(props_600.ke < 0.5);
750    }
751
752    #[test]
753    fn concrete_material_props() {
754        let props = MaterialPropertiesAtTemp::concrete(400.0, 30e6);
755        assert!(props.ky < 1.0 && props.ky > 0.0);
756    }
757
758    #[test]
759    fn composite_column() {
760        let steel = crate::section_library::steel::CircularHollowSectionLib::new(0.219, 0.008);
761        let concrete = crate::section_library::concrete::CircularConcreteSection::new(0.203);
762
763        let cft = composite::CFTFireAnalysis::new(
764            steel.build(),
765            concrete.build(),
766            STEEL_S355,
767            crate::material::presets::CONCRETE_C30_37,
768        );
769
770        let result = cft.fire_resistance(500e3, 10e3);
771        assert!(result.time > 0.0);
772    }
773
774    #[test]
775    fn shadow_factor_i_section_depth_gt_2x_width() {
776        // Regression test: h and b were swapped in shadow_factor.
777        // For I-section with depth=0.3, width=0.1: h > 2*b -> 0.3 > 0.2 -> true -> 0.9
778        // With bug: h=0.1 (width), b=0.3 (depth) -> 0.1 > 0.6 -> false -> 1.0
779        let i = crate::section_library::steel::ISection::new(0.3, 0.1, 0.008, 0.01, 0.012);
780        let section = i.build();
781        let sf = section.shadow_factor();
782        assert!(
783            (sf - 0.9).abs() < 1e-10,
784            "shadow_factor should be 0.9 for I-section with depth > 2*width, got {}",
785            sf
786        );
787    }
788}