Skip to main content

hydr_structures/structures/gate/
applicability.rs

1//! Explicit coefficient and hydraulic-envelope evidence for rectangular gates.
2
3use crate::structures::{StructureError, definition};
4
5/// Evidence for the hydrostatic pressure-strip closure across the admitted aperture envelope.
6#[derive(Clone, Debug, PartialEq, Eq)]
7pub struct GateApplicability {
8    /// Coefficient source, calibration, or declared assumption.
9    pub coefficient_provenance: String,
10    /// Evidence for hydrostatic pressures and negligible approach velocity between quiescent pools.
11    pub hydrostatic_quiescent_pool_assertion: String,
12    /// Coefficient applicability across free, mixed, submerged, and partly wetted openings.
13    pub free_submerged_aperture_applicability: String,
14    /// Evidence that both connections expose the complete sill-to-opening aperture.
15    pub unobstructed_aperture_assertion: String,
16    /// Explicit coefficient applicability under reversed flow.
17    pub symmetric_reversal: bool,
18}
19impl GateApplicability {
20    pub(crate) fn check(&self) -> Result<(), StructureError> {
21        for (value, field) in [
22            (&self.coefficient_provenance, "coefficient_provenance"),
23            (
24                &self.hydrostatic_quiescent_pool_assertion,
25                "hydrostatic_quiescent_pool_assertion",
26            ),
27            (
28                &self.free_submerged_aperture_applicability,
29                "free_submerged_aperture_applicability",
30            ),
31            (
32                &self.unobstructed_aperture_assertion,
33                "unobstructed_aperture_assertion",
34            ),
35        ] {
36            definition::text(value, field)?;
37        }
38        Ok(())
39    }
40}