Entropyk/_bmad-output/implementation-artifacts/11-10-moving-boundary-hx-cache.md

62 lines
1.5 KiB
Markdown

# Story 11.10: MovingBoundaryHX - Cache Optimization
**Epic:** 11 - Advanced HVAC Components
**Priorité:** P1-HIGH
**Estimation:** 4h
**Statut:** backlog
**Dépendances:** Story 11.9 (MovingBoundaryHX Zones)
---
## Story
> En tant qu'utilisateur critique de performance,
> Je veux que le MovingBoundaryHX mette en cache les calculs de zone,
> Afin que les itérations 2+ soient beaucoup plus rapides.
---
## Contexte
Le calcul complet de discrétisation prend ~50ms. En mettant en cache les résultats, les itérations suivantes peuvent utiliser l'interpolation linéaire en ~2ms (25x plus rapide).
---
## Cache Structure
```rust
pub struct MovingBoundaryCache {
// Positions des frontières de zone (0.0 à 1.0)
pub zone_boundaries: Vec<f64>,
// UA par zone
pub ua_per_zone: Vec<f64>,
// Enthalpies de saturation
pub h_sat_l_hot: f64,
pub h_sat_v_hot: f64,
pub h_sat_l_cold: f64,
pub h_sat_v_cold: f64,
// Conditions de validité
pub p_ref_hot: f64,
pub p_ref_cold: f64,
pub m_ref_hot: f64,
pub m_ref_cold: f64,
// Cache valide?
pub valid: bool,
}
```
---
## Critères d'Acceptation
- [ ] Itération 1: calcul complet (~50ms)
- [ ] Itérations 2+: cache si ΔP < 5% et Δm < 10% (~2ms)
- [ ] Cache invalidé sur changements significatifs
- [ ] Cache stocke: zone_boundaries, ua_per_zone, h_sat values, refs
---
## Références
- [Epic 11 Technical Specifications](../planning-artifacts/epic-11-technical-specifications.md)