Update desktop profile hover button
Recalibrated vehicle ventilation calcs
This commit is contained in:
fraxle
2026-07-26 16:03:53 +01:00
parent 84d035d903
commit dbadb1d410
10 changed files with 271 additions and 81 deletions
+14 -5
View File
@@ -13,7 +13,7 @@
import {
vaporPressureHpa, solarElevationDeg, calcTmrt, utciApprox,
calcConcreteTempPass, calcVehicleInteriorTemp,
calcConcreteTempPass, calcVehicleInteriorTempPass,
calcIndoorTempPass, calcManagedIndoorTempPass, calcShadeAirTemp,
calcFurSurfaceTempPass,
} from './physics.js';
@@ -88,7 +88,7 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
// (building shadow, beach umbrella, canopy...). Shares SunSoak's TaEnv
// baseline and env-reduced radiation, so the two columns stay consistent.
const shadeT = calcShadeAirTemp(TaEnv, dirEnv + difEnv * 0.2, va, elev, env.shade);
const vehicleT = calcVehicleInteriorTemp(Ta, glob, elev, vehicleType, vehicleVent, vehicleSpeed);
// vehicleT is stamped in the two-pass section below (thermal lag).
const eh = vaporPressureHpa(Ta, RH);
const Tmrt = calcTmrt(TaEnv, dirEnv, difEnv, globEnv, elev);
const utci = utciApprox(TaEnv, Tmrt, va, eh);
@@ -153,7 +153,7 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
cc, ccLow, ccMid, ccHigh, cloudCat,
uv, uvA, uvB,
precip, precipProb, lightning, cape, snow,
soilT0, soilT6, soilM, vehicleT, shadeT,
soilT0, soilT6, soilM, shadeT,
effectiveRad,
elev, Tmrt, utci, utciAdj, eh, compass,
visKm, aqi,
@@ -161,8 +161,8 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
};
}) : [];
// Two-pass calculations: concrete thermal lag + indoor temperature.
// Both need the full hourly arrays so they can look back at previous
// Two-pass calculations: concrete thermal lag + indoor + vehicle cabin.
// All need the full hourly arrays so they can look back at previous
// hours. Run after hourlyRows is built, then stamp each row.
if (hourlyRows.length > 0) {
const TaArr = hourlyRows.map(r => r.Ta);
@@ -188,6 +188,15 @@ export function buildHourlyRows({ forecast, airQuality, location, vehicleType, v
const managedTemps = calcManagedIndoorTempPass(TaArr, globArr, elevArr, buildingType);
hourlyRows.forEach((r, i) => { r.indoorT = indoorTemps[i]; r.managedT = managedTemps[i]; });
// Vehicle cabin temperature with thermal lag. A parked vehicle climbs
// toward the hour's equilibrium rather than jumping to it, so a van that
// has been in the sun since morning reads hotter than the same van an
// hour after parking. vaArr feeds ambient wind into shell convection.
const vehicleTemps = calcVehicleInteriorTempPass(
TaArr, globArr, elevArr, vaArr, vehicleType, vehicleVent, vehicleSpeed
);
hourlyRows.forEach((r, i) => { r.vehicleT = vehicleTemps[i]; });
// Fur surface temperature with thermal lag - Pets profile.
const furAlbedo = (FUR_COLORS[furColor] || FUR_COLORS.brown).albedo;
const furTemps = calcFurSurfaceTempPass(TaArr, radArr, vaArr, elevArr, furAlbedo);