Skip to content

Commit

Permalink
Added testDetachedLondon2018().
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonHD committed Sep 26, 2023
1 parent 1853f40 commit cd20fb2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 15 deletions.
30 changes: 15 additions & 15 deletions javasrc/org/hd/d/TRVmodel/hg/ShowComputations.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ public static void showCalcs() throws IOException
System.out.println("");
System.out.println("Parameterised model, fixes applied for doors and CoP temperature, external air temperature varied...");
System.out.println("London (EGLL) 2018 hourly temperatures");
// final DDNTemperatureDataCSV temperaturesLondon2018 =
// DDNTemperatureDataCSV.loadDDNTemperatureDataCSV(DDNTemperatureDataCSV.DATA_EGLL_2018);
// final HGTRVHPMModelByHour scenarioLondon2018 = new HGTRVHPMModelByHour(
// HGTRVHPMModelParameterised.ModelParameters.FIXES_APPLIED, temperaturesLondon2018);
// final ScenarioResult resultLondon2018 = scenarioLondon2018.runScenario(false, false, null);
// System.out.println(String.format("Percentage of hours that room setback raises heat pump demand: %.0f%%",
// 100 * resultLondon2018.hoursFractionSetbackRaisesDemand()));
// final double heatNoSetbackLondon2018 = resultLondon2018.demand().noSetback().heatDemand();
// final double heatWithSetbackLondon2018 = resultLondon2018.demand().withSetback().heatDemand();
// System.out.println(String.format("Heat mean demand: with no setback %.0fW, with setback %.0fW; %.0f%% change with setback",
// heatNoSetbackLondon2018, heatWithSetbackLondon2018, 100*((heatWithSetbackLondon2018/heatNoSetbackLondon2018)-1)));
// final double powerNoSetbackLondon2018 = resultLondon2018.demand().noSetback().heatPumpElectricity();
// final double powerWithSetbackLondon2018 = resultLondon2018.demand().withSetback().heatPumpElectricity();
// System.out.println(String.format("Heat pump mean power: with no setback %.0fW, with setback %.0fW; %.0f%% change with setback",
// powerNoSetbackLondon2018, powerWithSetbackLondon2018, 100*((powerWithSetbackLondon2018/powerNoSetbackLondon2018)-1)));
final DDNTemperatureDataCSV temperaturesLondon2018 =
DDNTemperatureDataCSV.loadDDNTemperatureDataCSV(DDNTemperatureDataCSV.DATA_EGLL_2018);
final HGTRVHPMModelByHour scenarioLondon2018 = new HGTRVHPMModelByHour(
HGTRVHPMModelParameterised.ModelParameters.FIXES_APPLIED, temperaturesLondon2018);
final ScenarioResult resultLondon2018 = scenarioLondon2018.runScenario(false, false, null);
System.out.println(String.format("Percentage of hours that room setback raises heat pump demand: %.0f%%",
100 * resultLondon2018.hoursFractionSetbackRaisesDemand()));
final double heatNoSetbackLondon2018 = resultLondon2018.demand().noSetback().heatDemand();
final double heatWithSetbackLondon2018 = resultLondon2018.demand().withSetback().heatDemand();
System.out.println(String.format("Heat mean demand: with no setback %.0fW, with setback %.0fW; %.0f%% change with setback",
heatNoSetbackLondon2018, heatWithSetbackLondon2018, 100*((heatWithSetbackLondon2018/heatNoSetbackLondon2018)-1)));
final double powerNoSetbackLondon2018 = resultLondon2018.demand().noSetback().heatPumpElectricity();
final double powerWithSetbackLondon2018 = resultLondon2018.demand().withSetback().heatPumpElectricity();
System.out.println(String.format("Heat pump mean power: with no setback %.0fW, with setback %.0fW; %.0f%% change with setback",
powerNoSetbackLondon2018, powerWithSetbackLondon2018, 100*((powerWithSetbackLondon2018/powerNoSetbackLondon2018)-1)));

System.out.println("");
System.out.println("Parameterised model, fixes applied for doors and CoP temperature, external air temperature varied...");
Expand Down
29 changes: 29 additions & 0 deletions test/javasrc/localtest/TestHGTRVHPModelDetachedParameterised.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@

package localtest;

import java.io.IOException;

import org.hd.d.TRVmodel.data.DDNTemperatureDataCSV;
import org.hd.d.TRVmodel.hg.HGTRVHPMModel;
import org.hd.d.TRVmodel.hg.HGTRVHPMModelByHour;
import org.hd.d.TRVmodel.hg.HGTRVHPMModelByHour.ScenarioResult;
import org.hd.d.TRVmodel.hg.HGTRVHPMModelParameterised;
import org.hd.d.TRVmodel.hg.HGTRVHPMModelParameterised.DemandWithoutAndWithSetback;
import org.hd.d.TRVmodel.hg.HGTRVHPMModelParameterised.ModelParameters;
Expand Down Expand Up @@ -113,4 +118,28 @@ public static void testOriginalVsDetached()
assertTrue(bungalowDemandW.withSetback().heatPumpElectricity() < detachedDemandW.withSetback().heatPumpElectricity());
}
}

/**Check one test scenario of number for detached (with fixes).
* @throws IOException
*/
public static void testDetachedLondon2018() throws IOException
{
final DDNTemperatureDataCSV temperaturesLondon2018 =
DDNTemperatureDataCSV.loadDDNTemperatureDataCSV(DDNTemperatureDataCSV.DATA_EGLL_2018);
final HGTRVHPMModelByHour scenarioLondon2018 = new HGTRVHPMModelByHour(
HGTRVHPMModelParameterised.ModelParameters.FIXES_APPLIED, temperaturesLondon2018);
final ScenarioResult resultLondon2018 = scenarioLondon2018.runScenario(false, false, null);
// Percentage of hours that room setback raises heat pump demand: 45%
assertEquals(0.45, resultLondon2018.hoursFractionSetbackRaisesDemand(), 0.01);
// Heat mean demand: with no setback 719W, with setback 634W; -12% change with setback
final double heatNoSetbackLondon2018 = resultLondon2018.demand().noSetback().heatDemand();
final double heatWithSetbackLondon2018 = resultLondon2018.demand().withSetback().heatDemand();
assertEquals(719, heatNoSetbackLondon2018, 1);
assertEquals(634, heatWithSetbackLondon2018, 1);
// Heat pump mean power: with no setback 246W, with setback 253W; 3% change with setback
final double powerNoSetbackLondon2018 = resultLondon2018.demand().noSetback().heatPumpElectricity();
final double powerWithSetbackLondon2018 = resultLondon2018.demand().withSetback().heatPumpElectricity();
assertEquals(246, powerNoSetbackLondon2018, 1);
assertEquals(253, powerWithSetbackLondon2018, 1);
}
}

0 comments on commit cd20fb2

Please sign in to comment.