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

Coil:Cooling:DX updates #8292

Closed
wants to merge 144 commits into from
Closed
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
7e70439
add Cooling Coil Condenser Inlet Temperature output variable
mitchute Feb 25, 2020
c6c5591
temp sizing changes
rraustad Feb 25, 2020
0efe30b
add Cooling Coil Dehumidification Mode output variable
mitchute Feb 25, 2020
2ba1a76
Update RequestSizing coil name and type
rraustad Feb 25, 2020
772c535
Merge pull request #36 from energy-plus/CoilRefactorFeb2020Rich
rraustad Feb 25, 2020
9f7f8b6
add Cooling Coil Evaporative Condenser Mains Supply Water Volume oupu…
mitchute Feb 25, 2020
5a167d1
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
mitchute Feb 25, 2020
02cc65a
add Cooling Coil Evaporative Condenser Water Volume output variable
mitchute Feb 25, 2020
c06dd9b
Add 210/240 standard ratings - single speed is very close to matching
Myoldmopar Feb 25, 2020
ececdba
add Cooling Coil Waste Heat output variables
mitchute Feb 25, 2020
47fc6c4
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
mitchute Feb 25, 2020
c49bc9d
Fix fractional speed autosizing
rraustad Feb 25, 2020
ecc6c01
Merge branch 'CoilRefactorFeb2020' of https://github.com/energy-plus/…
rraustad Feb 25, 2020
85e7121
Add EMS actuators to each operating mode for flow and capacity
Myoldmopar Feb 25, 2020
b36e2fa
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
Myoldmopar Feb 25, 2020
1c46765
add partial handling for secondary coils, and secondary coil output v…
mitchute Feb 25, 2020
d95ae87
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
mitchute Feb 25, 2020
f674f7c
add non-electric fuel usage output variables
mitchute Feb 25, 2020
487c169
Coil sizing report table looking awesome, at least for single speed :)
Myoldmopar Feb 25, 2020
693fb5e
Merge in, resolve conflict
Myoldmopar Feb 25, 2020
59d5296
Coil Refactor - fix airflow ratios
mjwitte Feb 26, 2020
aec080c
Merge branch 'CoilRefactorFeb2020' of https://github.com/Energy-Plus/…
mjwitte Feb 26, 2020
be750d4
Coil Refactor - fix output variable setup
mjwitte Feb 26, 2020
ee16753
Add new coil SP control in UnitarySystem
rraustad Feb 26, 2020
2bd53bc
Merge branch 'CoilRefactorFeb2020' of https://github.com/energy-plus/…
rraustad Feb 26, 2020
6ffeb03
Coil Refactor - protect unitary from failed factory
mjwitte Feb 26, 2020
62dbf50
set fan data through worker function, other minor cleanups in Unitary…
mitchute Feb 26, 2020
8e19ede
Fix failed unit test
rraustad Feb 26, 2020
dc12da7
Merge branch 'CoilRefactorFeb2020' of https://github.com/energy-plus/…
rraustad Feb 26, 2020
cff4b32
Add some support for 100% DOAS coil, fixup CBF error handling
Myoldmopar Feb 26, 2020
8074bf3
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
Myoldmopar Feb 26, 2020
8066e1a
Revert PLR change
rraustad Feb 26, 2020
ada6ffa
add coil method to get capFT curve index
mitchute Feb 26, 2020
46758c3
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
mitchute Feb 26, 2020
26b69df
Dont write EIO header if there arent any coils
Myoldmopar Feb 26, 2020
cdfc629
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
Myoldmopar Feb 26, 2020
0ce1212
fix speed num to vector index
mitchute Feb 26, 2020
b60dc8b
Coil Refactor - trying to control RH
mjwitte Feb 26, 2020
fe78e88
Merge branch 'CoilRefactorFeb2020' of https://github.com/Energy-Plus/…
mjwitte Feb 26, 2020
91ee5d3
cleanup some intermediate variables
mitchute Feb 26, 2020
dc7c3da
Unitary multispeed set OA to zero to avoid max iterations
mjwitte Feb 26, 2020
87c3b4a
Merge branch 'CoilRefactorFeb2020' of https://github.com/Energy-Plus/…
mjwitte Feb 26, 2020
a5fab55
Pull branch
Myoldmopar Feb 26, 2020
eede3e9
cleanup TODOs, protect unit static air pressure input
mitchute Feb 26, 2020
7598d80
add method to get nominal mode
mitchute Feb 26, 2020
0c56dfd
Change 2 speed
rraustad Feb 26, 2020
f022c39
Use coils.empty()
Myoldmopar Feb 26, 2020
a106a2b
Pull in matts changes
Myoldmopar Feb 26, 2020
36a13c0
Allow DX:TwoSpeed to run ax variable speed
rraustad Feb 26, 2020
d420727
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
Myoldmopar Feb 26, 2020
81731f8
Fix broken RH control from UnitarySys refactor
rraustad Feb 26, 2020
dc56c94
add method for alternate mode speed
mitchute Feb 27, 2020
09e3108
Get DXCoilSystemAuto running again
Myoldmopar Feb 27, 2020
4eda467
Fix fan index protection in coil cooling dx ratings
Myoldmopar Feb 27, 2020
d461c8f
Pull branch, merge conflicts
Myoldmopar Feb 27, 2020
fbe7518
Correct Alt mode dehum trigger flag
rraustad Feb 27, 2020
0e989e2
Merge branch 'CoilRefactorFeb2020' of https://github.com/energy-plus/…
rraustad Feb 27, 2020
890eb27
Trap before using plf curve if blank, start to add another unit test
Myoldmopar Feb 27, 2020
679c732
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
Myoldmopar Feb 27, 2020
ef7e349
Comment out unit test value stub
Myoldmopar Feb 27, 2020
34b6320
Coil Refactor - fix fanOpMode and add latent degradation
mjwitte Feb 27, 2020
c7faeea
Merge branch 'CoilRefactorFeb2020' of https://github.com/Energy-Plus/…
mjwitte Feb 27, 2020
35268d5
Unit test change only
Myoldmopar Feb 27, 2020
9fe45b1
Continuing to fix up unit test
Myoldmopar Feb 27, 2020
1cbbd09
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
Myoldmopar Feb 27, 2020
be45d4e
Coil Refactor - fix broken latent degradation flag logic
mjwitte Feb 27, 2020
39b9d48
Merge branch 'CoilRefactorFeb2020' of https://github.com/Energy-Plus/…
mjwitte Feb 27, 2020
fa650ff
updating output vars
mitchute Feb 27, 2020
3101478
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
mitchute Feb 27, 2020
7383944
Fleshing out unit test
Myoldmopar Feb 27, 2020
8ef4a6e
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
Myoldmopar Feb 27, 2020
f63da02
fix pasteo error, autosize cond flow rate, change logic on getSpeed m…
mitchute Feb 28, 2020
90b1523
Add bypass fraction averaging
Myoldmopar Feb 28, 2020
757e93b
idf change - autosize condenser air flow rate when total capacity and…
mitchute Feb 28, 2020
945d5ec
Merge branch 'CoilRefactorFeb2020' of github.com:energy-plus/EnergyPl…
mitchute Feb 28, 2020
b11dcb8
fixup unit test
mitchute Feb 28, 2020
7aaa661
Match up eio for Coil:Cooling:DX:TwoStageWithHumidityControlMode
rraustad Feb 28, 2020
9756ec1
Merge branch 'CoilRefactorFeb2020' of https://github.com/energy-plus/…
rraustad Feb 28, 2020
2435a80
Comment out bypass frac averaging for now
Myoldmopar Feb 28, 2020
ee44707
Re-add bypass calculations but not saturation check
Myoldmopar Feb 28, 2020
978bded
Always set RTF to 1 if speed>0
Myoldmopar Feb 28, 2020
a44d135
Protect coil_face_area adjustments with bool
rraustad Mar 2, 2020
cfde7c6
Merge branch 'CoilRefactorFeb2020' of https://github.com/energy-plus/…
rraustad Mar 2, 2020
5ee66db
Add in coil face area adjustment and adjust unit test
rraustad Mar 3, 2020
d9cc606
Pass SingleMode bool into new coil model
rraustad Mar 11, 2020
86033b4
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Aug 13, 2020
ae004fe
DX coil merge cleanup
mjwitte Aug 13, 2020
d7cad63
DX coil cleanup operating mode
mjwitte Aug 13, 2020
a7ab663
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Aug 27, 2020
9922030
DX coil build warning cleanup
mjwitte Aug 28, 2020
6baffdf
DX Coil undo extraneous formatting changes
mjwitte Aug 28, 2020
d31041e
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Aug 28, 2020
07bfe54
DX Coil - fix build error
mjwitte Aug 28, 2020
b9f8822
DX Coil - fix unitary multispeed control
mjwitte Aug 28, 2020
ab094cb
DX Coil - revert testfile changes
mjwitte Aug 28, 2020
5c99344
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 2, 2020
da6bbfc
DX Coil - fix crankcase heater meters
mjwitte Sep 3, 2020
b87ca90
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 3, 2020
47e35e3
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 21, 2020
8834328
DX Coil - merge repairs
mjwitte Sep 21, 2020
7dd8af8
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 21, 2020
dbb61a1
DX Coil - more merge repairs
mjwitte Sep 21, 2020
9b6126d
DX Coil - revert meter change
mjwitte Sep 21, 2020
b1db830
DX Coil - doc merge repairs
mjwitte Sep 22, 2020
fe5fede
DX Coil - more merge cleanup
mjwitte Sep 22, 2020
046e39b
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 22, 2020
4abdca0
DX Coil - use CalcComponentSensibleLatentOutput in performance
mjwitte Sep 22, 2020
bcc7bca
DX Coil - protect against zero amb pressure
mjwitte Sep 22, 2020
2a4c54e
DX Coil - rollback sizing changes
mjwitte Sep 22, 2020
56d9973
DX Coil - singlemode fixes
mjwitte Sep 22, 2020
3503f29
DX Coil - unit test adjustments
mjwitte Sep 22, 2020
dac5f80
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 22, 2020
21449e5
DX Coil - more unit test adjustments
mjwitte Sep 23, 2020
3db784d
DX Coil - rearrange Performance calcs
mjwitte Sep 24, 2020
76dd6b0
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 24, 2020
89d5bc6
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Sep 29, 2020
16c8512
DX Coil - fix rearrange Performance calcs
mjwitte Sep 29, 2020
d48ef3d
DX Coil - speed sizing for now
mjwitte Sep 29, 2020
980593b
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Oct 9, 2020
169e383
DX Coil - merge cleanup
mjwitte Oct 9, 2020
e342509
Multispeed DX fix massflow weighting between speeds
mjwitte Oct 20, 2020
0871b5b
DX Coil - Unit tests vs multispeed
mjwitte Oct 20, 2020
7ce40d8
DX Coil - Move sensible latent load calcs
mjwitte Oct 20, 2020
4086480
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Oct 20, 2020
105d4f5
DX Coil - fuel type cleanup
mjwitte Oct 20, 2020
8d282cd
DX Coil - more global merge cleanup
mjwitte Oct 20, 2020
7ce4218
DX Coil - global merge cleanup in unit tests
mjwitte Oct 20, 2020
728e8bb
DX Coil - more unit tests
mjwitte Oct 23, 2020
9b54afb
Multispeed DX fix outlet conditions at low speed
mjwitte Oct 23, 2020
14119d4
DX Coil - attempt to fix build errors on Windows
mjwitte Oct 24, 2020
4cd849e
Revert <= changes
mjwitte Oct 24, 2020
2b39ced
Multispeed DX more fix outlet conditions at low speed plus fix runtim…
mjwitte Oct 28, 2020
68ea088
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Oct 28, 2020
1419ff1
DX Coil - harmonize unitary system output variables
mjwitte Oct 29, 2020
09e58ed
Unitary numspeeds 1 for dx cooling singlespeed
mjwitte Oct 30, 2020
00036ed
Revert "DX Coil - Move sensible latent load calcs"
mjwitte Oct 30, 2020
d6d7fa7
DX Coil - restore outlet saturation check and add routinename to pysc…
mjwitte Oct 31, 2020
0daae98
Multimode DX fix outlet conditions for stage 1 and 2
mjwitte Oct 31, 2020
9563a69
Merge remote-tracking branch 'remotes/originNRELEnergyPlus/develop' i…
mjwitte Nov 9, 2020
91621e3
DX Coil - global merge cleanup
mjwitte Nov 11, 2020
186d6b4
Merge remote-tracking branch 'remotes/NRELEnergyPlus/develop' into Co…
mjwitte Dec 4, 2020
053e25a
DX Coil - merge cleanup
mjwitte Dec 7, 2020
9544cf7
Merge remote-tracking branch 'remotes/NRELEnergyPlus/develop' into Co…
mjwitte Dec 7, 2020
71b8bcc
DX Coil - more merge cleanup
mjwitte Dec 8, 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
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ \subsection{Fan}\label{fan}

\subsection{DX Cooling Coils}\label{dx-cooling-coils}

Actuators are available for overriding the autosize values related to the size of single speed DX coils.~ Actuators called ``Coil:Cooling:DX:SingleSpeed'' are available with control types ``Autosized Rated Air Flow Rate'' (in m3/s), ``Autosized Rated Sensible Heat Ratio'' (in W/W), and ``Autosized Rated Total Cooling Capacity'' (in W).~ These are only useful from the calling point named AfterComponentInputReadIn.
Actuators are available for overriding the autosize rated airflow rate and total cooling capacity of the Coil:Cooling:DX object.~ Actuators called ``Coil:Cooling:DX:CurveFit:SingleSpeed'' are available with control types ``Autosized Rated Air Flow Rate'' (in m3/s) and ``Autosized Rated Total Cooling Capacity'' (in W).~ These are only useful from the calling point named AfterComponentInputReadIn.

\subsection{Unitary Equipment}\label{unitary-equipment}

Expand Down
179 changes: 153 additions & 26 deletions doc/input-output-reference/src/overview/group-coil-cooling-dx.tex

Large diffs are not rendered by default.

448 changes: 386 additions & 62 deletions src/EnergyPlus/Coils/CoilCoolingDX.cc

Large diffs are not rendered by default.

24 changes: 20 additions & 4 deletions src/EnergyPlus/Coils/CoilCoolingDX.hh
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ struct CoilCoolingDX
static int factory(EnergyPlusData &state, std::string const &coilName);
static void getInput(EnergyPlusData &state);
static void clear_state();
static void reportAllStandardRatings(EnergyPlusData& state);
void instantiateFromInputSpec(EnergyPlusData &state, const CoilCoolingDXInputSpecification &input_data);
void oneTimeInit();
void simulate(EnergyPlusData &state, int useAlternateMode, Real64 PLR, int speedNum, Real64 speedRatio, int fanOpMode, Real64 LoadSHR = -1.0);
void simulate(EnergyPlusData &state, int useAlternateMode, Real64 PLR, int speedNum, Real64 speedRatio, int const fanOpMode, bool const singleMode, Real64 LoadSHR = -1.0);
void setData(int fanIndex, int fanType, std::string const &fanName, int airLoopNum);
void getFixedData(int &evapInletNodeIndex,
int &evapOutletNodeIndex,
Expand All @@ -95,13 +96,16 @@ struct CoilCoolingDX
static void inline passThroughNodeData(DataLoopNode::NodeData &in, DataLoopNode::NodeData &out);
void size(EnergyPlusData &state);

int getNumModes();
int getOpModeCapFTIndex(bool useAlternateMode = false);
Real64 condMassFlowRate(bool useAlternateMode);

CoilCoolingDXInputSpecification original_input_specs;
std::string name;
bool myOneTimeInitFlag = true;
int evapInletNodeIndex = 0;
int evapOutletNodeIndex = 0;
int availScheduleIndex = 0;
// int condZoneIndex = 0;
int condInletNodeIndex = 0;
int condOutletNodeIndex = 0;
CoilCoolingDXCurveFitPerformance performance;
Expand All @@ -112,16 +116,18 @@ struct CoilCoolingDX
int evaporativeCondSupplyTankIndex = 0;
int evaporativeCondSupplyTankARRID = 0;
Real64 evaporativeCondSupplyTankVolumeFlow = 0.0;
// Real64 evaporativeCondSupplyTankVolumeConsumption = 0.0;
Real64 evaporativeCondSupplyTankConsump = 0.0;
Real64 evapCondPumpElecPower = 0.0;
Real64 evapCondPumpElecConsumption = 0.0;
int airLoopNum = 0; // Add for AFN compatibility, revisit at a later date
int supplyFanIndex = 0;
int supplyFanType = 0;
std::string supplyFanName = "";
bool doStandardRatingFlag = true;
bool SubcoolReheatFlag = false; // Subcool reheat coil control

CoilCoolingDXCurveFitSpeed &normModeNomSpeed();
CoilCoolingDXCurveFitSpeed &altModeNomSpeed();

// report variables
Real64 totalCoolingEnergyRate = 0.0;
Real64 totalCoolingEnergy = 0.0;
Expand All @@ -147,9 +153,19 @@ struct CoilCoolingDX
Real64 wasteHeatEnergy = 0.0;
Real64 recoveredHeatEnergy = 0.0;
Real64 recoveredHeatEnergyRate = 0.0;
Real64 condenserInletTemperature = 0.0;
int dehumidificationMode = 0;
bool reportCoilFinalSizes = true;
bool isSecondaryDXCoilInZone = false;
Real64 secCoilSensHeatRejEnergyRate = 0.0;
Real64 secCoilSensHeatRejEnergy = 0.0;

void setToHundredPercentDOAS();
bool isHundredPercentDOAS = false;
};

extern std::vector<CoilCoolingDX> coilCoolingDXs;
extern bool stillNeedToReportStandardRatings; // standard ratings flag for all coils to report at the same time
extern bool coilCoolingDXGetInputFlag;
extern std::string const coilCoolingDXObjectName;

Expand Down
127 changes: 113 additions & 14 deletions src/EnergyPlus/Coils/CoilCoolingDXCurveFitOperatingMode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <EnergyPlus/DataIPShortCuts.hh>
#include <EnergyPlus/DataSizing.hh>
#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/EMSManager.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/Psychrometrics.hh>
#include <EnergyPlus/ReportSizingManager.hh>
Expand All @@ -67,12 +68,19 @@ void CoilCoolingDXCurveFitOperatingMode::instantiateFromInputSpec(EnergyPlusData
this->original_input_specs = input_data;
this->name = input_data.name;
this->ratedGrossTotalCap = input_data.gross_rated_total_cooling_capacity;
if (this->ratedGrossTotalCap == DataSizing::AutoSize) this->ratedGrossTotalCapIsAutosized = true;
this->ratedEvapAirFlowRate = input_data.rated_evaporator_air_flow_rate;
if (this->ratedEvapAirFlowRate == DataSizing::AutoSize) this->ratedEvapAirFlowRateIsAutosized = true;
this->ratedCondAirFlowRate = input_data.rated_condenser_air_flow_rate;
this->maxCyclingRate = input_data.maximum_cycling_rate;
this->timeForCondensateRemoval = input_data.nominal_time_for_condensate_removal_to_begin;
this->evapRateRatio = input_data.ratio_of_initial_moisture_evaporation_rate_and_steady_state_latent_capacity;
this->maxCyclingRate = input_data.maximum_cycling_rate;
this->latentTimeConst = input_data.latent_capacity_time_constant;
this->timeForCondensateRemoval = input_data.nominal_time_for_condensate_removal_to_begin;
if (UtilityRoutines::SameString(input_data.apply_latent_degradation_to_speeds_greater_than_1, "Yes")) {
this->applyLatentDegradationAllSpeeds = true;
} else {
this->applyLatentDegradationAllSpeeds = false;
}
// TODO: UNUSED apply_latent_degradation_to_speeds_greater_than_1
this->nominalEvaporativePumpPower = input_data.nominal_evap_condenser_pump_power;

Expand All @@ -82,6 +90,9 @@ void CoilCoolingDXCurveFitOperatingMode::instantiateFromInputSpec(EnergyPlusData
ShowWarningError(routineName + this->object_name + "=\"" + this->name + "\":");
ShowContinueError("...At least one of the four input parameters for the latent capacity degradation model");
ShowContinueError("...is set to zero. Therefore, the latent degradation model will not be used for this simulation.");
this->latentDegradationActive = false;
} else if (this->maxCyclingRate > 0.0 && this->evapRateRatio > 0.0 && this->latentTimeConst > 0.0 && this->timeForCondensateRemoval > 0.0) {
this->latentDegradationActive = true;
}

if (UtilityRoutines::SameString(input_data.condenser_type, "AirCooled")) {
Expand All @@ -98,6 +109,9 @@ void CoilCoolingDXCurveFitOperatingMode::instantiateFromInputSpec(EnergyPlusData
this->speeds.emplace_back(state, speed_name);
}

// convert speed num in IDF to vector index
this->nominalSpeedIndex = input_data.nominal_speed_number - 1;

if (errorsFound) {
ShowFatalError(routineName + "Errors found in getting " + this->object_name + " input. Preceding condition(s) causes termination.");
}
Expand Down Expand Up @@ -151,6 +165,23 @@ CoilCoolingDXCurveFitOperatingMode::CoilCoolingDXCurveFitOperatingMode(EnergyPlu
}
}

void CoilCoolingDXCurveFitOperatingMode::oneTimeInit() {
if (DataGlobals::AnyEnergyManagementSystemInModel) {
SetupEMSActuator(this->object_name,
this->name,
"Autosized Rated Air Flow Rate",
"[m3/s]",
this->ratedAirVolFlowEMSOverrideON,
this->ratedAirVolFlowEMSOverrideValue);
SetupEMSActuator(this->object_name,
this->name,
"Autosized Rated Total Cooling Capacity",
"[W]",
this->ratedTotCapFlowEMSOverrideON,
this->ratedTotCapFlowEMSOverrideValue);
}
}

void CoilCoolingDXCurveFitOperatingMode::size(EnergyPlusData &state)
{

Expand All @@ -160,20 +191,28 @@ void CoilCoolingDXCurveFitOperatingMode::size(EnergyPlusData &state)
bool PrintFlag = true;

int SizingMethod = DataHVACGlobals::CoolingAirflowSizing;
DataSizing::DataEMSOverrideON = this->ratedAirVolFlowEMSOverrideON;
DataSizing::DataEMSOverride = this->ratedAirVolFlowEMSOverrideValue;
std::string SizingString = "Rated Evaporator Air Flow Rate [m3/s]";
Real64 TempSize = this->original_input_specs.rated_evaporator_air_flow_rate;
ReportSizingManager::RequestSizing(state, CompType, CompName, SizingMethod, SizingString, TempSize, PrintFlag, RoutineName);
this->ratedEvapAirFlowRate = TempSize;
Real64 const ratedInletAirTemp(26.6667); // 26.6667C or 80F
Real64 const ratedInletAirHumRat(0.0111847); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb
DataSizing::DataEMSOverrideON = false;
DataSizing::DataEMSOverride = 0.0;
this->ratedEvapAirMassFlowRate = this->ratedEvapAirFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(
DataEnvironment::StdBaroPress, ratedInletAirTemp, ratedInletAirHumRat, RoutineName);

SizingMethod = DataHVACGlobals::CoolingCapacitySizing;
DataSizing::DataEMSOverrideON = this->ratedTotCapFlowEMSOverrideON;
DataSizing::DataEMSOverride = this->ratedTotCapFlowEMSOverrideValue;
SizingString = "Rated Gross Total Cooling Capacity [W]";
DataSizing::DataFlowUsedForSizing = this->ratedEvapAirFlowRate; // TODO: This is volume flow, right?
DataSizing::DataFlowUsedForSizing = this->ratedEvapAirFlowRate;
TempSize = this->original_input_specs.gross_rated_total_cooling_capacity;
ReportSizingManager::RequestSizing(state, CompType, CompName, SizingMethod, SizingString, TempSize, PrintFlag, RoutineName);
DataSizing::DataEMSOverrideON = false;
DataSizing::DataEMSOverride = 0.0;
this->ratedGrossTotalCap = TempSize;

SizingMethod = DataHVACGlobals::AutoCalculateSizing;
Expand All @@ -183,7 +222,11 @@ void CoilCoolingDXCurveFitOperatingMode::size(EnergyPlusData &state)
SizingString = "Rated Condenser Air Flow Rate [m3/s]";
TempSize = this->original_input_specs.rated_condenser_air_flow_rate;
ReportSizingManager::RequestSizing(state, CompType, CompName, SizingMethod, SizingString, TempSize, PrintFlag, RoutineName);
DataSizing::DataConstantUsedForSizing = 0.0;
DataSizing::DataFractionUsedForSizing = 0.0;
this->ratedCondAirFlowRate = TempSize;
int numSpeeds = this->speeds.size();
int thisSpeedNum = 0;


if (this->condenserType != AIRCOOLED) {
Expand All @@ -198,10 +241,27 @@ void CoilCoolingDXCurveFitOperatingMode::size(EnergyPlusData &state)
}

for (auto &curSpeed : this->speeds) {
curSpeed.parentName = this->parentName;
curSpeed.parentModeRatedGrossTotalCap = this->ratedGrossTotalCap;
curSpeed.ratedGrossTotalCapIsAutosized = this->ratedGrossTotalCapIsAutosized;
curSpeed.parentModeRatedEvapAirFlowRate = this->ratedEvapAirFlowRate;
curSpeed.ratedEvapAirFlowRateIsAutosized = this->ratedEvapAirFlowRateIsAutosized;
curSpeed.parentModeRatedCondAirFlowRate = this->ratedCondAirFlowRate;
curSpeed.size(state);

// Set latent degradation parameters if applicable
curSpeed.doLatentDegradation = false;
if (this->latentDegradationActive) {
if ((thisSpeedNum == 0) || ((thisSpeedNum > 0) && this->applyLatentDegradationAllSpeeds)) {
curSpeed.parentModeTimeForCondensateRemoval = this->timeForCondensateRemoval;
curSpeed.parentModeEvapRateRatio = this->evapRateRatio;
curSpeed.parentModeMaxCyclingRate = this->maxCyclingRate;
curSpeed.parentModeLatentTimeConst = this->latentTimeConst;
curSpeed.doLatentDegradation = true;
}
}

curSpeed.size(state, thisSpeedNum, numSpeeds);
thisSpeedNum++;
}
}

Expand All @@ -211,9 +271,10 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlusData &state
Real64 &PLR,
int &speedNum,
Real64 &speedRatio,
int &fanOpMode,
int const fanOpMode,
DataLoopNode::NodeData &condInletNode,
DataLoopNode::NodeData &EP_UNUSED(condOutletNode))
DataLoopNode::NodeData &EP_UNUSED(condOutletNode),
bool const singleMode)
{

// Currently speedNum is 1-based, while this->speeds are zero-based
Expand All @@ -226,20 +287,21 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlusData &state
condInletNode.Temp, condInletNode.HumRat, DataEnvironment::StdPressureSeaLevel, "CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode");
}
// thisspeed.ambPressure = inletNode.Press;
thisspeed.ambPressure = DataEnvironment::OutBaroPress;
thisspeed.ambPressure = condInletNode.Press;
thisspeed.AirMassFlow = inletNode.MassFlowRate;
if (fanOpMode == DataHVACGlobals::CycFanCycCoil && speedNum == 1) {
if (PLR > 0.0) {
thisspeed.AirMassFlow = inletNode.MassFlowRate / PLR;
thisspeed.AirMassFlow = thisspeed.AirMassFlow / PLR;
} else {
thisspeed.AirMassFlow = 0.0;
}
} else if (speedNum > 1) {
thisspeed.AirMassFlow = DataHVACGlobals::MSHPMassFlowRateHigh;
}
// rated flow rate is adjusted by coil face area fraction so adjustment is before next IF
thisspeed.AirMassFlow *= thisspeed.active_fraction_of_face_coil_area;
if (thisspeed.RatedAirMassFlowRate > 0.0) {
// TODO: The original two-speed just grabbed the RatedAirMassFlowRate(mode1), not for a specific speed, so that's what I'll do too
thisspeed.AirFF = thisspeed.AirMassFlow / this->ratedEvapAirMassFlowRate; //thisspeed.RatedAirMassFlowRate;
thisspeed.AirFF = thisspeed.AirMassFlow / thisspeed.RatedAirMassFlowRate;
} else {
thisspeed.AirFF = 0.0;
}
Expand All @@ -252,6 +314,24 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlusData &state

thisspeed.CalcSpeedOutput(state, inletNode, outletNode, plr1, fanOpMode, this->condInletTemp);

// the outlet node conditions are based on it running at the truncated flow, we need to merge the bypassed air back in and ramp up flow rate
if (thisspeed.adjustForFaceArea) {
thisspeed.AirMassFlow /= thisspeed.active_fraction_of_face_coil_area;
Real64 correctedEnthalpy = (1.0 - thisspeed.active_fraction_of_face_coil_area) * inletNode.Enthalpy +
thisspeed.active_fraction_of_face_coil_area * outletNode.Enthalpy;
Real64 correctedHumRat =
(1.0 - thisspeed.active_fraction_of_face_coil_area) * inletNode.HumRat + thisspeed.active_fraction_of_face_coil_area * outletNode.HumRat;
Real64 correctedTemp = Psychrometrics::PsyTdbFnHW(correctedEnthalpy, correctedHumRat);
// Check for saturation error and modify temperature at constant enthalpy
// if (correctedTemp < Psychrometrics::PsyTsatFnHPb(correctedEnthalpy, inletNode.Press)) {
// correctedTemp = Psychrometrics::PsyTsatFnHPb(correctedEnthalpy, inletNode.Press);
// correctedHumRat = Psychrometrics::PsyWFnTdbH(correctedTemp, correctedEnthalpy);
// }
outletNode.Temp = correctedTemp;
outletNode.HumRat = correctedHumRat;
outletNode.Enthalpy = correctedEnthalpy;
}

Real64 outSpeed1HumRat = outletNode.HumRat;
Real64 outSpeed1Enthalpy = outletNode.Enthalpy;

Expand All @@ -265,19 +345,38 @@ void CoilCoolingDXCurveFitOperatingMode::CalcOperatingMode(EnergyPlusData &state
OpModePower = thisspeed.fullLoadPower * thisspeed.RTF;
OpModeWasteHeat = thisspeed.fullLoadWasteHeat * thisspeed.RTF;

if ((speedNum > 1) && (speedRatio < 1.0)) {
if ((speedNum > 1) && (speedRatio < 1.0) && !singleMode) {

// If multispeed, evaluate next lower speed using PLR, then combine with high speed for final outlet conditions
auto &lowerspeed(this->speeds[max(speedNum - 2, 0)]);
lowerspeed.AirMassFlow = DataHVACGlobals::MSHPMassFlowRateLow;
lowerspeed.AirMassFlow = DataHVACGlobals::MSHPMassFlowRateLow * lowerspeed.active_fraction_of_face_coil_area;

lowerspeed.CalcSpeedOutput(state, inletNode, outletNode, PLR, fanOpMode, condInletTemp); // out

if (lowerspeed.adjustForFaceArea) {
lowerspeed.AirMassFlow /= lowerspeed.active_fraction_of_face_coil_area;
Real64 correctedEnthalpy = (1.0 - lowerspeed.active_fraction_of_face_coil_area) * inletNode.Enthalpy +
lowerspeed.active_fraction_of_face_coil_area * outletNode.Enthalpy;
Real64 correctedHumRat = (1.0 - lowerspeed.active_fraction_of_face_coil_area) * inletNode.HumRat +
lowerspeed.active_fraction_of_face_coil_area * outletNode.HumRat;
Real64 correctedTemp = Psychrometrics::PsyTdbFnHW(correctedEnthalpy, correctedHumRat);
// Check for saturation error and modify temperature at constant enthalpy
// if (correctedTemp < Psychrometrics::PsyTsatFnHPb(correctedEnthalpy, inletNode.Press)) {
// correctedTemp = Psychrometrics::PsyTsatFnHPb(correctedEnthalpy, inletNode.Press);
// correctedHumRat = Psychrometrics::PsyWFnTdbH(correctedTemp, correctedEnthalpy);
// }
outletNode.Temp = correctedTemp;
outletNode.HumRat = correctedHumRat;
outletNode.Enthalpy = correctedEnthalpy;
}

outletNode.HumRat = outSpeed1HumRat * speedRatio + (1.0 - speedRatio) * outletNode.HumRat;
outletNode.Enthalpy = outSpeed1Enthalpy * speedRatio + (1.0 - speedRatio) * outletNode.Enthalpy;
outletNode.Temp = Psychrometrics::PsyTdbFnHW(outletNode.Enthalpy, outletNode.HumRat);
OpModePower = OpModePower + (1.0 - thisspeed.RTF) * lowerspeed.fullLoadPower;
OpModeWasteHeat = OpModeWasteHeat + (1.0 - thisspeed.RTF) * lowerspeed.fullLoadWasteHeat;

this->OpModePower += (1.0 - thisspeed.RTF) * lowerspeed.fullLoadPower;
this->OpModeWasteHeat += (1.0 - thisspeed.RTF) * lowerspeed.fullLoadWasteHeat;
this->OpModeRTF = 1.0; // if we are on greater than 1 speed, RTF *must* be 1
}
}

Expand Down
Loading