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

Calculate Mean Radiant Temperature (MRT) for Enclosures (not zones) #9628

Merged
merged 14 commits into from
Sep 13, 2022

Conversation

mjwitte
Copy link
Contributor

@mjwitte mjwitte commented Aug 29, 2022

Pull request overview

  • This PR fixes some of Mean Radiant Temperature (MRT) calculations are zone-based (not enclosure-based) #9377
  • Calculate MRT for enclosure surfaces, not zone surfaces. If there are no airwalls and no spaces in the model, then there is one enclosure per zone and nothing will change. If airwalls or spaces result in enclosures that are <> zones, then this will cause diffs.
  • Expect surfaces listed in ComfortViewFactorAngles to be in the same radiant enclosure as the People object(s) which use it. Issue warnings if the enclosures don't match up. Surfaces may be in different zones or spaces as long as they are in the same enclosure. If the enclosure rule is violated, a warning is issued, but the simulation will continue with the specified surfaces. Zone Name is now ignored for this (it wasn't a required field, so no IDD change is necessary). The field should be removed after release.

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@mjwitte mjwitte added the Defect Includes code to repair a defect in EnergyPlus label Aug 29, 2022
@mjwitte mjwitte added this to the EnergyPlus 22.2 milestone Aug 29, 2022
Array1D<DataViewFactorInformation::EnclosureViewFactorInformation> EnclRadInfo;
Array1D<DataViewFactorInformation::EnclosureViewFactorInformation> EnclSolInfo;
EPVector<DataViewFactorInformation::EnclosureViewFactorInformation> EnclRadInfo;
EPVector<DataViewFactorInformation::EnclosureViewFactorInformation> EnclSolInfo;
Copy link
Collaborator

@amirroth amirroth Aug 29, 2022

Choose a reason for hiding this comment

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

I love struct/class type names that include the word "Data" or "Information". So what you're saying is ... this struct contains information? I think that's only allowed in C++20 and we're only on C++17.

for (int radEnclosureNum = 1; radEnclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++radEnclosureNum) {
auto &thisEnclosure(state.dataViewFactor->EnclRadInfo(radEnclosureNum));
if (!state.dataHeatBal->EnclRadReCalc(radEnclosureNum)) continue;
for (auto &thisRadEnclosure : state.dataViewFactor->EnclRadInfo) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@mjwitte
Copy link
Contributor Author

mjwitte commented Aug 31, 2022

@nealkruis @shorowit This change results in basement surface temperatures which are cooler on average. Is that what you expect?
image

image

@nealkruis
Copy link
Member

That makes sense to me if the non-basement surfaces are warmer than the basement surfaces on average.

@mjwitte mjwitte marked this pull request as ready for review August 31, 2022 23:01
@mjwitte
Copy link
Contributor Author

mjwitte commented Aug 31, 2022

@Myoldmopar This is mostly ready for review. It addresses part of #9377 but not all. No diffs are expected for the base test suite. This still needs a unit test or two. Handing this off to @jcyuan2020 to add a unit test and respond to comments.

Copy link
Contributor Author

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

Highlights:

Array1D<Real64> EnclRadQThermalRad; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones)
Array1D<Real64> EnclRadThermAbsMult; // EnclRadThermAbsMult - MULTIPLIER TO COMPUTE 'ITABSF'
Array1D<bool> EnclSolAbsFirstCalc; // for error message
Array1D<bool> EnclRadReCalc; // Enclosure solar or thermal radiation properties needs to be recalc due to window/shading status change
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to enclosure data. Which then required non-substantive changes throughout the code.

Comment on lines -377 to -378
Array1D<Real64> SurfaceAE; // Product of area and emissivity for each surface
Array1D<Real64> ZoneAESum; // Sum of area times emissivity for all zone surfaces
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to Surface struct

@@ -372,7 +372,7 @@ void KivaInstanceMap::setBoundaryConditions(EnergyPlusData &state)
state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(floorSurface); // HVAC

bcs->slabConvectiveTemp = state.dataHeatBal->SurfTempEffBulkAir(floorSurface) + DataGlobalConstants::KelvinConv;
bcs->slabRadiantTemp = ThermalComfort::CalcSurfaceWeightedMRT(state, zoneNum, floorSurface, false) + DataGlobalConstants::KelvinConv;
bcs->slabRadiantTemp = ThermalComfort::CalcSurfaceWeightedMRT(state, floorSurface, false) + DataGlobalConstants::KelvinConv;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

zoneNum is unnecessary. Get the enclosurenum now from the surface.

"...invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + state.dataIPShortCut->cAlphaArgs(2) + "\".");
ErrorsFound = true;
}
// Ignore ZoneName cAlphaArgs(2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modify ComfortViewFactorAngles to ignore zone name and check that all surfaces and associated People object are in the same radiant enclosure.

Comment on lines +2092 to +2093
for (auto const &thisRadEnclosure : state.dataViewFactor->EnclRadInfo) {
for (int const SurfNum2 : thisRadEnclosure.SurfacePtr) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The heart of all of this - loop over enclosure surfaces instead of zone surfaces.

auto &thisSurface = state.dataSurface->Surface(SurfNum);
auto &thisRadEnclosure = state.dataViewFactor->EnclRadInfo(thisSurface.RadEnclIndex);
// Recalc SurfaceEnclAESum only if needed due to window shades or EMS
if (thisRadEnclosure.radReCalc) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Recalculate area*emissivity only if needed.

Array1D<Real64> AngleFactor; // Angle factor of each surface
std::string Name; // Angle factor list name
Array1D_string SurfaceName; // Names of the Surfces
Array1D_int SurfacePtr; // ALLOCATABLE to the names of the Surfces
int TotAngleFacSurfaces; // Total number of surfaces
std::string ZoneName; // Name of zone the system is serving
int ZonePtr; // Point to this zone in the Zone derived type

// Default Constructor
AngleFactorData() : TotAngleFacSurfaces(0), ZonePtr(0)
{
}
EPVector<Real64> AngleFactor; // Angle factor of each surface
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some gratuitous Array1D --> EPVector scattered about.

this->runningAverageCEN = 0.0;
this->useEpwDataCEN = false;
this->firstDaySet = false; // first day is set with initiate -- so do not update
new (this) ThermalComfortsData();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use the latest clear_state form.

@mjwitte mjwitte changed the title Calculate Meant Radiant Temperature (MRT) for Enclosures (not zones) Calculate Mean Radiant Temperature (MRT) for Enclosures (not zones) Sep 1, 2022
@rraustad rraustad self-assigned this Sep 13, 2022

With this choice, the method used will be a factor per floor area of the zone. (The People per Zone Floor Area field should be filled).
\item[People/Area] With this choice, the method used will be a factor per floor area of the zone. (The People per Zone Floor Area field should be filled).

Copy link
Contributor

Choose a reason for hiding this comment

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

"floor area of the zone. (The People per Zone Floor Area" Since there is more work here, I would suggest adding to the end of the first sentance "or Space" in the future here and other places like this. Also it's just "People per Floor Area" now, another clean up that could happen in a future commit.

@@ -827,20 +802,20 @@ \subsection{Simplified ASHRAE 55 Warnings}\label{simplified-ashrae-55-warnings}
\item
Eliminate occupancy when conditioning equipment is off.
\item
Note that the ASHRAE graph lower limit is (19.6C to 21.7C) -- heating setpoints may need to be nearer 22.2C (72F) than 21.1C (70F).
Note that the ASHRAE graph lower limit is (19.6$^\circ$C to 21.7$^\circ$C)---heating setpoints may need to be nearer 22.2$^\circ$C (72$^\circ$F) than 21.1$^\circ$C (70$^\circ$F).
\item
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we were using \deg or something like that but this does give a good degree symbol and Google shows this is one method.

image

for (int const SurfNum : thisEnclosure.SurfacePtr) {
if (!Surface(SurfNum).HeatTransSurf) continue;
int const ConstrNum = Surface(SurfNum).Construction;
for (int const SurfNum : thisRadEnclosure.SurfacePtr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should most of E+ for loops use int const X?

Copy link
Contributor

@rraustad rraustad left a comment

Choose a reason for hiding this comment

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

Code changes and unit test look good.

@rraustad
Copy link
Contributor

@mjwitte is there anything else needed for this pass?

@mjwitte
Copy link
Contributor Author

mjwitte commented Sep 13, 2022

@mjwitte is there anything else needed for this pass?

Not that I'm aware of. Thanks for the review.

@rraustad
Copy link
Contributor

This change has no CI diffs and will merge later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants