pub struct StructuralSolver {Show 17 fields
pub section: CrossSection,
pub load: LoadCase,
pub axial_load_n: Fix128,
pub column_length_mm: Fix128,
pub end_condition: ColumnEndCondition,
pub material: MaterialProperties,
pub plastic_model: PlasticModel,
pub sn_curve: SnCurve,
pub creep_params: FindleyParameters,
pub norton_creep: NortonCreep,
pub operating_temp_c: Fix128,
pub dt_s: Fix128,
pub state: PlasticState,
pub elapsed_hours: Fix128,
pub fatigue_damage: Fix128,
pub failure_step: Option<u64>,
pub step_count: u64,
}Expand description
Structural solver configuration bundle.
Fields§
§section: CrossSectionBeam geometry (used for bending stress and axial buckling).
load: LoadCaseBending load applied every step.
axial_load_n: Fix128Axial column load (N) applied every step (0 = pure bending).
column_length_mm: Fix128Column length for buckling check (mm).
end_condition: ColumnEndConditionEnd condition for buckling check.
material: MaterialPropertiesFilament material.
plastic_model: PlasticModelPlastic constitutive model.
sn_curve: SnCurveFatigue S-N curve.
creep_params: FindleyParametersLong-term creep parameters.
norton_creep: NortonCreepNorton creep (short-term); used for the plastic-state creep field.
operating_temp_c: Fix128Operating temperature (°C) used for time-temperature shift.
dt_s: Fix128Time-step size (seconds).
state: PlasticStateState carried across steps.
elapsed_hours: Fix128Total elapsed simulation time (hours).
fatigue_damage: Fix128Accumulated fatigue damage (Miner).
failure_step: Option<u64>Failure step marker (once set, remains set).
step_count: u64Step counter.
Implementations§
Source§impl StructuralSolver
impl StructuralSolver
Sourcepub fn new(
section: CrossSection,
load: LoadCase,
material: MaterialProperties,
) -> Self
pub fn new( section: CrossSection, load: LoadCase, material: MaterialProperties, ) -> Self
Construct with from_fdm_material defaults for the given material and
bending load case. Axial load defaults to zero (pure bending).
Creep: the PLA presets are installed only when material is the PLA
preset (FDM category, name "PLA"). For every other material creep is
not modelled (zero coefficients, Self::creep_modelled is false,
reported creep strain is exactly zero) until Self::with_creep
supplies parameters.
Fatigue: the S-N curve is SnCurve::for_material (SUS304 / A5052
metal presets for those preset materials, the FDM rule of thumb for
every other material) until Self::with_sn_curve replaces it.
Sourcepub fn with_creep(self, findley: FindleyParameters, norton: NortonCreep) -> Self
pub fn with_creep(self, findley: FindleyParameters, norton: NortonCreep) -> Self
Replace both creep models, for any material. After this call creep is
modelled with exactly these parameters (unless all of findley.epsilon_0,
findley.m and norton.a are zero, which is the not-modelled state).
Sourcepub fn with_sn_curve(self, curve: SnCurve) -> Self
pub fn with_sn_curve(self, curve: SnCurve) -> Self
Replace the S-N curve used by the per-step Miner damage,
Self::fatigue_strength_mpa and Self::fatigue_spectrum_report.
Sourcepub fn fatigue_strength_mpa(
&self,
cycles: u64,
) -> Result<Fix128, FatigueRangeError>
pub fn fatigue_strength_mpa( &self, cycles: u64, ) -> Result<Fix128, FatigueRangeError>
Alternating stress (MPa) at which the solver’s S-N curve predicts
failure after exactly cycles: the Basquin inverse
S = S_e · (N_e / N)^(1/m), and S_e for cycles ≥ N_e.
§Errors
FatigueRangeError::ZeroCycles for cycles == 0,
FatigueRangeError::BelowLowCycleBound under 1 000 cycles (outside
the Basquin range), FatigueRangeError::NonPositiveExponent for a
curve with fatigue_exponent_m == 0.
Sourcepub fn fatigue_spectrum_report(
&self,
spectrum: &[SpectrumEntry],
) -> FatigueReport
pub fn fatigue_spectrum_report( &self, spectrum: &[SpectrumEntry], ) -> FatigueReport
Miner’s rule D = Σ nᵢ / N(Sᵢ) of a variable-amplitude spectrum on
the solver’s S-N curve, with is_safe = D < 1 and the safety factor
1 / D. Independent of the solver’s accumulated per-step damage.
Sourcepub fn plate_buckling_mpa(
&self,
thickness_mm: Fix128,
width_mm: Fix128,
poisson: Fix128,
edge_factor_k: Fix128,
) -> Fix128
pub fn plate_buckling_mpa( &self, thickness_mm: Fix128, width_mm: Fix128, poisson: Fix128, edge_factor_k: Fix128, ) -> Fix128
Local plate buckling stress (MPa) of a wall of thickness_mm and
width width_mm made of the solver’s material (Timoshenko):
σ_cr = k · π² E / (12 (1 − ν²)) · (t / b)², E = the material’s
Young’s modulus. edge_factor_k is 4 for a wall simply supported on
all edges, 0.425 with one free edge; poisson is supplied by the
caller because MaterialProperties carries no Poisson ratio. Returns 0
for width_mm == 0 or poisson == ±1.
Sourcepub fn snap_through_load_n(
&self,
rise_mm: Fix128,
span_mm: Fix128,
) -> Result<Fix128, SnapThroughError>
pub fn snap_through_load_n( &self, rise_mm: Fix128, span_mm: Fix128, ) -> Result<Fix128, SnapThroughError>
Snap-through (limit) load (N) of a shallow two-bar truss of rise
rise_mm and span span_mm whose bars have the solver’s
cross-section and material: P = (16 / (3√3)) · E A (h / L)³.
§Errors
SnapThroughError::NonPositiveSpan for span_mm ≤ 0,
SnapThroughError::NonPositiveStiffness for a non-positive modulus
or section area, SnapThroughError::NegativeRise for rise_mm < 0.
Sourcepub fn creep_modelled(&self) -> bool
pub fn creep_modelled(&self) -> bool
Whether creep is modelled for this solver. false means both creep
models carry zero coefficients (creep_params.epsilon_0,
creep_params.m and norton_creep.a all zero) and every
StructuralReport::creep_strain is exactly zero: new leaves a
non-PLA material in this state.
Sourcepub fn step(&mut self) -> StructuralReport
pub fn step(&mut self) -> StructuralReport
Advance one step and return the current diagnostics.
Sourcepub fn run(&mut self, n_steps: u64) -> StructuralHistory
pub fn run(&mut self, n_steps: u64) -> StructuralHistory
Run for n steps and return a snapshot of the final state.
Trait Implementations§
Source§impl Clone for StructuralSolver
impl Clone for StructuralSolver
impl Copy for StructuralSolver
Auto Trait Implementations§
impl Freeze for StructuralSolver
impl RefUnwindSafe for StructuralSolver
impl Send for StructuralSolver
impl Sync for StructuralSolver
impl Unpin for StructuralSolver
impl UnsafeUnpin for StructuralSolver
impl UnwindSafe for StructuralSolver
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more