MCPcopy Create free account
hub / github.com/NatLabRockies/EnergyPlus / getPackagedTerminalUnitData

Method getPackagedTerminalUnitData

src/EnergyPlus/UnitarySystem.cc:7426–7596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7424 }
7425
7426 void UnitarySys::getPackagedTerminalUnitData(
7427 EnergyPlusData &state, std::string_view objectName, bool const ZoneEquipment, int const ZoneOAUnitNum, bool &errorsFound)
7428 {
7429 std::string cCurrentModuleObject = "ZoneHVAC:PackagedTerminalAirConditioner";
7430 SysType sysTypeNum = SysType::PackagedAC;
7431 DataZoneEquipment::ZoneEquipType zoneEqType = DataZoneEquipment::ZoneEquipType::Invalid;
7432 int numPTAC = 0;
7433 int numPTHP = 0;
7434 int numPTWSHP = 0;
7435 auto &ip = state.dataInputProcessing->inputProcessor;
7436 for (int getPTUnitType = 1; getPTUnitType <= 3; ++getPTUnitType) {
7437 if (getPTUnitType == 2) {
7438 sysTypeNum = SysType::PackagedHP;
7439 zoneEqType = DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner;
7440 cCurrentModuleObject = "ZoneHVAC:PackagedTerminalHeatPump";
7441 } else if (getPTUnitType == 3) {
7442 sysTypeNum = SysType::PackagedWSHP;
7443 zoneEqType = DataZoneEquipment::ZoneEquipType::PackagedTerminalAirConditioner;
7444 cCurrentModuleObject = "ZoneHVAC:WaterToAirHeatPump";
7445 }
7446 auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(cCurrentModuleObject);
7447 if (instances != state.dataInputProcessing->inputProcessor->epJSON.end()) {
7448 auto &instancesValue = instances.value();
7449 auto const &objectSchemaProps = ip->getObjectSchemaProps(state, cCurrentModuleObject);
7450 for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) {
7451
7452 std::string const &thisObjectName = Util::makeUPPER(instance.key());
7453 // only get the current data once all data has been read in and vector unitarySys has been initialized
7454 // when UnitarySystems::getInputOnceFlag is true read all unitary systems, otherwise read just the current object
7455 if (!Util::SameString(objectName, thisObjectName) && !state.dataUnitarySystems->getInputOnceFlag) {
7456 continue;
7457 }
7458
7459 int sysNum = getUnitarySystemIndex(state, thisObjectName);
7460 UnitarySys thisSys;
7461 if (sysNum == -1) {
7462 ++state.dataUnitarySystems->numUnitarySystems;
7463 auto const &thisObjName = instance.key();
7464 state.dataInputProcessing->inputProcessor->markObjectAsUsed(cCurrentModuleObject, thisObjName);
7465 } else {
7466 thisSys = state.dataUnitarySystems->unitarySys[sysNum];
7467 }
7468
7469 // get PackagedTerminal unit object inputs
7470 auto const &fields = instance.value();
7471 thisSys.input_specs.name = thisObjectName;
7472 thisSys.input_specs.system_type = cCurrentModuleObject;
7473 thisSys.input_specs.availability_schedule_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "availability_schedule_name");
7474 thisSys.input_specs.air_inlet_node_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "air_inlet_node_name");
7475 thisSys.input_specs.air_outlet_node_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "air_outlet_node_name");
7476
7477 thisSys.input_specs.oa_mixer_type = ip->getAlphaFieldValue(fields, objectSchemaProps, "outdoor_air_mixer_object_type");
7478 thisSys.input_specs.oa_mixer_name = ip->getAlphaFieldValue(fields, objectSchemaProps, "outdoor_air_mixer_name");
7479
7480 thisSys.input_specs.cooling_supply_air_flow_rate =
7481 ip->getRealFieldValue(fields, objectSchemaProps, "cooling_supply_air_flow_rate");
7482 thisSys.input_specs.heating_supply_air_flow_rate =
7483 ip->getRealFieldValue(fields, objectSchemaProps, "heating_supply_air_flow_rate");

Callers

nothing calls this directly

Calls 10

makeUPPERFunction · 0.85
SameStringFunction · 0.85
getUnitarySystemIndexFunction · 0.85
getDesignSpecMSHPIndexFunction · 0.85
markObjectAsUsedMethod · 0.80
getAlphaFieldValueMethod · 0.80
getRealFieldValueMethod · 0.80
processInputSpecMethod · 0.80
valueMethod · 0.45
factoryMethod · 0.45

Tested by

no test coverage detected