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

Fix #10663 - Fan runtime fraction < 1 when flow rate scaling using DesignSpecification:ZoneHVAC:Sizing #10673

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Aug 21, 2024

Pull request overview

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

@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze) labels Aug 21, 2024
@jmarrec jmarrec self-assigned this Aug 21, 2024
@@ -1011,7 +1011,7 @@ namespace WindowAC {
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea ||
CapSizingMethod == FractionOfAutosizedCoolingCapacity) {
if (CapSizingMethod == HeatingDesignCapacity) {
if (CapSizingMethod == CoolingDesignCapacity) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was an existing logic error that I noticed

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch. Without example files or unit tests these are hard to find.

Comment on lines +1061 to +1063
// Make the Fan be sized by this
zoneEqSizing.CoolingAirFlow = true;
zoneEqSizing.CoolingAirVolFlow = windowAC.MaxAirVolFlow;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will size the Fan to match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

} else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) {
this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow;

Copy link
Contributor

Choose a reason for hiding this comment

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

In SystemAirFlowSizing, if CoolingAirVolFlow = windowAC.MaxAirVolFlow (which should be already adjusted?) and dataFracOfAutosizedCoolingAirflow = the target fraction, then how does this get the right answer? I would think this would either be 1 * adjusted air flow or fraction * design air flow. This looks like it's fraction * adjusted air flow. Maybe windowAC.MaxAirVolFlow is the design air flow which gets multiplied by the fraction. In any event you are getting the right answer now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies, I linked to the wrong bit in SystemAirFlowSizing. The correct bit is:

if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) {
this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow;

Process 2757796 stopped
* thread #1, name = 'energyplus', stop reason = step over
    frame #0: 0x00007ffff50d4370 libenergyplusapi.so.24.2.0`EnergyPlus::SystemAirFlowSizer::size(this=0x00007fffffff4d88, state=0x00007fffffffa980, _originalValue=-99999, errorsFound=0x00007fffffff529f) at SystemAirFlowSizing.cc:620:54
   617 	                    }
   618 	                } else {
   619 	                    if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) {
-> 620 	                        this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow;
   621 	                        if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 &&
   622 	                            this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) {
   623 	                            DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title;
(lldb) p this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow
(Real64) 0.28246116346780509

Comment on lines +586 to +609
" WindowACSizing; !- Design Specification ZoneHVAC Sizing Object Name",

// NOTE: Only difference here is that I'm settting a DesignSpecification:ZoneHVAC:Sizing
" DesignSpecification:ZoneHVAC:Sizing,",
" WindowACSizing, !- Name",
" FractionOfAutosizedCoolingAirflow, !- Cooling Supply Air Flow Rate Method",
" , !- Cooling Supply Air Flow Rate {m3/s}",
" , !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2}",
" 0.5, !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate",
" , !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}",
" FractionOfAutosizedCoolingAirflow, !- No Load Supply Air Flow Rate Method",
" , !- No Load Supply Air Flow Rate {m3/s}",
" , !- No Load Supply Air Flow Rate Per Floor Area {m3/s-m2}",
" 0.5, !- No Load Fraction of Cooling Supply Air Flow Rate",
" , !- No Load Fraction of Heating Supply Air Flow Rate",
" None, !- Heating Supply Air Flow Rate Method",
" , !- Heating Supply Air Flow Rate {m3/s}",
" , !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2}",
" , !- Heating Fraction of Heating Supply Air Flow Rate",
" , !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}",
" FractionOfAutosizedCoolingCapacity, !- Cooling Design Capacity Method",
" , !- Cooling Design Capacity {W}",
" , !- Cooling Design Capacity Per Floor Area {W/m2}",
" 0.5; !- Fraction of Autosized Cooling Design Capacity",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New unit test that uses a DesignSpecification:ZoneHVAC:Sizing

Comment on lines +948 to +976
double constexpr expected_full_airflow = 0.041484382187390034;
double constexpr scaler_cooling_saf = 0.5;
double constexpr scaler_cooling_cap = 0.5;
double constexpr expected_full_cap = 622.50474573886743;

auto const &windowAC = state->dataWindowAC->WindAC(compIndex);

ASSERT_GT(windowAC.FanIndex, 0);
auto const &fan = state->dataFans->fans(windowAC.FanIndex);

auto const &finalZoneSizing = state->dataSize->FinalZoneSizing(1);

EXPECT_NEAR(expected_full_airflow, finalZoneSizing.DesCoolVolFlow, 0.0001);

ASSERT_GT(windowAC.HVACSizingIndex, 0);
auto const &zoneHVACSizing = state->dataSize->ZoneHVACSizing(windowAC.HVACSizingIndex);

EXPECT_EQ(DataSizing::FractionOfAutosizedCoolingAirflow, zoneHVACSizing.CoolingSAFMethod);
EXPECT_EQ(scaler_cooling_saf, zoneHVACSizing.MaxCoolAirVolFlow);
EXPECT_EQ(DataSizing::FractionOfAutosizedCoolingCapacity, zoneHVACSizing.CoolingCapMethod);
EXPECT_EQ(scaler_cooling_cap, zoneHVACSizing.ScaledCoolingCapacity);

EXPECT_EQ(windowAC.DXCoilType_Num, HVAC::Coil_CoolingAirToAirVariableSpeed);
ASSERT_GT(windowAC.DXCoilIndex, 0);
auto const &varSpeedCoil = state->dataVariableSpeedCoils->VarSpeedCoil(windowAC.DXCoilIndex);

// check Sizing
EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, windowAC.MaxAirVolFlow, 0.0001);
EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, fan->maxAirFlowRate, 0.0001);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check that the Fan too is size at 0.5 of full flow

Copy link
Contributor

Choose a reason for hiding this comment

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

From my previous comment about SystemAirFlowSizing, windowAC.MaxAirVolFlow is already adjusted. Now I'm confused.

EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, windowAC.MaxAirVolFlow, 0.0001);
EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, fan->maxAirFlowRate, 0.0001);

EXPECT_NEAR(622.505, varSpeedCoil.RatedCapCoolTotal, 0.001);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that the Coil:Cooling:DX:VariableSpeed is not affected.

  • I don't know if we would want that.
  • SizeVarSpeedCoil seem to not call the Autosizing modules. Instead, it uses the FinalZoneSizing's DesCoolVolFlow / DesCoolHeatFlow. cf
    CheckZoneSizing(state, format("COIL:{}{}", varSpeedCoil.CoolHeatType, CurrentObjSubfix), varSpeedCoil.Name);
    RatedAirVolFlowRateDes = max(state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).DesCoolVolFlow,
    state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).DesHeatVolFlow);

Copy link
Contributor

Choose a reason for hiding this comment

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

The VS coil should be adjusted but it was never converted to use the sizing routines. That begs an open issue to adjust VS coil sizing when DesignSpecification:ZoneHVAC:Sizing is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed at #10699

Comment on lines +1008 to +1011
// capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and
// FractionOfAutosizedHeatingCapacity )
int const CapSizingMethod = zoneHVACSizing.CoolingCapMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I'm not sure if this is right... (this is pre-existing)

At this point in time, SizingMethod is either HVAC::CoolingAirflowSizing, or HVAC::CoolingCapacitySizing if the SAFMethod is FlowPerCoolingCapacity.

I think the intent here is to set the CoolingCapacitySizing method specifically, so it should be HVAC::CoolingCapacitySizing, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

The intent for FlowPerCoolingCapacity is:

  • calc design capacity using zone design air flow rate
  • set fraction that will adjust zone design air flow when air flow is sized (which will also adjust capacity when capacity is sized)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to be clear, you're saying this is currently correct right?

Copy link
Contributor

@rraustad rraustad Aug 27, 2024

Choose a reason for hiding this comment

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

Then the next time you call using HVAC::CoolingCapacitySizing the adjusted air flow rate would be used. It appears to me that the capacity sizer should be called here using SizingMethod = HVAC::CoolingCapacitySizing;. It looks like 1) state.dataSize->DataFlowUsedForSizing was not reset above to be an air flow rate (and DataFlowPerCoolingCapacity should be reset to 0), and 2) the sizing method should be explicitly set for capacity sizing (right now is looks to still be fraction of capacity).

Copy link
Contributor

@rraustad rraustad Aug 27, 2024

Choose a reason for hiding this comment

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

If you single step this a couple times you should see the capacity getting set using zone design air flow, the air flow being adjusted based on capacity, and the capacity being calculated again using the new air flow rate.

@jmarrec jmarrec force-pushed the 10663_WindowAC_FanSizing branch from ddc41c2 to a5d32de Compare August 21, 2024 08:36
@jmarrec jmarrec requested review from Myoldmopar and rraustad August 21, 2024 11:01
@jmarrec
Copy link
Contributor Author

jmarrec commented Aug 21, 2024

Note: these files are on DefectFiles support repo.

Taking the WindACAuto.idf and a modified Version WindACAutoScaled.idf that adds a DesignSpecification:ZoneHVAC:Sizing for the Zone1WindAC

image

I also added

  Output:Variable,Zone1WindACAirOutletNode,System Node Standard Density Volume Flow Rate,Detailed;
  Output:Variable,Zone1WindACFan,Fan Runtime Fraction,Detailed;

image

There is zero change for the WindACAuto.idf, as expected.

@jmarrec
Copy link
Contributor Author

jmarrec commented Aug 21, 2024

Comparing the component sizes

image

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.

This does look right except that 1 question with SystemAirFlowSizing.

Comment on lines +1008 to +1011
// capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and
// FractionOfAutosizedHeatingCapacity )
int const CapSizingMethod = zoneHVACSizing.CoolingCapMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
Copy link
Contributor

Choose a reason for hiding this comment

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

The intent for FlowPerCoolingCapacity is:

  • calc design capacity using zone design air flow rate
  • set fraction that will adjust zone design air flow when air flow is sized (which will also adjust capacity when capacity is sized)

@@ -1011,7 +1011,7 @@ namespace WindowAC {
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea ||
CapSizingMethod == FractionOfAutosizedCoolingCapacity) {
if (CapSizingMethod == HeatingDesignCapacity) {
if (CapSizingMethod == CoolingDesignCapacity) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch. Without example files or unit tests these are hard to find.

Comment on lines +1061 to +1063
// Make the Fan be sized by this
zoneEqSizing.CoolingAirFlow = true;
zoneEqSizing.CoolingAirVolFlow = windowAC.MaxAirVolFlow;
Copy link
Contributor

Choose a reason for hiding this comment

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

In SystemAirFlowSizing, if CoolingAirVolFlow = windowAC.MaxAirVolFlow (which should be already adjusted?) and dataFracOfAutosizedCoolingAirflow = the target fraction, then how does this get the right answer? I would think this would either be 1 * adjusted air flow or fraction * design air flow. This looks like it's fraction * adjusted air flow. Maybe windowAC.MaxAirVolFlow is the design air flow which gets multiplied by the fraction. In any event you are getting the right answer now.

Comment on lines +948 to +976
double constexpr expected_full_airflow = 0.041484382187390034;
double constexpr scaler_cooling_saf = 0.5;
double constexpr scaler_cooling_cap = 0.5;
double constexpr expected_full_cap = 622.50474573886743;

auto const &windowAC = state->dataWindowAC->WindAC(compIndex);

ASSERT_GT(windowAC.FanIndex, 0);
auto const &fan = state->dataFans->fans(windowAC.FanIndex);

auto const &finalZoneSizing = state->dataSize->FinalZoneSizing(1);

EXPECT_NEAR(expected_full_airflow, finalZoneSizing.DesCoolVolFlow, 0.0001);

ASSERT_GT(windowAC.HVACSizingIndex, 0);
auto const &zoneHVACSizing = state->dataSize->ZoneHVACSizing(windowAC.HVACSizingIndex);

EXPECT_EQ(DataSizing::FractionOfAutosizedCoolingAirflow, zoneHVACSizing.CoolingSAFMethod);
EXPECT_EQ(scaler_cooling_saf, zoneHVACSizing.MaxCoolAirVolFlow);
EXPECT_EQ(DataSizing::FractionOfAutosizedCoolingCapacity, zoneHVACSizing.CoolingCapMethod);
EXPECT_EQ(scaler_cooling_cap, zoneHVACSizing.ScaledCoolingCapacity);

EXPECT_EQ(windowAC.DXCoilType_Num, HVAC::Coil_CoolingAirToAirVariableSpeed);
ASSERT_GT(windowAC.DXCoilIndex, 0);
auto const &varSpeedCoil = state->dataVariableSpeedCoils->VarSpeedCoil(windowAC.DXCoilIndex);

// check Sizing
EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, windowAC.MaxAirVolFlow, 0.0001);
EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, fan->maxAirFlowRate, 0.0001);
Copy link
Contributor

Choose a reason for hiding this comment

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

From my previous comment about SystemAirFlowSizing, windowAC.MaxAirVolFlow is already adjusted. Now I'm confused.

EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, windowAC.MaxAirVolFlow, 0.0001);
EXPECT_NEAR(expected_full_airflow * scaler_cooling_saf, fan->maxAirFlowRate, 0.0001);

EXPECT_NEAR(622.505, varSpeedCoil.RatedCapCoolTotal, 0.001);
Copy link
Contributor

Choose a reason for hiding this comment

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

The VS coil should be adjusted but it was never converted to use the sizing routines. That begs an open issue to adjust VS coil sizing when DesignSpecification:ZoneHVAC:Sizing is used.

@Myoldmopar
Copy link
Member

Thanks for the review on this @rraustad, seems like this is very close, just maybe one remaining issue.

@rraustad
Copy link
Contributor

This data shows that the single speed DX coil air flow was adjusted so it follows that the VS DX coil air flow should also be adjusted. Also in this data, why is the window AC scaled-ori and scaled-new values both equal to 0.02832 and the single speed DX coil air flow rate different?

}
bool errorsFound = false;
CoolingCapacitySizer sizerCoolingCapacity;
sizerCoolingCapacity.overrideSizingString(SizingString);
sizerCoolingCapacity.overrideSizingString("");
sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataSize->DataCapacityUsedForSizing = sizerCoolingCapacity.size(state, TempSize, errorsFound);
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this does look correct. Call the cooling capacity sizer which uses zone design air flow.

sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataSize->DataCapacityUsedForSizing = sizerCoolingCapacity.size(state, TempSize, errorsFound);
state.dataSize->DataFlowPerCoolingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow;
state.dataSize->DataFlowPerCoolingCapacity = zoneHVACSizing.MaxCoolAirVolFlow;
Copy link
Contributor

Choose a reason for hiding this comment

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

Set the fraction of air flow here

sizingCoolingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataWindowAC->WindAC(WindACNum).MaxAirVolFlow = sizingCoolingAirFlow.size(state, TempSize, errorsFound);
windowAC.MaxAirVolFlow = sizingCoolingAirFlow.size(state, TempSize, errorsFound);
Copy link
Contributor

@rraustad rraustad Aug 27, 2024

Choose a reason for hiding this comment

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

And then size that new air flow rate here. You should also reset state.dataSize->DataFlowPerCoolingCapacity here to be a flow rate instead of a fraction.

@Myoldmopar
Copy link
Member

Final thoughts here @jmarrec ? Looks like @rraustad suggested at least one change to reset the DataFlowPerCoolingCapacity variable.

@rraustad
Copy link
Contributor

@jmarrec these global fraction variables are hard to get right. It may be correct now, just check to make sure the final scaled values are as expected.

@Myoldmopar Myoldmopar added this to the EnergyPlus 25.1 IO Freeze milestone Sep 11, 2024
@jmarrec
Copy link
Contributor Author

jmarrec commented Sep 12, 2024

For some reason, probably lack of understanding, I'm severely confused about what's being asked here.

Code linting and unit test aside, I haven't touched the sections that are being commented. The actual changes are https://github.com/NREL/EnergyPlus/pull/10673/files/5dbc7b13c8597788540474a075a5eab678a3ce12..a5d32dea2e5a7ea6c68c38b6f073176a9cdc9ce1

I've been looking at other files to see if I could figure out what may be different here compared to other objects

} else if (SAFMethod == FlowPerCoolingCapacity) {
SizingMethod = HVAC::CoolingCapacitySizing;
TempSize = AutoSize;
PrintFlag = false;
state.dataSize->DataScalableSizingON = true;
state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).DesCoolVolFlow;
if (zoneHVACSizing.CoolingCapMethod == FractionOfAutosizedCoolingCapacity) {
state.dataSize->DataFracOfAutosizedCoolingCapacity = zoneHVACSizing.ScaledCoolingCapacity;
}
bool errorsFound = false;
CoolingCapacitySizer sizerCoolingCapacity;
sizerCoolingCapacity.overrideSizingString("");
sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataSize->DataCapacityUsedForSizing = sizerCoolingCapacity.size(state, TempSize, errorsFound);
state.dataSize->DataFlowPerCoolingCapacity = zoneHVACSizing.MaxCoolAirVolFlow;
PrintFlag = true;
TempSize = AutoSize;
errorsFound = false;
CoolingAirFlowSizer sizingCoolingAirFlow;
std::string stringOverride = "Maximum Supply Air Flow Rate [m3/s]";
if (state.dataGlobal->isEpJSON) {
stringOverride = "maximum_supply_air_flow_rate [m3/s]";
}
sizingCoolingAirFlow.overrideSizingString(stringOverride);
// sizingCoolingAirFlow.setHVACSizingIndexData(windowAC.HVACSizingIndex);
sizingCoolingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
windowAC.MaxAirVolFlow = sizingCoolingAirFlow.size(state, TempSize, errorsFound);

eg taking FanCoilUnits,

} else if (SAFMethod == DataSizing::FlowPerCoolingCapacity) {
SizingMethod = HVAC::CoolingCapacitySizing;
TempSize = DataSizing::AutoSize;
PrintFlag = false;
CoolingCapacitySizer sizerCoolingCapacity;
sizerCoolingCapacity.overrideSizingString(SizingString);
sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataSize->DataAutosizedCoolingCapacity = sizerCoolingCapacity.size(state, TempSize, ErrorsFound);
if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod == DataSizing::FractionOfAutosizedCoolingCapacity) {
state.dataSize->DataFracOfAutosizedCoolingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity;
}
state.dataSize->DataFlowPerCoolingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxCoolAirVolFlow;
PrintFlag = true;
TempSize = DataSizing::AutoSize;
state.dataSize->DataScalableSizingON = true;
CoolingAirFlowSizer sizingCoolingAirFlow;
sizingCoolingAirFlow.overrideSizingString(SizingString);
// sizingCoolingAirFlow.setHVACSizingIndexData(fanCoil.HVACSizingIndex);
sizingCoolingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
CoolingAirVolFlowDes = sizingCoolingAirFlow.size(state, TempSize, ErrorsFound);
}

Rewritting a bit the code to miminize diffs:

--- WindowAC.blob.cc	2024-09-12 12:17:47.094657049 +0200
+++ FanCoilUnits.blob.cc	2024-09-12 12:18:03.988792981 +0200
@@ -2,22 +2,21 @@
                     SizingMethod = HVAC::CoolingCapacitySizing;
                     TempSize = DataSizing::AutoSize;
                     PrintFlag = false;
-                    state.dataSize->DataScalableSizingON = true;
-                    state.dataSize->DataFlowUsedForSizing = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).DesCoolVolFlow;
-                    if (zoneHVACSizing.CoolingCapMethod == FractionOfAutosizedCoolingCapacity) {
-                        state.dataSize->DataFracOfAutosizedCoolingCapacity = zoneHVACSizing.ScaledCoolingCapacity;
-                    }
                     bool errorsFound = false;
                     CoolingCapacitySizer sizerCoolingCapacity;
                     sizerCoolingCapacity.overrideSizingString("");
                     sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
-                    state.dataSize->DataCapacityUsedForSizing = sizerCoolingCapacity.size(state, TempSize, errorsFound);
+                    state.dataSize->DataAutosizedCoolingCapacity = sizerCoolingCapacity.size(state, TempSize, errorsFound);
+                    if (zoneHVACSizing.CoolingCapMethod == DataSizing::FractionOfAutosizedCoolingCapacity) {
+                        state.dataSize->DataFracOfAutosizedCoolingCapacity = zoneHVACSizing.ScaledCoolingCapacity;
+                    }
                     state.dataSize->DataFlowPerCoolingCapacity = zoneHVACSizing.MaxCoolAirVolFlow;
                     PrintFlag = true;
                     TempSize = DataSizing::AutoSize;
                     errorsFound = false;
+                    state.dataSize->DataScalableSizingON = true;
                     CoolingAirFlowSizer sizingCoolingAirFlow;
                     sizingCoolingAirFlow.overrideSizingString(SizingString);
                     sizingCoolingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
-                    windowAC.MaxAirVolFlow = sizingCoolingAirFlow.size(state, TempSize, errorsFound);
+                    CoolingAirVolFlowDes = sizingCoolingAirFlow.size(state, TempSize, errorsFound);
                 }

@nrel-bot-2c
Copy link

@jmarrec @Myoldmopar it has been 28 days since this pull request was last updated.

1 similar comment
@nrel-bot-2c
Copy link

@jmarrec @Myoldmopar it has been 28 days since this pull request was last updated.

@nrel-bot-2
Copy link

@jmarrec it has been 15 days since this pull request was last updated.

@nrel-bot-2c
Copy link

@jmarrec it has been 7 days since this pull request was last updated.

@nrel-bot-2c
Copy link

@jmarrec it has been 7 days since this pull request was last updated.

1 similar comment
@nrel-bot-2c
Copy link

@jmarrec it has been 7 days since this pull request was last updated.

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 NotIDDChange Code does not impact IDD (can be merged after IO freeze)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fan runtime fraction < 1 when flow rate scaling using DesignSpecification:ZoneHVAC:Sizing
8 participants