MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / translateLoads

Method translateLoads

src/sdd/MapGeometry.cpp:510–1178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508 }
509
510 boost::optional<openstudio::model::ModelObject> ReverseTranslator::translateLoads(const pugi::xml_node& element, openstudio::model::Space& space) {
511 // element is 'Spc' here
512
513 UnitSystem siSys(UnitSystem::SI);
514 UnitSystem whSys(UnitSystem::Wh);
515
516 openstudio::model::Model model = space.model();
517 std::string name = space.name().get();
518
519 // DLM: what to do with these?
520 //<SpcOcc>Office - Open</SpcOcc>
521 //<SchOcc>Table G-I Office Occupancy</SchOcc>
522
523 //***** OCCUPANCY *****
524 {
525 //<OccDens>6.67</OccDens> - person per thousand ft2
526 //<OccSensHtRt>250</OccSensHtRt> - Btu per h person
527 //<OccLatHtRt>200</OccLatHtRt> - Btu per h person
528 //<OccSchRef>Office Occup Sched</OccSchRef>
529
530 pugi::xml_node occDensElement = element.child("OccDensSim");
531 pugi::xml_node occSensHtRtElement = element.child("OccSensHtRt");
532 pugi::xml_node occLatHtRtElement = element.child("OccLatHtRt");
533 pugi::xml_node occSchRefElement = element.child("OccSchRef");
534
535 if ((occDensElement != nullptr) && (occDensElement.text().as_double() > 0)) {
536 if (occSensHtRtElement && occLatHtRtElement) {
537
538 openstudio::Quantity peopleDensityIP(occDensElement.text().as_double() / 1000.0,
539 openstudio::createUnit("people/ft^2", UnitSystem::BTU).get());
540 OptionalQuantity peopleDensitySI = QuantityConverter::instance().convert(peopleDensityIP, whSys);
541 OS_ASSERT(peopleDensitySI);
542 OS_ASSERT(peopleDensitySI->units() == WhUnit(WhExpnt(0, 0, -2, 0, 0, 0, 0, 0, 0, 1)));
543
544 openstudio::model::PeopleDefinition peopleDefinition(model);
545 peopleDefinition.setName(name + " People Definition");
546 peopleDefinition.setPeopleperSpaceFloorArea(peopleDensitySI->value()); // people/m2
547
548 openstudio::Quantity sensibleHeatRateIP(occSensHtRtElement.text().as_double(),
549 openstudio::createUnit("Btu/h*person", UnitSystem::BTU).get());
550 OptionalQuantity sensibleHeatRateSI = QuantityConverter::instance().convert(sensibleHeatRateIP, whSys);
551 OS_ASSERT(sensibleHeatRateSI);
552 OS_ASSERT(sensibleHeatRateSI->units() == WhUnit(WhExpnt(1, 0, 0, 0, 0, 0, 0, 0, 0, -1)));
553
554 openstudio::Quantity latentHeatRateIP(occLatHtRtElement.text().as_double(), openstudio::createUnit("Btu/h*person", UnitSystem::BTU).get());
555 OptionalQuantity latentHeatRateSI = QuantityConverter::instance().convert(latentHeatRateIP, whSys);
556 OS_ASSERT(latentHeatRateSI);
557 OS_ASSERT(latentHeatRateSI->units() == WhUnit(WhExpnt(1, 0, 0, 0, 0, 0, 0, 0, 0, -1)));
558
559 double totalHeatRateSI = sensibleHeatRateSI->value() + latentHeatRateSI->value();
560 if (totalHeatRateSI > 0) {
561 double sensibleHeatFraction = sensibleHeatRateSI->value() / totalHeatRateSI;
562 peopleDefinition.setSensibleHeatFraction(sensibleHeatFraction);
563 }
564
565 openstudio::model::People people(peopleDefinition);
566 people.setName(name + " People");
567 people.setSpace(space);

Callers

nothing calls this directly

Calls 15

createUnitFunction · 0.85
makeVectorOfChildrenFunction · 0.85
lexicalCastToIntFunction · 0.85
elementByTagNameAndIndexFunction · 0.85
istringEqualFunction · 0.85
numberFunction · 0.85

Tested by

no test coverage detected