conspire/constitutive/thermal/conduction/fourier/
mod.rs

1#[cfg(test)]
2mod test;
3
4use super::{
5    Constitutive, HeatFlux, Parameters, Scalar, TemperatureGradient, Thermal, ThermalConduction,
6};
7
8/// The Fourier thermal conduction constitutive model.
9///
10/// **Parameters**
11/// - The thermal conductivity $`k`$.
12///
13/// **External variables**
14/// - The temperature gradient $`\nabla T`$.
15///
16/// **Internal variables**
17/// - None.
18#[derive(Debug)]
19pub struct Fourier<P> {
20    parameters: P,
21}
22
23impl<P> Fourier<P>
24where
25    P: Parameters,
26{
27    fn thermal_conductivity(&self) -> &Scalar {
28        self.parameters.get(0)
29    }
30}
31
32impl<P> Constitutive<P> for Fourier<P>
33where
34    P: Parameters,
35{
36    fn new(parameters: P) -> Self {
37        Self { parameters }
38    }
39}
40impl<P> Thermal for Fourier<P> where P: Parameters {}
41
42impl<P> ThermalConduction for Fourier<P>
43where
44    P: Parameters,
45{
46    /// Calculates and returns the heat flux.
47    ///
48    /// ```math
49    /// \mathbf{q}(\nabla T) = -k\nabla T
50    /// ```
51    fn heat_flux(&self, temperature_gradient: &TemperatureGradient) -> HeatFlux {
52        temperature_gradient * -self.thermal_conductivity()
53    }
54}