Skip to content

Commit

Permalink
Misc. fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
nealkruis committed Oct 29, 2016
1 parent a35d721 commit 8c42d64
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
6 changes: 5 additions & 1 deletion idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -17528,9 +17528,13 @@ SurfaceProperty:ExposedFoundationPerimeter,
\required-field
\type object-list
\object-list FloorSurfaceNames
N1 , \field Exposed Perimeter Fraction
N1 , \field Total Exposed Perimeter
\type real
\units m
\minimum> 0.0
N2 , \field Exposed Perimeter Fraction
\type real
\units dimensionless
\minimum 0.0
\maximum 1.0
\default 1.0
Expand Down
20 changes: 10 additions & 10 deletions src/EnergyPlus/HeatBalanceKivaManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void KivaManager::setupKivaInstances() {
if (Surfaces(wallSurfaces[0]).Vertex[i].z < minZ) {minZ = Surfaces(wallSurfaces[0]).Vertex[i].z;}
if (Surfaces(wallSurfaces[0]).Vertex[i].z > maxZ) {maxZ = Surfaces(wallSurfaces[0]).Vertex[i].z;}
}
wallHeight = maxZ - minZ; // TODO Kiva: each wall with different height gets its own instance.
wallHeight = maxZ - minZ; // TODO Kiva: each wall with different height gets its own instance. Also use average height in case walls are on slope...
int constructionNum = Surfaces(wallSurfaces[0]).Construction;
for (auto& wl : wallSurfaces) {
for (size_t i = 1; i < Surfaces(wl).Vertex.size(); ++i ) {
Expand Down Expand Up @@ -321,23 +321,23 @@ void KivaManager::setupKivaInstances() {
auto extVIns = foundationInputs[surface.OSCPtr].extVIns;
auto footing = foundationInputs[surface.OSCPtr].footing;

if (intHIns.width > 0.0) {
if (std::abs(intHIns.width) > 0.0) {
intHIns.z += fnd.foundationDepth + fnd.slab.totalWidth();
fnd.inputBlocks.push_back(intHIns);
}
if (intVIns.width > 0.0) {
if (std::abs(intVIns.width) > 0.0) {
fnd.inputBlocks.push_back(intVIns);
}
if (extHIns.width > 0.0) {
if (std::abs(extHIns.width) > 0.0) {
extHIns.z += fnd.wall.heightAboveGrade;
extHIns.x = fnd.wall.totalWidth();
fnd.inputBlocks.push_back(extHIns);
}
if (extVIns.width > 0.0) {
if (std::abs(extVIns.width) > 0.0) {
extVIns.x = fnd.wall.totalWidth();
fnd.inputBlocks.push_back(extVIns);
}
if (footing.width > 0.0) {
if (std::abs(footing.width) > 0.0) {
footing.z = fnd.foundationDepth + fnd.slab.totalWidth() + fnd.wall.depthBelowSlab;
footing.x = fnd.wall.totalWidth()/2.0 - footing.width/2.0;
fnd.inputBlocks.push_back(footing);
Expand All @@ -354,7 +354,7 @@ void KivaManager::setupKivaInstances() {
fnd.isExposedPerimeter.push_back(s);
}
} else {
fnd.useDetailedExposedPerimeter = expPerimMap[surfNum].useDetailedExposedPerimeter;
fnd.exposedFraction = expPerimMap[surfNum].exposedFraction;
}
} else {
userSetExposedPerimeter = false;
Expand Down Expand Up @@ -385,7 +385,7 @@ void KivaManager::setupKivaInstances() {
fnd.polygon = floorPolygon;

// add new foundation instance to list of all instances
foundationInstances.push_back(fnd);
foundationInstances[inst] = fnd;


// create output map for ground instance. Calculate average temperature, flux, and convection for each surface
Expand Down Expand Up @@ -489,7 +489,7 @@ void KivaManager::calcKivaInstances() {
grnd.calculate(kv.bcs,DataGlobals::MinutesPerTimeStep*60.);
grnd.calculateSurfaceAverages();
kv.reportKivaSurfaces();
if (DataEnvironment::Month == 7 && DataEnvironment::DayOfMonth == 24 && DataGlobals::HourOfDay == 16 && DataGlobals::TimeStep == 1) {
if (DataEnvironment::Month == 1 && DataEnvironment::DayOfMonth == 10 && DataGlobals::HourOfDay == 1 && DataGlobals::TimeStep == 1) {
kv.plotDomain();
}
}
Expand All @@ -500,7 +500,7 @@ void KivaInstanceMap::plotDomain() {
#ifdef GROUND_PLOT

Kiva::SnapshotSettings ss;
ss.dir = DataStringGlobals::outDirPathName + "/snapshot";
ss.dir = DataStringGlobals::outDirPathName + "/" + DataSurfaces::Surface(floorSurface).Name;
double& l = ground.foundation.reductionLength2;
const double width = 6.0;
const double depth = ground.foundation.foundationDepth + width/2.0;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatBalanceKivaManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public:
private:
Real64 getValue(int surfNum, Kiva::GroundOutput::OutputType oT);
std::map<int, std::pair<int, Kiva::Surface::SurfaceType>> surfaceMap;
std::vector<Kiva::Foundation> foundationInstances;
std::map<int,Kiva::Foundation> foundationInstances;
};

} // HeatBalanceKivaManager
Expand Down
14 changes: 9 additions & 5 deletions src/EnergyPlus/SurfaceGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5895,20 +5895,19 @@ namespace SurfaceGeometry {

Data data;
data.useDetailedExposedPerimeter = true;
if ( !lNumericFieldBlanks( numF ) ) {data.exposedFraction = rNumericArgs( numF ); data.useDetailedExposedPerimeter = false;} numF++;
int optionsUsed = 0;
if ( !lNumericFieldBlanks( numF ) ) {data.exposedFraction = rNumericArgs( numF ) / Surface(Found).Perimeter; data.useDetailedExposedPerimeter = false; optionsUsed++;} numF++;
if ( !lNumericFieldBlanks( numF ) ) {data.exposedFraction = rNumericArgs( numF ); data.useDetailedExposedPerimeter = false; optionsUsed++;} numF++;

int numRemainingFields = NumAlphas - (alpF - 1) + NumNumbers - (numF -1);
if (numRemainingFields > 0) {
optionsUsed++;
if (numRemainingFields != (int)Surface(Found).Vertex.size()) {
ShowSevereError( cCurrentModuleObject + ": " + Surface(Found).Name + ", must have equal number of segments as the floor has vertices." + cAlphaFieldNames( alpF ) + "\" and \"" + cNumericFieldNames(numF - 1) +"\"");
ShowContinueError( Surface(Found).Name + " number of vertices = " + TrimSigDigits(Surface(Found).Vertex.size()) + ", " + cCurrentModuleObject + " number of segments = " + TrimSigDigits(numRemainingFields) );
ErrorsFound = true;
}
for (int segNum = 0; segNum < numRemainingFields; segNum++) {
if (!lNumericFieldBlanks( numF - 1 ) && !lAlphaFieldBlanks( alpF )) {
ShowSevereError( cCurrentModuleObject + ": " + Surface(Found).Name + ", cannot define both \"" + cAlphaFieldNames( alpF ) + "\" and \"" + cNumericFieldNames(numF - 1) +"\"");
ErrorsFound = true;
}
if ( lAlphaFieldBlanks( alpF ) || SameString(cAlphaArgs( alpF ), "YES") ) {
data.isExposedPerimeter.push_back(true);
} else if ( SameString(cAlphaArgs( alpF ), "NO") ) {
Expand All @@ -5925,6 +5924,11 @@ namespace SurfaceGeometry {
}
}

if (optionsUsed > 1) {
ShowSevereError( cCurrentModuleObject + ": " + Surface(Found).Name + ", may only define one of \"" + cNumericFieldNames( 1 ) + "\", \"" + cNumericFieldNames( 2 ) + "\", or \"" + cAlphaFieldNames( 2 ) + "\"");
ErrorsFound = true;
}

surfaceMap[Found] = data;
}
}
Expand Down

8 comments on commit 8c42d64

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - x86_64-MacOS-10.9-clang: OK (1771 of 1771 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (1791 of 1791 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (1197 of 1197 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (1774 of 1774 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - i386-Windows-7-VisualStudio-12: OK (1774 of 1774 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kiva (nealkruis) - Win64-Windows-7-VisualStudio-12: OK (1774 of 1774 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.