Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/energyplus/ForwardTranslator/ForwardTranslateSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "../../model/InteriorPartitionSurfaceGroup.hpp"
#include "../../model/Surface.hpp"

#include <utilities/idd/OS_Space_FieldEnums.hxx>
#include <utilities/idd/Space_FieldEnums.hxx>

#include "../../utilities/idd/IddEnums.hpp"
Expand Down Expand Up @@ -86,14 +87,22 @@ namespace energyplus {
idfObject.setString(SpaceFields::ZoneName, thermalZone->name().get());
}

// for CeilingHeight, Volume, FloorArea: only FT if hard set (same logic as for ThermalZone)

// CeilingHeight
idfObject.setDouble(SpaceFields::CeilingHeight, modelObject.ceilingHeight());
if (!modelObject.isCeilingHeightDefaulted()) {
idfObject.setDouble(SpaceFields::CeilingHeight, modelObject.ceilingHeight());
}

// Volume
idfObject.setDouble(SpaceFields::Volume, modelObject.volume());
if (!modelObject.isVolumeDefaulted()) {
idfObject.setDouble(SpaceFields::Volume, modelObject.volume());
}

// FloorArea
idfObject.setDouble(SpaceFields::FloorArea, modelObject.floorArea());
if (!modelObject.isFloorAreaDefaulted()) {
idfObject.setDouble(SpaceFields::FloorArea, modelObject.floorArea());
}

// SpaceType
if (boost::optional<SpaceType> spaceType_ = modelObject.spaceType()) {
Expand Down
6 changes: 4 additions & 2 deletions src/energyplus/Test/Space_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_Space2) {
Surface floor2(points2, model);

Space space1(model);
EXPECT_TRUE(space1.setFloorArea(1));
Space space2(model);
EXPECT_TRUE(space2.setFloorArea(4));
floor1.setParent(space1);
floor2.setParent(space2);

Expand Down Expand Up @@ -329,8 +331,8 @@ TEST_F(EnergyPlusFixture, Space_exampleModel_Loads) {
std::find_if(spaceNames.begin(), spaceNames.end(), [&i_space](const auto& s) { return openstudio::istringEqual(s, i_space.nameString()); });
EXPECT_NE(spaceNames.end(), it);

// TODO: should we actually write the floor area in this simple case or let E+ figure it out?
EXPECT_EQ(100.0, i_space.getDouble(SpaceFields::FloorArea).get());
// let E+ figure it out
EXPECT_TRUE(i_space.isEmpty(SpaceFields::FloorArea));
}

// There's one SpaceList corresponding to the SpaceType (for load attribution) and it does have the 4 spaces in there
Expand Down