From cf131a4414616c82def6ffb2979a3fdfcc2e7256 Mon Sep 17 00:00:00 2001 From: DamonHD Date: Fri, 22 Sep 2023 12:27:14 +0100 Subject: [PATCH] Extending ifHeatLossPerA2Storey(). --- .../hg/HGTRVHPMModelParameterised.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/javasrc/org/hd/d/TRVmodel/hg/HGTRVHPMModelParameterised.java b/javasrc/org/hd/d/TRVmodel/hg/HGTRVHPMModelParameterised.java index 7acae2b..d7c0498 100644 --- a/javasrc/org/hd/d/TRVmodel/hg/HGTRVHPMModelParameterised.java +++ b/javasrc/org/hd/d/TRVmodel/hg/HGTRVHPMModelParameterised.java @@ -252,9 +252,31 @@ private static double iwHeatLossPerA(final ModelParameters params) * This is only for a 2-storey detached, so in an ABAB arrangement (with BABA below) * each A room will lose each either to a B room below or above (not both). * Heat loss in each direction (up or down) is treated as the same. + *

+ * Assumes that A room is at 'normal' temperature and B room is at setback temperature. + * + * @param params model parameters; non-null */ private static double ifHeatLossPerA2Storey(final ModelParameters params) { + return(ifHeatLossPerA2Storey(params, HGTRVHPMModel.NORMAL_ROOM_TEMPERATURE_C)); + } + + /**Internal floor/ceiling heat loss/transfer per A room (W) for 2-storey detached. + * Only applies when a B room is directly above or below. + *

+ * This is only for a 2-storey detached, so in an ABAB arrangement (with BABA below) + * each A room will lose each either to a B room below or above (not both). + * Heat loss in each direction (up or down) is treated as the same. + * + * @param params model parameters; non-null + * @param tempA temperature of A room, must be no lower than B room setback. + */ + private static double ifHeatLossPerA2Storey(final ModelParameters params, final double tempA) + { + if(!Double.isFinite(tempA)) { throw new IllegalArgumentException(); } + if(tempA < HGTRVHPMModel.SETBACK_ROOM_TEMPERATURE_C) { throw new IllegalArgumentException("A must not be colder than B"); } + if(!params.roomsAlternatingABAB) { return(0); } // IFAabHL: internal floor/ceiling heat loss per Kelvin (W/K). @@ -264,7 +286,7 @@ private static double ifHeatLossPerA2Storey(final ModelParameters params) // IFAabHLW: internal floor/ceiling heat loss per A room (W). final double IFAabHLW = IFAabHL * - (HGTRVHPMModel.NORMAL_ROOM_TEMPERATURE_C - HGTRVHPMModel.SETBACK_ROOM_TEMPERATURE_C); + (tempA - HGTRVHPMModel.SETBACK_ROOM_TEMPERATURE_C); return(IFAabHLW); }