Geometry-Based Thermodynamic Homogenization for Porous Media, with Application to Resilience Prediction and Gyroscopic Sustainability