diff options
| author | Louis <louis@dnge.de> | 2026-11-06 16:58:13 +0100 |
|---|---|---|
| committer | Louis <louis@dnge.de> | 2026-11-06 16:58:13 +0100 |
| commit | bcfbc9630d5c052a23b8bfe205d11d0ba3feac41 (patch) | |
| tree | e4ba3115476455aff63498fd67aa467ffb5376fd /web/app.js | |
| parent | c440e6388381eeb52e1427e179e5ebecf8958316 (diff) | |
| download | deckungsanteil-bcfbc9630d5c052a23b8bfe205d11d0ba3feac41.tar.gz | |
Add Remko LWM 80/110/150 capacity and COP curves
Capacity (n-max) and COP per outdoor and flow temperature from the
installation manual. With a device the bivalence point follows from
capacity and load (manual switching temperature in alternative mode);
load not covered above it is reported separately, cycling hours below
the minimum capacity are counted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'web/app.js')
| -rw-r--r-- | web/app.js | 191 |
1 files changed, 139 insertions, 52 deletions
@@ -9,8 +9,6 @@ const HOUR_MONTH = new Uint8Array(8760); MONTH_DAYS.forEach((days, m) => { HOUR_MONTH.fill(m, h, h + days * 24); h += days * 24; }); } -// Remko LWM 110 datasheet, full load at W35: [outdoor °C, COP] -const LWM110_W35 = [[-7, 3.42], [2, 4.04], [7, 5.02]]; // constant source temperature of ground and water heat pumps, and their Carnot efficiency const SOURCE = { brine: [0, 0.68], water: [10, 0.68], dx: [-2, 0.68] }; const K = 273.15; @@ -18,7 +16,6 @@ const K = 273.15; // Carnot COP between condensing (5 K above flow) and evaporating (6 K below source) temperature const carnot = (flow, source) => (flow + 5 + K) / (flow + 5 - (source - 6)); const COP_MAX = 6.5; -const LWM110_ETA = LWM110_W35.map(([t, cop]) => [t, cop / carnot(35, t)]); function interp(points, x) { if (x <= points[0][0]) return points[0][1]; @@ -29,6 +26,22 @@ function interp(points, x) { return points[points.length - 1][1]; } +/** Interpolate a device table ({35: points, 45: points, 55: points}) in outdoor and flow temperature. */ +function interpFlow(table, t, flow) { + const f = Math.min(55, Math.max(35, flow)); + const f0 = f >= 45 ? 45 : 35, f1 = f0 + 10; + const v0 = interp(table[f0], t), v1 = interp(table[f1], t); + return v0 + ((v1 - v0) * (f - f0)) / (f1 - f0); +} + +/** Device COP; outside the datasheet range it is scaled with the Carnot COP. */ +function deviceCop(dev, t, flow) { + const points = dev.cop[35]; + const tc = Math.min(points[points.length - 1][0], Math.max(points[0][0], t)); + const fc = Math.min(55, Math.max(35, flow)); + return Math.min(COP_MAX, (interpFlow(dev.cop, tc, fc) * carnot(flow, t)) / carnot(fc, tc)); +} + // Backup heating fuels, energy content as lower heating value. `perPrice` is the energy in // kWh bought per price unit and `scale` converts the price to euros. const FUELS = { @@ -102,31 +115,48 @@ function temperatures(slice, resolution) { /** * Hour-by-hour split of the heating load between heat pump and backup heater. - * Load is linear from qn at tn to 0 at the heating limit thg. The heat pump is - * sized so that its capacity equals the load at the bivalence point; its capacity - * changes by `slope` (fraction per K) with the outdoor temperature. + * Load is linear from qn at tn to 0 at the heating limit thg. A datasheet device + * delivers its maximum capacity; the generic heat pump is sized so that its capacity + * equals the load at the bivalence point and changes by `slope` (fraction per K). + * With a device the bivalence point is where its capacity meets the load, except in + * alternative mode, where it is the user's switching temperature. + * Below the bivalence point the backup heater is released (always when monovalent, + * i.e. monoenergetic with heater rod); load neither of them covers stays uncovered. */ function model(p) { - const tb = p.mode === "mono" ? p.tn : p.tbiv; + const dev = p.type === "air" && p.device !== "generic" ? DEVICES[p.device] : null; + let tb = p.mode === "mono" ? p.tn : p.tbiv; const load = (t) => (t < p.thg ? (p.qn * (p.thg - t)) / (p.thg - p.tn) : 0); - const pb = load(tb); - const capacity = (t) => Math.max(0, pb * (1 + p.slope * (t - tb))); - const heatPump = (t) => { - if (p.mode === "alternative" && t < tb) return 0; - if (p.mode === "parallel" && Number.isFinite(p.cutoff) && t < p.cutoff) return 0; - return Math.min(load(t), capacity(t)); - }; const flow = (t) => { if (!p.flowCurve) return p.flowN; const f = 20 + ((p.flowN - 20) * (20 - t)) / (20 - p.tn); return Math.min(p.flowN, Math.max(25, f)); }; + let capacity; + if (dev) { + capacity = (t) => (t < dev.tmin ? 0 : interpFlow(dev.cap, t, flow(t))); + } else { + const pb = load(tb); + capacity = (t) => Math.max(0, pb * (1 + p.slope * (t - tb))); + } + // highest outdoor temperature at which the heat pump alone no longer covers the load + let limit = null; + for (let t = p.thg; t >= -30; t -= 0.1) { + if (capacity(t) < load(t) - 1e-9) { limit = Math.round(t * 10) / 10; break; } + } + if (dev && p.mode !== "alternative") tb = limit ?? -Infinity; + const heatPump = (t) => { + if (p.mode === "alternative" && t < tb) return 0; + if (p.mode === "parallel" && Number.isFinite(p.cutoff) && t < p.cutoff) return 0; + return Math.min(load(t), capacity(t)); + }; + const backupAllowed = (t) => p.mode === "mono" || t < tb; const cop = (t) => { - if (p.type === "air") return Math.min(COP_MAX, interp(LWM110_ETA, t) * carnot(flow(t), t)); + if (p.type === "air") return deviceCop(dev || DEVICES.lwm110, t, flow(t)); const [source, eta] = SOURCE[p.type]; return Math.min(COP_MAX, eta * carnot(flow(t), source)); }; - return { tb, pb, load, capacity, heatPump, flow, cop }; + return { dev, tb, pb: Number.isFinite(tb) ? capacity(tb) : 0, load, capacity, heatPump, backupAllowed, flow, cop, limit }; } function simulate(series, years, p) { @@ -134,12 +164,14 @@ function simulate(series, years, p) { const n = years.length; const r = { years, n, tb: m.tb, pb: m.pb, model: m, params: p, - q: 0, hp: 0, backup: 0, el: 0, heatingHours: 0, backupHours: 0, belowTn: 0, peak: 0, - months: Array.from({ length: 12 }, () => ({ hp: 0, backup: 0 })), + q: 0, hp: 0, backup: 0, uncovered: 0, el: 0, peak: 0, + heatingHours: 0, backupHours: 0, uncoveredHours: 0, cyclingHours: 0, belowTn: 0, + months: Array.from({ length: 12 }, () => ({ hp: 0, backup: 0, uncovered: 0 })), els: new Float32Array(n * 8760), bins: new Map(), loads: new Float32Array(n * 8760), hps: new Float32Array(n * 8760), + backs: new Float32Array(n * 8760), temps: [], }; years.forEach((year, y) => { @@ -148,29 +180,35 @@ function simulate(series, years, p) { for (let i = 0; i < t.length; i++) { const q = m.load(t[i]); const hp = m.heatPump(t[i]); - const backup = q - hp; + const backup = m.backupAllowed(t[i]) ? q - hp : 0; + const uncovered = q - hp - backup; r.loads[y * 8760 + i] = q; r.hps[y * 8760 + i] = hp; + r.backs[y * 8760 + i] = backup; if (q <= 0) continue; const el = hp > 0 ? hp / m.cop(t[i]) : 0; r.els[y * 8760 + i] = el; - r.q += q; r.hp += hp; r.backup += backup; r.el += el; + r.q += q; r.hp += hp; r.backup += backup; r.uncovered += uncovered; r.el += el; r.heatingHours++; if (backup > 1e-9) r.backupHours++; + if (uncovered > 1e-9) r.uncoveredHours++; + if (m.dev && hp > 0 && hp < m.dev.pmin) r.cyclingHours++; if (t[i] < p.tn) r.belowTn++; if (q > r.peak) r.peak = q; r.months[HOUR_MONTH[i]].hp += hp; r.months[HOUR_MONTH[i]].backup += backup; + r.months[HOUR_MONTH[i]].uncovered += uncovered; const key = Math.round(t[i]); - const bin = r.bins.get(key) || { hours: 0, hp: 0, backup: 0, el: 0 }; - bin.hours++; bin.hp += hp; bin.backup += backup; bin.el += el; + const bin = r.bins.get(key) || { hours: 0, hp: 0, backup: 0, uncovered: 0, el: 0 }; + bin.hours++; bin.hp += hp; bin.backup += backup; bin.uncovered += uncovered; bin.el += el; r.bins.set(key, bin); } }); // per-year averages - for (const k of ["q", "hp", "backup", "el", "heatingHours", "backupHours", "belowTn"]) r[k] /= n; - for (const month of r.months) { month.hp /= n; month.backup /= n; } - for (const bin of r.bins.values()) { bin.hours /= n; bin.hp /= n; bin.backup /= n; bin.el /= n; } + for (const k of ["q", "hp", "backup", "uncovered", "el", "heatingHours", "backupHours", + "uncoveredHours", "cyclingHours", "belowTn"]) r[k] /= n; + for (const month of r.months) for (const k in month) month[k] /= n; + for (const bin of r.bins.values()) for (const k in bin) bin[k] /= n; r.jaz = r.el > 0 ? r.hp / r.el : 0; r.costHp = (r.el * p.priceEl) / 100; r.backupFuel = r.backup / p.effBackup; @@ -196,6 +234,7 @@ function params() { slope: +$("slope").value / 100, resolution: $("resolution").value, type: $("type").value, + device: $("device").value, flowN: +$("flowN").value, flowCurve: $("flowCurve").checked, priceEl: +$("priceEl").value, @@ -210,8 +249,9 @@ function validate(p) { if (!(p.flowN >= 25 && p.flowN <= 65)) return "Vorlauftemperatur muss zwischen 25 und 65 °C liegen."; if (!(p.effBackup > 0)) return "Wirkungsgrad der Zusatzheizung muss größer als 0 sein."; if (!(p.tn < p.thg)) return "Norm-Außentemperatur muss unter der Heizgrenztemperatur liegen."; - if (p.mode !== "mono" && !(p.tbiv < p.thg)) return "Bivalenzpunkt muss unter der Heizgrenztemperatur liegen."; - if (p.mode !== "mono" && p.tbiv < p.tn) return "Bivalenzpunkt unter der Norm-Außentemperatur: dann ist die Anlage praktisch monovalent."; + const manualTbiv = p.mode === "alternative" || p.type !== "air" || p.device === "generic"; + if (p.mode !== "mono" && manualTbiv && !(p.tbiv < p.thg)) return "Bivalenzpunkt muss unter der Heizgrenztemperatur liegen."; + if (p.mode !== "mono" && manualTbiv && p.tbiv < p.tn) return "Bivalenzpunkt unter der Norm-Außentemperatur: dann ist die Anlage praktisch monovalent."; return null; } @@ -246,7 +286,13 @@ function fillScenarios() { function updateFieldVisibility() { const mode = $("mode").value; + const air = $("type").value === "air"; + $("deviceField").hidden = !air; + $("slopeField").hidden = air && $("device").value !== "generic"; $("bivalentFields").hidden = mode === "mono"; + const device = air && $("device").value !== "generic"; + $("tbivField").hidden = device && mode === "parallel"; + $("tbivLabel").textContent = device ? "Umschalttemperatur" : "Bivalenzpunkt"; $("cutoffField").hidden = mode !== "parallel"; $("cutoffField").nextElementSibling.hidden = mode !== "parallel"; } @@ -285,7 +331,20 @@ async function run() { $("status").textContent = years.length > 1 ? `Mittelwerte über ${years.length} Jahre (${years[0]}–${years[years.length - 1]}), Station ${station.name}.` : `Wetterjahr ${years[0]}, Station ${station.name}.`; - $("tbivHint").textContent = `WP-Heizleistung am Bivalenzpunkt: ${fmt(r.pb, 1)} kW`; + if (r.model.dev) { + const auto = p.mode !== "alternative"; + $("tbivHint").textContent = r.model.limit == null + ? `${r.model.dev.name} deckt die Heizlast bei allen Temperaturen.` + : auto ? `Bivalenzpunkt ${fmt(r.model.limit, 1)} °C: dort erreicht die Heizlast die Leistung der ${r.model.dev.name}.` + : `Leistungsgrenze ${r.model.dev.name}: ${fmt(r.model.limit, 1)} °C. Darunter muss umgeschaltet werden.`; + $("tbivAdopt").hidden = auto || r.model.limit == null; + } else { + $("tbivHint").textContent = `WP-Heizleistung am Bivalenzpunkt: ${fmt(r.pb, 1)} kW`; + $("tbivAdopt").hidden = true; + } + if (r.uncovered > 0.5) { + $("status").innerHTML += ` <span class="warn">${fmt(r.uncovered)} kWh/a nicht gedeckt: Die WP schafft die Heizlast oberhalb des Bivalenzpunkts nicht.</span>`; + } renderKpis(r); renderDuration(r); renderBins(r); @@ -305,6 +364,7 @@ function renderKpis(r) { kpi("Heizwärmebedarf", `${fmt(r.q)} kWh/a`, `${fmt(r.q / p.qn)} Vollbenutzungsstunden`), kpi("Deckungsanteil Wärmepumpe", `${fmt(share(r.hp), 1)} %`, `${fmt(r.hp)} kWh/a`, "hp"), kpi("Deckungsanteil Zusatzheizung", `${fmt(share(r.backup), 1)} %`, `${fmt(r.backup)} kWh/a`, "backup"), + r.uncovered > 0.5 ? kpi("Nicht gedeckt", `${fmt(share(r.uncovered), 1)} %`, `${fmt(r.uncovered)} kWh/a in ${fmt(r.uncoveredHours)} h`, "uncovered") : "", kpi("Jahresarbeitszahl WP", fmt(r.jaz, 2), `COP bei Norm-Außentemp. ${fmt(r.model.cop(p.tn), 2)}`, "hp"), kpi("Strombedarf WP", `${fmt(r.el)} kWh/a`, `${fmt(r.costHp)} €/a`, "hp"), kpi(`Endenergie ${$("fuel").selectedOptions[0].text}`, @@ -312,8 +372,12 @@ function renderKpis(r) { `${p.fuel === "electric" ? "" : `${fmt(r.backupFuel)} kWh · `}${fmt(r.costBackup)} €/a`, "backup"), kpi("Heizkosten gesamt", `${fmt(r.costHp + r.costBackup)} €/a`, `${fmt(r.q > 0 ? (100 * (r.costHp + r.costBackup)) / r.q : 0, 1)} ct/kWh Wärme`), kpi("Leistungsanteil bei Norm-Außentemp.", `${fmt(100 * r.powerShareTn, 1)} %`, `WP ${fmt(r.model.heatPump(p.tn), 1)} von ${fmt(p.qn, 1)} kW`), - kpi("Bivalenzpunkt", `${fmt(r.tb, 1)} °C`, `WP-Leistung ${fmt(r.pb, 1)} kW`), - kpi("Heizstunden", `${fmt(r.heatingHours)} h/a`, `davon ${fmt(r.backupHours)} h mit Zusatzheizung`), + Number.isFinite(r.tb) + ? kpi("Bivalenzpunkt", `${fmt(r.tb, 1)} °C`, `WP-Leistung ${fmt(r.pb, 1)} kW` + + (r.model.dev && p.mode === "alternative" && r.model.limit != null ? ` · Leistungsgrenze ${fmt(r.model.limit, 1)} °C` : "")) + : kpi("Bivalenzpunkt", "keiner", "WP deckt die Heizlast allein"), + kpi("Heizstunden", `${fmt(r.heatingHours)} h/a`, `davon ${fmt(r.backupHours)} h mit Zusatzheizung` + + (r.model.dev ? `, ${fmt(r.cyclingHours)} h unter Mindestleistung ${fmt(r.model.dev.pmin, 1)} kW (Takten)` : "")), kpi("Stunden unter Norm-Außentemp.", `${fmt(r.belowTn)} h/a`, `max. Heizlast ${fmt(r.peak, 1)} kW`), ].join(""); } @@ -344,6 +408,24 @@ function legend(items) { return `<div class="legend">${items.map(([cls, label]) => `<span><i style="background:var(--${cls})"></i>${label}</span>`).join("")}</div>`; } +function energyLegend(r) { + const items = [["hp", "Wärmepumpe"], ["backup", "Zusatzheizung"]]; + if (r.uncovered > 0.5) items.push(["uncovered", "nicht gedeckt"]); + return items; +} + +/** Stacked bar of heat pump, backup and uncovered energy. */ +function stack(x, w, py, parts) { + let s = "", sum = 0; + for (const [cls, v] of parts) { + if (v <= 0) continue; + const y0 = py(sum), y1 = py(sum + v); + s += `<rect class="${cls}" x="${x}" width="${w}" y="${y1}" height="${y0 - y1}"/>`; + sum += v; + } + return s; +} + function renderDuration(r) { // sort all hours by load, descending; x axis is hours per year const total = r.loads.length; @@ -354,12 +436,13 @@ function renderDuration(r) { const iw = W - PAD.l - PAD.r, ih = H - PAD.t - PAD.b; const yMax = niceMax(r.peak); const px = (h) => PAD.l + (iw * h) / xMax, py = (v) => PAD.t + ih - (ih * v) / yMax; - const loadPts = [], hpPts = []; + const loadPts = [], coveredPts = [], hpPts = []; for (let s = 0; s <= steps; s++) { const idx = Math.min(total - 1, Math.floor(((s / steps) * xMax) * r.n)); const i = order[idx]; const h = (s / steps) * xMax; loadPts.push(`${px(h)},${py(r.loads[i])}`); + coveredPts.push(`${px(h)},${py(r.hps[i] + r.backs[i])}`); hpPts.push(`${px(h)},${py(r.hps[i])}`); } const base = `${px(xMax)},${py(0)} ${px(0)},${py(0)}`; @@ -368,9 +451,10 @@ function renderDuration(r) { $("duration").innerHTML = `<svg viewBox="0 0 ${W} ${H}" role="img" aria-label="Jahresdauerlinie">` + axes(ticks, yMax, "Heizlast [kW]", "Stunden pro Jahr") + - `<polygon class="backup" points="${loadPts.join(" ")} ${base}"/>` + + `<polygon class="uncovered" points="${loadPts.join(" ")} ${base}"/>` + + `<polygon class="backup" points="${coveredPts.join(" ")} ${base}"/>` + `<polygon class="hp" points="${hpPts.join(" ")} ${base}"/>` + - `</svg>` + legend([["hp", "Wärmepumpe"], ["backup", "Zusatzheizung"]]); + `</svg>` + legend(energyLegend(r)); } function renderBins(r) { @@ -380,7 +464,7 @@ function renderBins(r) { const iw = W - PAD.l - PAD.r, ih = H - PAD.t - PAD.b; const count = hi - lo + 1, bw = iw / count; const energy = binView === "energy"; - const value = (b) => (energy ? b.hp + b.backup : b.hours); + const value = (b) => (energy ? b.hp + b.backup + b.uncovered : b.hours); const yMax = niceMax(Math.max(...keys.map((k) => value(r.bins.get(k))))); const py = (v) => PAD.t + ih - (ih * v) / yMax; let bars = ""; @@ -390,13 +474,12 @@ function renderBins(r) { if (k % 5 === 0) ticks.push([x + bw / 2, k]); const b = r.bins.get(k); if (!b) continue; - const title = `<title>${k} °C: ${fmt(b.hours)} h, WP ${fmt(b.hp)} kWh, Zusatz ${fmt(b.backup)} kWh</title>`; + const title = `<title>${k} °C: ${fmt(b.hours)} h, WP ${fmt(b.hp)} kWh, Zusatz ${fmt(b.backup)} kWh` + + (b.uncovered > 0.05 ? `, nicht gedeckt ${fmt(b.uncovered)} kWh` : "") + `</title>`; if (energy) { - const yHp = py(b.hp), yTop = py(b.hp + b.backup); - bars += `<g>${title}<rect class="hp" x="${x + 0.5}" width="${bw - 1}" y="${yHp}" height="${py(0) - yHp}"/>` + - `<rect class="backup" x="${x + 0.5}" width="${bw - 1}" y="${yTop}" height="${yHp - yTop}"/></g>`; + bars += `<g>${title}${stack(x + 0.5, bw - 1, py, [["hp", b.hp], ["backup", b.backup], ["uncovered", b.uncovered]])}</g>`; } else { - const cls = b.backup > 1e-9 ? (b.hp > 1e-9 ? "backup" : "uncovered") : "hp"; + const cls = b.uncovered > 1e-9 ? "uncovered" : b.backup > 1e-9 ? "backup" : "hp"; bars += `<g>${title}<rect class="${cls}" x="${x + 0.5}" width="${bw - 1}" y="${py(b.hours)}" height="${py(0) - py(b.hours)}"/></g>`; } } @@ -406,30 +489,29 @@ function renderBins(r) { $("bins").innerHTML = toggle + `<svg viewBox="0 0 ${W} ${H}" role="img" aria-label="Bins">` + axes(ticks, yMax, energy ? "Wärme [kWh/a]" : "Stunden [h/a]", "Außentemperatur [°C]") + bars + `</svg>` + - legend(energy ? [["hp", "Wärmepumpe"], ["backup", "Zusatzheizung"]] - : [["hp", "nur WP"], ["backup", "WP + Zusatzheizung"], ["uncovered", "nur Zusatzheizung"]]); + legend(energy ? energyLegend(r) + : [["hp", "nur WP"], ["backup", "mit Zusatzheizung"], ...(r.uncovered > 0.5 ? [["uncovered", "teils nicht gedeckt"]] : [])]); $("bins").querySelectorAll("button").forEach((b) => b.addEventListener("click", () => { binView = b.dataset.view; renderBins(lastResult); })); } function renderMonths(r) { const iw = W - PAD.l - PAD.r, ih = H - PAD.t - PAD.b, bw = iw / 12; - const yMax = niceMax(Math.max(...r.months.map((m) => m.hp + m.backup))); + const yMax = niceMax(Math.max(...r.months.map((m) => m.hp + m.backup + m.uncovered))); const py = (v) => PAD.t + ih - (ih * v) / yMax; let bars = ""; const ticks = []; r.months.forEach((m, i) => { const x = PAD.l + i * bw; ticks.push([x + bw / 2, MONTH_NAMES[i]]); - const yHp = py(m.hp), yTop = py(m.hp + m.backup); - bars += `<g><title>${MONTH_NAMES[i]}: WP ${fmt(m.hp)} kWh, Zusatz ${fmt(m.backup)} kWh</title>` + - `<rect class="hp" x="${x + 4}" width="${bw - 8}" y="${yHp}" height="${py(0) - yHp}"/>` + - `<rect class="backup" x="${x + 4}" width="${bw - 8}" y="${yTop}" height="${yHp - yTop}"/></g>`; + bars += `<g><title>${MONTH_NAMES[i]}: WP ${fmt(m.hp)} kWh, Zusatz ${fmt(m.backup)} kWh` + + (m.uncovered > 0.05 ? `, nicht gedeckt ${fmt(m.uncovered)} kWh` : "") + `</title>` + + stack(x + 4, bw - 8, py, [["hp", m.hp], ["backup", m.backup], ["uncovered", m.uncovered]]) + `</g>`; }); $("months").innerHTML = `<svg viewBox="0 0 ${W} ${H}" role="img" aria-label="Monate">` + axes(ticks, yMax, "Wärme [kWh]", "") + bars + `</svg>` + - legend([["hp", "Wärmepumpe"], ["backup", "Zusatzheizung"]]); + legend(energyLegend(r)); } // ---------- export ---------- @@ -447,10 +529,10 @@ function exportBins() { const r = lastResult; if (!r) return; const m = r.model; - const rows = [["Außentemperatur °C", "Stunden h/a", "Heizlast kW", "WP-Leistung kW", "Vorlauf °C", "COP", "Wärme kWh/a", "WP kWh/a", "Zusatzheizung kWh/a", "Strom WP kWh/a"]]; + const rows = [["Außentemperatur °C", "Stunden h/a", "Heizlast kW", "WP-Leistung kW", "Vorlauf °C", "COP", "Wärme kWh/a", "WP kWh/a", "Zusatzheizung kWh/a", "nicht gedeckt kWh/a", "Strom WP kWh/a"]]; for (const k of [...r.bins.keys()].sort((a, b) => a - b)) { const b = r.bins.get(k); - rows.push([k, b.hours, m.load(k), m.heatPump(k), m.flow(k), m.cop(k), b.hp + b.backup, b.hp, b.backup, b.el]); + rows.push([k, b.hours, m.load(k), m.heatPump(k), m.flow(k), m.cop(k), b.hp + b.backup + b.uncovered, b.hp, b.backup, b.uncovered, b.el]); } download(`bins_${$("plz").value}.csv`, rows); } @@ -458,13 +540,13 @@ function exportBins() { function exportHours() { const r = lastResult; if (!r) return; - const rows = [["Jahr", "Monat", "Tag", "Stunde (UTC)", "Außentemperatur °C", "Heizlast kW", "WP kW", "Zusatzheizung kW", "Strom WP kW"]]; + const rows = [["Jahr", "Monat", "Tag", "Stunde (UTC)", "Außentemperatur °C", "Heizlast kW", "WP kW", "Zusatzheizung kW", "nicht gedeckt kW", "Strom WP kW"]]; r.years.forEach((year, y) => { let i = 0; MONTH_DAYS.forEach((days, month) => { for (let d = 1; d <= days; d++) for (let h = 0; h < 24; h++, i++) { - const q = r.loads[y * 8760 + i], hp = r.hps[y * 8760 + i]; - rows.push([year, month + 1, d, h, r.temps[y][i], q, hp, q - hp, r.els[y * 8760 + i]]); + const j = y * 8760 + i, q = r.loads[j], hp = r.hps[j], backup = r.backs[j]; + rows.push([year, month + 1, d, h, r.temps[y][i], q, hp, backup, q - hp - backup, r.els[j]]); } }); }); @@ -489,6 +571,11 @@ async function init() { }); $("type").addEventListener("change", onTypeChange); $("fuel").addEventListener("change", () => onFuelChange()); + $("tbivAdopt").addEventListener("click", () => { + // round up to 0.5 K so the heat pump covers everything above the bivalence point + if (lastResult && lastResult.model.limit != null) $("tbiv").value = Math.ceil(lastResult.model.limit * 2) / 2; + run(); + }); onFuelChange(false); $("form").addEventListener("input", run); $("form").addEventListener("change", run); |
