Skip to content
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

Surface Window data struct & heat balance routines refactoring #8257

Merged
merged 47 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5363b0a
transolar
xuanluo113 Aug 31, 2020
0ec01de
Merge branch 'window-test' of https://github.com/energy-plus/EnergyPl…
xuanluo113 Sep 1, 2020
e82f4a2
more surf win
xuanluo113 Sep 2, 2020
f4f285b
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 2, 2020
6064516
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 2, 2020
f93e803
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 3, 2020
147075c
more surfwin
xuanluo113 Sep 4, 2020
8a5b32f
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 4, 2020
b5d30ed
fix tdd
xuanluo113 Sep 4, 2020
013e992
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 4, 2020
aaa0d4c
locals
xuanluo113 Sep 4, 2020
05e3b4e
test inithb
xuanluo113 Sep 5, 2020
15dbe85
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 7, 2020
7618438
test init
xuanluo113 Sep 8, 2020
3bfd63d
test init
xuanluo113 Sep 8, 2020
df84b1a
revert some tests
xuanluo113 Sep 8, 2020
48d0093
reduce test 1
xuanluo113 Sep 9, 2020
ef6900a
shading
xuanluo113 Sep 9, 2020
2cdd30b
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 9, 2020
ff797a1
Merge branch 'window-struct2' of https://github.com/energy-plus/Energ…
xuanluo113 Sep 9, 2020
1c47c9e
tdd
xuanluo113 Sep 9, 2020
347bb62
Merge branch 'window-struct' of https://github.com/energy-plus/Energy…
xuanluo113 Sep 9, 2020
d2451f6
test reduce
xuanluo113 Sep 9, 2020
cb37a59
revert
xuanluo113 Sep 10, 2020
5597b57
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 10, 2020
b227d8c
framediv
xuanluo113 Sep 10, 2020
51449d5
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 10, 2020
5699572
Merge branch 'window-struct2' of https://github.com/energy-plus/Energ…
xuanluo113 Sep 10, 2020
75ff0e7
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 11, 2020
aadcdd1
reduce
xuanluo113 Sep 11, 2020
c766f50
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 11, 2020
36ce354
scope
xuanluo113 Sep 11, 2020
142c031
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 11, 2020
15813fd
tdd shelf tubular
xuanluo113 Sep 11, 2020
c136df5
test
xuanluo113 Sep 11, 2020
eeb94b5
seperate
xuanluo113 Sep 12, 2020
a792481
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 15, 2020
9291a8c
fix dome
xuanluo113 Sep 16, 2020
7788635
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 16, 2020
c45388f
clean up
xuanluo113 Sep 18, 2020
8fa7d45
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into win…
xuanluo113 Sep 18, 2020
5b9773e
merge
xuanluo113 Oct 4, 2020
3c58f50
merge
xuanluo113 Oct 4, 2020
90bab9d
Merge remote-tracking branch 'remotes/origin/develop' into window-struct
mjwitte Oct 9, 2020
8a581b9
address review
xuanluo113 Oct 10, 2020
ca7d940
address review
xuanluo113 Oct 10, 2020
96f3999
encl naming
xuanluo113 Oct 10, 2020
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
2 changes: 2 additions & 0 deletions src/EnergyPlus/DataGlobals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ namespace DataGlobals {
std::function<void(EnergyPlus::Error e, const std::string &)> errorCallback;

bool eplusRunningViaAPI;
double timer_1(0.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intend to keep this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Left by mistake. Just deleted these.


// Clears the global data in DataGlobals.
// Needed for unit tests, should not be normally called.
Expand Down Expand Up @@ -349,6 +350,7 @@ namespace DataGlobals {
ioFiles.mtr.close();
ioFiles.err_stream.reset();
eplusRunningViaAPI = false;
timer_1 = 0.0;
}

} // namespace DataGlobals
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/DataGlobals.hh
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ namespace DataGlobals {
extern std::function<void(const std::string &)> messageCallback;
extern std::function<void(EnergyPlus::Error, const std::string &)> errorCallback;
extern bool eplusRunningViaAPI; // a flag for capturing whether we are running via API - if so we can't do python plugins

extern double timer_1;
// Clears the global data in DataGlobals.
// Needed for unit tests, should not be normally called.
void clear_state(EnergyPlus::IOFiles &ioFiles);
Expand Down
152 changes: 76 additions & 76 deletions src/EnergyPlus/DataHeatBalSurface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,88 +159,88 @@ namespace DataHeatBalSurface {
Array1D<Real64> QAirExtReport; // Surface Outside Face Thermal Radiation to Air Heat Transfer Rate [W]
Array1D<Real64> QHeatEmiReport; // Surface Outside Face Heat Emission to Air Rate [W]

Array1D<Real64> OpaqSurfInsFaceCondGainRep; // Equals Opaq Surf Ins Face Cond
Array1D<Real64> SurfOpaqInsFaceCondGainRep; // Equals Opaq Surf Ins Face Cond
// when Opaq Surf Ins Face Cond >= 0
Array1D<Real64> OpaqSurfInsFaceCondLossRep; // Equals -Opaq Surf Ins Face Cond
Array1D<Real64> SurfOpaqInsFaceCondLossRep; // Equals -Opaq Surf Ins Face Cond
// when Opaq Surf Ins Face Cond < 0
Array1D<Real64> OpaqSurfInsFaceConduction; // Opaque surface inside face heat conduction flow (W)
Array1D<Real64> SurfOpaqInsFaceConduction; // Opaque surface inside face heat conduction flow (W)
// from inside of opaque surfaces, for reporting (W)
Array1D<Real64> OpaqSurfInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2)
Array1D<Real64> SurfOpaqInsFaceConductionFlux; // Opaque surface inside face heat conduction flux (W/m2)
// from inside of opaque surfaces, for reporting (W/m2)
Array1D<Real64> OpaqSurfInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J)
Array1D<Real64> SurfOpaqInsFaceConductionEnergy; // Opaque surface inside face heat conduction flow (J)
// from inside of opaque surfaces, for reporting (J)

Array1D<Real64> OpaqSurfExtFaceCondGainRep; // Equals Opaq Surf Ext Face Cond
Array1D<Real64> SurfOpaqExtFaceCondGainRep; // Equals Opaq Surf Ext Face Cond
// when Opaq Surf Ext Face Cond >= 0
Array1D<Real64> OpaqSurfExtFaceCondLossRep; // Equals -Opaq Surf Ext Face Cond
Array1D<Real64> SurfOpaqExtFaceCondLossRep; // Equals -Opaq Surf Ext Face Cond
// when Opaq Surf Ext Face Cond < 0
Array1D<Real64> OpaqSurfOutsideFaceConduction; // Opaque surface outside face heat conduction flow (W)
Array1D<Real64> SurfOpaqOutsideFaceConduction; // Opaque surface outside face heat conduction flow (W)
// from inside of opaque surfaces, for reporting (W)
Array1D<Real64> OpaqSurfOutsideFaceConductionFlux; // Opaque surface outside face heat conduct flux (W/m2)
Array1D<Real64> SurfOpaqOutsideFaceConductionFlux; // Opaque surface outside face heat conduct flux (W/m2)
// from outside of opaque surfaces, for reporting (W/m2)
Array1D<Real64> OpaqSurfOutsideFaceConductionEnergy; // Opaque surface outside face heat conduction flow (J)
Array1D<Real64> SurfOpaqOutsideFaceConductionEnergy; // Opaque surface outside face heat conduction flow (J)
// from inside of opaque surfaces, for reporting (J)

Array1D<Real64> OpaqSurfAvgFaceCondGainRep; // Equals Opaq Surf average Face Cond
Array1D<Real64> SurfOpaqAvgFaceCondGainRep; // Equals Opaq Surf average Face Cond
// when Opaq Surf average Face Cond >= 0
Array1D<Real64> OpaqSurfAvgFaceCondLossRep; // Equals -Opaq Surf average Face Cond
Array1D<Real64> SurfOpaqAvgFaceCondLossRep; // Equals -Opaq Surf average Face Cond
// when Opaq Surf average Face Cond < 0
Array1D<Real64> OpaqSurfAvgFaceConduction; // Opaque surface average heat conduction flow (W)
Array1D<Real64> SurfOpaqAvgFaceConduction; // Opaque surface average heat conduction flow (W)
// net conduction from outside environ toward inside zone
// from inside of opaque surfaces, for reporting (W)
Array1D<Real64> OpaqSurfAvgFaceConductionFlux; // Opaque surface average face heat conduction flux (W/m2)
Array1D<Real64> SurfOpaqAvgFaceConductionFlux; // Opaque surface average face heat conduction flux (W/m2)
// net conduction from outside environ to inside zone
// from inside of opaque surfaces, for reporting (W/m2)
Array1D<Real64> OpaqSurfAvgFaceConductionEnergy; // Opaque surface average heat conduction flow (J)
Array1D<Real64> SurfOpaqAvgFaceConductionEnergy; // Opaque surface average heat conduction flow (J)
// net conduction from outside environ toward inside zone
// from inside of opaque surfaces, for reporting (J)

Array1D<Real64> OpaqSurfStorageGainRep; // Equals Opaque surface stored heat conduction flow
Array1D<Real64> SurfOpaqStorageGainRep; // Equals Opaque surface stored heat conduction flow
// when Opaque surface stored heat conduction flow >= 0
Array1D<Real64> OpaqSurfStorageCondLossRep; // Equals -Opaque surface stored heat conduction flow
Array1D<Real64> SurfOpaqStorageCondLossRep; // Equals -Opaque surface stored heat conduction flow
// when Opaque surface stored heat conduction flow < 0
Array1D<Real64> OpaqSurfStorageConduction; // Opaque surface stored heat conduction flow (W)
Array1D<Real64> SurfOpaqStorageConduction; // Opaque surface stored heat conduction flow (W)
// storage of heat inside surface, positive is increasing in surf
Array1D<Real64> OpaqSurfStorageConductionFlux; // Opaque surface stored heat conduction flux (W/m2)
Array1D<Real64> SurfOpaqStorageConductionFlux; // Opaque surface stored heat conduction flux (W/m2)
// storage of heat inside surface, positive is increasing in surf
Array1D<Real64> OpaqSurfStorageConductionEnergy; // Opaque surface stored heat conduction flow (J)
Array1D<Real64> SurfOpaqStorageConductionEnergy; // Opaque surface stored heat conduction flow (J)
// storage of heat inside surface, positive is increasing in surf

Array1D<Real64> OpaqSurfInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar,
Array1D<Real64> SurfOpaqInsFaceBeamSolAbsorbed; // Opaque surface inside face absorbed beam solar,
// for reporting (W)
Array1D<Real64> TempSurfOut; // Temperature of the Outside Surface for each heat transfer surface
Array1D<Real64> SurfTempSurfOut; // Temperature of the Outside Surface for each heat transfer surface
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor, but names like this which already have Surf in them could simply be SurfTempOut.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed this globally.

// used for reporting purposes only. Ref: TH(x,1,1)
Array1D<Real64> QRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation
Array1D<Real64> SurfQRadSWOutMvIns; // Short wave radiation absorbed on outside of movable insulation
// unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus
// diffuse from beam not absorbed in zone, plus
// beam absorbed at inside surfaces
Array1D<Real64> QC; // Short-Wave Radiation Converted Direct To Convection
Array1D<Real64> QD; // Diffuse solar radiation in a zone from sky and ground diffuse entering
Array1D<Real64> ZoneQC; // Short-Wave Radiation Converted Direct To Convection
Array1D<Real64> ZoneQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering
// through exterior windows and reflecting from interior surfaces,
// beam from exterior windows reflecting from interior surfaces,
// and beam entering through interior windows (considered diffuse)
Array1D<Real64> QDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering
Array1D<Real64> ZoneQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering
// through exterior windows, beam from exterior windows reflecting
// from interior surfaces, and beam entering through interior windows
//(considered diffuse)
// Originally QD, now used only for QSDifSol calc for daylighting
Array1D<Real64> QDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering
Array1D<Real64> ZoneQDV; // Diffuse solar radiation in a zone from sky and ground diffuse entering
// through exterior windows
Array1D<Real64> VMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance)
Array1D<Real64> VCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection
Array1D<Real64> NetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces
Array1D<Real64> ZoneVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance)
Array1D<Real64> ZoneVCONV; // Fraction Of Short-Wave Radiation From Lights Converted To Convection
Copy link
Contributor

Choose a reason for hiding this comment

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

These (and others) are really enclosure variables, not zone, indexed on enclosureNum (or similar). Also, solar and radiant enclosures can be different. Seems like we should use different prefixes for enclosures? SolEncl... RadEncl... ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed ZoneVMULT and QD's to use SolEnclprefix. I realizedQC, QDVandVCONV` are allocated but not used anymore, so I deleted them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at this now, I realize that this should be EnclSol to match the pattern of SurfOpaq SurfWin etc. It's your call whether to change that in this branch or in your next phase. Sorry I didn't see that before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I renamed it at the latest commit.

Array1D<Real64> SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces
Array1D<Real64> ZoneMRT; // Zone Mean Radiant Temperature
Array1D<Real64> QRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface
Array1D<Real64> SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface
// Variables that are used in both the Surface Heat Balance and the Moisture Balance
Array1D<Real64> QRadSWOutAbs; // Short wave radiation absorbed on outside of opaque surface
Array1D<Real64> QRadSWInAbs; // Short wave radiation absorbed on inside of opaque surface
Array1D<Real64> QRadLWOutSrdSurfs; // Long wave radiation absorbed on outside of exterior surface
Array1D<Real64> SurfOpaqQRadSWOutAbs; // Short wave radiation absorbed on outside of opaque surface
Array1D<Real64> SurfOpaqQRadSWInAbs; // Short wave radiation absorbed on inside of opaque surface
Array1D<Real64> SurfQRadLWOutSrdSurfs; // Long wave radiation absorbed on outside of exterior surface

Array1D<Real64> QAdditionalHeatSourceOutside; // Additional heat source term on boundary conditions at outside surface
Array1D<Real64> QAdditionalHeatSourceInside; // Additional heat source term on boundary conditions at inside surface
Array1D<Real64> SurfQAdditionalHeatSourceOutside; // Additional heat source term on boundary conditions at outside surface
Array1D<Real64> SurfQAdditionalHeatSourceInside; // Additional heat source term on boundary conditions at inside surface

Array1D<Real64> InitialDifSolInAbs; // Initial diffuse solar absorbed on inside of opaque surface [W/m2]
Array1D<Real64> InitialDifSolInTrans; // Initial diffuse solar transmitted out through window surface [W/m2]
Array1D<Real64> SurfOpaqInitialDifSolInAbs; // Initial diffuse solar absorbed on inside of opaque surface [W/m2]
Array1D<Real64> SurfWinInitialDifSolInTrans; // Initial diffuse solar transmitted out through window surface [W/m2]

// REAL(r64) variables from BLDCTF.inc and only used in the Heat Balance
Array3D<Real64> TH; // Temperature History (SurfNum,Hist Term,In/Out) where:
Expand Down Expand Up @@ -324,45 +324,45 @@ namespace DataHeatBalSurface {
QRadOutReport.deallocate();
QdotRadOutRep.deallocate();
QdotRadOutRepPerArea.deallocate();
OpaqSurfInsFaceCondGainRep.deallocate();
OpaqSurfInsFaceCondLossRep.deallocate();
OpaqSurfInsFaceConduction.deallocate();
OpaqSurfInsFaceConductionFlux.deallocate();
OpaqSurfInsFaceConductionEnergy.deallocate();
OpaqSurfExtFaceCondGainRep.deallocate();
OpaqSurfExtFaceCondLossRep.deallocate();
OpaqSurfOutsideFaceConduction.deallocate();
OpaqSurfOutsideFaceConductionFlux.deallocate();
OpaqSurfOutsideFaceConductionEnergy.deallocate();
OpaqSurfAvgFaceCondGainRep.deallocate();
OpaqSurfAvgFaceCondLossRep.deallocate();
OpaqSurfAvgFaceConduction.deallocate();
OpaqSurfAvgFaceConductionFlux.deallocate();
OpaqSurfAvgFaceConductionEnergy.deallocate();
OpaqSurfStorageGainRep.deallocate();
OpaqSurfStorageCondLossRep.deallocate();
OpaqSurfStorageConduction.deallocate();
OpaqSurfStorageConductionFlux.deallocate();
OpaqSurfStorageConductionEnergy.deallocate();
OpaqSurfInsFaceBeamSolAbsorbed.deallocate();
TempSurfOut.deallocate();
QRadSWOutMvIns.deallocate();
QC.deallocate();
QD.deallocate();
QDforDaylight.deallocate();
QDV.deallocate();
VMULT.deallocate();
VCONV.deallocate();
NetLWRadToSurf.deallocate();
SurfOpaqInsFaceCondGainRep.deallocate();
SurfOpaqInsFaceCondLossRep.deallocate();
SurfOpaqInsFaceConduction.deallocate();
SurfOpaqInsFaceConductionFlux.deallocate();
SurfOpaqInsFaceConductionEnergy.deallocate();
SurfOpaqExtFaceCondGainRep.deallocate();
SurfOpaqExtFaceCondLossRep.deallocate();
SurfOpaqOutsideFaceConduction.deallocate();
SurfOpaqOutsideFaceConductionFlux.deallocate();
SurfOpaqOutsideFaceConductionEnergy.deallocate();
SurfOpaqAvgFaceCondGainRep.deallocate();
SurfOpaqAvgFaceCondLossRep.deallocate();
SurfOpaqAvgFaceConduction.deallocate();
SurfOpaqAvgFaceConductionFlux.deallocate();
SurfOpaqAvgFaceConductionEnergy.deallocate();
SurfOpaqStorageGainRep.deallocate();
SurfOpaqStorageCondLossRep.deallocate();
SurfOpaqStorageConduction.deallocate();
SurfOpaqStorageConductionFlux.deallocate();
SurfOpaqStorageConductionEnergy.deallocate();
SurfOpaqInsFaceBeamSolAbsorbed.deallocate();
SurfTempSurfOut.deallocate();
SurfQRadSWOutMvIns.deallocate();
ZoneQC.deallocate();
ZoneQD.deallocate();
ZoneQDforDaylight.deallocate();
ZoneQDV.deallocate();
ZoneVMULT.deallocate();
ZoneVCONV.deallocate();
SurfNetLWRadToSurf.deallocate();
ZoneMRT.deallocate();
QRadSWLightsInAbs.deallocate();
QRadSWOutAbs.deallocate();
QRadSWInAbs.deallocate();
QRadLWOutSrdSurfs.deallocate();
QAdditionalHeatSourceOutside.deallocate();
QAdditionalHeatSourceInside.deallocate();
InitialDifSolInAbs.deallocate();
InitialDifSolInTrans.deallocate();
SurfOpaqQRadSWLightsInAbs.deallocate();
SurfOpaqQRadSWOutAbs.deallocate();
SurfOpaqQRadSWInAbs.deallocate();
SurfQRadLWOutSrdSurfs.deallocate();
SurfQAdditionalHeatSourceOutside.deallocate();
SurfQAdditionalHeatSourceInside.deallocate();
SurfOpaqInitialDifSolInAbs.deallocate();
SurfWinInitialDifSolInTrans.deallocate();
TH.deallocate();
QH.deallocate();
THM.deallocate();
Expand Down
Loading