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

Add output wetbulb globe temperature in the csv output #10506

Merged
merged 18 commits into from
Jun 4, 2024

Conversation

yujiex
Copy link
Collaborator

@yujiex yujiex commented May 15, 2024

Pull request overview

introduction

This PR adds an Output:Variable, Wetbulb Globe Temperature, to the zone air report. Its calculation is as follows

Wetbulb Globe Temperature = 0.7 * zone wetbulb temperature + 0.3 * zone operative temperature

The attached file is a sample output file with the Wetbulb Globe Temperature added.
image

eplusout.csv

regression diffs

  • audit diffs are due to changes in the requested output variables

For example, in 1ZoneUncontrolled example file, NumOfRVariable increased by 2 as Wetbulb Globe Temperature and Wetbulb Temperature are added. The NumConsideredOutputVariables and NumOfRVariable(Actual) increases by 3 as 3 more Output:Variable are added to the idf.

image

  • rdd diffs are because 2 more variables are available with this feature. For example, this is the diffs for the 1ZoneUncontrolled.idf.

image

  • Table diffs are due to the added output variables. These table diffs are only present in 1ZoneUncontrolled and 5ZoneAirCooledWithSpacesHVAC as Output:Variable are added to these two files for testing.

image

  • Meter diffs happen in 1ZoneUncontrolled and 5ZoneAirCooledWithSpacesHVAC
    image
    in 1ZoneUncontrolled the "Meters for xx" index increased by 3 as 3 output:variables are requested for 1 zone; in 5ZoneAirCooledWithSpacesHVAC, the "Meters for xx" index increased by 14 as 2 outputs are requested for all 6 zones and two outputs are requested for one space
    The following shows the added outputs in 5ZoneAirCooledWithSpacesHVAC.idf
  Output:Variable,Space 5 Office,Space Wetbulb Temperature,hourly; !- Zone Average [C]
  Output:Variable,Space 5 Office,Space Wetbulb Globe Temperature,hourly;
  Output:Variable,*,Zone Wetbulb Temperature,hourly; !- Zone Average [C]
  Output:Variable,*,Zone Wetbulb Globe Temperature,hourly;

NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE

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

@yujiex yujiex added the NewFeature Includes code to add a new feature to EnergyPlus label May 15, 2024
@yujiex yujiex added this to the EnergyPlus 24.2 IOFreeze milestone May 15, 2024
@yujiex yujiex self-assigned this May 15, 2024
Copy link
Contributor

@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.

@yujiex PsyTwbFnTdbWPb is an iterative calculation, so we try to avoid calculating it unless it's requested as an output variable or used as an EMS sensor. See NodeInputManager::CalcMoreNodeInfo for how this is managed for certain node outputs. It would be good to add a zone-level flag for this new output to skip the calculation if the variable has not been requested or used in EMS.

@@ -4928,6 +4928,9 @@ void calcMeanAirTemps(EnergyPlusData &state,
thisAirRpt.MeanAirTemp = ZTAV;
thisAirRpt.MeanAirHumRat = airHumRatAvg;
thisAirRpt.OperativeTemp = 0.5 * (ZTAV + MRT);
thisAirRpt.WetbulbTemp = Psychrometrics::PsyTwbFnTdbWPb(state, ZTAV, airHumRatAvg, state.dataEnvrn->OutBaroPress);
thisAirRpt.WetbulbGlobeTemp =
0.7 * Psychrometrics::PsyTwbFnTdbWPb(state, ZTAV, airHumRatAvg, state.dataEnvrn->OutBaroPress) + 0.3 * thisAirRpt.OperativeTemp;
Copy link
Contributor

Choose a reason for hiding this comment

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

Several lines below here, there is a block which recalculates thisAirRpt.OperativeTemp if operative temperature control is being used. Should the WetbulbGlobeTemp happen after that to be consistent?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Definitely, it should be after the thisAirRpt.OperativeTemp has been recalculated. Thanks for noticing this.

@yujiex
Copy link
Collaborator Author

yujiex commented May 21, 2024

@yujiex PsyTwbFnTdbWPb is an iterative calculation, so we try to avoid calculating it unless it's requested as an output variable or used as an EMS sensor. See NodeInputManager::CalcMoreNodeInfo for how this is managed for certain node outputs. It would be good to add a zone-level flag for this new output to skip the calculation if the variable has not been requested or used in EMS.

I will add a zone-level flag so that the calculation is only triggered if an output:variable is requested for this new wetbulb glob temperature variable.

Yujie Xu added 2 commits May 22, 2024 10:30
The zone reporting flag will make sure the calculation only happens when the
variable is requested
The WBGT depends on the operative temperature (OT), so its calculation is moved
to after OT obtains the most updated value.
only calculate WBGT when it is requested as a senser by EMS
@Myoldmopar Myoldmopar assigned mjwitte and unassigned yujiex May 22, 2024
@@ -4902,6 +4903,22 @@ void ReportZoneMeanAirTemp(EnergyPlusData &state)
// PURPOSE OF THIS SUBROUTINE:
// This subroutine updates the report variables for the AirHeatBalance.

for (int ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is good, but it needs to be protected by a oneTime variable so these loops don't execute every timestep.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh make sense. I will add the oneTime flag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

Yujie Xu added 2 commits May 22, 2024 14:42
so that the reporting flag calculation only happens once
Copy link
Contributor

@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.

@yujiex Sorry, I didn't think of this earlier, but this output variable will be generated for zones and for spaces (if state.dataHeatBal->doSpaceHeatBalanceSimulation is true), see ReportZoneMeanAirTemp).

@@ -4902,6 +4903,25 @@ void ReportZoneMeanAirTemp(EnergyPlusData &state)
// PURPOSE OF THIS SUBROUTINE:
// This subroutine updates the report variables for the AirHeatBalance.

if (state.dataHeatBalAirMgr->CalcExtraReportVarMyOneTimeFlag) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is eerily similar to node wet-bulb temp. Shouldn't this be done over in NodeInputManager? and globe temp recorded as a node condition? Then these AirRpt variables could pick up data off the node.

        for (auto const *reqVar : state.dataOutputProcessor->reqVars) {
            if (Util::SameString(reqVar->key, state.dataLoopNodes->NodeID(iNode)) || reqVar->key.empty()) {
                if (Util::SameString(reqVar->name, "System Node Wetbulb Temperature")) {
                    state.dataNodeInputMgr->NodeWetBulbRepReq(iNode) = true;
                    NodeWetBulbSchedPtr(iNode) = reqVar->SchedPtr;
                } else if (Util::SameString(reqVar->name, "System Node Relative Humidity")) {
                    NodeRelHumidityRepReq(iNode) = true;
                    NodeRelHumiditySchedPtr(iNode) = reqVar->SchedPtr;
                } else if (Util::SameString(reqVar->name, "System Node Dewpoint Temperature")) {
                    NodeDewPointRepReq(iNode) = true;
                    NodeDewPointSchedPtr(iNode) = reqVar->SchedPtr;
                } else if (Util::SameString(reqVar->name, "System Node Specific Heat")) {
                    NodeSpecificHeatRepReq(iNode) = true;
                    NodeSpecificHeatSchedPtr(iNode) = reqVar->SchedPtr;
                }
            }
        }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there one node in each space/zone? I didn't find out how to get the node index from space or zone index

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if this mapping can be done relatively straightforward, then maybe I should calculate it at the nodes above and retrieve them during the reporting.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure you want to make any big changes here. There is already Zone/Space Mean Air Temperature and these changes mimic that report variable. I am just pointing out that there may be a cleaner way to do this. If this PR is clean and gets the job done then that is good enough for now. A new branch could be used to test using the node condition as the basis for these AirRpt variables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see. I will test it out with some other test branches computing the node condition as the basis for the AirRpt variables.

Copy link
Contributor

Choose a reason for hiding this comment

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

One issue here is that node conditions are updated at the system timestep and these zone values are the averages at the zone timestep. So I'm not sure it's worth pursuing this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make sense. Maybe we can keep it as this and not calculate at the node level, otherwise, I assume there also needs to be some temporal aggregation steps in addition to node-to-zone/space matching.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, keep it like this for now.

if (state.dataHeatBalAirMgr->CalcExtraReportVarMyOneTimeFlag) {
for (int ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) {
auto &thisZone = state.dataHeatBal->Zone(ZoneLoop);
for (auto const *reqVar : state.dataOutputProcessor->reqVars) {
Copy link
Contributor

Choose a reason for hiding this comment

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

For this use case, I think it's better to make reqVars the outer loop and check first for name="Zone Wetbulb Globe . . ." only first. Then if key.empty() set ReportWBGT for all zone (and spaces). If it's not empty, you can use FindItemInList to find the zone or space number and then set ReportWBGT for that single instance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This way is better. I will loop through the reqVars first

auto &thisZone = state.dataHeatBal->Zone(ZoneLoop);
for (auto const *reqVar : state.dataOutputProcessor->reqVars) {
if (Util::SameString(reqVar->key, thisZone.Name) || reqVar->key.empty()) {
if (Util::SameString(reqVar->name, "Zone Wetbulb Globe Temperature")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (reqVar->name == "ZONE WETBULB GLOBE TEMPERATURE")) {
name is already uppercase, so no need to use SameString here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

indeed

}
for (int loop = 1; loop <= state.dataRuntimeLang->NumSensors; ++loop) {
if (state.dataRuntimeLang->Sensor(loop).UniqueKeyName == thisZone.Name &&
Util::SameString(state.dataRuntimeLang->Sensor(loop).OutputVarName, "Zone Wetbulb Globe Temperature")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here I'm not sure about the case of sensor OutputVarName so probably keep SameString.

Comment on lines 4973 to 4974
auto const &thisZone = state.dataHeatBal->Zone(zoneNum);
if (thisZone.ReportWBGT) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If you move ReportWBGT into thisAirRpt (state.dataHeatBal->ZnAirRpt and spaceAirRpt) then it will work for both here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea. I'll move it to be one of the fields in thisAirRpt

@yujiex
Copy link
Collaborator Author

yujiex commented May 23, 2024

doSpaceHeatBalanceSimulation

Thanks for noticing this. I will add another space layer in theReportWBGT flag calculation. I tested it with the "5ZoneAirCooledWithSpacesHVAC.idf" file. Looks like it's working

Yujie Xu added 2 commits May 23, 2024 14:49
change loop order:

  *reqVar moved to the outer loop
  check first for variable name="Zone Wetbulb Globe . . ."
  Then if key.empty() set ReportWBGT for all zone (and spaces).
  If it's not empty, use FindItemInList to find the zone or space number and then set
  ReportWBGT for that single instance.

reqVar->name changed to use "==" to check equality since it's upper case

ReportWBGT moved into thisAirRpt, so it can work for both ZnAirRpt and spaceAirRpt
Comment on lines 4916 to 4918
} else {
auto &thisZnAirRpt = state.dataHeatBal->ZnAirRpt(ZoneLoop);
thisZnAirRpt.ReportWBGT = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be an else. If doSpaceHeatBalanceSimulation is true, then there will be values for both zones and spaces.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see. I'll remove the else.

}
} else {
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
int spaceNum = Util::FindItemInList(reqVar->name, state.dataHeatBal->space);
Copy link
Contributor

Choose a reason for hiding this comment

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

These need to search on reqVar->key, not name. If you run a test file with a zone name in the output variable object, it won't work here. And this needs to test for spaceNum > 0 to prevent a subscript error. Same comments apply to zone below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll search the "key" field here for the space and zone name instead of the "name" field, and add a check for the space and zone index > 0.

Comment on lines 4926 to 4927
} else {
int ZoneLoop = Util::FindItemInList(reqVar->name, state.dataHeatBal->Zone);
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, this shouldn't be an else.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

indeed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Although here there should probably still be a separation based on state.dataHeatBal->doSpaceHeatBalanceSimulation T/F values, as when the spaceNum is found, the corresponding zone index containing this space will come from the zoneNum field of the space. When there's no space level simulations, a FindItemInList will be used to find the zone index

src/EnergyPlus/HeatBalanceAirManager.hh Show resolved Hide resolved
@@ -1475,6 +1477,8 @@ namespace DataHeatBalance {
Real64 OABalanceFanElec = 0.0; // Fan Electricity {W} due to OA air balance
Real64 SumEnthalpyM = 0.0; // Zone sum of EnthalpyM
Real64 SumEnthalpyH = 0.0; // Zone sum of EnthalpyH
// reporting flags
bool ReportWBGT = true; // whether the wetbulb globe temperature is reqeusted as an output variable or used as an EMS sensor
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry - it's this flag that should be initialized to false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh! right right. This should be false.

Yujie Xu added 4 commits May 28, 2024 13:09
zone will report the variable when itself is requested and when its subspace is requested
when a specific space is requested to report WBGT, only that space is reported,
not its parent zone.

when no specific zone or space is requested, then
Output:Variable,*,Zone Wetbulb Globe Temperature,hourly; -> report all zones
Output:Variable,*,Space Wetbulb Globe Temperature,hourly;-> report all spaces
set up a Wetbulb Globe Temperature EMSInternalVariable for zone and space
Comment on lines 314 to 316
std::string const &spaceName = state.dataHeatBal->space(spaceNum).Name;
auto &thisSpaceAirRpt = state.dataHeatBal->spaceAirRpt(spaceNum);
SetupEMSInternalVariable(state, "Space Wetbulb Globe Temperature", spaceName, "[C]", thisSpaceAirRpt.WetbulbGlobeTemp);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not needed. Since the new WBGT is an output:variable is can be accessed with EMS:Sensor. The internal variable setup is to provide EMS access to values that are not time series data such as sizing results. See EMS Applicatoin Guide "Internal Variables" section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If I don't add this, it doesn't show up in the edd file. Is that expected?

Copy link
Contributor

Choose a reason for hiding this comment

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

If I don't add this, it doesn't show up in the edd file. Is that expected?

Correct. The EDD will list available actuators and internal variables only. Everything in the RDD is available to use as an EMS sensor.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the clarification. I will remove the SetupEMSInternalVariables.

@@ -373,6 +377,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err
OutputProcessor::TimeStepType::System,
OutputProcessor::StoreType::Average,
name);

SetupEMSInternalVariable(state, "Zone Wetbulb Globe Temperature", name, "[C]", thisZnAirRpt.WetbulbGlobeTemp);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment here, not needed.

Comment on lines 4913 to 4924
if (reqVar->name == "ZONE WETBULB GLOBE TEMPERATURE" || reqVar->name == "SPACE WETBULB GLOBE TEMPERATURE") {
if (reqVar->key.empty()) {
for (int ZoneLoop = 1; ZoneLoop <= state.dataGlobal->NumOfZones; ++ZoneLoop) {
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
for (int spaceNum : state.dataHeatBal->Zone(ZoneLoop).spaceIndexes) {
auto &thisSpaceAirRpt = state.dataHeatBal->spaceAirRpt(spaceNum);
thisSpaceAirRpt.ReportWBGT = true;
}
}
auto &thisZnAirRpt = state.dataHeatBal->ZnAirRpt(ZoneLoop);
thisZnAirRpt.ReportWBGT = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I've made zone vs space so confusing. This code here will set ReportWBGT=true for all zones and spaces if either "Zone Wetbulb..." or "Space Webulb..." is requested. The structure should be more like:

if (reqVar->name == "ZONE WETBULB GLOBE TEMPERATURE"){
  if (reqVar->key.empty()) {
      set true for all zones
  else
      set for matching zone name.
}
}
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
if (reqVar->name == "SPACE WETBULB GLOBE TEMPERATURE"){
  if (reqVar->key.empty()) {
      set true for all spaces
  else
      set for matching space name.
}
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see I see. Cleaner this way. I had zones and space nested together earlier. I will change it to this format.

Comment on lines 4944 to 4945
if (state.dataRuntimeLang->Sensor(loop).OutputVarName == "ZONE WETBULB GLOBE TEMPERATURE" ||
state.dataRuntimeLang->Sensor(loop).OutputVarName == "SPACE WETBULB GLOBE TEMPERATURE") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment here. If Zone then search for matching zone name, if Space, then search for matching space name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will change it to separate zone and space checks like the pattern you showed above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just to make sure, I don't need to check state.dataRuntimeLang->Sensor(loop).UniqueKeyName.empty() right? They're guaranteed to be non-empty (otherwise it will err with "Unique Key Name not found.") @mjwitte

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to make sure, I don't need to check state.dataRuntimeLang->Sensor(loop).UniqueKeyName.empty() right? They're guaranteed to be non-empty (otherwise it will err with "Unique Key Name not found.") @mjwitte

Correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks

Make the zone and space checks into the following pattern

if (reqVar->name == "ZONE WETBULB GLOBE TEMPERATURE"){
  if (reqVar->key.empty()) {
      set true for all zones
  else
      set for matching zone name.
  }
}
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
  if (reqVar->name == "SPACE WETBULB GLOBE TEMPERATURE"){
    if (reqVar->key.empty()) {
        set true for all spaces
    else
        set for matching space name.
    }
  }
}
Copy link
Contributor

@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.

@yujiex This is getting close. See comments below, update with develop, and remove and temporary changes (e.g. Zone Wetbulb Temperature).

}
}
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
if (reqVar->key.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Almost there. Before this line:
if (reqVar->name == "SPACE WETBULB GLOBE TEMPERATURE") {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh I forgot this space var check. Good catch

}
}
}
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be else if.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right. it should not check again if reqVar->name is already "ZONE WETBULB GLOBE TEMPERATURE"

thisZnAirRpt.ReportWBGT = true;
}
}
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) {
Copy link
Contributor

Choose a reason for hiding this comment

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

else if

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll change to else if here


### Adding an Output:Variable, Wetbulb Globe Temperature

An output variable will be added, Wetbulb Globe Temperature.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should list both flavors, Zone Wetbulb Globe Temperature and Space . . .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll add the space version too

Copy link
Contributor

@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.

@yujiex This looks good, tested with various combinations of output variable and EMS sensor inputs. After you remove the Zone/Space Wetbulb Temperature from code and idfs, this will be ready to merge.

@yujiex
Copy link
Collaborator Author

yujiex commented Jun 4, 2024

@yujiex This looks good, tested with various combinations of output variable and EMS sensor inputs. After you remove the Zone/Space Wetbulb Temperature from code and idfs, this will be ready to merge.

Thanks @mjwitte. I just removed the wetbulb temperature output.

@Myoldmopar
Copy link
Member

Wow. This has been run through the wringer! I'm not going to add more here, if it looks good at any point, merge away @mjwitte

@mjwitte mjwitte merged commit 0f06ec3 into develop Jun 4, 2024
15 checks passed
@mjwitte mjwitte deleted the wetBulbGlobeTemperatureOutput branch June 4, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NewFeature Includes code to add a new feature to EnergyPlus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propose to add an "indoor Wet-bulb Globe Temperature" report variable
9 participants