-
Notifications
You must be signed in to change notification settings - Fork 490
ConstructionProperty:InternalHeatSource not being properly integrated with the surface heat balance
#11729
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
base: develop
Are you sure you want to change the base?
ConstructionProperty:InternalHeatSource not being properly integrated with the surface heat balance
#11729
Changes from all commits
06d2da9
a406a28
a063151
54a04f3
49bc055
f1dd714
aa2000b
19f22c1
ec2f6b5
09cb46c
6da13ea
cf62072
68b7e01
3acdf85
7ed8f0a
ee65e23
a9f9458
c93ba68
ae59c3a
c58476f
223ccca
43a805d
7ae8c37
c983629
f44a337
980c1b0
fbf25b0
6c7125c
523c557
228b2b1
4eda9f1
5ce484e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,7 @@ | |
| #include <EnergyPlus/DataLoopNode.hh> | ||
| #include <EnergyPlus/DataMoistureBalance.hh> | ||
| #include <EnergyPlus/DataMoistureBalanceEMPD.hh> | ||
| #include <EnergyPlus/DataPhotovoltaics.hh> | ||
| #include <EnergyPlus/DataRuntimeLanguage.hh> | ||
| #include <EnergyPlus/DataSizing.hh> | ||
| #include <EnergyPlus/DataSurfaces.hh> | ||
|
|
@@ -111,6 +112,7 @@ | |
| #include <EnergyPlus/OutputProcessor.hh> | ||
| #include <EnergyPlus/OutputReportPredefined.hh> | ||
| #include <EnergyPlus/OutputReportTabular.hh> | ||
| #include <EnergyPlus/Photovoltaics.hh> | ||
| #include <EnergyPlus/Psychrometrics.hh> | ||
| #include <EnergyPlus/ScheduleManager.hh> | ||
| #include <EnergyPlus/SolarShading.hh> | ||
|
|
@@ -162,6 +164,17 @@ void ManageSurfaceHeatBalance(EnergyPlusData &state) | |
| } | ||
| InitSurfaceHeatBalance(state); // Initialize all heat balance related parameters | ||
|
|
||
| // Surface-coupled PV must be initialized before its first temperature-dependent calculation. | ||
| if (state.dataPhotovoltaicState->GetInputFlag && | ||
| state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, "Generator:Photovoltaic") > 0) { | ||
| Photovoltaics::GetPVInput(state); | ||
| state.dataPhotovoltaicState->GetInputFlag = false; | ||
| } | ||
|
|
||
| for (int PVnum = 1; PVnum <= state.dataPhotovoltaic->NumPVs; ++PVnum) { | ||
| Photovoltaics::SimSurfaceCoupledPV(state, PVnum); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hitting this before resolving the outside and inside heat balance. Seems fine.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's actually necessary, and is the crucial piece in this PR. We need to supply the PV heat sink that the surface heat balance eqns need for the current timestep. |
||
| } | ||
|
|
||
| // Solve the zone heat balance 'Detailed' solution | ||
| // Call the outside and inside surface heat balances | ||
| if (state.dataHeatBalSurfMgr->ManageSurfaceHeatBalancefirstTime) { | ||
|
|
@@ -231,6 +244,26 @@ void ManageSurfaceHeatBalance(EnergyPlusData &state) | |
| state.dataHeatBalSurfMgr->ManageSurfaceHeatBalancefirstTime = false; | ||
| } | ||
|
|
||
| void ResimulateSurfaceHeatBalanceForPV(EnergyPlusData &state) | ||
| { | ||
| // Repeat the coupled surface and PV calculations after electric simulation changes the PV heat sink. | ||
| if (!state.dataHVACGlobal->PVSurfaceHeatBalanceResimFlag) { | ||
| return; | ||
| } | ||
|
|
||
| for (int pass = 1; pass <= 2; ++pass) { | ||
| state.dataHVACGlobal->PVSurfaceHeatBalanceResimFlag = false; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, you set PVSurfaceHeatBalanceResimFlag to false, and then inside SimSurfaceCoupledPV it can drop into UpdatePVIntegrationSource, which then evaluates whether another iteration is needed. But only up to a max of 2. Seems OK, I think.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the pass max of 2 due to the impact on the outside surface heat balance and needing it to better update?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we are within an HVAC iteration. We want to limit each HVAC iteration to two surface/PV correction updates:
If after 2 passes PV surface sink is still changing, then the HVAC iteration loop can hit |
||
| CalcHeatBalanceOutsideSurf(state); | ||
| CalcHeatBalanceInsideSurf(state); | ||
| for (int PVnum = 1; PVnum <= state.dataPhotovoltaic->NumPVs; ++PVnum) { | ||
| Photovoltaics::SimSurfaceCoupledPV(state, PVnum); | ||
| } | ||
| if (!state.dataHVACGlobal->PVSurfaceHeatBalanceResimFlag) { | ||
| break; | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+247
to
+265
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New function to resim the outside and and inside surface heat balances, and then (?) resim the PV after. That's backwards from what you did earlier. Does it matter?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't it true that by the time the simulation has hit this point that it has already gone through the inside and outside heat balance? So, why would it need to do another round of that (for all surfaces) if the point here is that something in the PV systems has to update and another round of the heat balance has to take place? In UpdateFinalSurfaceHeatBalance, another round is needed because those systems are running at the HVAC time step and the zone heat balance needs to update based on the "average" of what has been happening. Since PV is running at the HVAC time step level, is something similar happening here? Or is there a different reason that I'm not understanding yet? I guess, why not call SimSurfaceCoupledPV and then just use the UpdateFinalSurfaceHeatBalance with an updated flag?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mitchute The differing orders are intentional:
@RKStrand I think we could use UpdateFinalSurfaceHeatBalance with an updated flag, but then we wouldn't be able to feed the corrected surface temperatures back through |
||
|
|
||
| // Beginning Initialization Section of the Module | ||
| //****************************************************************************** | ||
|
|
||
|
|
@@ -5433,6 +5466,10 @@ void UpdateFinalSurfaceHeatBalance(EnergyPlusData &state) | |
| // Call the outside and inside surface heat balances | ||
| CalcHeatBalanceOutsideSurf(state); | ||
| CalcHeatBalanceInsideSurf(state); | ||
|
|
||
| for (int PVnum = 1; PVnum <= state.dataPhotovoltaic->NumPVs; ++PVnum) { | ||
| Photovoltaics::SimSurfaceCoupledPV(state, PVnum); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -7238,7 +7275,6 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, | |
| // // Locals | ||
| // // SUBROUTINE ARGUMENT DEFINITIONS: | ||
| // | ||
| //>>>>>>> origin/develop | ||
| // SUBROUTINE PARAMETER DEFINITIONS: | ||
| constexpr std::string_view RoutineNameGroundTemp("CalcHeatBalanceOutsideSurf:GroundTemp"); | ||
| constexpr std::string_view RoutineNameGroundTempFC("CalcHeatBalanceOutsideSurf:GroundTempFC"); | ||
|
|
||
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 not proposing we change this now, just wondering why not integrate this with
InitSuraceHeatBalance?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.
That's a good point. It might fit better there, but maybe the thinking was it's only for PV not for "all surfaces" and so maybe it doesn't?
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 the idea is that
InitSurfaceHeatBalancedoes the heat balance initialization whereas this block is related to making sure PV data are available right before runningSimSurfaceCoupledPV(i.e., not doing any surface heat balancing).