Skip to content

Commit

Permalink
Add LG_APHWC80 and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
spahrenk committed Dec 9, 2024
1 parent 4ef38fc commit 7230fd4
Show file tree
Hide file tree
Showing 8 changed files with 4,092 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/HPWH.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4120,6 +4120,10 @@ void HPWH::checkInputs()
{
model = HPWH::MODELS_LG_APHWC50;
}
else if (modelName == "LG_APHWC80")
{
model = HPWH::MODELS_LG_APHWC80;
}
else
{
model = HPWH::MODELS_basicIntegrated;
Expand Down
3 changes: 2 additions & 1 deletion src/HPWH.hh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ class HPWH : public Courier::Sender
MODELS_BradfordWhiteAeroThermRE2H65 = 501,
MODELS_BradfordWhiteAeroThermRE2H80 = 502,

MODELS_LG_APHWC50 = 600
MODELS_LG_APHWC50 = 600,
MODELS_LG_APHWC80 = 601
};

/// specifies the modes for writing output
Expand Down
14 changes: 11 additions & 3 deletions src/HPWHpresets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4490,13 +4490,21 @@ void HPWH::initPreset(MODELS presetNum)
resistiveElementTop->followedByHeatSource = resistiveElementBottom;
resistiveElementBottom->followedByHeatSource = compressor;
}
else if (presetNum == MODELS_LG_APHWC50)
else if ((presetNum == MODELS_LG_APHWC50) || (presetNum == MODELS_LG_APHWC80))
{ //
setNumNodes(12);
setpoint_C = F_TO_C(125.);

tankVolume_L = GAL_TO_L(52.8);
tankUA_kJperHrC = 7.78;
if (presetNum == MODELS_LG_APHWC50)
{
tankVolume_L = GAL_TO_L(52.8);
tankUA_kJperHrC = 7.78;
}
else if (presetNum == MODELS_LG_APHWC80)
{
tankVolume_L = GAL_TO_L(72.0);
tankUA_kJperHrC = 10.83;
}

doTempDepression = false;
tankMixesOnDraw = false;
Expand Down
13 changes: 8 additions & 5 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ set(BradfordWhiteAeroThermRE2H80_Tests
)

#
set(LG_models LG_APHWC50 LG_APHWC80)
set(LG_APHWC50Dir "LG/LG_APHWC50")
set(LG_APHWC50_Tests
DOE2014_LGC50_24hr50
Expand Down Expand Up @@ -276,11 +277,13 @@ foreach (size ${BradfordWhiteAeroThermRE2HSizes})
endforeach (size)

#Test(s) specifically for LG APHWC50 model
foreach (test ${LG_APHWC50_Tests})
foreach(model ${LG_Models})
foreach (test ${LG_APHWC50_Tests})
set(fullTestName "${LG_APHWC50Dir}/${test}")
add_model_test(TEST_NAME "${fullTestName}" MODEL_NAME "LG_APHWC50" SPEC_TYPE "Preset")
add_model_test(TEST_NAME "${fullTestName}" MODEL_NAME "LG_APHWC50" SPEC_TYPE "File")
endforeach (test)
add_model_test(TEST_NAME "${fullTestName}" MODEL_NAME "${model}" SPEC_TYPE "Preset")
add_model_test(TEST_NAME "${fullTestName}" MODEL_NAME "${model}" SPEC_TYPE "File")
endforeach (test)
endforeach (model)

add_plot_test(SPEC_TYPE "Preset" MODEL_NAME "AquaThermAire" TEST_NAME "villara_24hr67" )

Expand Down Expand Up @@ -431,4 +434,4 @@ endforeach (test)
add_test(NAME "RegressionTest.YearRuns" COMMAND ${CMAKE_COMMAND} -E compare_files "${CMAKE_CURRENT_BINARY_DIR}/output/DHW_YRLY.csv" "${CMAKE_CURRENT_SOURCE_DIR}/ref/DHW_YRLY.csv")

# Add unit tests
add_subdirectory(unit_tests)
add_subdirectory(unit_tests)
118 changes: 118 additions & 0 deletions test/LG_APHWC80.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
numNodes 12 #number of nodes
setpoint 125 F
volume 72.0 gal
UA 10.83 kJperHrC

depressTemp false
mixOnDraw false

numHeatSources 3

# top resistance
heatsource 0 isVIP true
heatsource 0 isOn false
heatsource 0 type resistor
heatsource 0 condensity 0 0 0 0 0 0 0 0 1 0 0 0

heatsource 0 nTemps 2
heatsource 0 T1 50 F
heatsource 0 T2 67 F

heatsource 0 inPowT1const 5000
heatsource 0 inPowT1lin 0.0
heatsource 0 inPowT1quad 0.0
heatsource 0 inPowT2const 5000
heatsource 0 inPowT2lin 0.0
heatsource 0 inPowT2quad 0.0
heatsource 0 copT1const 1.0
heatsource 0 copT1lin 0.0
heatsource 0 copT1quad 0.0
heatsource 0 copT2const 1.0
heatsource 0 copT2lin 0.0
heatsource 0 copT2quad 0.0

heatsource 0 hysteresis 0 F
heatsource 0 coilConfig submerged

# bottom resistance
heatsource 1 isVIP false
heatsource 1 isOn false
heatsource 1 type resistor
heatsource 1 condensity 1 0 0 0 0 0 0 0 0 0 0 0

heatsource 1 nTemps 2
heatsource 1 T1 50 F
heatsource 1 T2 67 F

heatsource 1 inPowT1const 5000
heatsource 1 inPowT1lin 0.0
heatsource 1 inPowT1quad 0.0
heatsource 1 inPowT2const 5000
heatsource 1 inPowT2lin 0.0
heatsource 1 inPowT2quad 0.0
heatsource 1 copT1const 1.0
heatsource 1 copT1lin 0.0
heatsource 1 copT1quad 0.0
heatsource 1 copT2const 1.0
heatsource 1 copT2lin 0.0
heatsource 1 copT2quad 0.0

heatsource 1 hysteresis 2 F
heatsource 1 coilConfig submerged

# compressor
heatsource 2 isVIP false
heatsource 2 isOn false
heatsource 2 type compressor

# spread evenly across bottom half of tank.
heatsource 2 condensity 0.17 0.166 0.166 0.166 0.166 0.166 0 0 0 0 0 0

heatsource 2 nTemps 3
heatsource 2 T1 50 F
heatsource 2 T2 67.5 F
heatsource 2 T3 95 F

heatsource 2 inPowT1const 128
heatsource 2 inPowT1lin 1.7
heatsource 2 inPowT1quad 0

heatsource 2 copT1const 3.5
heatsource 2 copT1lin 0
heatsource 2 copT1quad 0

heatsource 2 inPowT2const 26
heatsource 2 inPowT2lin 1.8
heatsource 2 inPowT2quad 0

heatsource 2 copT2const 9.5
heatsource 2 copT2lin -0.05
heatsource 2 copT2quad 0.0

heatsource 2 inPowT3const -31.81
heatsource 2 inPowT3lin 2.309
heatsource 2 inPowT3quad 0

heatsource 2 copT3const 20.29913
heatsource 2 copT3lin -0.1329
heatsource 2 copT3quad 0.0

heatsource 2 minT 23 F
heatsource 2 maxT 120 F
heatsource 2 hysteresis 1 F
heatsource 2 coilConfig wrapped


#this might be better as the 5/6 layer at 20F below setpoint
heatsource 0 onlogic topThird 34.0 F

heatsource 2 onlogic bottomThird 52.7 F
heatsource 2 onlogic standby 9.0 F

heatsource 1 backupSource 2
heatsource 2 backupSource 1

heatsource 0 followedBySource 2
heatsource 1 followedBySource 2

heatsource 0 companionSource 2
Loading

0 comments on commit 7230fd4

Please sign in to comment.