3.1.0.0
Vehicle Speed Calcs Extra At A Glance ranges New Driver profile
This commit is contained in:
+26
-32
@@ -11,7 +11,7 @@
|
||||
// calcConcreteTempPass(arrays...) thermal-lag pass over full hourly arrays
|
||||
// calcIndoorTempPass(TaArr, globArr, elevArr, buildingType) passive indoor temp
|
||||
// calcManagedIndoorTempPass(TaArr, globArr, elevArr, buildingType) managed indoor temp
|
||||
// calcVehicleInteriorTemp(Ta, globalRad, solElev, vehicleType, ventilated)
|
||||
// calcVehicleInteriorTemp(Ta, globalRad, solElev, vehicleType, ventilated, speedMph)
|
||||
// vaporPressureHpa(Ta, RH) Magnus formula - hPa
|
||||
// solarElevationDeg(lat, lon, dateUTC) NOAA simplified solar position (-)
|
||||
// calcTmrt(Ta, dirRad, diffRad, globalRad, solElev) Mean radiant temperature
|
||||
@@ -396,17 +396,24 @@ export function calcManagedIndoorTempPass(TaArr, globArr, elevArr, buildingType
|
||||
// 35-45 -C - dangerous for children/pets (hyperthermia risk)
|
||||
// > 45 -C - potentially fatal within minutes
|
||||
// -------------------------------------------------------------------
|
||||
export function calcVehicleInteriorTemp(Ta, globalRad, solElev, vehicleType = 'car', ventilated = false) {
|
||||
export function calcVehicleInteriorTemp(Ta, globalRad, solElev, vehicleType = 'car', ventilated = false, speedMph = 0) {
|
||||
if (globalRad == null || Ta == null) return null;
|
||||
|
||||
// Look up vehicle preset; fall back to a standard car if key unknown.
|
||||
const preset = VEHICLE_TYPES[vehicleType] || VEHICLE_TYPES.car;
|
||||
|
||||
// Road speed in m/s. speedMph = 0 is "Static" (parked) and reproduces the
|
||||
// original stationary model exactly; higher speeds scrub the shell with
|
||||
// forced airflow and (windows down) flush the cabin toward ambient.
|
||||
const vMs = Math.max(0, speedMph) * 0.447; // mph -> m/s
|
||||
|
||||
// -- 1. Panel conduction ------------------------------------------
|
||||
const panelAbsorbed = globalRad * (1 - preset.albedo); // W/m- absorbed by bodywork
|
||||
// Panel surface temp: absorbed solar / convective loss to outside air
|
||||
// hOut ~10 W/m-K (light breeze over panel surface even when parked)
|
||||
const hOut = 10;
|
||||
// Panel surface temp: absorbed solar / convective loss to outside air.
|
||||
// Parked, a light breeze over the panels gives hOut ~10 W/m-K. Once moving,
|
||||
// forced convection rises with road speed (same sqrt form as the surface
|
||||
// model), so the bodywork runs progressively closer to ambient.
|
||||
const hOut = 10 + 5.5 * Math.sqrt(vMs);
|
||||
const panelSurfaceTemp = Ta + panelAbsorbed / hOut;
|
||||
// Conductive gain into cabin. Cars are thin metal + trim; motorhomes and
|
||||
// caravans use insulated sandwich panels, so their bodyU is much lower.
|
||||
@@ -437,10 +444,14 @@ export function calcVehicleInteriorTemp(Ta, globalRad, solElev, vehicleType = 'c
|
||||
const totalGain = conductionGain + glazingGain;
|
||||
// Cabin heat rejection: an effective blend of leakage, internal air volume,
|
||||
// and surfaces exchanging heat with the outside. With windows open it is
|
||||
// roughly 5- higher - air moves freely
|
||||
// through the cabin, flushing heat out and capping interior temperature much
|
||||
// closer to ambient. Cabin temp still rises a little due to panel/roof solar gain.
|
||||
const effectiveHLoss = ventilated ? preset.hCabinLoss * 5 : preset.hCabinLoss;
|
||||
// roughly 5x higher when parked - air moves freely through the cabin,
|
||||
// flushing heat out and capping interior temperature much closer to ambient.
|
||||
// On the move the through-draught multiplies this further (a 70 mph open
|
||||
// window flushes the cabin almost to ambient). Sealed but moving rejects a
|
||||
// little faster too, because the cooler shell pulls cabin heat out.
|
||||
const speedFactor = 1 + vMs / 12; // grows with road speed (windows-open draught)
|
||||
const lossMult = ventilated ? 5 * speedFactor : 1 + vMs / 40;
|
||||
const effectiveHLoss = preset.hCabinLoss * lossMult;
|
||||
const thermalMass = preset.thermalMass ?? 1;
|
||||
const solarRise = (totalGain / effectiveHLoss) * thermalMass;
|
||||
|
||||
@@ -493,30 +504,13 @@ export function calcVehicleInteriorTemp(Ta, globalRad, solElev, vehicleType = 'c
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -- FUTURE FEATURE: Vehicle-at-speed thermal model ----------------------------
|
||||
// Idea: extend calcVehicleInteriorTemp (or add a companion function) to model
|
||||
// cabin temperature for a vehicle travelling at speed, not just parked.
|
||||
// -- Vehicle-at-speed thermal model (IMPLEMENTED) ------------------------------
|
||||
// calcVehicleInteriorTemp now takes a speedMph argument (Static / 20 / 50 / 70
|
||||
// mph in the UI). Forced convection over the shell scales with road speed, and
|
||||
// windows-open through-flow scales further with speed, so a moving cabin runs
|
||||
// cooler than the same parked car. speedMph = 0 reproduces the static model.
|
||||
//
|
||||
// Key physics differences from the static model:
|
||||
// - Forced convection over the shell scales with vehicle speed (v-), so
|
||||
// hOut rises significantly - shell cools much faster than when parked.
|
||||
// - Above ~30 mph the vehicle's own forward motion dominates airflow, so
|
||||
// ambient wind direction becomes largely irrelevant (simplifies the model).
|
||||
// - Speed classes to model: urban (~20 mph), dual carriageway (~50 mph),
|
||||
// motorway (~70 mph) - each with a derived hOut multiplier.
|
||||
// - Windows-open behaviour changes completely at speed: at 70 mph open
|
||||
// windows create high-velocity through-flow, dramatically cutting cabin
|
||||
// temp vs. the sealed-car case (but much less pleasant than AC!).
|
||||
// - Roof and bonnet solar gain stays the same; side-glass gain is unchanged.
|
||||
// - AC-off vs AC-on would be the primary user toggle alongside speed class.
|
||||
//
|
||||
// Suggested signature:
|
||||
// calcVehicleInteriorTempAtSpeed(Ta, globalRad, solElev, vehicleType, speedMph, windowsOpen)
|
||||
//
|
||||
// This would be a useful companion output column (e.g. "Vehicle (moving)")
|
||||
// for road-trip planning, dog-in-car safety at a rest stop vs. motorway, etc.
|
||||
//
|
||||
// -- CYCLIST AT SPEED (companion to the above) --------------------------------
|
||||
// -- CYCLIST AT SPEED (FUTURE) ------------------------------------------------
|
||||
// A cyclist generates their own headwind, so the felt temperature (UTCI) is
|
||||
// very different from a stationary person - even without ambient wind.
|
||||
// Could share the same speed-class approach as the vehicle model:
|
||||
|
||||
Reference in New Issue
Block a user