Vad kostar en läcka?

 

Storlek på läcka i kubik (m3/24 tim)




'use strict'; const submit = document.getElementById('submit'); submit.addEventListener('click', calc); function calc() { let sizeLeak = document.getElementById('sizeLeak').value; let energyPrice = document.getElementById('energyPrice').value; let rawWaterTempSupl = document.getElementById('rawWaterTempSupl').value; let rawWaterTemp = document.getElementById('rawWaterTemp').value; let rawWaterCost = document.getElementById('rawWaterCost').value; if(!sizeLeak || !energyPrice || !rawWaterTempSupl || !rawWaterTemp || !rawWaterCost || isNaN(sizeLeak)) { alert('Ange ett tal'); } else { const sum = document.getElementById('sum'); //let sizeLeak = 50; let summerTime = 45; let winterTime = 90; let deltaValue = (rawWaterTempSupl - rawWaterTemp); let waterTempSummer = 70; let waterTempWinter = 75; let medelTemperatur = summerTime * ((waterTempWinter - rawWaterTempSupl) / (waterTempWinter - waterTempSummer)) + winterTime * ((rawWaterTempSupl - waterTempSummer) / (waterTempWinter - waterTempSummer)); let energy = 1.2; let summerTimeCalc = summerTime * sizeLeak; let winterTimeCalc = winterTime * sizeLeak; let summerTimeYear = summerTimeCalc * 365; let winterTimeYear = winterTimeCalc * 365; let avgPerDay = Math.round((energy * sizeLeak * deltaValue * energyPrice) + (rawWaterCost * sizeLeak)); let supplyPipeAvgYear = Math.round(avgPerDay * 365); let supplyWaterTempSummer = 70; let supplyWaterTempWinter = 75; let supplyRawWaterTemp = 83; let tSummer = supplyWaterTempSummer - rawWaterTemp; let tWinter = supplyWaterTempWinter - rawWaterTemp; let tAvgtempSupply = supplyRawWaterTemp - rawWaterTemp; let energySummer = sizeLeak * energy * tSummer; let energyWinter = sizeLeak * energy * tWinter; let rawWaterEnergy = sizeLeak * energy * tAvgtempSupply; let avgKwhYear = rawWaterEnergy * 365; let avgMwhYear = avgKwhYear / 1000; let avgGwhYear = avgMwhYear / 1000; sum.innerHTML = `

Kostnaden för läckaget

24h 1 år
Kostnad på försörjningsrörets genomsnitt ${avgPerDay} kr ${supplyPipeAvgYear} kr
 

Detta läckage kommer att förbruka i snitt:

${(avgKwhYear).toLocaleString()} KWH/år

${avgMwhYear.toFixed(2)} MWH/år

${avgGwhYear.toFixed(2)} GWH/år

Detta kunde värma samt ge el för cirka ${Math.ceil(avgKwhYear / 16000)} hus per år

`; } }