3.3
Added pets profile
This commit is contained in:
+45
-34
@@ -526,40 +526,51 @@ export function calcShadeAirTemp(Ta, effectiveRad, va, elev, shade) {
|
||||
return Ta + Math.max(-4, Math.min(5, adj));
|
||||
}
|
||||
|
||||
// -- FUTURE FEATURE v2: Pets Profile - Fur Temperature & Heat Stress ----------
|
||||
// Dogs and cats experience heat very differently from humans:
|
||||
//
|
||||
// FUR SURFACE TEMPERATURE
|
||||
// Dark/thick fur absorbs solar radiation and can run significantly hotter
|
||||
// than air temperature - similar in principle to calcConcreteTemp() but
|
||||
// with fur-specific albedo values:
|
||||
// Black fur: albedo ~0.05 (almost all radiation absorbed)
|
||||
// Brown fur: albedo ~0.15
|
||||
// Golden fur: albedo ~0.25
|
||||
// White fur: albedo ~0.40
|
||||
// Add a calcFurSurfaceTemp(Ta, globalRad, windSpeed, furAlbedo) function
|
||||
// mirroring calcConcreteTemp but with appropriate convective coefficients
|
||||
// for fur (lower hc than concrete - fur insulates).
|
||||
//
|
||||
// PAW BURN RISK
|
||||
// Paw pads are highly sensitive to surface temperature. Use calcConcreteTemp()
|
||||
// output directly - the existing concrete surface temp is already the right
|
||||
// number. Threshold guidance:
|
||||
// < 40 -C - safe
|
||||
// 40-52 -C - discomfort / possible burn (hold-your-hand-for-7-seconds test)
|
||||
// > 52 -C - burns within 60 seconds
|
||||
// Display as a simple traffic-light column in the Pets profile.
|
||||
//
|
||||
// BREED-SPECIFIC HEAT STRESS
|
||||
// Brachycephalic breeds (Bulldogs, Pugs, French Bulldogs, Persians) have
|
||||
// severely impaired thermoregulation - their safe UTCI ceiling is much lower.
|
||||
// A breed selector (Normal / Brachycephalic / Senior) applies a risk multiplier
|
||||
// to the UTCI thresholds, similar to the planned activity modifier.
|
||||
//
|
||||
// SUGGESTED COLUMNS FOR PETS PROFILE
|
||||
// Hour | Air Temp | UTCI+P | Fur Surface Temp | Paw Burn Risk | Shade Advised
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// -- Pets Profile - Fur Surface Temperature -----------------------------------
|
||||
// Cats and small dogs experience solar heat differently from bare pavement:
|
||||
// a coat absorbs radiation like calcConcreteTemp()'s slab, but a thin/short
|
||||
// coat over a living, blood-perfused body insulates less than a heavy double
|
||||
// coat and never bakes as hot as dead concrete. furAlbedo varies by coat
|
||||
// colour (FUR_COLORS in utils.js): black ~0.05, brown ~0.15, golden ~0.25,
|
||||
// white ~0.40. Paw burn risk reuses calcConcreteTemp() output directly (the
|
||||
// ground/pavement surface temp is already the right number for paw contact):
|
||||
// < 40 -C - safe
|
||||
// 40-52 -C - discomfort / possible burn (hold-your-hand-for-7-seconds test)
|
||||
// > 52 -C - burns within 60 seconds
|
||||
// A breed-specific multiplier (brachycephalic/senior) is deliberately not
|
||||
// modelled - this profile targets cats and small dogs as the reference animal.
|
||||
// -------------------------------------------------------------------------
|
||||
export function calcFurSurfaceTemp(Ta, globalRad, windSpeed, solElev, furAlbedo = 0.15) {
|
||||
if (globalRad == null || Ta == null) return null;
|
||||
const elevDeg = (solElev != null) ? Math.max(5, solElev) : 45;
|
||||
const angleCorrection = Math.sin(elevDeg * Math.PI / 180);
|
||||
const absorbed = globalRad * (1 - furAlbedo) * angleCorrection;
|
||||
// Lower convective coefficient than bare concrete (hc=10+4.5*sqrt(v)) -
|
||||
// trapped air in the coat insulates, running the surface hotter for a
|
||||
// given wind speed than pavement, but not as insulated as a thick double
|
||||
// coat, so it sits between "bare skin" and "heavy fur".
|
||||
const hc = 7 + 3.5 * Math.sqrt(Math.max(windSpeed || 0, 0));
|
||||
const Ts = Ta + absorbed / hc;
|
||||
// Floor at air temp; cap below concrete's 85-C ceiling - a thin coat over
|
||||
// a living body doesn't bake as hot as dead pavement. No wet-fur/rain
|
||||
// evaporative term yet (future refinement, mirrors calcConcreteTemp's).
|
||||
return Math.max(Ta, Math.min(Ts, 70));
|
||||
}
|
||||
|
||||
export const LAG_HOURS_FUR = 0.4; // ~24 min - low thermal mass, animal moves in/out of sun
|
||||
|
||||
export function calcFurSurfaceTempPass(TaArr, radArr, vaArr, elevArr, furAlbedo = 0.15) {
|
||||
const n = TaArr.length;
|
||||
const result = new Array(n);
|
||||
const alpha = 1 - Math.exp(-1 / LAG_HOURS_FUR);
|
||||
let Tf = calcFurSurfaceTemp(TaArr[0], radArr[0], vaArr[0], elevArr[0], furAlbedo) ?? TaArr[0];
|
||||
for (let i = 0; i < n; i++) {
|
||||
const target = calcFurSurfaceTemp(TaArr[i], radArr[i], vaArr[i], elevArr[i], furAlbedo) ?? TaArr[i];
|
||||
Tf = Tf + alpha * (target - Tf);
|
||||
result[i] = Math.max(TaArr[i], Tf);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// -- Vehicle-at-speed thermal model (IMPLEMENTED) ------------------------------
|
||||
// calcVehicleInteriorTemp now takes a speedMph argument (Static / 20 / 50 / 70
|
||||
|
||||
Reference in New Issue
Block a user