-
Notifications
You must be signed in to change notification settings - Fork 378
/
Fans.cc
3424 lines (2833 loc) · 142 KB
/
Fans.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-2016, The Board of Trustees of the University of Illinois and
// 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). All rights
// reserved.
//
// If you have questions about your rights to use or distribute this software, please contact
// Berkeley Lab's Innovation & Partnerships Office at IPO@lbl.gov.
//
// 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 Lawrence Berkeley National Laboratory'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.
//
// You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the
// features, functionality or performance of the source code ("Enhancements") to anyone; however,
// if you choose to make your Enhancements available either publicly, or directly to Lawrence
// Berkeley National Laboratory, without imposing a separate written license agreement for such
// Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free
// perpetual license to install, use, modify, prepare derivative works, incorporate into other
// computer software, distribute, and sublicense such enhancements or derivative works thereof,
// in binary and source code form.
// C++ Headers
#include <cmath>
// ObjexxFCL Headers
#include <ObjexxFCL/Fmath.hh>
// EnergyPlus Headers
#include <Fans.hh>
#include <BranchNodeConnections.hh>
#include <CurveManager.hh>
#include <DataAirflowNetwork.hh>
#include <DataAirLoop.hh>
#include <DataContaminantBalance.hh>
#include <DataEnvironment.hh>
#include <DataLoopNode.hh>
#include <DataPrecisionGlobals.hh>
#include <DataSizing.hh>
#include <DataZoneEquipment.hh>
#include <EMSManager.hh>
#include <General.hh>
#include <GeneralRoutines.hh>
#include <InputProcessor.hh>
#include <NodeInputManager.hh>
#include <OutputProcessor.hh>
#include <OutputReportPredefined.hh>
#include <Psychrometrics.hh>
#include <ReportSizingManager.hh>
#include <ScheduleManager.hh>
#include <FaultsManager.hh>
#include <UtilityRoutines.hh>
namespace EnergyPlus {
namespace Fans {
// Module containing the fan simulation routines
// MODULE INFORMATION:
// AUTHOR Richard J. Liesen
// DATE WRITTEN April 1998
// MODIFIED Shirey, May 2001
// Griffith, May 2009, EMS changes
// Craig Wray 22Aug2010 Added Fan Component Model
// RE-ENGINEERED na
// PURPOSE OF THIS MODULE:
// To encapsulate the data and algorithms required to
// manage the Fan System Component
// REFERENCES: none
// OTHER NOTES: none
// USE STATEMENTS:
// Use statements for data only modules
// Using/Aliasing
using namespace DataPrecisionGlobals;
using namespace DataLoopNode;
using namespace DataGlobals;
using DataHVACGlobals::TurnFansOn; // cpw22Aug2010 Added FanType_ComponentModel
using DataHVACGlobals::TurnFansOff;
using DataHVACGlobals::Main;
using DataHVACGlobals::Cooling;
using DataHVACGlobals::Heating;
using DataHVACGlobals::Other;
using DataHVACGlobals::OnOffFanPartLoadFraction;
using DataHVACGlobals::SmallAirVolFlow;
using DataHVACGlobals::UnbalExhMassFlow;
using DataHVACGlobals::BalancedExhMassFlow;
using DataHVACGlobals::NightVentOn;
using DataHVACGlobals::cFanTypes;
using DataHVACGlobals::FanType_SimpleConstVolume;
using DataHVACGlobals::FanType_SimpleVAV;
using DataHVACGlobals::FanType_SimpleOnOff;
using DataHVACGlobals::FanType_ZoneExhaust;
using DataHVACGlobals::FanType_ComponentModel;
using DataHVACGlobals::MinFrac;
using DataHVACGlobals::FixedMin;
using DataGlobals::BeginEnvrnFlag;
using DataGlobals::WarmupFlag;
using DataGlobals::SysSizingCalc;
using DataGlobals::emsCallFromComponentGetInput;
using DataGlobals::DisplayExtraWarnings;
using EMSManager::ManageEMS;
using DataEnvironment::StdRhoAir;
using Psychrometrics::PsyRhoAirFnPbTdbW;
using Psychrometrics::PsyTdbFnHW;
using Psychrometrics::PsyCpAirFnWTdb;
using InputProcessor::SameString;
// Use statements for access to subroutines in other modules
using namespace ScheduleManager;
// Data
//MODULE PARAMETER DEFINITIONS
// parameters describing fan types are contained in DataHVACGlobals (see USE statement above)
int const ExhaustFanCoupledToAvailManagers( 150 );
int const ExhaustFanDecoupledFromAvailManagers( 151 );
static std::string const BlankString;
//na
// DERIVED TYPE DEFINITIONS
//MODULE VARIABLE DECLARATIONS:
int NumFans( 0 ); // The Number of Fans found in the Input
int NumNightVentPerf( 0 ); // number of FAN:NIGHT VENT PERFORMANCE objects found in the input
bool GetFanInputFlag( true ); // Flag set to make sure you get input once
bool LocalTurnFansOn( false ); // If True, overrides fan schedule and cycles ZoneHVAC component fans on
bool LocalTurnFansOff( false ); // If True, overrides fan schedule and LocalTurnFansOn and cycles ZoneHVAC component fans off
namespace {
// These were static variables within different functions. They were pulled out into the namespace
// to facilitate easier unit testing of those functions.
// These are purposefully not in the header file as an extern variable. No one outside of this module should
// use these. They are cleared by clear_state() for use by unit tests, but normal simulations should be unaffected.
// This is purposefully in an anonymous namespace so nothing outside this implementation file can use it.
bool MyOneTimeFlag( true ); // used for allocation in Init
bool ZoneEquipmentListChecked( false ); // True after the Zone Equipment List has been checked for items
Array1D_bool MySizeFlag;
Array1D_bool MyEnvrnFlag;
Array1D_bool CheckEquipName;
}
// Subroutine Specifications for the Module
// Driver/Manager Routines
// Get Input routines for module
// Initialization routines for module
// Algorithms for the module
// Update routine to check convergence and update nodes
// Reporting routines for module
// Utility routines for module
// Object Data
Array1D< FanEquipConditions > Fan;
Array1D< NightVentPerfData > NightVentPerf;
Array1D< FanNumericFieldData > FanNumericFields;
// MODULE SUBROUTINES:
//*************************************************************************
void
SimulateFanComponents(
std::string const & CompName,
bool const FirstHVACIteration,
int & CompIndex,
Optional< Real64 const > SpeedRatio,
Optional_bool_const ZoneCompTurnFansOn, // Turn fans ON signal from ZoneHVAC component
Optional_bool_const ZoneCompTurnFansOff, // Turn Fans OFF signal from ZoneHVAC component
Optional< Real64 const > PressureRise // Pressure difference to use for DeltaPress
)
{
// SUBROUTINE INFORMATION:
// AUTHOR Richard Liesen
// DATE WRITTEN February 1998
// MODIFIED Chandan Sharma, March 2011 - FSEC: Added logic for ZoneHVAC sys avail managers
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// This subroutine manages Fan component simulation.
// METHODOLOGY EMPLOYED:
// na
// REFERENCES:
// na
// Using/Aliasing
using InputProcessor::FindItemInList;
using General::TrimSigDigits;
// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
// SUBROUTINE PARAMETER DEFINITIONS:
// na
// INTERFACE BLOCK SPECIFICATIONS
// DERIVED TYPE DEFINITIONS
// na
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int FanNum; // current fan number
// FLOW:
// Obtains and Allocates fan related parameters from input file
if ( GetFanInputFlag ) { //First time subroutine has been entered
GetFanInput();
GetFanInputFlag = false;
}
if ( CompIndex == 0 ) {
FanNum = FindItemInList( CompName, Fan, &FanEquipConditions::FanName );
if ( FanNum == 0 ) {
ShowFatalError( "SimulateFanComponents: Fan not found=" + CompName );
}
CompIndex = FanNum;
} else {
FanNum = CompIndex;
if ( FanNum > NumFans || FanNum < 1 ) {
ShowFatalError( "SimulateFanComponents: Invalid CompIndex passed=" + TrimSigDigits( FanNum ) + ", Number of Fans=" + TrimSigDigits( NumFans ) + ", Fan name=" + CompName );
}
if ( CheckEquipName( FanNum ) ) {
if ( ! CompName.empty() && CompName != Fan( FanNum ).FanName ) {
ShowFatalError( "SimulateFanComponents: Invalid CompIndex passed=" + TrimSigDigits( FanNum ) + ", Fan name=" + CompName + ", stored Fan Name for that index=" + Fan( FanNum ).FanName );
}
CheckEquipName( FanNum ) = false;
}
}
LocalTurnFansOn = false;
LocalTurnFansOff = false;
// With the correct FanNum Initialize
InitFan( FanNum, FirstHVACIteration ); // Initialize all fan related parameters
if ( present( ZoneCompTurnFansOn ) && present( ZoneCompTurnFansOff ) ) {
// Set module-level logic flags equal to ZoneCompTurnFansOn and ZoneCompTurnFansOff values passed into this routine
// for ZoneHVAC components with system availability managers defined.
// The module-level flags get used in the other subroutines (e.g., SimSimpleFan,SimVariableVolumeFan and SimOnOffFan)
LocalTurnFansOn = ZoneCompTurnFansOn;
LocalTurnFansOff = ZoneCompTurnFansOff;
} else {
// Set module-level logic flags equal to the global LocalTurnFansOn and LocalTurnFansOff variables for all other cases.
LocalTurnFansOn = TurnFansOn;
LocalTurnFansOff = TurnFansOff;
}
// Calculate the Correct Fan Model with the current FanNum
if ( Fan( FanNum ).FanType_Num == FanType_SimpleConstVolume ) {
SimSimpleFan( FanNum );
} else if ( Fan( FanNum ).FanType_Num == FanType_SimpleVAV ) {
if ( present( PressureRise ) ) {
SimVariableVolumeFan( FanNum, PressureRise );
} else {
SimVariableVolumeFan( FanNum );
}
} else if ( Fan( FanNum ).FanType_Num == FanType_SimpleOnOff ) {
SimOnOffFan( FanNum, SpeedRatio );
} else if ( Fan( FanNum ).FanType_Num == FanType_ZoneExhaust ) {
SimZoneExhaustFan( FanNum );
// cpw22Aug2010 Add call for Component Model fan
} else if ( Fan( FanNum ).FanType_Num == FanType_ComponentModel ) {
SimComponentModelFan( FanNum );
}
// Update the current fan to the outlet nodes
UpdateFan( FanNum );
// Report the current fan
ReportFan( FanNum );
}
// Get Input Section of the Module
//******************************************************************************
void
GetFanInput()
{
// SUBROUTINE INFORMATION:
// AUTHOR Richard Liesen
// DATE WRITTEN April 1998
// MODIFIED Shirey, May 2001
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// Obtains input data for fans and stores it in fan data structures
// METHODOLOGY EMPLOYED:
// Uses "Get" routines to read in data.
// REFERENCES:
// na
// Using/Aliasing
using namespace InputProcessor;
using NodeInputManager::GetOnlySingleNode;
using CurveManager::GetCurveIndex;
using BranchNodeConnections::TestCompSet;
// USE DataIPShortCuts
using DataGlobals::AnyEnergyManagementSystemInModel;
using DataGlobals::ScheduleAlwaysOn;
// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
// na
// SUBROUTINE PARAMETER DEFINITIONS:
// na
// INTERFACE BLOCK SPECIFICATIONS
// na
// DERIVED TYPE DEFINITIONS
// na
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int FanNum; // The fan that you are currently loading input into
int NumSimpFan; // The number of Simple Const Vol Fans
int NumVarVolFan; // The number of Simple Variable Vol Fans
int NumOnOff; // The number of Simple on-off Fans
int NumZoneExhFan;
int SimpFanNum;
int OnOffFanNum;
int VarVolFanNum;
int ExhFanNum;
int NVPerfNum;
bool NVPerfFanFound;
int NumCompModelFan; // cpw22Aug2010 The number of Component Model Fans
int CompModelFanNum; // cpw22Aug2010 Component Model Fan index
int NumAlphas;
int NumNums;
int checkNum;
int IOStat;
static bool ErrorsFound( false ); // If errors detected in input
bool IsNotOK; // Flag to verify name
bool IsBlank; // Flag for blank name
static std::string const RoutineName( "GetFanInput: " ); // include trailing blank space
Array1D_string cAlphaFieldNames;
Array1D_string cNumericFieldNames;
Array1D_bool lNumericFieldBlanks;
Array1D_bool lAlphaFieldBlanks;
Array1D_string cAlphaArgs;
Array1D< Real64 > rNumericArgs;
std::string cCurrentModuleObject;
int NumParams;
int MaxAlphas;
int MaxNumbers;
// Flow
MaxAlphas = 0;
MaxNumbers = 0;
NumSimpFan = GetNumObjectsFound( "Fan:ConstantVolume" );
if ( NumSimpFan > 0 ) {
GetObjectDefMaxArgs( "Fan:ConstantVolume", NumParams, NumAlphas, NumNums );
MaxAlphas = max( MaxAlphas, NumAlphas );
MaxNumbers = max( MaxNumbers, NumNums );
}
NumVarVolFan = GetNumObjectsFound( "Fan:VariableVolume" );
if ( NumVarVolFan > 0 ) {
GetObjectDefMaxArgs( "Fan:VariableVolume", NumParams, NumAlphas, NumNums );
MaxAlphas = max( MaxAlphas, NumAlphas );
MaxNumbers = max( MaxNumbers, NumNums );
}
NumOnOff = GetNumObjectsFound( "Fan:OnOff" );
if ( NumOnOff > 0 ) {
GetObjectDefMaxArgs( "Fan:OnOff", NumParams, NumAlphas, NumNums );
MaxAlphas = max( MaxAlphas, NumAlphas );
MaxNumbers = max( MaxNumbers, NumNums );
}
NumZoneExhFan = GetNumObjectsFound( "Fan:ZoneExhaust" );
if ( NumZoneExhFan > 0 ) {
GetObjectDefMaxArgs( "Fan:ZoneExhaust", NumParams, NumAlphas, NumNums );
MaxAlphas = max( MaxAlphas, NumAlphas );
MaxNumbers = max( MaxNumbers, NumNums );
}
NumNightVentPerf = GetNumObjectsFound( "FanPerformance:NightVentilation" );
if ( NumNightVentPerf > 0 ) {
GetObjectDefMaxArgs( "FanPerformance:NightVentilation", NumParams, NumAlphas, NumNums );
MaxAlphas = max( MaxAlphas, NumAlphas );
MaxNumbers = max( MaxNumbers, NumNums );
}
// cpw22Aug2010 Added get max alphas and numbers for ComponentModel fan
NumCompModelFan = GetNumObjectsFound( "Fan:ComponentModel" );
if ( NumCompModelFan > 0 ) {
GetObjectDefMaxArgs( "Fan:ComponentModel", NumParams, NumAlphas, NumNums );
MaxAlphas = max( MaxAlphas, NumAlphas );
MaxNumbers = max( MaxNumbers, NumNums );
}
cAlphaArgs.allocate( MaxAlphas );
cAlphaFieldNames.allocate( MaxAlphas );
lAlphaFieldBlanks.dimension( MaxAlphas, false );
cNumericFieldNames.allocate( MaxNumbers );
lNumericFieldBlanks.dimension( MaxNumbers, false );
rNumericArgs.dimension( MaxNumbers, 0.0 );
NumFans = NumSimpFan + NumVarVolFan + NumZoneExhFan + NumOnOff + NumCompModelFan; // cpw1Mar2010 Add NumCompModelFan
if ( NumFans > 0 ) {
Fan.allocate( NumFans );
FanNumericFields.allocate( NumFans );
}
CheckEquipName.dimension( NumFans, true );
for ( SimpFanNum = 1; SimpFanNum <= NumSimpFan; ++SimpFanNum ) {
FanNum = SimpFanNum;
cCurrentModuleObject = "Fan:ConstantVolume";
GetObjectItem( cCurrentModuleObject, SimpFanNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat, lNumericFieldBlanks, lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames );
FanNumericFields( FanNum ).FieldNames.allocate( MaxNumbers );
FanNumericFields( FanNum ).FieldNames = "";
FanNumericFields( FanNum ).FieldNames = cNumericFieldNames;
IsNotOK = false;
IsBlank = false;
VerifyName( cAlphaArgs( 1 ), Fan, &FanEquipConditions::FanName, FanNum - 1, IsNotOK, IsBlank, cCurrentModuleObject + " Name" );
if ( IsNotOK ) {
ErrorsFound = true;
if ( IsBlank ) cAlphaArgs( 1 ) = "xxxxx";
}
Fan( FanNum ).FanName = cAlphaArgs( 1 );
Fan( FanNum ).FanType = cCurrentModuleObject;
Fan( FanNum ).AvailSchedName = cAlphaArgs( 2 );
if ( lAlphaFieldBlanks( 2 ) ) {
Fan( FanNum ).AvailSchedPtrNum = ScheduleAlwaysOn;
} else {
Fan( FanNum ).AvailSchedPtrNum = GetScheduleIndex( cAlphaArgs( 2 ) );
if ( Fan( FanNum ).AvailSchedPtrNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 2 ) + " entered =" + cAlphaArgs( 2 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
}
}
Fan( FanNum ).FanType_Num = FanType_SimpleConstVolume;
Fan( FanNum ).FanEff = rNumericArgs( 1 );
Fan( FanNum ).DeltaPress = rNumericArgs( 2 );
Fan( FanNum ).MaxAirFlowRate = rNumericArgs( 3 );
if ( Fan( FanNum ).MaxAirFlowRate == 0.0 ) {
ShowWarningError( cCurrentModuleObject + "=\"" + Fan( FanNum ).FanName + "\" has specified 0.0 max air flow rate. It will not be used in the simulation." );
}
Fan( FanNum ).MaxAirFlowRateIsAutosizable = true;
Fan( FanNum ).MotEff = rNumericArgs( 4 );
Fan( FanNum ).MotInAirFrac = rNumericArgs( 5 );
Fan( FanNum ).MinAirFlowRate = 0.0;
Fan( FanNum ).InletNodeNum = GetOnlySingleNode( cAlphaArgs( 3 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent );
Fan( FanNum ).OutletNodeNum = GetOnlySingleNode( cAlphaArgs( 4 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent );
if ( NumAlphas > 4 ) {
Fan( FanNum ).EndUseSubcategoryName = cAlphaArgs( 5 );
} else {
Fan( FanNum ).EndUseSubcategoryName = "General";
}
TestCompSet( cCurrentModuleObject, cAlphaArgs( 1 ), cAlphaArgs( 3 ), cAlphaArgs( 4 ), "Air Nodes" );
} // end Number of Simple FAN Loop
for ( VarVolFanNum = 1; VarVolFanNum <= NumVarVolFan; ++VarVolFanNum ) {
FanNum = NumSimpFan + VarVolFanNum;
cCurrentModuleObject = "Fan:VariableVolume";
GetObjectItem( cCurrentModuleObject, VarVolFanNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat, lNumericFieldBlanks, lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames );
FanNumericFields( FanNum ).FieldNames.allocate( MaxNumbers );
FanNumericFields( FanNum ).FieldNames = "";
FanNumericFields( FanNum ).FieldNames = cNumericFieldNames;
IsNotOK = false;
IsBlank = false;
VerifyName( cAlphaArgs( 1 ), Fan, &FanEquipConditions::FanName, FanNum - 1, IsNotOK, IsBlank, cCurrentModuleObject + " Name" );
if ( IsNotOK ) {
ErrorsFound = true;
if ( IsBlank ) cAlphaArgs( 1 ) = "xxxxx";
}
Fan( FanNum ).FanName = cAlphaArgs( 1 );
Fan( FanNum ).FanType = cCurrentModuleObject;
Fan( FanNum ).AvailSchedName = cAlphaArgs( 2 );
if ( lAlphaFieldBlanks( 2 ) ) {
Fan( FanNum ).AvailSchedPtrNum = ScheduleAlwaysOn;
} else {
Fan( FanNum ).AvailSchedPtrNum = GetScheduleIndex( cAlphaArgs( 2 ) );
if ( Fan( FanNum ).AvailSchedPtrNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 2 ) + " entered =" + cAlphaArgs( 2 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
}
}
Fan( FanNum ).FanType_Num = FanType_SimpleVAV;
Fan( FanNum ).FanEff = rNumericArgs( 1 );
Fan( FanNum ).DeltaPress = rNumericArgs( 2 );
Fan( FanNum ).MaxAirFlowRate = rNumericArgs( 3 );
if ( Fan( FanNum ).MaxAirFlowRate == 0.0 ) {
ShowWarningError( cCurrentModuleObject + "=\"" + Fan( FanNum ).FanName + "\" has specified 0.0 max air flow rate. It will not be used in the simulation." );
}
Fan( FanNum ).MaxAirFlowRateIsAutosizable = true;
if ( SameString( cAlphaArgs( 3 ), "Fraction" ) ) {
Fan( FanNum ).FanMinAirFracMethod = MinFrac;
} else if ( SameString( cAlphaArgs( 3 ), "FixedFlowRate" ) ) {
Fan( FanNum ).FanMinAirFracMethod = FixedMin;
} else {
ShowSevereError( cAlphaFieldNames( 3 ) + " should be either Fraction or FixedFlowRate." );
ShowContinueError( "Occurs in " + Fan( FanNum ).FanName + " object." );
ErrorsFound = true;
}
// Fan(FanNum)%MinAirFlowRate= rNumericArgs(4)
Fan( FanNum ).FanMinFrac = rNumericArgs( 4 );
Fan( FanNum ).FanFixedMin = rNumericArgs( 5 );
Fan( FanNum ).MotEff = rNumericArgs( 6 );
Fan( FanNum ).MotInAirFrac = rNumericArgs( 7 );
Fan( FanNum ).FanCoeff( 1 ) = rNumericArgs( 8 );
Fan( FanNum ).FanCoeff( 2 ) = rNumericArgs( 9 );
Fan( FanNum ).FanCoeff( 3 ) = rNumericArgs( 10 );
Fan( FanNum ).FanCoeff( 4 ) = rNumericArgs( 11 );
Fan( FanNum ).FanCoeff( 5 ) = rNumericArgs( 12 );
if ( Fan( FanNum ).FanCoeff( 1 ) == 0.0 && Fan( FanNum ).FanCoeff( 2 ) == 0.0 && Fan( FanNum ).FanCoeff( 3 ) == 0.0 && Fan( FanNum ).FanCoeff( 4 ) == 0.0 && Fan( FanNum ).FanCoeff( 5 ) == 0.0 ) {
ShowWarningError( "Fan Coefficients are all zero. No Fan power will be reported." );
ShowContinueError( "For " + cCurrentModuleObject + ", Fan=" + cAlphaArgs( 1 ) );
}
Fan( FanNum ).InletNodeNum = GetOnlySingleNode( cAlphaArgs( 4 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent );
Fan( FanNum ).OutletNodeNum = GetOnlySingleNode( cAlphaArgs( 5 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent );
if ( NumAlphas > 5 ) {
Fan( FanNum ).EndUseSubcategoryName = cAlphaArgs( 6 );
} else {
Fan( FanNum ).EndUseSubcategoryName = "General";
}
TestCompSet( cCurrentModuleObject, cAlphaArgs( 1 ), cAlphaArgs( 4 ), cAlphaArgs( 5 ), "Air Nodes" );
} // end Number of Variable Volume FAN Loop
for ( ExhFanNum = 1; ExhFanNum <= NumZoneExhFan; ++ExhFanNum ) {
FanNum = NumSimpFan + NumVarVolFan + ExhFanNum;
cCurrentModuleObject = "Fan:ZoneExhaust";
GetObjectItem( cCurrentModuleObject, ExhFanNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat, lNumericFieldBlanks, lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames );
FanNumericFields( FanNum ).FieldNames.allocate( MaxNumbers );
FanNumericFields( FanNum ).FieldNames = "";
FanNumericFields( FanNum ).FieldNames = cNumericFieldNames;
IsNotOK = false;
IsBlank = false;
VerifyName( cAlphaArgs( 1 ), Fan, &FanEquipConditions::FanName, FanNum - 1, IsNotOK, IsBlank, cCurrentModuleObject + " Name" );
if ( IsNotOK ) {
ErrorsFound = true;
if ( IsBlank ) cAlphaArgs( 1 ) = "xxxxx";
}
Fan( FanNum ).FanName = cAlphaArgs( 1 );
Fan( FanNum ).FanType = cCurrentModuleObject;
Fan( FanNum ).AvailSchedName = cAlphaArgs( 2 );
if ( lAlphaFieldBlanks( 2 ) ) {
Fan( FanNum ).AvailSchedPtrNum = ScheduleAlwaysOn;
} else {
Fan( FanNum ).AvailSchedPtrNum = GetScheduleIndex( cAlphaArgs( 2 ) );
if ( Fan( FanNum ).AvailSchedPtrNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 2 ) + " entered =" + cAlphaArgs( 2 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
} else {
if ( HasFractionalScheduleValue( Fan( FanNum ).AvailSchedPtrNum ) ) {
ShowWarningError( cCurrentModuleObject + "=\"" + Fan( FanNum ).FanName + "\" has fractional values in Schedule=" + cAlphaArgs( 2 ) + ". Only 0.0 in the schedule value turns the fan off." );
}
}
}
Fan( FanNum ).FanType_Num = FanType_ZoneExhaust;
Fan( FanNum ).FanEff = rNumericArgs( 1 );
Fan( FanNum ).DeltaPress = rNumericArgs( 2 );
Fan( FanNum ).MaxAirFlowRate = rNumericArgs( 3 );
Fan( FanNum ).MaxAirFlowRateIsAutosizable = false;
Fan( FanNum ).MotEff = 1.0;
Fan( FanNum ).MotInAirFrac = 1.0;
Fan( FanNum ).MinAirFlowRate = 0.0;
Fan( FanNum ).RhoAirStdInit = StdRhoAir;
Fan( FanNum ).MaxAirMassFlowRate = Fan( FanNum ).MaxAirFlowRate * Fan( FanNum ).RhoAirStdInit;
if ( Fan( FanNum ).MaxAirFlowRate == 0.0 ) {
ShowWarningError( cCurrentModuleObject + "=\"" + Fan( FanNum ).FanName + "\" has specified 0.0 max air flow rate. It will not be used in the simulation." );
}
Fan( FanNum ).InletNodeNum = GetOnlySingleNode( cAlphaArgs( 3 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent );
Fan( FanNum ).OutletNodeNum = GetOnlySingleNode( cAlphaArgs( 4 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent );
if ( NumAlphas > 4 && ! lAlphaFieldBlanks( 5 ) ) {
Fan( FanNum ).EndUseSubcategoryName = cAlphaArgs( 5 );
} else {
Fan( FanNum ).EndUseSubcategoryName = "General";
}
if ( NumAlphas > 5 && ! lAlphaFieldBlanks( 6 ) ) {
Fan( FanNum ).FlowFractSchedNum = GetScheduleIndex( cAlphaArgs( 6 ) );
if ( Fan( FanNum ).FlowFractSchedNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 6 ) + " entered =" + cAlphaArgs( 6 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
} else if ( Fan( FanNum ).FlowFractSchedNum > 0 ) {
if ( ! CheckScheduleValueMinMax( Fan( FanNum ).FlowFractSchedNum, ">=", 0.0, "<=", 1.0 ) ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 6 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ShowContinueError( "Error found in " + cAlphaFieldNames( 6 ) + " = " + cAlphaArgs( 6 ) );
ShowContinueError( "Schedule values must be (>=0., <=1.)" );
ErrorsFound = true;
}
}
} else {
Fan( FanNum ).FlowFractSchedNum = ScheduleAlwaysOn;
}
if ( NumAlphas > 6 && ! lAlphaFieldBlanks( 7 ) ) {
{ auto const SELECT_CASE_var( cAlphaArgs( 7 ) );
if ( SELECT_CASE_var == "COUPLED" ) {
Fan( FanNum ).AvailManagerMode = ExhaustFanCoupledToAvailManagers;
} else if ( SELECT_CASE_var == "DECOUPLED" ) {
Fan( FanNum ).AvailManagerMode = ExhaustFanDecoupledFromAvailManagers;
} else {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 7 ) + " entered =" + cAlphaArgs( 7 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
}}
} else {
Fan( FanNum ).AvailManagerMode = ExhaustFanCoupledToAvailManagers;
}
if ( NumAlphas > 7 && ! lAlphaFieldBlanks( 8 ) ) {
Fan( FanNum ).MinTempLimitSchedNum = GetScheduleIndex( cAlphaArgs( 8 ) );
if ( Fan( FanNum ).MinTempLimitSchedNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 8 ) + " entered =" + cAlphaArgs( 8 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
}
} else {
Fan( FanNum ).MinTempLimitSchedNum = 0;
}
if ( NumAlphas > 8 && ! lAlphaFieldBlanks( 9 ) ) {
Fan( FanNum ).BalancedFractSchedNum = GetScheduleIndex( cAlphaArgs( 9 ) );
if ( Fan( FanNum ).BalancedFractSchedNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 9 ) + " entered =" + cAlphaArgs( 9 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
} else if ( Fan( FanNum ).BalancedFractSchedNum > 0 ) {
if ( ! CheckScheduleValueMinMax( Fan( FanNum ).BalancedFractSchedNum, ">=", 0.0, "<=", 1.0 ) ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 9 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ShowContinueError( "Error found in " + cAlphaFieldNames( 9 ) + " = " + cAlphaArgs( 9 ) );
ShowContinueError( "Schedule values must be (>=0., <=1.)" );
ErrorsFound = true;
}
}
} else {
Fan( FanNum ).BalancedFractSchedNum = 0;
}
// Component sets not setup yet for zone equipment
// CALL TestCompSet(TRIM(cCurrentModuleObject),cAlphaArgs(1),cAlphaArgs(3),cAlphaArgs(4),'Air Nodes')
} // end of Zone Exhaust Fan loop
for ( OnOffFanNum = 1; OnOffFanNum <= NumOnOff; ++OnOffFanNum ) {
FanNum = NumSimpFan + NumVarVolFan + NumZoneExhFan + OnOffFanNum;
cCurrentModuleObject = "Fan:OnOff";
GetObjectItem( cCurrentModuleObject, OnOffFanNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat, lNumericFieldBlanks, lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames );
FanNumericFields( FanNum ).FieldNames.allocate( MaxNumbers );
FanNumericFields( FanNum ).FieldNames = "";
FanNumericFields( FanNum ).FieldNames = cNumericFieldNames;
IsNotOK = false;
IsBlank = false;
VerifyName( cAlphaArgs( 1 ), Fan, &FanEquipConditions::FanName, FanNum - 1, IsNotOK, IsBlank, cCurrentModuleObject + " Name" );
if ( IsNotOK ) {
ErrorsFound = true;
if ( IsBlank ) cAlphaArgs( 1 ) = "xxxxx";
}
Fan( FanNum ).FanName = cAlphaArgs( 1 );
Fan( FanNum ).FanType = cCurrentModuleObject;
Fan( FanNum ).AvailSchedName = cAlphaArgs( 2 );
if ( lAlphaFieldBlanks( 2 ) ) {
Fan( FanNum ).AvailSchedPtrNum = ScheduleAlwaysOn;
} else {
Fan( FanNum ).AvailSchedPtrNum = GetScheduleIndex( cAlphaArgs( 2 ) );
if ( Fan( FanNum ).AvailSchedPtrNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 2 ) + " entered =" + cAlphaArgs( 2 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
}
}
Fan( FanNum ).FanType_Num = FanType_SimpleOnOff;
Fan( FanNum ).FanEff = rNumericArgs( 1 );
Fan( FanNum ).DeltaPress = rNumericArgs( 2 );
Fan( FanNum ).MaxAirFlowRate = rNumericArgs( 3 );
if ( Fan( FanNum ).MaxAirFlowRate == 0.0 ) {
ShowWarningError( cCurrentModuleObject + "=\"" + Fan( FanNum ).FanName + "\" has specified 0.0 max air flow rate. It will not be used in the simulation." );
}
Fan( FanNum ).MaxAirFlowRateIsAutosizable = true;
// the following two structure variables are set here, as well as in InitFan, for the Heat Pump:Water Heater object
// (Standard Rating procedure may be called before BeginEnvirFlag is set to TRUE, if so MaxAirMassFlowRate = 0)
Fan( FanNum ).RhoAirStdInit = StdRhoAir;
Fan( FanNum ).MaxAirMassFlowRate = Fan( FanNum ).MaxAirFlowRate * Fan( FanNum ).RhoAirStdInit;
Fan( FanNum ).MotEff = rNumericArgs( 4 );
Fan( FanNum ).MotInAirFrac = rNumericArgs( 5 );
Fan( FanNum ).MinAirFlowRate = 0.0;
Fan( FanNum ).InletNodeNum = GetOnlySingleNode( cAlphaArgs( 3 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent );
Fan( FanNum ).OutletNodeNum = GetOnlySingleNode( cAlphaArgs( 4 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent );
if ( NumAlphas > 4 && ! lAlphaFieldBlanks( 5 ) ) {
Fan( FanNum ).FanPowerRatAtSpeedRatCurveIndex = GetCurveIndex( cAlphaArgs( 5 ) );
}
if ( NumAlphas > 5 && ! lAlphaFieldBlanks( 6 ) ) {
Fan( FanNum ).FanEffRatioCurveIndex = GetCurveIndex( cAlphaArgs( 6 ) );
}
if ( NumAlphas > 6 && ! lAlphaFieldBlanks( 7 ) ) {
Fan( FanNum ).EndUseSubcategoryName = cAlphaArgs( 7 );
} else {
Fan( FanNum ).EndUseSubcategoryName = "General";
}
TestCompSet( cCurrentModuleObject, cAlphaArgs( 1 ), cAlphaArgs( 3 ), cAlphaArgs( 4 ), "Air Nodes" );
} // end Number of Simple ON-OFF FAN Loop
cCurrentModuleObject = "FanPerformance:NightVentilation";
NumNightVentPerf = GetNumObjectsFound( cCurrentModuleObject );
if ( NumNightVentPerf > 0 ) {
NightVentPerf.allocate( NumNightVentPerf );
for ( auto & e : NightVentPerf ) {
e.FanName.clear();
e.FanEff = 0.0;
e.DeltaPress = 0.0;
e.MaxAirFlowRate = 0.0;
e.MotEff = 0.0;
e.MotInAirFrac = 0.0;
e.MaxAirMassFlowRate = 0.0;
}
}
// input the night ventilation performance objects
for ( NVPerfNum = 1; NVPerfNum <= NumNightVentPerf; ++NVPerfNum ) {
GetObjectItem( cCurrentModuleObject, NVPerfNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat, lNumericFieldBlanks, lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames );
IsNotOK = false;
IsBlank = false;
VerifyName( cAlphaArgs( 1 ), NightVentPerf, &NightVentPerfData::FanName, NVPerfNum - 1, IsNotOK, IsBlank, cCurrentModuleObject + " Name" );
if ( IsNotOK ) {
ErrorsFound = true;
if ( IsBlank ) cAlphaArgs( 1 ) = "xxxxx";
}
NightVentPerf( NVPerfNum ).FanName = cAlphaArgs( 1 );
NightVentPerf( NVPerfNum ).FanEff = rNumericArgs( 1 );
NightVentPerf( NVPerfNum ).DeltaPress = rNumericArgs( 2 );
NightVentPerf( NVPerfNum ).MaxAirFlowRate = rNumericArgs( 3 );
NightVentPerf( NVPerfNum ).MotEff = rNumericArgs( 4 );
NightVentPerf( NVPerfNum ).MotInAirFrac = rNumericArgs( 5 );
// find the corresponding fan
NVPerfFanFound = false;
for ( FanNum = 1; FanNum <= NumFans; ++FanNum ) {
if ( NightVentPerf( NVPerfNum ).FanName == Fan( FanNum ).FanName ) {
NVPerfFanFound = true;
Fan( FanNum ).NVPerfNum = NVPerfNum;
break;
}
}
if ( ! NVPerfFanFound ) {
ShowSevereError( cCurrentModuleObject + ", fan name not found=" + cAlphaArgs( 1 ) );
ErrorsFound = true;
}
}
//cpw22Aug2010 Added get input for Component Fan Model
for ( CompModelFanNum = 1; CompModelFanNum <= NumCompModelFan; ++CompModelFanNum ) {
FanNum = NumSimpFan + NumVarVolFan + NumZoneExhFan + NumOnOff + CompModelFanNum;
cCurrentModuleObject = "Fan:ComponentModel";
GetObjectItem( cCurrentModuleObject, CompModelFanNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat, lNumericFieldBlanks, lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames );
FanNumericFields( FanNum ).FieldNames.allocate( MaxNumbers );
FanNumericFields( FanNum ).FieldNames = "";
FanNumericFields( FanNum ).FieldNames = cNumericFieldNames;
IsNotOK = false;
IsBlank = false;
VerifyName( cAlphaArgs( 1 ), Fan, &FanEquipConditions::FanName, FanNum - 1, IsNotOK, IsBlank, cCurrentModuleObject + " Name" );
if ( IsNotOK ) {
ErrorsFound = true;
if ( IsBlank ) cAlphaArgs( 1 ) = "xxxxx";
}
Fan( FanNum ).FanName = cAlphaArgs( 1 ); // Fan name
Fan( FanNum ).FanType = cCurrentModuleObject;
Fan( FanNum ).InletNodeNum = GetOnlySingleNode( cAlphaArgs( 2 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent ); // Air inlet node name
Fan( FanNum ).OutletNodeNum = GetOnlySingleNode( cAlphaArgs( 3 ), ErrorsFound, cCurrentModuleObject, cAlphaArgs( 1 ), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent ); // Air outlet node name
TestCompSet( cCurrentModuleObject, cAlphaArgs( 1 ), cAlphaArgs( 2 ), cAlphaArgs( 3 ), "Air Nodes" );
Fan( FanNum ).AvailSchedName = cAlphaArgs( 4 ); // Availability schedule name
if ( lAlphaFieldBlanks( 4 ) ) {
Fan( FanNum ).AvailSchedPtrNum = 0;
} else {
Fan( FanNum ).AvailSchedPtrNum = GetScheduleIndex( cAlphaArgs( 4 ) );
if ( Fan( FanNum ).AvailSchedPtrNum == 0 ) {
ShowSevereError( RoutineName + cCurrentModuleObject + ": invalid " + cAlphaFieldNames( 4 ) + " entered =" + cAlphaArgs( 4 ) + " for " + cAlphaFieldNames( 1 ) + '=' + cAlphaArgs( 1 ) );
ErrorsFound = true;
}
}
Fan( FanNum ).FanType_Num = FanType_ComponentModel;
Fan( FanNum ).MaxAirFlowRate = rNumericArgs( 1 );
if ( Fan( FanNum ).MaxAirFlowRate == 0.0 ) {
ShowWarningError( cCurrentModuleObject + "=\"" + Fan( FanNum ).FanName + "\" has specified 0.0 max air flow rate. It will not be used in the simulation." );
}
Fan( FanNum ).MaxAirFlowRateIsAutosizable = true;
Fan( FanNum ).MinAirFlowRate = rNumericArgs( 2 );
Fan( FanNum ).FanSizingFactor = rNumericArgs( 3 ); // Fan max airflow sizing factor [-] cpw31Aug2010
Fan( FanNum ).FanWheelDia = rNumericArgs( 4 ); // Fan wheel outer diameter [m]
Fan( FanNum ).FanOutletArea = rNumericArgs( 5 ); // Fan outlet area [m2]
Fan( FanNum ).FanMaxEff = rNumericArgs( 6 ); // Fan maximum static efficiency [-]
Fan( FanNum ).EuMaxEff = rNumericArgs( 7 ); // Euler number at Fan maximum static efficiency [-]
Fan( FanNum ).FanMaxDimFlow = rNumericArgs( 8 ); // Fan maximum dimensionless airflow [-]
Fan( FanNum ).PulleyDiaRatio = rNumericArgs( 9 ); // Motor/fan pulley diameter ratio [-]
Fan( FanNum ).BeltMaxTorque = rNumericArgs( 10 ); // Belt maximum torque [N-m, autosizable]
Fan( FanNum ).BeltSizingFactor = rNumericArgs( 11 ); // Belt sizing factor [-]
Fan( FanNum ).BeltTorqueTrans = rNumericArgs( 12 ); // Belt fractional torque transition Region 1-2 [-]
Fan( FanNum ).MotorMaxSpd = rNumericArgs( 13 ); // Motor maximum speed [rpm]
Fan( FanNum ).MotorMaxOutPwr = rNumericArgs( 14 ); // Motor maximum output power [W, autosizable]
Fan( FanNum ).MotorSizingFactor = rNumericArgs( 15 ); // Motor sizing factor [-]
Fan( FanNum ).MotInAirFrac = rNumericArgs( 16 ); // Fraction of fan and motor losses to airstream [-]
Fan( FanNum ).VFDEffType = cAlphaArgs( 5 ); // VFD efficiency type [Speed or Power]
Fan( FanNum ).VFDMaxOutPwr = rNumericArgs( 17 ); // VFD maximum output power [W, autosizable]
Fan( FanNum ).VFDSizingFactor = rNumericArgs( 18 ); // VFD sizing factor [-] cpw31Aug2010
Fan( FanNum ).PressRiseCurveIndex = GetCurveIndex( cAlphaArgs( 6 ) ); // Fan pressure rise curve
Fan( FanNum ).PressResetCurveIndex = GetCurveIndex( cAlphaArgs( 7 ) ); // Duct static pressure reset curve
Fan( FanNum ).PLFanEffNormCurveIndex = GetCurveIndex( cAlphaArgs( 8 ) ); // Fan part-load eff (normal) curve
Fan( FanNum ).PLFanEffStallCurveIndex = GetCurveIndex( cAlphaArgs( 9 ) ); // Fan part-load eff (stall) curve
Fan( FanNum ).DimFlowNormCurveIndex = GetCurveIndex( cAlphaArgs( 10 ) ); // Fan dim airflow (normal) curve
Fan( FanNum ).DimFlowStallCurveIndex = GetCurveIndex( cAlphaArgs( 11 ) ); // Fan dim airflow (stall) curve
Fan( FanNum ).BeltMaxEffCurveIndex = GetCurveIndex( cAlphaArgs( 12 ) ); // Belt max eff curve
Fan( FanNum ).PLBeltEffReg1CurveIndex = GetCurveIndex( cAlphaArgs( 13 ) ); // Belt part-load eff Region 1 curve
Fan( FanNum ).PLBeltEffReg2CurveIndex = GetCurveIndex( cAlphaArgs( 14 ) ); // Belt part-load eff Region 2 curve
Fan( FanNum ).PLBeltEffReg3CurveIndex = GetCurveIndex( cAlphaArgs( 15 ) ); // Belt part-load eff Region 3 curve
Fan( FanNum ).MotorMaxEffCurveIndex = GetCurveIndex( cAlphaArgs( 16 ) ); // Motor max eff curve
Fan( FanNum ).PLMotorEffCurveIndex = GetCurveIndex( cAlphaArgs( 17 ) ); // Motor part-load eff curve
Fan( FanNum ).VFDEffCurveIndex = GetCurveIndex( cAlphaArgs( 18 ) ); // VFD eff curve
if ( NumAlphas > 18 ) {
Fan( FanNum ).EndUseSubcategoryName = cAlphaArgs( 19 );
} else {
Fan( FanNum ).EndUseSubcategoryName = "General";
}
} // end Number of Component Model FAN Loop
cAlphaArgs.deallocate();
cAlphaFieldNames.deallocate();
lAlphaFieldBlanks.deallocate();
cNumericFieldNames.deallocate();
lNumericFieldBlanks.deallocate();
rNumericArgs.deallocate();
// Check Fans
for ( FanNum = 1; FanNum <= NumFans; ++FanNum ) {
for ( checkNum = FanNum + 1; checkNum <= NumFans; ++checkNum ) {
if ( Fan( FanNum ).InletNodeNum == Fan( checkNum ).InletNodeNum ) {
ErrorsFound = true;
ShowSevereError( "GetFanInput, duplicate fan inlet node names, must be unique for fans." );
ShowContinueError( "Fan=" + Fan( FanNum ).FanType + ':' + Fan( FanNum ).FanName + " and Fan=" + Fan( checkNum ).FanType + ':' + Fan( checkNum ).FanName + '.' );
ShowContinueError( "Inlet Node Name=\"" + NodeID( Fan( FanNum ).InletNodeNum ) + "\"." );
}
if ( Fan( FanNum ).OutletNodeNum == Fan( checkNum ).OutletNodeNum ) {
ErrorsFound = true;
ShowSevereError( "GetFanInput, duplicate fan outlet node names, must be unique for fans." );
ShowContinueError( "Fan=" + Fan( FanNum ).FanType + ':' + Fan( FanNum ).FanName + " and Fan=" + Fan( checkNum ).FanType + ':' + Fan( checkNum ).FanName + '.' );
ShowContinueError( "Outlet Node Name=\"" + NodeID( Fan( FanNum ).OutletNodeNum ) + "\"." );
}
}
}
if ( ErrorsFound ) {
ShowFatalError( RoutineName + "Errors found in input. Program terminates." );
}
for ( FanNum = 1; FanNum <= NumFans; ++FanNum ) {
// Setup Report variables for the Fans CurrentModuleObject='Fans'
SetupOutputVariable( "Fan Electric Power [W]", Fan( FanNum ).FanPower, "System", "Average", Fan( FanNum ).FanName );
SetupOutputVariable( "Fan Rise in Air Temperature [deltaC]", Fan( FanNum ).DeltaTemp, "System", "Average", Fan( FanNum ).FanName );
SetupOutputVariable( "Fan Electric Energy [J]", Fan( FanNum ).FanEnergy, "System", "Sum", Fan( FanNum ).FanName, _, "Electric", "Fans", Fan( FanNum ).EndUseSubcategoryName, "System" );
if ( ( Fan( FanNum ).FanType_Num == FanType_ZoneExhaust ) && ( Fan( FanNum ).BalancedFractSchedNum > 0 ) ) {
SetupOutputVariable( "Fan Unbalanced Air Mass Flow Rate [kg/s]", Fan( FanNum ).UnbalancedOutletMassFlowRate, "System", "Average", Fan( FanNum ).FanName );
SetupOutputVariable( "Fan Balanced Air Mass Flow Rate [kg/s]", Fan( FanNum ).BalancedOutletMassFlowRate, "System", "Average", Fan( FanNum ).FanName );
}
if ( AnyEnergyManagementSystemInModel ) {
SetupEMSInternalVariable( "Fan Maximum Mass Flow Rate", Fan( FanNum ).FanName, "[kg/s]", Fan( FanNum ).MaxAirMassFlowRate );
SetupEMSActuator( "Fan", Fan( FanNum ).FanName, "Fan Air Mass Flow Rate", "[kg/s]", Fan( FanNum ).EMSMaxMassFlowOverrideOn, Fan( FanNum ).EMSAirMassFlowValue );
SetupEMSInternalVariable( "Fan Nominal Pressure Rise", Fan( FanNum ).FanName, "[Pa]", Fan( FanNum ).DeltaPress );
SetupEMSActuator( "Fan", Fan( FanNum ).FanName, "Fan Pressure Rise", "[Pa]", Fan( FanNum ).EMSFanPressureOverrideOn, Fan( FanNum ).EMSFanPressureValue );
SetupEMSInternalVariable( "Fan Nominal Total Efficiency", Fan( FanNum ).FanName, "[fraction]", Fan( FanNum ).FanEff );
SetupEMSActuator( "Fan", Fan( FanNum ).FanName, "Fan Total Efficiency", "[fraction]", Fan( FanNum ).EMSFanEffOverrideOn, Fan( FanNum ).EMSFanEffValue );
SetupEMSActuator( "Fan", Fan( FanNum ).FanName, "Fan Autosized Air Flow Rate", "[m3/s]", Fan( FanNum ).MaxAirFlowRateEMSOverrideOn, Fan( FanNum ).MaxAirFlowRateEMSOverrideValue );
}
}
for ( OnOffFanNum = 1; OnOffFanNum <= NumOnOff; ++OnOffFanNum ) {
FanNum = NumSimpFan + NumVarVolFan + NumZoneExhFan + OnOffFanNum;
SetupOutputVariable( "Fan Runtime Fraction []", Fan( FanNum ).FanRuntimeFraction, "System", "Average", Fan( FanNum ).FanName );
}
bool anyRan;
ManageEMS( emsCallFromComponentGetInput, anyRan );
MySizeFlag.dimension( NumFans, true );
}
// End of Get Input subroutines for the HB Module
//******************************************************************************
// Beginning Initialization Section of the Module
//******************************************************************************
void
InitFan(
int const FanNum,
bool const EP_UNUSED( FirstHVACIteration ) // unused1208
)
{
// SUBROUTINE INFORMATION:
// AUTHOR Richard J. Liesen
// DATE WRITTEN February 1998
// MODIFIED na
// RE-ENGINEERED na
// PURPOSE OF THIS SUBROUTINE:
// This subroutine is for initializations of the Fan Components.
// METHODOLOGY EMPLOYED:
// Uses the status flags to trigger initializations.
// REFERENCES:
// na
// Using/Aliasing
using DataSizing::CurSysNum;
using DataAirLoop::AirLoopControlInfo;
using DataZoneEquipment::ZoneEquipInputsFilled;
using DataZoneEquipment::CheckZoneEquipmentList;
using InputProcessor::SameString;
// Locals