pub struct HeatConduction1D {
pub n_nodes: usize,
pub length: f64,
pub temperature: Vec<f64>,
pub material: ThermalMaterial,
}Expand description
Fourier heat conduction in 1D via explicit finite differences.
Fields§
§n_nodes: usizeNumber of nodes (including boundary nodes).
length: f64Domain length [m].
temperature: Vec<f64>Current nodal temperatures [K].
material: ThermalMaterialMaterial properties.
Implementations§
Source§impl HeatConduction1D
impl HeatConduction1D
Sourcepub fn new(
n_nodes: usize,
length: f64,
t_init: f64,
material: ThermalMaterial,
) -> Self
pub fn new( n_nodes: usize, length: f64, t_init: f64, material: ThermalMaterial, ) -> Self
Construct a uniform-temperature rod.
Sourcepub fn set_temperature_bc(&mut self, t_left: f64, t_right: f64)
pub fn set_temperature_bc(&mut self, t_left: f64, t_right: f64)
Set Dirichlet BCs at both ends.
Sourcepub fn step_explicit(&mut self, dt: f64) -> bool
pub fn step_explicit(&mut self, dt: f64) -> bool
Explicit (forward-Euler) time step.
Sourcepub fn step_explicit_with_source(&mut self, dt: f64, source: f64) -> bool
pub fn step_explicit_with_source(&mut self, dt: f64, source: f64) -> bool
Explicit step with volumetric heat source Q (W/m^3).
Sourcepub fn critical_dt(&self) -> f64
pub fn critical_dt(&self) -> f64
Maximum stable time step: dx^2 / (2 * alpha).
Sourcepub fn steady_state_temperature(&self, t_left: f64, t_right: f64) -> Vec<f64>
pub fn steady_state_temperature(&self, t_left: f64, t_right: f64) -> Vec<f64>
Exact steady-state temperature profile (linear between BCs).
Sourcepub fn heat_flux(&self) -> Vec<f64>
pub fn heat_flux(&self) -> Vec<f64>
Heat flux at each interior node via central finite differences.
Sourcepub fn total_heat_content(&self) -> f64
pub fn total_heat_content(&self) -> f64
Total heat stored in the rod (integral of rhocpT*dx).
Auto Trait Implementations§
impl Freeze for HeatConduction1D
impl RefUnwindSafe for HeatConduction1D
impl Send for HeatConduction1D
impl Sync for HeatConduction1D
impl Unpin for HeatConduction1D
impl UnsafeUnpin for HeatConduction1D
impl UnwindSafe for HeatConduction1D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more