From 709e51e1fa4ba7eee1a29b23a1d1167ae5b0ade6 Mon Sep 17 00:00:00 2001 From: fraxle Date: Sun, 26 Jul 2026 16:52:41 +0100 Subject: [PATCH] More calibrations --- assets/js/physics.js | 41 +++++++++++++++++++++++------------------ assets/js/utils.js | 18 ++++++++++++------ 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/assets/js/physics.js b/assets/js/physics.js index 257ef24..164cd17 100644 --- a/assets/js/physics.js +++ b/assets/js/physics.js @@ -377,15 +377,12 @@ export function calcManagedIndoorTempPass(TaArr, globArr, elevArr, buildingType // Panel surface temp - conductive gain into cabin air. // // 2. VERTICAL GLAZING GAIN (sun-angle dependent) -// When solar elevation is between ~10- and ~60-, the sun's rays -// cut through the side glass and windscreen at an angle that allows -// significant transmission into the cabin. This warms the cabin air -// but the occupant is modelled as NOT sitting in the beam - -// so it adds to ambient cabin temp, not direct radiant load. -// Outside that window a diffuse floor still applies: scattered sky -// light enters the glass at any sun angle, so the tent function is -// clamped rather than switched off (an unclamped tent produced a -// discontinuity where a LOWER sun gave MORE glazing gain). +// Sun cuts through the side glass and windscreen and warms the cabin +// air, but the occupant is modelled as NOT sitting in the beam - so it +// adds to ambient cabin temp, not direct radiant load. The beam on +// vertical glass goes as cos(elevation) averaged over azimuth, over a +// diffuse floor that applies at any sun angle. A parked vehicle is not +// aimed at the sun, so only orientFactor of the glazing is catching it. // // 3. HORIZONTAL GLAZING GAIN (rooflights / panoramic roofs) // Rooflights collect most strongly when the sun is high - the exact @@ -442,16 +439,24 @@ export function calcVehicleInteriorTemp(Ta, globalRad, solElev, vehicleType = 'c // -- 2. Vertical glazing gain (angle-dependent) -------------------- // Glazing transmission for auto glass ~0.70; scaled by vehicle glazing area. - // Tent function peaks at 35- elevation, where the sun cuts squarely through - // side glass and windscreen, and tapers either side. It is clamped at 0.30 - // (= the 0.15 diffuse floor once the 0.5 not-in-beam factor is applied) so - // scattered sky light always gets in. Without that clamp the gain fell to - // zero at 10- and 60- and then jumped back up outside the range. + // + // The beam landing on VERTICAL glass goes as cos(elevation) once averaged + // over azimuth, plus a diffuse floor of scattered sky light that gets in at + // any sun angle. orientFactor then accounts for the glazing that is NOT + // pointing at the sun - a parked vehicle is not aimed, and a motorhome's + // windscreen faces wherever it happened to park. + // + // This replaced a tent function that peaked at 35- elevation. That shape + // assumed the glass was always squarely aimed at the sun, so its factor + // nearly TRIPLED between 3pm and 5pm as the sun dropped toward the peak - + // sending a ventilated van climbing to +9 over ambient in the late + // afternoon when the measured excess stays flat around +5..6. It also had + // a discontinuity at its 10-/60- cut-offs where a LOWER sun gave MORE gain. const tau = 0.70 * preset.glazingArea; - const tent = (solElev != null && solElev > 0) - ? Math.max(0, 1 - Math.abs(solElev - 35) / 25) - : 0; - const glazingGain = tau * globalRad * Math.max(0.30, tent) * 0.5; // occupant not in beam + const angleFactor = (solElev != null && solElev > 0) + ? 0.30 + 0.70 * Math.cos(solElev * Math.PI / 180) + : 0.30; + const glazingGain = tau * globalRad * angleFactor * (preset.orientFactor ?? 0.65) * 0.5; // -- 3. Horizontal glazing gain (rooflights, panoramic roof) ------- // Rooflights collect in proportion to sin(elevation), so they peak at midday diff --git a/assets/js/utils.js b/assets/js/utils.js index 3d2b4c7..aa825d2 100644 --- a/assets/js/utils.js +++ b/assets/js/utils.js @@ -215,6 +215,12 @@ export function burnLabel(mins) { // roofGlazing - relative HORIZONTAL glass area (rooflights / Heki hatches / // panoramic glass roof). Gains from these peak at high sun, // which is exactly when the vertical-glass term is tailing off. +// orientFactor - fraction of the vertical glazing actually facing the sun, +// same idea as BUILDING_TYPES.orientFactor. A parked vehicle +// is NOT aimed at the sun: a car has glass on all four sides +// so a decent share always catches it (0.65), whereas a +// motorhome's glazing is dominated by one big windscreen +// pointing wherever it happened to park (0.50). // bodyU - effective body/panel conductance into the cabin. Cars are // thin metal/glass boxes; motorhomes/caravans have insulated // sandwich panels, commonly around 25-35 mm thick. @@ -234,12 +240,12 @@ export function burnLabel(mins) { // internalGain - small living-space warmth boost when closed up. // ------------------------------------------------------------------- export const VEHICLE_TYPES = { - car: { name: 'Car / Hatchback', albedo: 0.25, glazingArea: 1.00, roofGlazing: 0.00, bodyU: 4.0, hCabinLoss: 11.0, ventMult: 4.0, lagHours: 0.5, retainedWarmth: false, internalGain: 0.0 }, - mpv: { name: 'MPV / People Carrier', albedo: 0.25, glazingArea: 1.30, roofGlazing: 0.02, bodyU: 4.0, hCabinLoss: 11.5, ventMult: 4.0, lagHours: 0.6, retainedWarmth: false, internalGain: 0.0 }, - suv: { name: 'SUV / 4x4', albedo: 0.22, glazingArea: 1.10, roofGlazing: 0.02, bodyU: 3.8, hCabinLoss: 11.0, ventMult: 4.0, lagHours: 0.6, retainedWarmth: false, internalGain: 0.0 }, - truck: { name: 'Truck / HGV Cab', albedo: 0.30, glazingArea: 1.20, roofGlazing: 0.00, bodyU: 3.5, hCabinLoss: 10.5, ventMult: 4.0, lagHours: 0.7, retainedWarmth: false, internalGain: 0.0 }, - motorhome: { name: 'Motorhome / Campervan', albedo: 0.55, glazingArea: 0.85, roofGlazing: 0.06, bodyU: 0.9, hCabinLoss: 6.5, ventMult: 2.5, lagHours: 1.5, retainedWarmth: true, internalGain: 1.2 }, - caravan: { name: 'Caravan (towed)', albedo: 0.60, glazingArea: 0.55, roofGlazing: 0.07, bodyU: 0.8, hCabinLoss: 6.2, ventMult: 2.4, lagHours: 1.7, retainedWarmth: true, internalGain: 1.2 }, + car: { name: 'Car / Hatchback', albedo: 0.25, glazingArea: 1.00, roofGlazing: 0.00, orientFactor: 0.65, bodyU: 4.0, hCabinLoss: 11.5, ventMult: 4.0, lagHours: 0.5, retainedWarmth: false, internalGain: 0.0 }, + mpv: { name: 'MPV / People Carrier', albedo: 0.25, glazingArea: 1.30, roofGlazing: 0.02, orientFactor: 0.65, bodyU: 4.0, hCabinLoss: 13.0, ventMult: 4.0, lagHours: 0.6, retainedWarmth: false, internalGain: 0.0 }, + suv: { name: 'SUV / 4x4', albedo: 0.22, glazingArea: 1.10, roofGlazing: 0.02, orientFactor: 0.65, bodyU: 3.8, hCabinLoss: 12.0, ventMult: 4.0, lagHours: 0.6, retainedWarmth: false, internalGain: 0.0 }, + truck: { name: 'Truck / HGV Cab', albedo: 0.30, glazingArea: 1.20, roofGlazing: 0.00, orientFactor: 0.60, bodyU: 3.5, hCabinLoss: 11.0, ventMult: 4.0, lagHours: 0.7, retainedWarmth: false, internalGain: 0.0 }, + motorhome: { name: 'Motorhome / Campervan', albedo: 0.55, glazingArea: 0.85, roofGlazing: 0.06, orientFactor: 0.50, bodyU: 0.9, hCabinLoss: 7.0, ventMult: 2.5, lagHours: 1.5, retainedWarmth: true, internalGain: 1.2 }, + caravan: { name: 'Caravan (towed)', albedo: 0.60, glazingArea: 0.55, roofGlazing: 0.07, orientFactor: 0.55, bodyU: 0.8, hCabinLoss: 6.5, ventMult: 2.4, lagHours: 1.7, retainedWarmth: true, internalGain: 1.2 }, }; // -------------------------------------------------------------------