Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use data models #214

Open
wants to merge 224 commits into
base: main
Choose a base branch
from
Open

Use data models #214

wants to merge 224 commits into from

Conversation

spahrenk
Copy link
Contributor

Enables initialization of HPWH objects from IHPWH data-model specification in JSON format. The IHPWH data-model specification is defined by schema entries in repository hpwh-data-model. The schema are used by lattice to generate a code library for reading the JSON representations of the HPWH models. The code-generation step could be initiated by cmake when building the project (rather than being retaining the code in HPWHsim, but this has not been implemented, due to a relatively small number of manual changes that remain necessary in the generated code.

The command-line utility convert was added to the hpwh executable. This was used to convert all existing IHPWH models from preset entries to JSON files. These models were exported to the folder "models_json " in the "test" folder. Many of these models were previously implemented using polynomial expansions at specific environment temperatures of the variation of input power and cop with heat-source temperature (determined by the condensity-weighted tank temperature.) These were converted by sampling into performance grids for evaluation using btwxt. Criteria were developed for the number of grid points, based on the curvatures of the input-power and cop functions, to ensure sufficient resolution of the grid representations for the reproduction of reference test results.

The assigned JSON file names correspond to their predefined model names. However, 'cse' primarily specifies HPWH presets by HPWH::MODELS number, whereas HPWHsim uses only specification by model name, not number, for testing. Furthermore, roughly eight models did not have assigned names, and were inaccessible via command line. To export these models to JSON, the convert utility also allows specification by either model name or number. Obvious names were also defined in the code for these models. However, no mechanism exists currently to initiate a model from a JSON representation via model number.

Tests were added for comparison of the JSON and Preset (and File) representations.

@spahrenk spahrenk changed the base branch from develop to main November 13, 2024 16:51
@spahrenk spahrenk requested a review from nealkruis November 13, 2024 16:52
# Conflicts:
#	test/CMakeLists.txt
#	test/ref/test30_Preset_AOSmithHPTS40.csv
#	test/ref/test50_Preset_AOSmithHPTS40.csv
#	test/ref/test70_Preset_AOSmithHPTS40.csv
#	test/ref/test95_Preset_AOSmithHPTS40.csv
…to use-data-models

# Conflicts:
#	src/HPWHpresets.cc
#	test/CMakeLists.txt
#	test/LG_APHWC50.txt
#	test/ref/DOE2014_LGC50_24hr50_Preset_LG_APHWC50.csv
#	test/ref/DOE2014_LGC50_24hr67_Preset_LG_APHWC50.csv
#	test/ref/DOE2014_LGC50_24hr95_Preset_LG_APHWC50.csv
#	test/ref/DP_LGC50_HVT_Preset_LG_APHWC50.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant