commercial/office.h

Go to the documentation of this file.
00001 
00008 #ifndef _HOUSE_H
00009 #define _HOUSE_H
00010 
00011 #include "gridlabd.h"
00012 
00013 class multizone;
00014 
00015 /* each electric load must have an enduse member */
00016 typedef struct s_enduse {
00017     double power_factor;        
00018     complex energy;             
00019     complex power;              
00020     complex demand;             
00021 } ENDUSE;
00022 
00023 /*****************************************************
00024  ENDUSE: HVAC
00025  *****************************************************/
00026 /* HVAC has three mode */
00027 typedef enum {
00028     HC_OFF,                     
00029     HC_HEAT,                    
00030     HC_AUX,                     
00031     HC_COOL,                    
00032     HC_ECON,                    
00033 } HCMODE;
00034 
00035 /* HVAC design parameters */
00036 typedef struct s_hvacdesign {
00037     double design_temperature;  
00038     double balance_temperature; 
00039     double efficiency;          
00040     double cop;                 
00041     double capacity;            
00042     double capacity_perF;       
00043 } HVACDESIGN;
00044 
00045 /* HVAC load */
00046 typedef struct s_hvac {
00047     ENDUSE enduse;              
00048     HCMODE mode;                
00049     HVACDESIGN cooling;         
00050     HVACDESIGN heating;         
00051 } HVAC;
00052 
00053 /*****************************************************
00054  ENDUSE: LIGHTING
00055  *****************************************************/
00056 typedef struct s_lighting {
00057     ENDUSE enduse;              
00058     double capacity;            
00059     double fraction;            
00060 } LIGHTS;
00061 
00062 /*****************************************************
00063  ENDUSE: PLUGS
00064  *****************************************************/
00065 typedef struct s_plugs {
00066     ENDUSE enduse;              
00067     double capacity;            
00068     double fraction;            
00069 } PLUGS;
00070 
00071 /*****************************************************
00072  Prevailing conditions
00073  *****************************************************/
00074 typedef struct s_conditions {
00075     double *pTemperature;       
00076     double *pHumidity;          
00077     double *pSolar;             
00078     double air_temperature;     
00079     double mass_temperature;    
00080     double occupancy;           
00081     double temperature_change;  
00082 } CONDITIONS;
00083 
00084 /*****************************************************
00085  Controls
00086  *****************************************************/
00087 typedef struct s_controls {
00088     double cooling_setpoint;        
00089     double heating_setpoint;        
00090     double setpoint_deadband;       
00091     double ventilation_fraction;    
00092     double lighting_fraction;       
00093 } CONTROLS;
00094 
00095 /*****************************************************
00096  Zone information
00097  *****************************************************/
00098 typedef struct s_zonedata {
00099     struct {
00100         double floor_area;      
00101         double floor_height;    
00102         double exterior_ua;     
00103         double interior_ua;     
00104         double interior_mass;   
00105         double window_area[9];  
00106         double glazing_coeff;   
00107         double occupants;       
00108         char256 schedule;       
00109     } design;
00110     HVAC hvac;                  
00111     LIGHTS lights;              
00112     PLUGS plugs;                
00113     ENDUSE total;               
00114     CONDITIONS current;         
00115     CONTROLS control;           
00116 } ZONEDATA;
00117 
00118 class office {
00119 public:
00120     complex *pVoltage;
00121     complex *pCurrent;
00122     ZONEDATA zone;
00123 private:
00124     double TcoolOn, TcoolOff;
00125     double TheatOn, TheatOff;
00126     double cop, Qrated;
00127     double Qi, Qh, Qs, Qz;
00128     double Teq, Tevent;
00129     double r1, r2, k1, k2;
00130     void update_control_setpoints();
00131     double update_lighting(double dt);
00132     double update_plugs(double dt);
00133     double update_hvac(double dt);
00134 public:
00135     static CLASS *oclass;
00136     static office *defaults;
00137     office(MODULE *module);
00138     int create();
00139     int init(OBJECT *parent);
00140     TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
00141     TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00142     TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1);
00143     TIMESTAMP plc(TIMESTAMP t0, TIMESTAMP t1);
00144 
00145     friend class multizone;
00146 };
00147 
00148 #endif
00149 

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