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

Function buildDemoModel2012

src/airflow/Test/DemoModel.cpp:33–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include "../../utilities/geometry/Point3d.hpp"
32
33boost::optional<openstudio::model::Model> buildDemoModel2012(openstudio::model::Model model) {
34 // set outdoor air specifications
35 openstudio::model::Building building = model.getUniqueModelObject<openstudio::model::Building>();
36 boost::optional<openstudio::model::SpaceType> spaceType = building.spaceType();
37 if (!spaceType) {
38 return boost::none;
39 }
40 boost::optional<openstudio::model::DesignSpecificationOutdoorAir> oa = spaceType->designSpecificationOutdoorAir();
41 if (!oa) {
42 return boost::none;
43 }
44
45 if (!oa->setOutdoorAirMethod("Sum")) {
46 return boost::none;
47 }
48 if (!oa->setOutdoorAirFlowperPerson(0.0)) {
49 return boost::none;
50 }
51 if (!oa->setOutdoorAirFlowperFloorArea(0.00508)) { // 1 cfm/ft^2 = 0.00508 m/s
52 return boost::none;
53 }
54 if (!oa->setOutdoorAirFlowRate(0.0)) {
55 return boost::none;
56 }
57 if (!oa->setOutdoorAirFlowAirChangesperHour(0.0)) {
58 return boost::none;
59 }
60
61 double floorHeight = 3.0;
62
63 openstudio::model::BuildingStory story1(model);
64 story1.setName("Story 1");
65 story1.setNominalZCoordinate(0.0);
66 story1.setNominalFloortoFloorHeight(floorHeight);
67
68 std::vector<openstudio::Point3d> points;
69 points.push_back(openstudio::Point3d(0, 0, 0));
70 points.push_back(openstudio::Point3d(0, 17, 0));
71 points.push_back(openstudio::Point3d(8, 17, 0));
72 points.push_back(openstudio::Point3d(8, 10, 0));
73 points.push_back(openstudio::Point3d(8, 0, 0));
74
75 boost::optional<openstudio::model::Space> library = openstudio::model::Space::fromFloorPrint(points, floorHeight, model);
76 if (!library) {
77 return boost::none;
78 }
79 library->setName("Library");
80
81 points.clear();
82 points.push_back(openstudio::Point3d(8, 10, 0));
83 points.push_back(openstudio::Point3d(8, 17, 0));
84 points.push_back(openstudio::Point3d(18, 17, 0));
85 points.push_back(openstudio::Point3d(18, 10, 0));
86 points.push_back(openstudio::Point3d(11, 10, 0));
87
88 boost::optional<openstudio::model::Space> office2 = openstudio::model::Space::fromFloorPrint(points, floorHeight, model);
89 if (!office2) {
90 return boost::none;

Callers 3

TEST_FFunction · 0.85
buildDemoModel2014Function · 0.85
TEST_FFunction · 0.85

Calls 15

addSystemType3Function · 0.85
setOutdoorAirMethodMethod · 0.80
setOutdoorAirFlowRateMethod · 0.80
matchSurfacesMethod · 0.80
setBuildingStoryMethod · 0.80
Point3dClass · 0.50
spaceTypeMethod · 0.45

Tested by 2

TEST_FFunction · 0.68
TEST_FFunction · 0.68