residential/residential.h

00001 /* residential.h
00002  * contains all utility functions and common definitions for the residential module
00003  */
00004 
00005 #ifndef _RESIDENTIAL_H
00006 #define _RESIDENTIAL_H
00007 
00008 #include "gridlabd.h"
00009 
00010 /* useful constants */
00011 #define RHOWATER    (62.4)          // lb/cf
00012 #define CFPGAL      (0.133681)      // cf/gal
00013 #define GALPCF      (7.4805195)     // gal/cf
00014 #define CWATER      (0.9994)        // BTU/lb/F
00015 #define BTUPHPW     (3.4120)        // BTUPH/W
00016 #define BTUPHPKW    (1e3 * 3.4120)      // BTUPH/kW
00017 #define KWPBTUPH    (1e-3/BTUPHPW)  // kW/BTUPH
00018 #define MWPBTUPH    (1e-6/BTUPHPW)  // MW/BTUPH
00019 #define ROUNDOFF    1e-6            // numerical accuracy for zero in float comparisons
00020 
00021 const double pi = 3.1415926535897931;
00022 const double Cp = 1;                    // Btu/lbm-F
00023 
00024 /* approximate tests */
00025 #define AEQ(A,B,C) (fabs(A-B)<C)
00026 #define ANE(A,B,C) (fabs(A-B)>=C)
00027 #define ALT(A,B,C) (A<=B+C)
00028 #define AGT(Ak,B,C) (A>=B-C)
00029 
00030 #define MAX(A,B) ((A)>(B)?(A):(B))
00031 #define MIN(A,B) ((A)<(B)?(A):(B))
00032 
00033 #endif  /* _RESIDENTIAL_H */
00034 

GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy