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

Separate Infiltration from Natural Ventilation Flows for AirflowNetwork #8689

Merged

Conversation

lgu1234
Copy link
Contributor

@lgu1234 lgu1234 commented Apr 1, 2021

Pull request overview

Fixes #8475

Separate the following output variables from infiltration to both Infiltration and Ventilation:

AFN Zone Infiltration Volume AirflowNetworkZnRpt(i).InfilVolume
AFN Zone Infiltration Mass AirflowNetworkZnRpt(i).InfilMass
AFN Zone Infiltration Air Change Rate AirflowNetworkZnRpt(i).InfilAirChangeRate

Add 3 new output variables:

AFN Zone Ventilation Volume AirflowNetworkZnRpt(i).VentilVolume
AFN Zone Ventilation Mass AirflowNetworkZnRpt(i).VentilMass
AFN Zone Ventilation Air Change Rate AirflowNetworkZnRpt(i).VentilAirChangeRate

Fixes #8716 Corrects AFN infiltration in the Outdoor Air Details Report.

Add AFN Zone Ventilation output variables to testfiles as appropriate (has openings and ahs AFN Zone Infiltration outputs already).

Pull Request Author

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

  • [X ] Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • [ X] Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • [ X] Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • [X ] Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • [X ] 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

@lgu1234 lgu1234 added the Defect Includes code to repair a defect in EnergyPlus label Apr 1, 2021
@lgu1234
Copy link
Contributor Author

lgu1234 commented Apr 1, 2021

Outputs of infiltration from develop
8475-1

Outputs of sum of infiltration and ventilation from branch
8475-2

Outputs of ventilation from branch
8475-3

Outputs of infiltration from branch
8475-4

\item
HVAC,Sum,AFN Zone Ventilation Mass {[}kg{]}
\item
HVAC,Average,AFN Zone Ventilation Air Change Rate {[}ach{]}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add 3 new output variables for natural ventilation flows

@@ -1493,6 +1493,8 @@ namespace AirflowNetwork {
Real64 TotalLat;
Real64 SumMCp;
Real64 SumMCpT;
Real64 SumMVCp;
Real64 SumMVCpT;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add 2 more variables to store ventilation values.

state.dataAirflowNetworkBalanceManager->AirflowNetworkZnRpt(i).VentilAirChangeRate,
"System",
"Average",
Zone(i).Name);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add output variables for report.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added AFN Zone Ventilation output variables to pertinent files (ones with AFN Zone Infiltration variables that also have openings).

@@ -9464,6 +9485,9 @@ namespace AirflowNetworkBalanceManager {
e.InfilVolume = 0.0;
e.InfilMass = 0.0;
e.InfilAirChangeRate = 0.0;
e.VentilVolume = 0.0;
e.VentilMass = 0.0;
e.VentilAirChangeRate = 0.0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initialization.

state.dataAirflowNetworkBalanceManager->AirflowNetworkZnRpt(i).VentilAirChangeRate =
state.dataAirflowNetworkBalanceManager->AirflowNetworkZnRpt(i).VentilVolume / (TimeStepSys * Zone(i).Volume);
state.dataAirflowNetworkBalanceManager->AirflowNetworkZnRpt(i).VentilMass =
(state.dataAirflowNetworkBalanceManager->exchangeData(i).SumMVCp / CpAir) * ReportingConstant;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calculate outputs for natural ventilation.

state.dataAirflowNetwork->AirflowNetworkLinkSimu(i).FLOW2 * CpAir;
state.dataAirflowNetworkBalanceManager->exchangeData(ZN1).SumMVCpT +=
state.dataAirflowNetwork->AirflowNetworkLinkSimu(i).FLOW2 * CpAir * Tamb;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Separate infiltration and natural ventilation.

state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMMCp;
MCpT_Total = state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMCpT +
state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMVCpT +
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add infiltration and ventilation impact together. A single variables was used previously.

state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMVCpT -
(state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMCp +
state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMVCp) *
state.dataHeatBalFanSys->MAT(ZoneNum);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Include infiltration and ventilation together.

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.

@lgu1234 A few comments below. I also added some change to feed into the OA Details report. But something is off in that report that I still need to fix here.

@@ -12745,8 +12809,10 @@ namespace AirflowNetworkBalanceManager {
CpAir = PsyCpAirFnW(state.dataHeatBalFanSys->ZoneAirHumRat(ZoneNum));
RhoAir = PsyRhoAirFnPbTdbW(
state, state.dataEnvrn->OutBaroPress, state.dataHeatBalFanSys->MAT(ZoneNum), state.dataHeatBalFanSys->ZoneAirHumRat(ZoneNum));
InfilVolume =
(state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMCp / CpAir / RhoAir) * TimeStepSys * DataGlobalConstants::SecInHour;
InfilVolume = ((state.dataAirflowNetworkBalanceManager->exchangeData(ZoneNum).SumMCp +
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid confusion down the road, I would rename this function from GetZoneInfilAirChangeRate to something like GetZoneOutdoorAirChangeRate or at least add comments here to explain why both infiltration and ventilation flows are summed 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.

Done. Change the function name.

@@ -78,6 +78,7 @@ namespace AirflowNetworkBalanceManager {
Real64 VentilHeatGain; // Heat Loss {W} due to ventilation
Real64 VentilVolume; // Volume of Air {m3} due to ventilation
Real64 VentilMass; // Mass of Air {kg} due to ventilation
Real64 VentilAirChangeRate; // Infiltration air change rate {ach}
Copy link
Contributor

Choose a reason for hiding this comment

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

In the comment: Infiltration --> Ventilation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@mjwitte
Copy link
Contributor

mjwitte commented Apr 12, 2021

@lgu1234 I made a few more tweaks to this. For an opening, when it is closed, where does that airflow get recorded? Is that infiltration or ventilation?

@lgu1234
Copy link
Contributor Author

lgu1234 commented Apr 12, 2021

@mjwitte I assume airflow gets recorded in ventilation, when openings are closed.

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.

@lgu1234 After CI completes another round, I think this will be ready to merge. Feel free to review my changes if you want.

PreDefTableEntry(state,
state.dataOutRptPredefined->pdchOaTaBzInfil,
Zone(iZone).Name,
ZonePreDefRep(iZone).InfilVolTotalStdDen + ZonePreDefRep(iZone).AFNInfilVolTotalStdDen);
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is the source of many table diffs in the AFN files. Previously AFN infiltration was omitted from the Infiltration columns in the Outdoor Air Details report. I should probably post an issue about that.

state.dataAirflowNetworkBalanceManager->AirflowNetworkZnRpt(i).VentilAirChangeRate,
"System",
"Average",
Zone(i).Name);
Copy link
Contributor

Choose a reason for hiding this comment

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

I added AFN Zone Ventilation output variables to pertinent files (ones with AFN Zone Infiltration variables that also have openings).

@lgu1234
Copy link
Contributor Author

lgu1234 commented Apr 14, 2021

@mjwitte I reviewed your changes. They are OK with me. Thanks.

@mjwitte mjwitte merged commit 4a4bce0 into develop Apr 15, 2021
@mjwitte mjwitte deleted the 8475-Separate-AFN-infiltration-from-natural-ventilation branch April 15, 2021 19:57
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
7 participants