-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Kiva foundation heat transfer calculations #5901
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nealkruis This is my first pass at an (impromptu) review. I may have other comments later. You may want to check indention and coding style to make sure it follows EnergyPlus guidelines.
if (wallSurfaces.size() != 0) { | ||
wallHeight = Surfaces(wallSurfaces[0]).Height; // TODO Kiva: each wall with different height gets its own instance. | ||
for (auto& wl : wallSurfaces) { | ||
if (Surfaces(wl).Height != wallHeight) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nealkruis Why not put this conditional check in the same loop on line 218? That would eliminate searching all wall surfaces a second time.
|
||
// polygon | ||
if (DataSurfaces::CCW) { | ||
for (size_t i = 0; i < surface.Vertex.size_; ++i ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use surface.Vertex.size_
instead of surface.Vertex.size()
? The latter seems more standard with STL since i'd imagine the size member variable would normally be private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do objexx arrays have a size method?
|
||
// TODO Kiva: Add wall surfaces to EIO | ||
gio::write( DataGlobals::OutputFileInits, "(A)" ) << "! <Kiva Foundation Name>, Horizontal Cells, Vertical Cells, Total Cells, Floor Surface, Wall Surface(s)"; | ||
gio::write( DataGlobals::OutputFileInits, "(A,',',I5',',I5',',I5',',A)" ) << foundationInputs[DataSurfaces::Surface(kv.floorSurface).OSCPtr].name << grnd.nX << grnd.nZ << grnd.nX*grnd.nZ << DataSurfaces::Surface(kv.floorSurface).Name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misaligned indention.
if (DataEnvironment::Month == 1 && DataEnvironment::DayOfMonth == 2 && DataGlobals::HourOfDay == 2 && DataGlobals::TimeStep == 1) { | ||
Kiva::SnapshotSettings ss; | ||
ss.dir = DataStringGlobals::outDirPathName + "/snapshot"; | ||
double& l = ground.foundation.reductionLength2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why get the value by reference? You don't seem to be updating it anywhere. You do this in quite a few places...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything wrong with this? I'm using "l" as an alias so I don't have to type out "ground.foundation.reductionLength2" everywhere.
Kiva::Foundation defFnd; | ||
|
||
defFnd.hasWall = true; | ||
defFnd.hasWall = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assigned twice, same for two below.
third_party/cmake/kiva.cmake
Outdated
include_directories( SYSTEM "${CMAKE_BINARY_DIR}/third_party/kiva/vendor/mathgl-2.3.5.1/include/") | ||
add_subdirectory("${CMAKE_SOURCE_DIR}/third_party/kiva/vendor/zlib-1.2.8/") | ||
add_subdirectory("${CMAKE_SOURCE_DIR}/third_party/kiva/vendor/libpng-1.6.23/") | ||
add_subdirectory("${CMAKE_SOURCE_DIR}/third_party/kiva/vendor/mathgl-2.3.5.1/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure MathGL has a compatible license with EnergyPlus since it can be either GPL or LGPL. @jasondegraw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MathGL is used only for debugging purposes. It won't be in the final release.
@@ -1,8 +1,9 @@ | |||
|
|||
INCLUDE_DIRECTORIES( "${CMAKE_SOURCE_DIR}/third_party/Expat/lib") | |||
INCLUDE_DIRECTORIES( "${CMAKE_SOURCE_DIR}/third_party/") | |||
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/zlib ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why include this now? It seemed to be working before? I'm just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it from the top CMakeLists.txt file. It is only used in the FMI/FMU stuff and conflicted with the zlib I'm using for the ground plot library.
src/EnergyPlus/WeatherManager.cc
Outdated
int count = 0; | ||
std::string WeatherDataLine; | ||
|
||
while (! ReadStatus) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised this can't be part of the existing file read somewhere else. It seems like we might be reading the weather file twice now, correct? Is AnnualAverageDrybulbTemp
the only useful statistic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a whole lot of information we can gather from one pass of the weather file instead of asking the users to input weather information. I'm starting with annual temperature, but this will likely expand to other purposes as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other places that are currently reading the .stat file or requiring user input which all could get the info directly from a pre-read of the epw file (water mains temperature, adaptive comfort values, FCfactor ground temps, other ground models). So, this is something good to get in place in some way or another.
} else if ( SameString( cAlphaArgs( ArgPointer ), "OtherSideConditionsModel" ) ) { | ||
Found = FindItemInList( SurfaceTmp( SurfNum ).ExtBoundCondName, OSCM, TotOSCM ); | ||
if ( Found == 0 ) { | ||
ShowSevereError( cCurrentModuleObject + "=\"" + SurfaceTmp( SurfNum ).Name + "\", invalid " + cAlphaFieldNames( ArgPointer ) + "=\"" + cAlphaArgs( ArgPointer ) + "\"." ); | ||
ShowSevereError( cCurrentModuleObject + "=\"" + SurfaceTmp( SurfNum ).Name + "\", invalid " + cAlphaFieldNames( ArgPointer + 1 ) + "=\"" + cAlphaArgs( ArgPointer + 1 ) + "\"." ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a bug? Why the ArgPointer + 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a small bug that I fixed while I was writing the similar line above.
defaultFoundation.foundation = defFnd; | ||
defaultFoundation.name = "<Default Foundation>"; | ||
|
||
foundationInputs.push_back(defaultFoundation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do you add other foundations other than default foundation? I can't seem to find any other spots, especially since you have a function to find a foundation by name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming...
What is the status of the problem of warm up for design days, discussed in the NFP here? https://gist.github.com/nealkruis/fde60b564425e1b10a5d3a8ec179df51#warm-up-and-design-days Most EnergyPlus models in practice are autosizing the HVAC system based on building loads. If a ground model cannot be used for design days it will not be of much practical use. I hope this can be addressed somehow. |
@EnergyArchmage The current plan is to use a steady-state initialization for design days. It is a conservative estimate of load through foundations since the actual peak load will likely be damped and lagged relative to the design day. |
@nealkruis So does that mean a long soak at design day conditions or a multi-year steady periodic description for a year? Current sizing design practice, using the "Ground" boundary condition with Site:GroundTemperature:BuildingSurface filled by slab.exe, essentially uses a year descripton of the ground condition, as it would develop over many years. The date of the design day indicates when within the year the load calculations are being done at and it just uses the ground boundary condition for that date, well the month anyway. So I think the precendent is to do sizing with annual-type ground conditions and I fear doing something very different is risky without some study of the implications on sizing results. |
I would prefer to build up a better thermal history. Kiva has an effective method to do so, but there are a couple of EnergyPlus limitations we'd have to get around:
|
@nealkruis @lgentile it has been 14 days since this pull request was last updated. |
Whoa, and over 5000 new files. I thought based on the NFP that we would be linking in a Kiva library "The computational core of Kiva can be compiled as an independent library and linked to the EnergyPlus executable." So, where's all the baggage from? |
@Myoldmopar I've been looking into ground init stuff today and making some progress. I don't think I'll have something figured out in time for interface freeze, so if anything changes it'll be behind the scenes. I'll try to address the formatting and remaining @mbadams5 comments today or tomorrow. @mjwitte word from above was to vendor Kiva instead of an using an external clone, hence the additional files (most of them are third(fourth?)-party boost geometry header files). I'd love to replace boost geometry with something slimmer, but that option was ruled out in discussions. We can chat privately if you'd like more details. |
@nealkruis OK. That's all I need to know. I'll yield to @Myoldmopar and @jasondegraw on that front. BTW, this branch has some small conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nealkruis Just a few comments/question mainly on the IDD.
idd/Energy+.idd.in
Outdated
@@ -16057,6 +16064,372 @@ SurfaceProperty:OtherSideConditionsModel, | |||
\note in contact with GroundDomain objects | |||
\default GapConvectionRadiation | |||
|
|||
Foundation:Kiva, | |||
\memo Refined definition of the foundation surface construction used to | |||
\memo infrom two-diemensional heat transfer calculated using the Kiva |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typos here
\note Extent of insulation as measured from the wall interior | ||
\units m | ||
\type real | ||
\minimum> 0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be zero? Same question for N3, N6, and N9.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a material is assigned, a zero value would imply no insulation. If a material is not assigned, a zero value is implicit. Do you think allowing zero would be better? I already have an error if a value (including zero) is defined here and no material is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a fine point. If someone wants to run some parametrics, the way it currently is, you'd have to change both fields in order to add or remove the insulation. Instead of having the material name there and simply running this value from zero to whatever. When you say error here, do you mean a warning or fatals out? Again, it's a fine point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it fatals out...though of course a value of zero won't even get past the input processor.
I don't have a strong opinion on this. I see you point, but there are also many places in the program where you can't use a value of zero (e.g., material thickness) and requires much more than changing two fields.
I can probably change this in about 20 min. So let me know if you think it's worthwhile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, just let it ride. If it causes frustrations, then we'll hear about it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, but you should make it clear here with a \note, that if the material name is blank, then this field must also be blank. And in the I/O Ref if it's not there already. Same for similar fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misspoke (mistyped?). It gives only a warning if you provide values without specifying a material.
idd/Energy+.idd.in
Outdated
|
||
Foundation:Kiva:Settings, | ||
\memo Settings applied across all Kiva foundation calculations. | ||
\memo Object is not required. If not defined, defaults will applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
. . . defaults will be applied.
idd/Energy+.idd.in
Outdated
\key ZeroFlux | ||
\key GroundWater | ||
\key Autocalculate | ||
\default Autocalculate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower case on Autocalculate. (EnergyPlus doesn't care, but other IDD validators do.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key, the default, or both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - this is a key choice "Autocalculate", not an autocalculatable field. This would be the only place in the entire IDD with "\key Autocalculate". I guess there's no rule against using it, but "autocalculate" does have special meaning in numeric fields. Is there a different word that would convey the same intent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just "Auto"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, or "Autoselect"? It's really not calculating a value here, it's just making a choice between the two models if I'm following the docs correctly.
SetupOutputVariable( "Surface Heat Storage Loss Rate [W]", OpaqSurfStorageCondLossRep( loop ), "Zone", "State", Surface( loop ).Name ); | ||
SetupOutputVariable( "Surface Heat Storage Rate per Area [W/m2]", OpaqSurfStorageConductionFlux( loop ), "Zone", "State", Surface( loop ).Name ); | ||
SetupOutputVariable( "Surface Heat Storage Energy [J]", OpaqSurfStorageConductionEnergy( loop ), "Zone", "Sum", Surface( loop ).Name ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remind me (briefly) how the Kiva model connects to the surface and why these output can't be calculated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kiva simulates both the floor and the walls in the same two-dimensional model and they can exchange heat with deep ground, or the exterior grade. Heat stored in the ground can be come from any boundary. There are no set of "inside face" and "outside face" connected with the ground that can be used to calculate the storage for a specific surface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got it, I fogot the surfaces are included in the Kiva domain. But the usual Inside Face outputs (temperature and flux) will still be available and calculated appropriately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. These are demonstrated in the example files.
@nealkruis FYI - I merged in latest develop to get a clean set of CI tests, and resolved minor conflict in yaml file. Put the |
@nealkruis This is showing -8% performance improvement. What's changing that would impact runs that don't use the kiva model? |
@mjwitte It's likely the |
@nealkruis Let's move it for now and then after this release, we can consider an initial read into memory for runs that use the weather file. |
Appears there are still lots of CI problems on this branch. Note we are five days past feature freeze. |
@Myoldmopar I think the CI problems on Linux are the same we were seeing earlier--something screwy with the Linux machine. I'll double check locally, but I don't think it is a problem with the branch. |
@nealkruis It is a problem with kiva...
This is the same issue I had with re2 before, basically you need to compile on linux with |
Yep, just seeing this now. Thanks @mbadams5 |
@nealkruis Going to wait for CI to catch up to the latest commit on develop. If that's clean, then will re-merge develop here and wait for CI again. |
Not sure it's worth another pass here. The warnings and failures are from other known issues. This should be good as far as i can tell from my mobile here. |
@Myoldmopar That's your call. Develop is looking clean now, so I was going to merge develop in here shortly and let it run overnight. |
@Myoldmopar There's a problem in the IDD. I'll fix it here. |
Wahoo!
On Feb 23, 2017, at 7:45 AM, Michael J. Witte <[email protected]<mailto:[email protected]>> wrote:
Merged #5901<#5901>.
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#5901 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFFA6sW5wSk3y1MW8E3hCpotmQGFiWqRks5rfZuPgaJpZM4KPE60>.
|
Pull request overview
Integration of Kiva into EnergyPlus as described in this NFP.
Work completed for:
Work Checklist
Review Checklist
This will not be exhaustively relevant to every PR.