diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index dddc93d85e8..6daf4bbe915 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -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 diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index 56851983662..9c11e4c842c 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -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 ) { @@ -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); @@ -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; @@ -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 @@ -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(); } } @@ -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; diff --git a/src/EnergyPlus/HeatBalanceKivaManager.hh b/src/EnergyPlus/HeatBalanceKivaManager.hh index 592da994196..6743ecd1a45 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.hh +++ b/src/EnergyPlus/HeatBalanceKivaManager.hh @@ -159,7 +159,7 @@ public: private: Real64 getValue(int surfNum, Kiva::GroundOutput::OutputType oT); std::map> surfaceMap; - std::vector foundationInstances; + std::map foundationInstances; }; } // HeatBalanceKivaManager diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index cc2c25b424d..01788d80452 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -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") ) { @@ -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; } }