Skip to content

Commit

Permalink
CoP computation renaming.
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonHD committed Dec 11, 2023
1 parent 44c9917 commit e4c6c58
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
16 changes: 10 additions & 6 deletions javasrc/org/hd/d/TRVmodel/hg/HGTRVHPMModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,24 @@ private HGTRVHPMModel() { }
public static final double RADIATOR_MW_IN_A_ROOMS_WHEN_B_SETBACK_C =
NORMAL_ROOM_TEMPERATURE_C + RADIATOR_DT_IN_A_ROOMS_WHEN_B_SETBACK_K;

/**CoPA2W46p0: (Heat Pump Efficiency) suggested HP CoP at 46.0C flow temperature. */
public static final double COP_AT_46p0C = 2.6;
/**CoPA2W51p5: (Heat Pump Efficiency) suggested HP CoP at 51.5C flow temperature. */
public static final double COP_AT_51p5C = 2.3;
/**CoPLt: lower CoP sample temperature (C).*/
public static final double CoPLt = 46.0;
/**CoPHt: higher CoP sample temperature (C).*/
public static final double CoPHt = 51.5;
/**CoPA2W46p0: (Heat Pump Efficiency) suggested HP CoP sample at lower flow temperature. */
public static final double CoPL = 2.6;
/**CoPA2W51p5: (Heat Pump Efficiency) suggested HP CoP sample at higher flow temperature. */
public static final double CoPH = 2.3;
/**CoPDropPerK: (Heat Pump Efficiency) suggested approximate fall in CoP per K rise in flow temperature. */
public static final double COP_DROP_pK = 0.025;
/**HPinWnsb: (Heat Pump Efficiency) heat-pump electrical power in when B not setback (W).
* Note that flow and mean temperatures seem to be being mixed here.
*/
public static final double HEAT_PUMP_POWER_IN_NO_SETBACK_W =
HOME_HEAT_LOSS_AT_NORMAL_ROOM_TEMPERATURE_W / COP_AT_46p0C;
HOME_HEAT_LOSS_AT_NORMAL_ROOM_TEMPERATURE_W / CoPL;
/**HPinWsb: (Heat Pump Efficiency) heat-pump electrical power in when B is setback (W).
* Note that flow and mean temperatures seem to be being mixed here.
*/
public static final double HEAT_PUMP_POWER_IN_B_SETBACK_W =
HOME_HEAT_LOSS_B_SETBACK_W / COP_AT_51p5C;
HOME_HEAT_LOSS_B_SETBACK_W / CoPH;
}
10 changes: 4 additions & 6 deletions javasrc/org/hd/d/TRVmodel/hg/HGTRVHPMModelParameterised.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,11 @@ public record DemandWithoutAndWithSetback(HeatAndElectricityDemand noSetback, He
*/
public static double computeFlowCoP(final double flowC)
{
final double lowerTempC = 46.0;
final double upperTempC = 51.5;
final double tempDeltaK = upperTempC - lowerTempC;
final double CoPDelta = HGTRVHPMModel.COP_AT_51p5C - HGTRVHPMModel.COP_AT_46p0C;
final double tempDeltaK = HGTRVHPMModel.CoPHt - HGTRVHPMModel.CoPLt;
final double CoPDelta = HGTRVHPMModel.CoPH - HGTRVHPMModel.CoPL;

final double CoP = HGTRVHPMModel.COP_AT_46p0C +
((flowC - lowerTempC) * (CoPDelta / tempDeltaK));
final double CoP = HGTRVHPMModel.CoPL +
((flowC - HGTRVHPMModel.CoPLt) * (CoPDelta / tempDeltaK));

return(CoP);
}
Expand Down
12 changes: 6 additions & 6 deletions test/javasrc/localtest/TestHGTRVHPModelParameterised.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ public static void testWithDefaultParameters()
/**Test the CoP computation. */
public static void testComputeFlowCoP()
{
assertEquals("must reproduce the original quoted value", HGTRVHPMModel.COP_AT_46p0C, HGTRVHPMModelParameterised.computeFlowCoP(46.0), 0.01);
assertEquals("must reproduce the original quoted value", HGTRVHPMModel.COP_AT_51p5C, HGTRVHPMModelParameterised.computeFlowCoP(51.5), 0.01);
assertEquals("must reproduce the original quoted value", HGTRVHPMModel.CoPL, HGTRVHPMModelParameterised.computeFlowCoP(46.0), 0.01);
assertEquals("must reproduce the original quoted value", HGTRVHPMModel.CoPH, HGTRVHPMModelParameterised.computeFlowCoP(51.5), 0.01);
final double intermediateTempC = 50.0;
assertTrue("should interpolate an intermediate value (inverse relationship)", HGTRVHPMModel.COP_AT_46p0C > HGTRVHPMModelParameterised.computeFlowCoP(intermediateTempC));
assertTrue("should interpolate an intermediate value (inverse relationship)", HGTRVHPMModel.COP_AT_51p5C < HGTRVHPMModelParameterised.computeFlowCoP(intermediateTempC));
assertTrue("should interpolate an intermediate value (inverse relationship)", HGTRVHPMModel.CoPL > HGTRVHPMModelParameterised.computeFlowCoP(intermediateTempC));
assertTrue("should interpolate an intermediate value (inverse relationship)", HGTRVHPMModel.CoPH < HGTRVHPMModelParameterised.computeFlowCoP(intermediateTempC));
final double lowTempC = 35.0;
assertTrue("should extrapolate low", HGTRVHPMModel.COP_AT_46p0C < HGTRVHPMModelParameterised.computeFlowCoP(lowTempC));
assertTrue("should extrapolate low", HGTRVHPMModel.CoPL < HGTRVHPMModelParameterised.computeFlowCoP(lowTempC));
final double highTempC = 60.0;
assertTrue("should extrapolate high", HGTRVHPMModel.COP_AT_51p5C > HGTRVHPMModelParameterised.computeFlowCoP(highTempC));
assertTrue("should extrapolate high", HGTRVHPMModel.CoPH > HGTRVHPMModelParameterised.computeFlowCoP(highTempC));
}

/**Test with parameters at default except one full door per internal wall. */
Expand Down

0 comments on commit e4c6c58

Please sign in to comment.