forked from NREL/EnergyPlus
/
HVACStandAloneERV.cc
2124 lines (1852 loc) · 113 KB
/
HVACStandAloneERV.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// EnergyPlus, Copyright (c) 1996-2019, The Board of Trustees of the University of Illinois,
// The Regents of the University of California, through Lawrence Berkeley National Laboratory
// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
// National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
// contributors. All rights reserved.
//
// NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
// U.S. Government consequently retains certain rights. As such, the U.S. Government has been
// granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
// worldwide license in the Software to reproduce, distribute copies to the public, prepare
// derivative works, and perform publicly and display publicly, and to permit others to do so.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
// the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific prior
// written permission.
//
// (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
// without changes from the version obtained under this License, or (ii) Licensee makes a
// reference solely to the software portion of its product, Licensee must refer to the
// software as "EnergyPlus version X" software, where "X" is the version number Licensee
// obtained under this License and may not use a different name for the software. Except as
// specifically required in this Section (4), Licensee shall not use in a company name, a
// product name, in advertising, publicity, or other promotional activities any name, trade
// name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
// similar designation, without the U.S. Department of Energy's prior written consent.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// C++ Headers
#include <cmath>
// ObjexxFCL Headers
#include <ObjexxFCL/Array.functions.hh>
#include <ObjexxFCL/Fmath.hh>
// EnergyPlus Headers
#include <EnergyPlus/BranchNodeConnections.hh>
#include <EnergyPlus/CurveManager.hh>
#include <EnergyPlus/DataAirLoop.hh>
#include <EnergyPlus/DataEnvironment.hh>
#include <EnergyPlus/DataHVACGlobals.hh>
#include <EnergyPlus/DataHeatBalance.hh>
#include <EnergyPlus/DataIPShortCuts.hh>
#include <EnergyPlus/DataLoopNode.hh>
#include <EnergyPlus/DataPrecisionGlobals.hh>
#include <EnergyPlus/DataSizing.hh>
#include <EnergyPlus/DataZoneControls.hh>
#include <EnergyPlus/DataZoneEquipment.hh>
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/General.hh>
#include <EnergyPlus/GlobalNames.hh>
#include <EnergyPlus/HVACFan.hh>
#include <EnergyPlus/HVACStandAloneERV.hh>
#include <EnergyPlus/HeatRecovery.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/MixedAir.hh>
#include <EnergyPlus/NodeInputManager.hh>
#include <EnergyPlus/OutAirNodeManager.hh>
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/Psychrometrics.hh>
#include <EnergyPlus/ReportSizingManager.hh>
#include <EnergyPlus/ScheduleManager.hh>
#include <EnergyPlus/UtilityRoutines.hh>
namespace EnergyPlus {
namespace HVACStandAloneERV {
// Module containing the routines dealing with stand alone energy recovery ventilators (ERVs)
// MODULE INFORMATION:
// AUTHOR Richard Raustad, FSEC
// DATE WRITTEN June 2003
// MODIFIED na
// RE-ENGINEERED na
// PURPOSE OF THIS MODULE:
// To encapsulate the data and algorithms needed to simulate stand alone
// energy recovery ventilators that condition outdoor ventilation air and
// supply that air directly to a zone.
// METHODOLOGY EMPLOYED:
// These units are modeled as a collection of components: air-to-air generic heat exchanger,
// supply air fan, exhaust air fan and an optional controller to avoid overheating
// of the supply air (economizer or free cooling operation).
// REFERENCES: none
// OTHER NOTES: none
// USE STATEMENTS:
// Use statements for data only modules
// Using/Aliasing
using namespace DataPrecisionGlobals;
using namespace DataLoopNode;
using DataEnvironment::StdBaroPress;
using DataEnvironment::StdRhoAir;
using DataGlobals::BeginEnvrnFlag;
using DataGlobals::DisplayExtraWarnings;
using DataGlobals::NumOfZones;
using DataGlobals::ScheduleAlwaysOn;
using DataGlobals::SecInHour;
using DataGlobals::SysSizingCalc;
using DataGlobals::WarmupFlag;
using namespace DataHVACGlobals;
using ScheduleManager::GetCurrentScheduleValue;
using ScheduleManager::GetScheduleIndex;
// Data
// MODULE PARAMETER DEFINITIONS
static std::string const BlankString;
int const ControllerSimple(1);
int const ControllerOutsideAir(2);
int const ControllerStandAloneERV(3);
// DERIVED TYPE DEFINITIONS
// MODULE VARIABLE DECLARATIONS:
int NumStandAloneERVs; // Total number of stand alone ERVs defined in the idf
Array1D_bool MySizeFlag;
Array1D_bool CheckEquipName;
bool GetERVInputFlag(true); // First time, input is "gotten"
// SUBROUTINE SPECIFICATIONS FOR MODULE
// Driver/Manager Routine
// Algorithms/Calculation routine for the module
// Get Input routine for module
// Sizing routine for the module
// Initialization routine for module
// Utility routines for module
// Object Data
Array1D<StandAloneERVData> StandAloneERV;
std::unordered_set<std::string> HeatExchangerUniqueNames;
std::unordered_set<std::string> SupplyAirFanUniqueNames;
std::unordered_set<std::string> ExhaustAirFanUniqueNames;
std::unordered_set<std::string> ControllerUniqueNames;
// Functions
void clear_state()
{
NumStandAloneERVs = 0;
GetERVInputFlag = true;
MySizeFlag.deallocate();
CheckEquipName.deallocate();
StandAloneERV.deallocate();
HeatExchangerUniqueNames.clear();
SupplyAirFanUniqueNames.clear();
ExhaustAirFanUniqueNames.clear();
ControllerUniqueNames.clear();
}
void SimStandAloneERV(std::string const &CompName, // name of the Stand Alone ERV unit
int const ZoneNum, // number of zone being served unused1208
bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
Real64 &SensLoadMet, // net sensible load supplied by the ERV unit to the zone (W)
Real64 &LatLoadMet, // net latent load supplied by ERV unit to the zone (kg/s),
int &CompIndex // pointer to correct component
)
{
// SUBROUTINE INFORMATION:
// AUTHOR Richard Raustad, FSEC
// DATE WRITTEN June 2003
// MODIFIED Don Shirey, Aug 2009 (LatLoadMet)
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// Manages the simulation of a Stand Alone ERV unit. Called from SimZoneEquipment
// Using/Aliasing
using General::TrimSigDigits;
// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
// ZoneNum not used at this time, future modifications may require zone information
// dehumid = negative
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int StandAloneERVNum; // index of Stand Alone ERV unit being simulated
// First time SimStandAloneERV is called, get the input for all Stand Alone ERV units
if (GetERVInputFlag) {
GetStandAloneERV();
GetERVInputFlag = false;
}
// Find the correct Stand Alone ERV unit index
if (CompIndex == 0) {
StandAloneERVNum = UtilityRoutines::FindItem(CompName, StandAloneERV);
if (StandAloneERVNum == 0) {
ShowFatalError("SimStandAloneERV: Unit not found=" + CompName);
}
CompIndex = StandAloneERVNum;
} else {
StandAloneERVNum = CompIndex;
if (StandAloneERVNum > NumStandAloneERVs || StandAloneERVNum < 1) {
ShowFatalError("SimStandAloneERV: Invalid CompIndex passed=" + TrimSigDigits(StandAloneERVNum) +
", Number of Units=" + TrimSigDigits(NumStandAloneERVs) + ", Entered Unit name=" + CompName);
}
if (CheckEquipName(StandAloneERVNum)) {
if (CompName != StandAloneERV(StandAloneERVNum).Name) {
ShowFatalError("SimStandAloneERV: Invalid CompIndex passed=" + TrimSigDigits(StandAloneERVNum) + ", Unit name=" + CompName +
", stored Unit Name for that index=" + StandAloneERV(StandAloneERVNum).Name);
}
CheckEquipName(StandAloneERVNum) = false;
}
}
// Initialize the Stand Alone ERV unit
InitStandAloneERV(StandAloneERVNum, ZoneNum, FirstHVACIteration);
CalcStandAloneERV(StandAloneERVNum, FirstHVACIteration, SensLoadMet, LatLoadMet);
ReportStandAloneERV(StandAloneERVNum);
}
void GetStandAloneERV()
{
// SUBROUTINE INFORMATION:
// AUTHOR Richard Raustad
// DATE WRITTEN June 2003
// MODIFIED July 2012, Chandan Sharma - FSEC: Added zone sys avail managers
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// Obtains input data for Stand Alone ERV units and stores it in the Stand Alone ERV data structure
// METHODOLOGY EMPLOYED:
// Uses "Get" routines to read in data.
// Using/Aliasing
using BranchNodeConnections::SetUpCompSets;
using DataHeatBalance::Zone;
using DataSizing::AutoSize;
using DataZoneControls::HumidityControlZone;
using DataZoneControls::NumHumidityControlZones;
using DataZoneEquipment::ZoneEquipConfig;
using Fans::GetFanAvailSchPtr;
using Fans::GetFanDesignVolumeFlowRate;
using Fans::GetFanIndex;
using Fans::GetFanOutletNode;
using Fans::GetFanType;
using General::RoundSigDigits;
using MixedAir::OAController;
using NodeInputManager::GetOnlySingleNode;
auto &GetGenericSupplyAirFlowRate(HeatRecovery::GetSupplyAirFlowRate);
using HeatRecovery::GetHeatExchangerObjectTypeNum;
auto &GetHXSupplyInletNode(HeatRecovery::GetSupplyInletNode);
auto &GetHXSecondaryInletNode(HeatRecovery::GetSecondaryInletNode);
using CurveManager::GetCurveIndex;
using OutAirNodeManager::CheckOutAirNodeNumber;
using namespace DataIPShortCuts;
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int StandAloneERVIndex; // loop index
int StandAloneERVNum; // current Stand Alone ERV number
Array1D_string Alphas; // Alpha items for object
Array1D<Real64> Numbers; // Numeric items for object
Array1D_string cAlphaFields;
Array1D_string cNumericFields;
Array1D_bool lAlphaBlanks;
Array1D_bool lNumericBlanks;
std::string CompSetSupplyFanInlet;
std::string CompSetSupplyFanOutlet;
std::string CompSetExhaustFanInlet;
std::string CompSetExhaustFanOutlet;
std::string CurrentModuleObject; // Object type for getting and error messages
int SAFanTypeNum; // Integer equivalent to fan type
int EAFanTypeNum; // Integer equivalent to fan type
int NumArg;
int NumAlphas; // Number of Alphas for each GetObjectItem call
int NumNumbers; // Number of Numbers for each GetObjectItem call
int MaxAlphas; // Max between the two objects gotten here
int MaxNumbers; // Max between the two objects gotten here
int IOStatus; // Used in GetObjectItem
static bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine
int NumERVCtrlrs; // total number of CONTROLLER:STAND ALONE ERV objects
int ERVControllerNum; // index to ERV controller
int WhichERV; // used in controller GetInput
Real64 AirFlowRate; // used to find zone with humidistat
int NodeNumber; // used to find zone with humidistat
int HStatZoneNum; // used to find zone with humidistat
int NumHstatZone; // index to humidity controlled zones
static int ControlledZoneNum(0); // used to find zone with humidistat
static bool ZoneNodeFound(false); // used to find zone with humidistat
static bool HStatFound(false); // used to find zone with humidistat
bool errFlag; // Error flag used in mining calls
Real64 SAFanVolFlowRate; // supply air fan volumetric flow rate [m3/s]
Real64 EAFanVolFlowRate; // exhaust air fan volumetric flow rate [m3/s]
Real64 HXSupAirFlowRate; // HX supply air flow rate [m3/s]
Real64 HighRHOARatio; // local variable for HighRHOAFlowRatio
bool ZoneInletNodeFound; // used for warning when zone node not listed in equipment connections
bool ZoneExhaustNodeFound; // used for warning when zone node not listed in equipment connections
int ZoneInletCZN; // used for warning when zone node not listed in equipment connections
int ZoneExhaustCZN; // used for warning when zone node not listed in equipment connections
inputProcessor->getObjectDefMaxArgs("ZoneHVAC:EnergyRecoveryVentilator", NumArg, NumAlphas, NumNumbers);
MaxAlphas = NumAlphas;
MaxNumbers = NumNumbers;
inputProcessor->getObjectDefMaxArgs("ZoneHVAC:EnergyRecoveryVentilator:Controller", NumArg, NumAlphas, NumNumbers);
MaxAlphas = max(MaxAlphas, NumAlphas);
MaxNumbers = max(MaxNumbers, NumNumbers);
Alphas.allocate(MaxAlphas);
Numbers.dimension(MaxNumbers, 0.0);
cAlphaFields.allocate(MaxAlphas);
cNumericFields.allocate(MaxNumbers);
lNumericBlanks.dimension(MaxNumbers, false);
lAlphaBlanks.dimension(MaxAlphas, false);
GetERVInputFlag = false;
// find the number of each type of Stand Alone ERV unit
CurrentModuleObject = "ZoneHVAC:EnergyRecoveryVentilator";
NumStandAloneERVs = inputProcessor->getNumObjectsFound(CurrentModuleObject);
// allocate the data structures
StandAloneERV.allocate(NumStandAloneERVs);
HeatExchangerUniqueNames.reserve(static_cast<unsigned>(NumStandAloneERVs));
SupplyAirFanUniqueNames.reserve(static_cast<unsigned>(NumStandAloneERVs));
ExhaustAirFanUniqueNames.reserve(static_cast<unsigned>(NumStandAloneERVs));
ControllerUniqueNames.reserve(static_cast<unsigned>(NumStandAloneERVs));
CheckEquipName.dimension(NumStandAloneERVs, true);
// loop over Stand Alone ERV units; get and load the input data
for (StandAloneERVIndex = 1; StandAloneERVIndex <= NumStandAloneERVs; ++StandAloneERVIndex) {
inputProcessor->getObjectItem(CurrentModuleObject,
StandAloneERVIndex,
Alphas,
NumAlphas,
Numbers,
NumNumbers,
IOStatus,
lNumericBlanks,
lAlphaBlanks,
cAlphaFields,
cNumericFields);
StandAloneERVNum = StandAloneERVIndex; // separate variables in case other objects read by this module at some point later
UtilityRoutines::IsNameEmpty(Alphas(1), CurrentModuleObject, ErrorsFound);
StandAloneERV(StandAloneERVNum).Name = Alphas(1);
StandAloneERV(StandAloneERVNum).UnitType = CurrentModuleObject;
if (lAlphaBlanks(2)) {
StandAloneERV(StandAloneERVNum).SchedPtr = ScheduleAlwaysOn;
} else {
StandAloneERV(StandAloneERVNum).SchedPtr = GetScheduleIndex(Alphas(2)); // convert schedule name to pointer
if (StandAloneERV(StandAloneERVNum).SchedPtr == 0) {
ShowSevereError(CurrentModuleObject + ", \"" + StandAloneERV(StandAloneERVNum).Name + "\" " + cAlphaFields(2) +
" not found = " + Alphas(2));
ErrorsFound = true;
}
}
GlobalNames::IntraObjUniquenessCheck(Alphas(3), CurrentModuleObject, cAlphaFields(3), HeatExchangerUniqueNames, ErrorsFound);
StandAloneERV(StandAloneERVNum).HeatExchangerName = Alphas(3);
errFlag = false;
StandAloneERV(StandAloneERVNum).HeatExchangerTypeNum =
GetHeatExchangerObjectTypeNum(StandAloneERV(StandAloneERVNum).HeatExchangerName, errFlag);
if (errFlag) {
ShowContinueError("... occurs in " + CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ErrorsFound = true;
}
errFlag = false;
HXSupAirFlowRate = GetGenericSupplyAirFlowRate(StandAloneERV(StandAloneERVNum).HeatExchangerName, errFlag);
if (errFlag) {
ShowContinueError("... occurs in " + CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ErrorsFound = true;
}
StandAloneERV(StandAloneERVNum).DesignHXVolFlowRate = HXSupAirFlowRate;
StandAloneERV(StandAloneERVNum).SupplyAirFanName = Alphas(4);
GlobalNames::IntraObjUniquenessCheck(Alphas(4), CurrentModuleObject, cAlphaFields(4), SupplyAirFanUniqueNames, ErrorsFound);
errFlag = false;
if (HVACFan::checkIfFanNameIsAFanSystem(
StandAloneERV(StandAloneERVNum).SupplyAirFanName)) { // no object type in input, so check if Fan:SystemModel
StandAloneERV(StandAloneERVNum).SupplyAirFanType_Num = DataHVACGlobals::FanType_SystemModelObject;
HVACFan::fanObjs.emplace_back(new HVACFan::FanSystem(StandAloneERV(StandAloneERVNum).SupplyAirFanName)); // call constructor
StandAloneERV(StandAloneERVNum).SupplyAirFanIndex =
HVACFan::getFanObjectVectorIndex(StandAloneERV(StandAloneERVNum).SupplyAirFanName);
StandAloneERV(StandAloneERVNum).SupplyAirFanSchPtr =
HVACFan::fanObjs[StandAloneERV(StandAloneERVNum).SupplyAirFanIndex]->availSchedIndex;
StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate =
HVACFan::fanObjs[StandAloneERV(StandAloneERVNum).SupplyAirFanIndex]->designAirVolFlowRate;
StandAloneERV(StandAloneERVNum).SupplyAirOutletNode =
HVACFan::fanObjs[StandAloneERV(StandAloneERVNum).SupplyAirFanIndex]->outletNodeNum;
} else {
GetFanType(StandAloneERV(StandAloneERVNum).SupplyAirFanName,
SAFanTypeNum,
errFlag,
CurrentModuleObject,
StandAloneERV(StandAloneERVNum).Name);
if (errFlag) {
ErrorsFound = true;
}
StandAloneERV(StandAloneERVNum).SupplyAirFanType_Num = SAFanTypeNum;
errFlag = false;
StandAloneERV(StandAloneERVNum).SupplyAirFanSchPtr =
GetFanAvailSchPtr(cFanTypes(SAFanTypeNum), StandAloneERV(StandAloneERVNum).SupplyAirFanName, errFlag);
if (errFlag) {
ShowContinueError("... occurs in " + CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ErrorsFound = true;
}
GetFanIndex(StandAloneERV(StandAloneERVNum).SupplyAirFanName,
StandAloneERV(StandAloneERVNum).SupplyAirFanIndex,
errFlag,
CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
// Set the SA Design Fan Volume Flow Rate
// get from fan module
errFlag = false;
SAFanVolFlowRate = GetFanDesignVolumeFlowRate(cFanTypes(SAFanTypeNum), StandAloneERV(StandAloneERVNum).SupplyAirFanName, errFlag);
if (errFlag) {
ShowContinueError("... occurs in " + CurrentModuleObject + " =" + StandAloneERV(StandAloneERVNum).Name);
ErrorsFound = true;
}
StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate = SAFanVolFlowRate;
errFlag = false;
StandAloneERV(StandAloneERVNum).SupplyAirOutletNode =
GetFanOutletNode(cFanTypes(SAFanTypeNum), StandAloneERV(StandAloneERVNum).SupplyAirFanName, errFlag);
}
StandAloneERV(StandAloneERVNum).ExhaustAirFanName = Alphas(5);
GlobalNames::IntraObjUniquenessCheck(Alphas(5), CurrentModuleObject, cAlphaFields(5), ExhaustAirFanUniqueNames, ErrorsFound);
errFlag = false;
if (HVACFan::checkIfFanNameIsAFanSystem(
StandAloneERV(StandAloneERVNum).ExhaustAirFanName)) { // no object type in input, so check if Fan:SystemModel
StandAloneERV(StandAloneERVNum).ExhaustAirFanType_Num = DataHVACGlobals::FanType_SystemModelObject;
HVACFan::fanObjs.emplace_back(new HVACFan::FanSystem(StandAloneERV(StandAloneERVNum).ExhaustAirFanName)); // call constructor
StandAloneERV(StandAloneERVNum).ExhaustAirFanIndex =
HVACFan::getFanObjectVectorIndex(StandAloneERV(StandAloneERVNum).ExhaustAirFanName);
StandAloneERV(StandAloneERVNum).ExhaustAirFanSchPtr =
HVACFan::fanObjs[StandAloneERV(StandAloneERVNum).ExhaustAirFanIndex]->availSchedIndex;
StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate =
HVACFan::fanObjs[StandAloneERV(StandAloneERVNum).ExhaustAirFanIndex]->designAirVolFlowRate;
StandAloneERV(StandAloneERVNum).ExhaustAirOutletNode =
HVACFan::fanObjs[StandAloneERV(StandAloneERVNum).ExhaustAirFanIndex]->outletNodeNum;
} else {
GetFanType(StandAloneERV(StandAloneERVNum).ExhaustAirFanName,
EAFanTypeNum,
errFlag,
CurrentModuleObject,
StandAloneERV(StandAloneERVNum).Name);
if (!errFlag) {
StandAloneERV(StandAloneERVNum).ExhaustAirFanType_Num = EAFanTypeNum;
// error for fan availability schedule?
StandAloneERV(StandAloneERVNum).ExhaustAirFanSchPtr =
GetFanAvailSchPtr(cFanTypes(EAFanTypeNum), StandAloneERV(StandAloneERVNum).ExhaustAirFanName, errFlag);
GetFanIndex(StandAloneERV(StandAloneERVNum).ExhaustAirFanName,
StandAloneERV(StandAloneERVNum).ExhaustAirFanIndex,
errFlag,
CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
} else {
ErrorsFound = true;
}
// Set the EA Design Fan Volume Flow Rate
// get from fan module
errFlag = false;
EAFanVolFlowRate = GetFanDesignVolumeFlowRate(cFanTypes(EAFanTypeNum), StandAloneERV(StandAloneERVNum).ExhaustAirFanName, errFlag);
if (errFlag) {
ShowContinueError("... occurs in " + CurrentModuleObject + " =" + StandAloneERV(StandAloneERVNum).Name);
ErrorsFound = true;
}
StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate = EAFanVolFlowRate;
StandAloneERV(StandAloneERVNum).ExhaustAirOutletNode =
GetFanOutletNode(cFanTypes(EAFanTypeNum), StandAloneERV(StandAloneERVNum).ExhaustAirFanName, errFlag);
if (errFlag) {
ShowContinueError("... occurs in " + CurrentModuleObject + " =" + StandAloneERV(StandAloneERVNum).Name);
ErrorsFound = true;
}
}
errFlag = false;
StandAloneERV(StandAloneERVNum).SupplyAirInletNode = GetHXSupplyInletNode(StandAloneERV(StandAloneERVNum).HeatExchangerName, errFlag);
StandAloneERV(StandAloneERVNum).ExhaustAirInletNode = GetHXSecondaryInletNode(StandAloneERV(StandAloneERVNum).HeatExchangerName, errFlag);
if (errFlag) {
ShowContinueError("... occurs in " + CurrentModuleObject + " =" + StandAloneERV(StandAloneERVNum).Name);
ErrorsFound = true;
}
StandAloneERV(StandAloneERVNum).SupplyAirInletNode = GetOnlySingleNode(NodeID(StandAloneERV(StandAloneERVNum).SupplyAirInletNode),
ErrorsFound,
CurrentModuleObject,
Alphas(1),
NodeType_Air,
NodeConnectionType_Inlet,
1,
ObjectIsParent);
StandAloneERV(StandAloneERVNum).SupplyAirOutletNode = GetOnlySingleNode(NodeID(StandAloneERV(StandAloneERVNum).SupplyAirOutletNode),
ErrorsFound,
CurrentModuleObject,
Alphas(1),
NodeType_Air,
NodeConnectionType_Outlet,
1,
ObjectIsParent);
StandAloneERV(StandAloneERVNum).ExhaustAirInletNode = GetOnlySingleNode(NodeID(StandAloneERV(StandAloneERVNum).ExhaustAirInletNode),
ErrorsFound,
CurrentModuleObject,
Alphas(1),
NodeType_Air,
NodeConnectionType_Inlet,
2,
ObjectIsParent);
StandAloneERV(StandAloneERVNum).ExhaustAirOutletNode = GetOnlySingleNode(NodeID(StandAloneERV(StandAloneERVNum).ExhaustAirOutletNode),
ErrorsFound,
CurrentModuleObject,
Alphas(1),
NodeType_Air,
NodeConnectionType_ReliefAir,
2,
ObjectIsParent);
// Check that supply air inlet node is an OA node
if (!CheckOutAirNodeNumber(StandAloneERV(StandAloneERVNum).SupplyAirInletNode)) {
ShowSevereError("For " + CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError(" Node name of supply air inlet node not valid Outdoor Air Node = " +
NodeID(StandAloneERV(StandAloneERVNum).SupplyAirInletNode));
ShowContinueError("...does not appear in an OutdoorAir:NodeList or as an OutdoorAir:Node.");
ErrorsFound = true;
}
// Check to make sure inlet and exhaust nodes are listed in a ZoneHVAC:EquipmentConnections object
ZoneInletNodeFound = false;
ZoneExhaustNodeFound = false;
for (ControlledZoneNum = 1; ControlledZoneNum <= NumOfZones; ++ControlledZoneNum) {
if (!ZoneInletNodeFound) {
for (NodeNumber = 1; NodeNumber <= ZoneEquipConfig(ControlledZoneNum).NumInletNodes; ++NodeNumber) {
if (ZoneEquipConfig(ControlledZoneNum).InletNode(NodeNumber) == StandAloneERV(StandAloneERVNum).SupplyAirOutletNode) {
ZoneInletNodeFound = true;
ZoneInletCZN = ControlledZoneNum;
break; // found zone inlet node
}
}
}
if (!ZoneExhaustNodeFound) {
for (NodeNumber = 1; NodeNumber <= ZoneEquipConfig(ControlledZoneNum).NumExhaustNodes; ++NodeNumber) {
if (ZoneEquipConfig(ControlledZoneNum).ExhaustNode(NodeNumber) == StandAloneERV(StandAloneERVNum).ExhaustAirInletNode) {
ZoneExhaustNodeFound = true;
ZoneExhaustCZN = ControlledZoneNum;
break; // found zone exhaust node
}
}
}
}
if (!ZoneInletNodeFound) {
ShowSevereError("For " + CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... Node name of supply air outlet node does not appear in a ZoneHVAC:EquipmentConnections object.");
ShowContinueError("... Supply air outlet node = " + NodeID(StandAloneERV(StandAloneERVNum).SupplyAirOutletNode));
ErrorsFound = true;
}
if (!ZoneExhaustNodeFound) {
ShowSevereError("For " + CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... Node name of exhaust air inlet node does not appear in a ZoneHVAC:EquipmentConnections object.");
ShowContinueError("... Exhaust air inlet node = " + NodeID(StandAloneERV(StandAloneERVNum).ExhaustAirInletNode));
ErrorsFound = true;
}
// If nodes are found, make sure they are in the same zone
if (ZoneInletNodeFound && ZoneExhaustNodeFound) {
if (ZoneInletCZN != ZoneExhaustCZN) {
ShowSevereError("For " + CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... Node name of supply air outlet node and exhasut air inlet node must appear in the same "
"ZoneHVAC:EquipmentConnections object.");
ShowContinueError("... Supply air outlet node = " + NodeID(StandAloneERV(StandAloneERVNum).SupplyAirOutletNode));
ShowContinueError("... ZoneHVAC:EquipmentConnections Zone Name = " + ZoneEquipConfig(ZoneInletCZN).ZoneName);
ShowContinueError("... Exhaust air inlet node = " + NodeID(StandAloneERV(StandAloneERVNum).ExhaustAirInletNode));
ShowContinueError("... ZoneHVAC:EquipmentConnections Zone Name = " + ZoneEquipConfig(ZoneExhaustCZN).ZoneName);
ErrorsFound = true;
}
}
StandAloneERV(StandAloneERVNum).ControllerName = Alphas(6);
// If controller name is blank the ERV unit will operate with no controller
if (lAlphaBlanks(6)) {
StandAloneERV(StandAloneERVNum).ControllerName = "xxxxx";
StandAloneERV(StandAloneERVNum).ControllerNameDefined = false;
} else {
// Verify controller name in Stand Alone ERV object matches name of valid controller object
GlobalNames::IntraObjUniquenessCheck(Alphas(6), CurrentModuleObject, cAlphaFields(6), ControllerUniqueNames, ErrorsFound);
StandAloneERV(StandAloneERVNum).ControllerNameDefined = true;
if (ErrorsFound) {
StandAloneERV(StandAloneERVNum).ControllerNameDefined = false;
}
if (inputProcessor->getObjectItemNum("ZoneHVAC:EnergyRecoveryVentilator:Controller",
StandAloneERV(StandAloneERVNum).ControllerName) <= 0) {
ShowSevereError(CurrentModuleObject + " controller type ZoneHVAC:EnergyRecoveryVentilator:Controller not found = " + Alphas(6));
ErrorsFound = true;
StandAloneERV(StandAloneERVNum).ControllerNameDefined = false;
}
}
if (!lAlphaBlanks(7)) {
StandAloneERV(StandAloneERVNum).AvailManagerListName = Alphas(7);
}
// Read supply and exhaust air flow rates
StandAloneERV(StandAloneERVNum).SupplyAirVolFlow = Numbers(1);
StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow = Numbers(2);
// Read ventilation rate per floor area for autosizing HX and fans
StandAloneERV(StandAloneERVNum).AirVolFlowPerFloorArea = Numbers(3);
StandAloneERV(StandAloneERVNum).AirVolFlowPerOccupant = Numbers(4);
if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow == AutoSize && StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate != AutoSize) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... When autosizing ERV, supply air fan = " + cFanTypes(SAFanTypeNum) + " \"" +
StandAloneERV(StandAloneERVNum).SupplyAirFanName + "\" must also be autosized.");
}
if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow == AutoSize && StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate != AutoSize) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... When autosizing ERV, exhaust air fan = " + cFanTypes(EAFanTypeNum) + " \"" +
StandAloneERV(StandAloneERVNum).ExhaustAirFanName + "\" must also be autosized.");
}
if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow == AutoSize && HXSupAirFlowRate != AutoSize) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... When autosizing ERV " + cNumericFields(1) + ", nominal supply air flow rate for heat exchanger with name = " +
StandAloneERV(StandAloneERVNum).HeatExchangerName + " must also be autosized.");
}
if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow == AutoSize && HXSupAirFlowRate != AutoSize) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... When autosizing ERV " + cNumericFields(2) + ", nominal supply air flow rate for heat exchanger with name = " +
StandAloneERV(StandAloneERVNum).HeatExchangerName + " must also be autosized.");
}
// Compare the ERV SA flow rates to SA fan object.
if (StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate != AutoSize && StandAloneERV(StandAloneERVNum).SupplyAirVolFlow != AutoSize) {
if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow > StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate) {
ShowWarningError(CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has a " + cNumericFields(1) +
" > Max Volume Flow Rate defined in the associated fan object, should be <=");
ShowContinueError("... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).SupplyAirVolFlow, 2) + "... Fan [" +
cFanTypes(SAFanTypeNum) + " \"" + StandAloneERV(StandAloneERVNum).SupplyAirFanName +
"\"] Max Value = " + RoundSigDigits(StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate, 2));
ShowContinueError(" The ERV " + cNumericFields(1) + " is reset to the supply air fan flow rate and the simulation continues.");
StandAloneERV(StandAloneERVNum).SupplyAirVolFlow = StandAloneERV(StandAloneERVNum).DesignSAFanVolFlowRate;
}
}
if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow != AutoSize) {
if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow <= 0.0) {
ShowSevereError(CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has a " + cNumericFields(1) +
" <= 0.0, it must be >0.0");
ShowContinueError("... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).SupplyAirVolFlow, 2));
ErrorsFound = true;
}
} else {
if (StandAloneERV(StandAloneERVNum).AirVolFlowPerFloorArea == 0.0 && StandAloneERV(StandAloneERVNum).AirVolFlowPerOccupant == 0.0) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... Autosizing " + cNumericFields(1) + " requires at least one input for " + cNumericFields(3) + " or " +
cNumericFields(4) + '.');
ErrorsFound = true;
}
// both inputs must be autosized
if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow != AutoSize) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... When autosizing, " + cNumericFields(1) + " and " + cNumericFields(2) + " must both be autosized.");
ErrorsFound = true;
}
}
// Compare the ERV EA flow rates to EA fan object.
if (StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate != AutoSize && StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow != AutoSize) {
if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow > StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate) {
ShowWarningError(CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has an " + cNumericFields(2) +
" > Max Volume Flow Rate defined in the associated fan object, should be <=");
ShowContinueError("... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow, 2) + "... Fan [" +
cFanTypes(EAFanTypeNum) + ':' + StandAloneERV(StandAloneERVNum).ExhaustAirFanName +
"] Max Value = " + RoundSigDigits(StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate, 2));
ShowContinueError(" The ERV " + cNumericFields(2) + " is reset to the exhaust air fan flow rate and the simulation continues.");
StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow = StandAloneERV(StandAloneERVNum).DesignEAFanVolFlowRate;
}
}
if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow != AutoSize) {
if (StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow <= 0.0) {
ShowSevereError(CurrentModuleObject + " = " + StandAloneERV(StandAloneERVNum).Name + " has an " + cNumericFields(2) +
" <= 0.0, it must be >0.0");
ShowContinueError("... Entered value=" + RoundSigDigits(StandAloneERV(StandAloneERVNum).ExhaustAirVolFlow, 2));
ErrorsFound = true;
}
} else {
if (StandAloneERV(StandAloneERVNum).AirVolFlowPerFloorArea == 0.0 && StandAloneERV(StandAloneERVNum).AirVolFlowPerOccupant == 0.0) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... Autosizing " + cNumericFields(2) + " requires at least one input for " + cNumericFields(3) + " or " +
cNumericFields(4) + '.');
ErrorsFound = true;
}
if (StandAloneERV(StandAloneERVNum).SupplyAirVolFlow != AutoSize) {
ShowSevereError(CurrentModuleObject + " \"" + StandAloneERV(StandAloneERVNum).Name + "\"");
ShowContinueError("... When autosizing, " + cNumericFields(1) + " and " + cNumericFields(2) + " must both be autosized.");
ErrorsFound = true;
}
}
// Add supply fan to component sets array
CompSetSupplyFanInlet = "UNDEFINED";
CompSetSupplyFanOutlet = NodeID(StandAloneERV(StandAloneERVNum).SupplyAirOutletNode);
// Add exhaust fan to component sets array
CompSetExhaustFanInlet = "UNDEFINED";
CompSetExhaustFanOutlet = NodeID(StandAloneERV(StandAloneERVNum).ExhaustAirOutletNode);
// Add HX to component sets array
SetUpCompSets(StandAloneERV(StandAloneERVNum).UnitType,
StandAloneERV(StandAloneERVNum).Name,
"UNDEFINED",
StandAloneERV(StandAloneERVNum).HeatExchangerName,
"UNDEFINED",
"UNDEFINED");
// Add supply fan to component sets array
SetUpCompSets(StandAloneERV(StandAloneERVNum).UnitType,
StandAloneERV(StandAloneERVNum).Name,
"UNDEFINED",
StandAloneERV(StandAloneERVNum).SupplyAirFanName,
CompSetSupplyFanInlet,
CompSetSupplyFanOutlet);
// Add exhaust fan to component sets array
SetUpCompSets(StandAloneERV(StandAloneERVNum).UnitType,
StandAloneERV(StandAloneERVNum).Name,
"UNDEFINED",
StandAloneERV(StandAloneERVNum).ExhaustAirFanName,
CompSetExhaustFanInlet,
CompSetExhaustFanOutlet);
// Verify HX name in Stand Alone ERV object matches name of valid HX object
if (inputProcessor->getObjectItemNum("HeatExchanger:AirToAir:SensibleAndLatent", StandAloneERV(StandAloneERVNum).HeatExchangerName) <=
0) {
ShowSevereError(CurrentModuleObject + " heat exchanger type HeatExchanger:AirToAir:SensibleAndLatent not found = " +
StandAloneERV(StandAloneERVNum).HeatExchangerName);
ErrorsFound = true;
}
// Verify supply air fan name in Stand Alone ERV object matches name of valid fan object
if (StandAloneERV(StandAloneERVNum).SupplyAirFanType_Num != DataHVACGlobals::FanType_SystemModelObject) {
if (inputProcessor->getObjectItemNum("Fan:OnOff", StandAloneERV(StandAloneERVNum).SupplyAirFanName) <= 0) {
ShowSevereError(CurrentModuleObject +
" supply fan type Fan:OnOff not found = " + StandAloneERV(StandAloneERVNum).SupplyAirFanName);
ErrorsFound = true;
}
} else {
if (inputProcessor->getObjectItemNum("Fan:SystemModel", StandAloneERV(StandAloneERVNum).SupplyAirFanName) <= 0) {
ShowSevereError(CurrentModuleObject +
" supply fan type Fan:SystemModel not found = " + StandAloneERV(StandAloneERVNum).SupplyAirFanName);
ErrorsFound = true;
}
}
// Verify exhaust air fan name in Stand Alone ERV object matches name of valid fan object
if (StandAloneERV(StandAloneERVNum).ExhaustAirFanType_Num != DataHVACGlobals::FanType_SystemModelObject) {
if (inputProcessor->getObjectItemNum("Fan:OnOff", StandAloneERV(StandAloneERVNum).ExhaustAirFanName) <= 0) {
ShowSevereError(CurrentModuleObject +
" exhaust fan type Fan:OnOff not found = " + StandAloneERV(StandAloneERVNum).ExhaustAirFanName);
ErrorsFound = true;
}
} else {
if (inputProcessor->getObjectItemNum("Fan:SystemModel", StandAloneERV(StandAloneERVNum).ExhaustAirFanName) <= 0) {
ShowSevereError(CurrentModuleObject +
" exhaust fan type Fan:SystemModel not found = " + StandAloneERV(StandAloneERVNum).ExhaustAirFanName);
ErrorsFound = true;
}
}
}
int OutAirNum = 0;
CurrentModuleObject = "ZoneHVAC:EnergyRecoveryVentilator:Controller";
NumERVCtrlrs = inputProcessor->getNumObjectsFound(CurrentModuleObject);
for (ERVControllerNum = 1; ERVControllerNum <= NumERVCtrlrs; ++ERVControllerNum) {
inputProcessor->getObjectItem(CurrentModuleObject,
ERVControllerNum,
Alphas,
NumAlphas,
Numbers,
NumNumbers,
IOStatus,
lNumericBlanks,
lAlphaBlanks,
cAlphaFields,
cNumericFields);
MixedAir::CheckOAControllerName(Alphas(1), CurrentModuleObject, cAlphaFields(1), ErrorsFound);
++OutAirNum;
auto &thisOAController(OAController(OutAirNum));
thisOAController.Name = Alphas(1);
thisOAController.ControllerType = CurrentModuleObject;
thisOAController.ControllerType_Num = ControllerStandAloneERV;
WhichERV = UtilityRoutines::FindItemInList(Alphas(1), StandAloneERV, &StandAloneERVData::ControllerName);
if (WhichERV != 0) {
AirFlowRate = StandAloneERV(WhichERV).SupplyAirVolFlow;
StandAloneERV(WhichERV).ControllerIndex = OutAirNum;
} else {
ShowSevereError("GetERVController: Could not find ZoneHVAC:EnergyRecoveryVentilator with " + cAlphaFields(1) + " = \"" + Alphas(1) +
"\"");
ErrorsFound = true;
AirFlowRate = -1000.0;
}
thisOAController.MaxOA = AirFlowRate;
thisOAController.MinOA = AirFlowRate;
// OAController(OutAirNum)%TempLim = Numbers(1)
if (lNumericBlanks(1)) {
thisOAController.TempLim = BlankNumeric;
} else {
thisOAController.TempLim = Numbers(1);
}
// OAController(OutAirNum)%TempLowLim = Numbers(2)
if (lNumericBlanks(2)) {
thisOAController.TempLowLim = BlankNumeric;
} else {
thisOAController.TempLowLim = Numbers(2);
}
// OAController(OutAirNum)%EnthLim = Numbers(3)
if (lNumericBlanks(3)) {
thisOAController.EnthLim = BlankNumeric;
} else {
thisOAController.EnthLim = Numbers(3);
}
// OAController(OutAirNum)%DPTempLim = Numbers(4)
if (lNumericBlanks(4)) {
thisOAController.DPTempLim = BlankNumeric;
} else {
thisOAController.DPTempLim = Numbers(4);
}
if (WhichERV != 0) {
NodeNumber = StandAloneERV(WhichERV).SupplyAirInletNode;
} else {
NodeNumber = 0;
}
thisOAController.OANode = NodeNumber;
// set the inlet node to also equal the OA node because this is a special controller for economizing stand alone ERV
// with the assumption that equipment is bypassed....(moved from module MixedAir)
thisOAController.InletNode = NodeNumber;
if (WhichERV != 0) {
NodeNumber = StandAloneERV(WhichERV).ExhaustAirInletNode;
} else {
NodeNumber = 0;
}
thisOAController.RetNode = NodeNumber;
if (!lAlphaBlanks(2)) {
thisOAController.EnthalpyCurvePtr = GetCurveIndex(Alphas(2));
if (GetCurveIndex(Alphas(2)) == 0) {
ShowSevereError(CurrentModuleObject + " \"" + Alphas(1) + "\"");
ShowContinueError("..." + cAlphaFields(2) + " not found:" + Alphas(2));
ErrorsFound = true;
} else {
// Verify Curve Object, only legal types are Quadratic and Cubic
ErrorsFound |= CurveManager::CheckCurveDims(thisOAController.EnthalpyCurvePtr, // Curve index
{1}, // Valid dimensions
"GetStandAloneERV: ", // Routine name
CurrentModuleObject, // Object Type
thisOAController.Name, // Object Name
cAlphaFields(2)); // Field Name
}
}
// Changed by AMIT for new implementation of the controller:outside air
if (Alphas(3) == "EXHAUSTAIRTEMPERATURELIMIT" && Alphas(4) == "EXHAUSTAIRENTHALPYLIMIT") {
thisOAController.Econo = MixedAir::DifferentialDryBulbAndEnthalpy;
} else if (Alphas(3) == "EXHAUSTAIRTEMPERATURELIMIT" && Alphas(4) == "NOEXHAUSTAIRENTHALPYLIMIT") {
thisOAController.Econo = MixedAir::DifferentialDryBulb;
} else if (Alphas(3) == "NOEXHAUSTAIRTEMPERATURELIMIT" && Alphas(4) == "EXHAUSTAIRENTHALPYLIMIT") {
thisOAController.Econo = MixedAir::DifferentialEnthalpy;
} else if (Alphas(3) == "NOEXHAUSTAIRTEMPERATURELIMIT" && Alphas(4) == "NOEXHAUSTAIRENTHALPYLIMIT") {
if ((!lNumericBlanks(1)) || (!lNumericBlanks(3)) || (!lNumericBlanks(4)) || (!lAlphaBlanks(2))) {
// This means that any of the FIXED DRY BULB, FIXED ENTHALPY, FIXED DEW POINT AND DRY BULB OR
// ELECTRONIC ENTHALPY ECONOMIZER STRATEGY is present
thisOAController.Econo = MixedAir::FixedDryBulb;
}
} else if ((!lAlphaBlanks(3)) && (!lAlphaBlanks(4))) {
if ((lNumericBlanks(1)) && (lNumericBlanks(3)) && (lNumericBlanks(4)) && lAlphaBlanks(2)) {
ShowWarningError(CurrentModuleObject + " \"" + Alphas(1) + "\"");
ShowContinueError("... Invalid " + cAlphaFields(3) + cAlphaFields(4) + " = " + Alphas(3) + Alphas(4));
ShowContinueError("... Assumed NO EXHAUST AIR TEMP LIMIT and NO EXHAUST AIR ENTHALPY LIMIT.");
thisOAController.Econo = MixedAir::NoEconomizer;
} else {
// This means that any of the FIXED DRY BULB, FIXED ENTHALPY, FIXED DEW POINT AND DRY BULB OR
// ELECTRONIC ENTHALPY ECONOMIZER STRATEGY is present
thisOAController.Econo = MixedAir::FixedDryBulb;
}
} else if ((lAlphaBlanks(3)) && (!lAlphaBlanks(4))) {
if ((lNumericBlanks(1)) && (lNumericBlanks(3)) && (lNumericBlanks(4)) && lAlphaBlanks(2)) {
ShowWarningError(CurrentModuleObject + " \"" + Alphas(1) + "\"");
ShowContinueError("... Invalid " + cAlphaFields(4) + " = " + Alphas(4));
ShowContinueError("... Assumed NO EXHAUST AIR ENTHALPY LIMIT.");
thisOAController.Econo = MixedAir::NoEconomizer;
} else {
// This means that any of the FIXED DRY BULB, FIXED ENTHALPY, FIXED DEW POINT AND DRY BULB OR
// ELECTRONIC ENTHALPY ECONOMIZER STRATEGY is present
thisOAController.Econo = MixedAir::FixedDryBulb;
}
} else if ((!lAlphaBlanks(3)) && (lAlphaBlanks(4))) {
if ((lNumericBlanks(1)) && (lNumericBlanks(3)) && (lNumericBlanks(4)) && lAlphaBlanks(2)) {
ShowWarningError(CurrentModuleObject + " \"" + Alphas(1) + "\"");
ShowContinueError("... Invalid " + cAlphaFields(3) + " = " + Alphas(3));
ShowContinueError("... Assumed NO EXHAUST AIR TEMP LIMIT ");
thisOAController.Econo = MixedAir::NoEconomizer;
} else {
// This means that any of the FIXED DRY BULB, FIXED ENTHALPY, FIXED DEW POINT AND DRY BULB OR
// ELECTRONIC ENTHALPY ECONOMIZER STRATEGY is present
thisOAController.Econo = MixedAir::FixedDryBulb;
}
} else { // NO Economizer
thisOAController.Econo = MixedAir::NoEconomizer;
}
thisOAController.FixedMin = false;
thisOAController.EconBypass = true;
// Initialize to one in case high humidity control is NOT used
HighRHOARatio = 1.0;
// READ Modify Air Flow Data
// High humidity control option is YES, read in additional data
if (UtilityRoutines::SameString(Alphas(6), "Yes")) {
HStatZoneNum = UtilityRoutines::FindItemInList(Alphas(7), Zone);
thisOAController.HumidistatZoneNum = HStatZoneNum;
// Get the node number for the zone with the humidistat
if (HStatZoneNum > 0) {
ZoneNodeFound = false;
HStatFound = false;
for (ControlledZoneNum = 1; ControlledZoneNum <= NumOfZones; ++ControlledZoneNum) {
if (ZoneEquipConfig(ControlledZoneNum).ActualZoneNum != HStatZoneNum) continue;
// Find the controlled zone number for the specified humidistat location
thisOAController.NodeNumofHumidistatZone = ZoneEquipConfig(ControlledZoneNum).ZoneNode;
ZoneNodeFound = true;
break; // found zone node
}
if (!ZoneNodeFound) {
ShowSevereError(CurrentModuleObject + " \"" + Alphas(1) + "\"");
ShowContinueError("... Did not find Air Node (Zone with Humidistat)");
ShowContinueError("... Specified " + cAlphaFields(7) + " = " + Alphas(7));
ShowContinueError("... A ZoneHVAC:EquipmentConnections object must be specified for this zone.");
ErrorsFound = true;
} else {
for (NumHstatZone = 1; NumHstatZone <= NumHumidityControlZones; ++NumHstatZone) {
if (HumidityControlZone(NumHstatZone).ActualZoneNum != HStatZoneNum) continue;
HStatFound = true;
break;
}
if (!HStatFound) {
ShowSevereError(CurrentModuleObject + " \"" + Alphas(1) + "\"");
ShowContinueError("... Did not find zone humidistat");
ShowContinueError("... A ZoneControl:Humidistat object must be specified for this zone.");
ErrorsFound = true;
}
}
} else {
ShowSevereError(CurrentModuleObject + " \"" + Alphas(1) + "\"");
ShowContinueError("... Did not find Air Node (Zone with Humidistat)");
ShowContinueError("... A ZoneHVAC:EquipmentConnections object must be specified for this zone.");
ErrorsFound = true;
}
if (Numbers(5) <= 0.0 && NumNumbers > 4) {