Skip to content

Dizayer/RegulHeat

Repository files navigation

Regul'Heat

Heat strain assessment with sex and age stratification for sedentary and occupational populations

Python 3.10+ Streamlit Standards

Regul'Heat integrates the Gagge 2-node thermoregulatory model (Gagge et al. 1986; Ji et al. 2022) with ISO 7933 heat balance and ISO 7243 WBGT to provide realistic, population-specific heat strain predictions for sedentary individuals and occupational workers.

Population stratification by sex and age (Havenith 2001; Deurenberg 1991; Gagnon & Kenny 2012; Kenney & Munce 2003) adjusts maximum sweat rate and baseline core temperature to reflect individual physiological differences.

Designed for scientists and practitioners. All equations, coefficients, and thresholds cite primary sources (Gagge 1986, Havenith 2001, ISO 7933:2009, ISO 8996:2021).

v2.6.1 — public release.


Why Regul'Heat?

Two limitations motivated this tool over using ISO 7933 PHS alone:

  1. Unbounded Tre predictions: The ISO 7933 linear Euler integration produces physiologically impossible temperatures (46–49°C) in extreme conditions because it integrates constant heat storage with no thermoregulatory feedback. The Gagge 2-node model corrects this through dynamic vasomotor control and sweating feedback — producing realistic sigmoid Tre trajectories.

  2. No individualization in standard PHS: ISO 7933 uses a single reference subject. Regul'Heat adds population stratification (sex, age) to modulate sweat capacity and baseline core temperature, making predictions more realistic across demographic groups.


Features

  • Gagge 2-node thermoregulatory model — realistic sigmoid Tre and dynamic Tsk trajectories
  • Two population modes: Sedentary / Worker — each with appropriate thresholds, SWmax, and activity tables
  • Population stratification: sex and age corrections to SWmax and baseline Tre
  • Dual-model assessment: ISO 7243 WBGT (environmental) + Hybrid Gagge+ISO 7933 (physiological)
  • Three-tier threshold system: Caution / Warning / Danger — values differ by mode
  • Live weather fetch: Open-Meteo API (free, no key) — city name → real hourly forecast
  • Full physiological output: Tre and Tsk time series, sweat rate, skin wettedness, dehydration risk
  • Dynamic recommendations: hydration per 15 min, rest breaks, mode-aware messages
  • 126 unit tests covering all scientific models

Population modes and thresholds

Parameter Sedentary Worker
Caution threshold 38.0°C 38.5°C
Warning threshold 38.5°C 39.0°C
Danger threshold 39.0°C 39.5°C
SWmax (non-accl.) 200 W/m² 250 W/m²
SWmax (acclimatized) 200 W/m² 400 W/m²
Tre ceiling 42.0°C 42.0°C
Reference conservative ISO 7933:2009

Population stratification

Factor Correction Reference
Sex (female) SWmax ×0.85 Gagnon & Kenny 2012
Age (>50y) SWmax linear decline to ×0.80 at 70y Kenney & Munce 2003
Acclimatization Baseline Tre −0.2°C Havenith 2001
Body fat Estimated via Deurenberg 1991 (informational) Deurenberg et al. 1991

Default parameters (male, 35 years) produce identical output to the uncorrected model.


Quick start

# 1. Clone
git clone <repo-url>
cd regulheat

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run
streamlit run app.py

The app opens at http://localhost:8501.


Scientific models

Gagge 2-node thermoregulatory model (Gagge 1986, Ji 2022)

The body is divided into a core node (viscera, muscle) and a skin shell, coupled by blood flow. At each 1-minute step the model solves:

dTcore/dt = f(M, W, vasomotor, sweating, skin–core heat flow)
dTskin/dt = f(convection, radiation, evaporation, skin–core heat flow)

Sweating increases non-linearly with rising Tre and Tsk (sigmoidal, not linear). Vasodilation increases skin blood flow to dissipate heat. This produces bounded, physiologically realistic Tre trajectories — unlike the ISO 7933 linear Euler integration.

Implementation: pythermalcomfort.models.two_nodes_gagge_ji (Ji 2022 variant).

Hybrid Gagge + ISO 7933 heat balance

Gagge 2-node → (Tre_series, Tsk_series)  [per minute]
ISO 7933     → Ereq, Emax, wreq, SWp    [using Gagge's dynamic Tsk each minute]
  • Tre comes from Gagge (thermoregulatory feedback) for sedentary mode, or ISO 7933 Tre model for worker mode
  • Ereq, Emax, wreq, sweat volume from ISO 7933 equations per minute

A 42°C hard ceiling is applied to Tre (model validity limit; multi-organ failure begins above this).

WBGT — ISO 7243:2017

WBGT_outdoor = 0.7 × T_nwb + 0.2 × T_g + 0.1 × T_a
WBGT_indoor  = 0.7 × T_nwb + 0.3 × T_g
WBGT_effective = WBGT_calculated + clothing add-on (ISO 7243 Annex D)

MET values

  • Sedentary: ISO 8996:2021 Table C.1 — office work, light domestic, standing
  • Worker: ISO 8996:2021 Table C.2 — light/moderate/heavy/very heavy manual

Project structure

regulheat/
├── app.py                        # Streamlit application (Regul'Heat)
├── requirements.txt
├── .streamlit/config.toml        # Warm earth palette theme
├── src/
│   ├── models/
│   │   ├── gagge.py              # Gagge 2-node wrapper (Gagge 1986, Ji 2022)
│   │   ├── phs.py                # Hybrid Gagge+ISO 7933 + two-mode thresholds
│   │   ├── iso_tre.py            # ISO 7933 Tre model (worker mode)
│   │   ├── population.py         # Sex/age stratification (Havenith 2001)
│   │   ├── wbgt.py               # WBGT outdoor/indoor (ISO 7243)
│   │   ├── met.py                # MET tables: sedentary + worker (ISO 8996)
│   │   ├── risk.py               # Risk classification (ISO 7243 Annex B)
│   │   ├── clothing.py           # Clothing ensembles (ISO 7243 Annex D)
│   │   ├── sweat.py              # Sweat rate model (Sawka et al. 2007)
│   │   └── recommendations.py   # Dynamic recommendation engine
│   └── weather/
│       ├── api.py                # Open-Meteo forecast client
│       └── geocoding.py          # Open-Meteo geocoding (city → lat/lon)
└── tests/
    ├── test_gagge.py             # 9 tests — Gagge 2-node wrapper
    ├── test_phs.py               # 28 tests — hybrid PHS, modes, population
    ├── test_population.py        # 21 tests — sex/age stratification
    ├── test_iso_validation.py    # 6 tests — ISO 7933 Annex F scenarios
    ├── test_wbgt.py              # 16 tests
    ├── test_met.py               # 16 tests
    └── test_sweat.py             # 18 tests

Running tests

pytest tests/ -v

All 126 tests should pass.


Model limitations

  • Gagge 2-node: Calibrated for adults 18–80; not validated for children, pregnancy, or pathological conditions (impaired thermoregulation, cardiovascular disease).
  • Population stratification: Based on population-level averages (Deurenberg 1991, Gagnon & Kenny 2012, Kenney & Munce 2003). Individual variation within sex/age groups is not captured. Valid BMI range: 18–35 kg/m².
  • ISO 7933 vapour pressure: Antoine equation gives systematically ~33% higher Psat than standard Tetens — internally consistent throughout Malchaire (2001).
  • 42°C Tre ceiling is a model validity limit, not a clinical boundary.
  • Weather fetch uses ECMWF forecast data (Open-Meteo).

References

See REFERENCES.md for full citations with DOIs.

Key references:

  • Gagge AP, Fobelets AP, Berglund LG (1986). ASHRAE Trans. 92(2B):709–731.
  • Ji L et al. (2022). Building and Environment, 222, 109385.
  • Havenith G (2001). J Appl Physiol. 90(5):1943–1954.
  • Deurenberg P et al. (1991). Br J Nutr. 65(2):105–114.
  • Gagnon D, Kenny GP (2012). Eur J Appl Physiol. 112(1):37–49.
  • Kenney WL, Munce TA (2003). J Appl Physiol. 95(6):2598–2603.
  • ISO 7243:2017 · ISO 7933:2009 · ISO 7726:1998 · ISO 8996:2021

License

MIT — see LICENSE for details.

About

Hybrid Gagge + ISO 7933 heat strain model with population stratification for occupational and sedentary heat stress assessment

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages