Skip to content

Commit

Permalink
Merge pull request #52 from john-grando/hvac_template_build
Browse files Browse the repository at this point in the history
updated documentation and command line tweaks
  • Loading branch information
John Grando authored Sep 22, 2021
2 parents 14ca832 + cc90bc8 commit c08b1d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion design/FY2021/NFP-HVACTemplateAndExpandObjectsWithEpJSON.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ The current HVACTemplate Processing section (2.1) will be revised to directly ad
3. The EnergyPlus simulation proceeds using the expidf file as the input stream.
4. If there are error messages from EnergyPlus, they will refer to the contents of the expidf file. Specific objects referred to in error messages may exist in the original idf, but they may be objects created by ExpandObjects and only exist in the expidf. Remember that the expidf will be overwritten everytime the original idf is run using EP-Launch or RunEPlus.bat

If you are trying to go beyond the capabilities of the HVACTemplate objects, one strategy you can use is to start your specification using the HVACTemplate objects, run EnergyPlus using EP-Launch and producing an expidf file, rename that file and start making modifications. This approach may help with getting all of the objects needed and the node names set consistently.

***2.1.2 epJSON File Overview***
**The HVACTemplate objects for this filetype are handled by a standalone application called pyExpandObjects.** *Preprocessing epJSON files must be done manually from the command line. This may be done by directly calling the program (src/main.py) from the application source directory (src/pyExpandObjects), or from a built executable (see the documentation README for more details: [https://github.com/john-grando/pyExpandObjects#build-instructions](https://github.com/john-grando/pyExpandObjects#build-instructions))*

Expand All @@ -82,7 +84,10 @@ The current HVACTemplate Processing section (2.1) will be revised to directly ad
3. *The EnergyPlus simulation may now be run with the "expanded" file as the target.*
4. *If there are error messages from EnergyPlus, they will refer to the contents of the expanded file. Specific objects referred to in error messages may exist in the original epJSON, but they may be objects created by pyExpandObjects and only exist in the expanded file. Remember that the "\<original-file-name\>_expanded.epJSON", "\<original-file-name\>_hvac_templates.epJSON", and "\<original-file-name\>_base.epJSON" files will be overwritten everytime the original epJSON is run using EP-Launch or RunEPlus.bat. Also note, the "\<original-file-name\>_hvac_templates.epJSON" and "\<original-file-name\>_base.epJSON" files can be merged to recreate the original epJSON file.*

If you are trying to go beyond the capabilities of the HVACTemplate objects, one strategy you can use is to start your specification using the HVACTemplate objects, run EnergyPlus using EP-Launch and producing an expidf *or epJSON* file, rename that file and start making modifications. This approach may help with getting all of the objects needed and the node names set consistently. Users need to remember that no objects related to HVAC except for HVAC template objects are needed in the IDF */ epJSON* file. The existence of other objects (unless specifically described in the following sections) may cause unexpected errors to occur. Sizing:Zone, Sizing:System, and Sizing:Plant objects will be generated by the corresponding HVACTemplate objects; the user does not need to create these elsewhere in the input file. There are some exceptions to this rule:
*If you are trying to go beyond the capabilities of the HVACTemplate objects, one strategy you can use is to start your specification using the HVACTemplate objects, run pyExpandObjects manually to produce an epJSON file, rename that file, make modifications, and simulate the new file in EnergyPlus manually. This approach may help with getting all of the objects needed and the node names set consistently.*

***2.1.3 General HVACTemplate Overview***
**Users need to remember that no objects related to HVAC except for HVAC template objects are needed in the IDF */ epJSON* file**. The existence of other objects (unless specifically described in the following sections) may cause unexpected errors to occur. Sizing:Zone, Sizing:System, and Sizing:Plant objects will be generated by the corresponding HVACTemplate objects; the user does not need to create these elsewhere in the input file. There are some exceptions to this rule:
- HVACTemplate:Plant:Chiller:ObjectReference which requires that the corresponding chiller object be present in the idf */ epJSON* file along with any required curve or performance objects. In this case, the HVACTemplate object does not create the chiller object, but adds all of the connections. HVACTemplate:Plant:Tower:ObjectReference and HVACTemplate:Plant:Boiler;ObjectReferences are similar.
- For HVACTemplate:Zone:* objects, if Outdoor Air Method = DetailedSpecification, then any referenced DesignSpecification:OutdoorAir and DesignSpecification:ZoneAirDistribution objects must be
present in the idf */ epJSON* file.
Expand Down
8 changes: 4 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import logging
import json

from custom_exceptions import InvalidInputException


def get_property(prop):
"""
Expand Down Expand Up @@ -131,7 +129,8 @@ def main(args=None):
elif isinstance(args.file, (pathlib.PosixPath, pathlib.WindowsPath)):
file_suffix_check = args.file.suffix == '.epJSON'
else:
raise InvalidInputException('Invalid input file reference')
hvt.logger.error('Error: Invalid input file reference')
return
# get or set output directory
if hasattr(args, 'output_directory') and args.output_directory:
if not os.path.exists(args.output_directory):
Expand Down Expand Up @@ -160,7 +159,8 @@ def main(args=None):
if not args.no_backup else None
# check that file names are not the same as the original
if input_file_name in [expanded_file_name, hvac_templates_file_name, base_file_name]:
raise InvalidInputException('file could not be renamed') # pragma: no cover - unlikely to be hit
hvt.logger.error('Error: file could not be renamed') # pragma: no cover - unlikely to be hit
return
if os.path.exists(args.file):
hvt.logger.info('Processing %s', args.file)
# QA skipped since any unanticipated condition should still get caught and returned to user.
Expand Down

0 comments on commit c08b1d1

Please sign in to comment.