33const int LOAD_NUM = 11;
34const int HOURS_IN_YEAR = 8760;
50 enum RefrigerantType { R_11, R_123, R_12, R_134a, R_22, R_717 };
52 enum ACSourceLocation { Inside, Outside };
54 enum CoolingSystemType { Water, Air };
56 enum CellFanType { AxialFan, CentrifugalFan };
58 enum TowerSizedBy { Tonnage, Fan_HP };
60 enum ChillerCompressorType { Centrifugal, Screw, Reciprocating };
62 enum FanMotorSpeedType { One, Two, Variable };
74 ChillerOutput(vector<vector<double>> efficiency, vector<vector<double>> hours, vector<vector<double>> power,
75 vector<vector<double>> energy)
76 : efficiency(std::move(efficiency)), hours(std::move(hours)), power(std::move(power)),
77 energy(std::move(energy)) {}
79 vector<vector<double>> efficiency;
80 vector<vector<double>> hours;
81 vector<vector<double>> power;
82 vector<vector<double>> energy;
93 : chillerPumpingEnergy(std::move(pumpingEnergy)) {}
95 vector<double> chillerPumpingEnergy;
113 TowerOutput(vector<double> hours, vector<double> energy) : hours(std::move(hours)), energy(std::move(energy)) {}
115 vector<double> tempBins = {35, 45, 55, 65, 75, 75};
116 vector<double> hours;
117 vector<double> energy;
139 bool CWVariableFlow,
double CWFlowRate,
double CWTFollow)
140 : CHWT(CHWT), useFreeCooling(useFreeCooling), HEXApproachTemp(HEXApproachTemp), constantCWT(constantCWT),
141 CWT(CWT), CWVariableFlow(CWVariableFlow), CWFlowRate(CWFlowRate), CWTFollow(CWTFollow) {
142 isWaterCooled =
true;
146 bool useFreeCooling =
false;
147 double HEXApproachTemp = 0;
148 bool constantCWT =
true;
150 bool CWVariableFlow =
true;
151 double CWFlowRate = 3;
152 double CWTFollow = 0;
153 bool isWaterCooled =
false;
172 : CHWT(CHWT), OADT(OADT), ACSource(ACSource), indoorTemp(indoorTemp), CWTFollow(CWTFollow) {
178 ACSourceLocation ACSource = ACSourceLocation::Outside;
179 double indoorTemp = 75;
180 double CWTFollow = 0;
181 bool isAirCooled =
false;
193 PumpInput(
bool variableFlow,
double flowRate,
double efficiency,
double motorSize,
double motorEfficiency)
194 : variableFlow(variableFlow), flowRate(flowRate), efficiency(efficiency * 100), motorSize(motorSize),
195 motorEfficiency(motorEfficiency * 100) {}
201 double motorEfficiency;
221 TowerInput(
int numTower,
int numFanPerTower_Cells, FanMotorSpeedType fanSpeedType, TowerSizedBy towerSizing,
222 CellFanType towerCellFanType,
double cellFanHP,
double tonnage)
223 : numTower(numTower), numFanPerTower_Cells(numFanPerTower_Cells), fanSpeedType(fanSpeedType),
224 fanHP(cellFanHP), tonnage(tonnage) {
225 fanHP = getFanHP(tonnage, towerSizing, numFanPerTower_Cells, towerCellFanType, fanHP);
229 int numFanPerTower_Cells;
230 FanMotorSpeedType fanSpeedType;
251 ChillerInput(ChillerCompressorType chillerType,
double capacity,
bool isFullLoadEffKnown,
double fullLoadEff,
252 double age,
bool installVSD,
bool useARIMonthlyLoadSchedule, vector<vector<double>> monthlyLoads)
253 : chillerType(chillerType), capacity(capacity), isFullLoadEffKnown(isFullLoadEffKnown),
254 fullLoadEff(fullLoadEff), age(age), installVSD(installVSD),
255 useARIMonthlyLoadSchedule(useARIMonthlyLoadSchedule), monthlyLoads(std::move(monthlyLoads)),
256 isCustomChiller(false), loadAtPercent({}), kwPerTonLoads({}), changeRefrig(
false),
257 currentRefrig(RefrigerantType::R_11), proposedRefrig(RefrigerantType::R_11) {
258 InitNonVaryingMonthlyLoad();
279 ChillerInput(ChillerCompressorType chillerType,
double capacity,
bool isFullLoadEffKnown,
double fullLoadEff,
280 double age,
bool installVSD,
bool useARIMonthlyLoadSchedule, vector<vector<double>> monthlyLoads,
281 bool changeRefrig, RefrigerantType currentRefrig, RefrigerantType proposedRefrig)
282 : chillerType(chillerType), capacity(capacity), isFullLoadEffKnown(isFullLoadEffKnown),
283 fullLoadEff(fullLoadEff), age(age), installVSD(installVSD),
284 useARIMonthlyLoadSchedule(useARIMonthlyLoadSchedule), monthlyLoads(std::move(monthlyLoads)),
285 isCustomChiller(false), loadAtPercent({}), kwPerTonLoads({}), changeRefrig(changeRefrig),
286 currentRefrig(currentRefrig), proposedRefrig(proposedRefrig) {
287 InitNonVaryingMonthlyLoad();
308 ChillerInput(ChillerCompressorType chillerType,
double capacity,
bool isFullLoadEffKnown,
double fullLoadEff,
309 double age,
bool installVSD,
bool useARIMonthlyLoadSchedule, vector<vector<double>> monthlyLoads,
310 RefrigerantType currentRefrig, RefrigerantType proposedRefrig)
311 : chillerType(chillerType), capacity(capacity), isFullLoadEffKnown(isFullLoadEffKnown),
312 fullLoadEff(fullLoadEff), age(age), installVSD(installVSD),
313 useARIMonthlyLoadSchedule(useARIMonthlyLoadSchedule), monthlyLoads(std::move(monthlyLoads)),
314 isCustomChiller(false), loadAtPercent({}), kwPerTonLoads({}), changeRefrig(
true),
315 currentRefrig(currentRefrig), proposedRefrig(proposedRefrig) {
316 InitNonVaryingMonthlyLoad();
337 ChillerInput(ChillerCompressorType chillerType,
double capacity,
bool isFullLoadEffKnown,
double fullLoadEff,
338 double age,
bool installVSD,
bool useARIMonthlyLoadSchedule, vector<vector<double>> monthlyLoads,
339 vector<double> loadAtPercent, vector<double> kwPerTonLoads)
340 : chillerType(chillerType), capacity(capacity), isFullLoadEffKnown(isFullLoadEffKnown),
341 fullLoadEff(fullLoadEff), age(age), installVSD(installVSD),
342 useARIMonthlyLoadSchedule(useARIMonthlyLoadSchedule), monthlyLoads(std::move(monthlyLoads)),
343 isCustomChiller(true), loadAtPercent(std::move(loadAtPercent)), kwPerTonLoads(std::move(kwPerTonLoads)),
344 changeRefrig(false), currentRefrig(RefrigerantType::R_11), proposedRefrig(RefrigerantType::R_11) {
345 InitNonVaryingMonthlyLoad();
346 SetCustomCoefficient();
370 ChillerInput(ChillerCompressorType chillerType,
double capacity,
bool isFullLoadEffKnown,
double fullLoadEff,
371 double age,
bool installVSD,
bool useARIMonthlyLoadSchedule, vector<vector<double>> monthlyLoads,
372 vector<double> loadAtPercent, vector<double> kwPerTonLoads, RefrigerantType currentRefrig,
373 RefrigerantType proposedRefrig)
374 : chillerType(chillerType), capacity(capacity), isFullLoadEffKnown(isFullLoadEffKnown),
375 fullLoadEff(fullLoadEff), age(age), installVSD(installVSD),
376 useARIMonthlyLoadSchedule(useARIMonthlyLoadSchedule), monthlyLoads(std::move(monthlyLoads)),
377 isCustomChiller(true), loadAtPercent(std::move(loadAtPercent)), kwPerTonLoads(std::move(kwPerTonLoads)),
378 changeRefrig(true), currentRefrig(currentRefrig), proposedRefrig(proposedRefrig) {
379 InitNonVaryingMonthlyLoad();
380 SetCustomCoefficient();
383 ChillerCompressorType chillerType;
385 bool isFullLoadEffKnown;
389 bool useARIMonthlyLoadSchedule;
390 vector<vector<double>> monthlyLoads;
392 bool isCustomChiller;
393 vector<double> loadAtPercent;
394 vector<double> kwPerTonLoads;
396 bool changeRefrig =
false;
397 RefrigerantType currentRefrig;
398 RefrigerantType proposedRefrig;
400 vector<double> customCoeffs;
403 void InitNonVaryingMonthlyLoad() {
404 if (monthlyLoads.size() == 1) {
405 auto monthlyLoad = monthlyLoads[0];
407 for (
int i = 0; i < 11; i++) {
408 monthlyLoads.push_back(monthlyLoad);
413 void SetCustomCoefficient() {
414 auto size =
static_cast<int>(loadAtPercent.size());
415 vector<double> x(size, 0);
416 vector<double> y(size, 0);
417 for (
int i = 0; i < size; i++) {
418 x[i] = loadAtPercent[i];
419 y[i] = kwPerTonLoads[i] * loadAtPercent[i] / kwPerTonLoads[0];
421 vector<double> coeff = solveForCoefficients(x, y);
423 size =
static_cast<int>(coeff.size());
424 customCoeffs.resize(size, 0);
425 for (
int i = 0; i < size; i++) {
426 customCoeffs[i] = coeff[i];
430 static vector<double> solveForCoefficients(vector<double> x, vector<double> y) {
431 if (x.empty() || x.size() != y.size())
434 const int n = (int)x.size();
436 vector<vector<double>> a(n, vector<double>(n, 0));
437 for (
int i = 0; i < n; ++i) {
438 for (
int j = 0; j < n; ++j) {
439 a[i][j] = pow(x[i], n - 1 - j);
444 for (
int k = 0; k < n - 1; ++k) {
445 for (
int i = k + 1; i < n; ++i) {
446 double factor = a[i][k] / a[k][k];
447 for (
int j = k + 1; j < n; ++j) {
448 a[i][j] -= factor * a[k][j];
450 y[i] -= factor * y[k];
455 vector<double> coeff(n, 0);
456 coeff[n - 1] = y[n - 1] / a[n - 1][n - 1];
457 for (
int i = n - 2; i >= 0; --i) {
459 for (
int j = i + 1; j < n; ++j) {
460 sum -= a[i][j] * coeff[j];
462 coeff[i] = sum / a[i][i];
485 ProcessCooling(
const vector<int>& systemOperationAnnualHours,
const vector<double>& weatherDryBulbHourlyTemp,
486 const vector<double>& weatherWetBulbHourlyTemp,
const vector<ChillerInput>& chillerInputList,
488 :
ProcessCooling(systemOperationAnnualHours, weatherDryBulbHourlyTemp, weatherWetBulbHourlyTemp,
489 chillerInputList, {}, towerInput, waterCooledSystemInput) {}
502 ProcessCooling(
const vector<int>& systemOperationAnnualHours,
const vector<double>& weatherDryBulbHourlyTemp,
503 const vector<double>& weatherWetBulbHourlyTemp,
const vector<ChillerInput>& chillerInputList,
505 :
ProcessCooling(systemOperationAnnualHours, weatherDryBulbHourlyTemp, weatherWetBulbHourlyTemp,
506 chillerInputList, airCooledSystemInput, {}, {}) {}
538 static vector<int>
getSysOpAnnualHours(
const vector<int>& weeklyOpStartHour,
const vector<int>& weeklyOpStopHour,
const vector<int>& monthlyOpMaxHour);
541 ProcessCooling(
const vector<int>& systemOperationAnnualHours,
const vector<double>& weatherDryBulbHourlyTemp,
542 const vector<double>& weatherWetBulbHourlyTemp,
const vector<ChillerInput>& chillerInputList,
546 vector<int> systemOperationAnnual;
547 vector<double> dryBulbHourlyTemp;
548 vector<double> wetBulbHourlyTemp;
551 WaterCooledSystemInput waterCooledSystem;
552 AirCooledSystemInput airCooledSystem;
553 CoolingSystemType coolingType;
556 vector<double> CWTHourly;
559 vector<ChillerInput> chillers;
560 vector<vector<double>> chillerHourlyLoad;
561 vector<vector<double>> chillerHourlyLoadOperational;
562 vector<vector<double>> chillerHourlyEfficiencyARI;
563 vector<vector<double>> chillerHourlyEfficiency;
564 vector<vector<double>> chillerHourlyPower;
566 void annualChillerLoadProfile();
568 void annualChillerEfficiencyProfileARI();
570 void annualChillerEfficiencyProfile();
572 void annualChillerPowerProfile();
574 static double getFanHP(
double tonnage, TowerSizedBy towerSizing,
int fanNum, CellFanType fanType,
double fanHP);
576 double getPercentFanPower(
double wetBulbTemp,
double percentWaterFlow,
double range,
double desiredApproach,
579 double getPercentWaterFlow(
int yearHourIndex);
581 double getRange(
int yearHourIndex);
583 double getApproach(
double wetBulbTemp,
double minToChillersTemp)
const;
585 double modifyPercentFanPower(
double percentFanPower)
const;
587 double getWeightedAverageChillerLoad(
int yearHourIndex);
589 double getChillerTonnageTotal();
591 static double getCubeRoot(
double number);
593 static double getPumpHP(
double power);
Calculator estimates energy consumption of operating Chillers, Pumps and Towers in a cooling system (...
TowerOutput calculateTowerEnergy()
ChillerOutput calculateChillerEnergy()
ProcessCooling(const vector< int > &systemOperationAnnualHours, const vector< double > &weatherDryBulbHourlyTemp, const vector< double > &weatherWetBulbHourlyTemp, const vector< ChillerInput > &chillerInputList, AirCooledSystemInput airCooledSystemInput)
ChillerPumpingEnergyOutput calculatePumpEnergy(PumpInput pump)
static vector< int > getSysOpAnnualHours(const vector< int > &weeklyOpStartHour, const vector< int > &weeklyOpStopHour, const vector< int > &monthlyOpMaxHour)
ProcessCooling(const vector< int > &systemOperationAnnualHours, const vector< double > &weatherDryBulbHourlyTemp, const vector< double > &weatherWetBulbHourlyTemp, const vector< ChillerInput > &chillerInputList, TowerInput towerInput, WaterCooledSystemInput waterCooledSystemInput)
ChillerOutput(vector< vector< double > > efficiency, vector< vector< double > > hours, vector< vector< double > > power, vector< vector< double > > energy)
ChillerPumpingEnergyOutput(vector< double > pumpingEnergy)
TowerOutput(vector< double > hours, vector< double > energy)