00001
00010 #ifndef _HOUSE_H
00011 #define _HOUSE_H
00012
00013 #include "residential.h"
00014 #include "residential_enduse.h"
00015
00016 typedef enum {duration=0,energy=1} TYPEOFEVENT;
00017 typedef enum {analog=0, PWM=1, queued=2} TYPEOFPULSE;
00018
00019 #define ENDUSELOAD enduse
00020
00021 class house : public residential_enduse {
00022 public:
00025
00026 complex *pCircuit_V;
00027 complex *pLine_I;
00028 complex *pLine12;
00029
00030 public:
00031 typedef enum { HEAT,
00032 AUX,
00033 COOL,
00034 OFF
00035 }HCMODE;
00036 typedef enum {
00037 ELECTRIC,
00038 GASHEAT
00039 } HEATMODE;
00040
00041 public:
00042
00043 double floor_area;
00044 double envelope_UA;
00045 double glazing_shgc;
00046 double window_wall_ratio;
00047 double gross_wall_area;
00048 double ceiling_height;
00049 double aspect_ratio;
00050 double thermostat_deadband;
00051 double airchange_per_hour;
00052 double heating_setpoint;
00053 double cooling_setpoint;
00054 double solar_aperture[N_SOLAR_SURFACES];
00055 double design_heating_capacity;
00056 double design_cooling_capacity;
00057 double heating_COP;
00058 double cooling_COP;
00059 double over_sizing_factor;
00060 double outside_temp;
00061
00062 double volume;
00063 double air_mass;
00064 double air_thermal_mass;
00065 double solar_load;
00066 double house_content_heat_transfer_coeff;
00067 double COP_coeff;
00068 double air_density;
00069 double air_heat_capacity;
00070 double house_content_thermal_mass;
00071
00072 double *pTout;
00073 double *pRhout;
00074 double *pSolar;
00075
00076 double Tair;
00077 double Tout;
00078 double Tsolar;
00079 double Tmaterials;
00080
00081 enumeration heat_cool_mode;
00082 enumeration heat_mode;
00083 double hvac_rated_power;
00084 double hvac_rated_capacity;
00085 double rated_heating_capacity;
00086 double rated_cooling_capacity;
00087
00088 PANEL panel;
00089
00090
00091
00092 enduse tload;
00093
00094 CIRCUIT *hvac_circuit;
00095 private:
00096 double A11;
00097 double A12;
00098 double A21;
00099 double A22;
00100
00101 double B11;
00102 double B12;
00103 double B21;
00104 double B22;
00105
00106 double s1;
00107 double s2;
00108
00109 double M_inv11;
00110 double M_inv12;
00111 double M_inv21;
00112 double M_inv22;
00113
00114 double BB11;
00115 double BB21;
00116 double BB12;
00117 double BB22;
00118
00119 public:
00120 static CLASS *oclass, *pclass;
00121 house( MODULE *module);
00122 ~house();
00123
00124 int create();
00125 TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
00126 TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00127 TIMESTAMP sync_hvac_load(TIMESTAMP t1, double nHours);
00128 TIMESTAMP sync_thermal(TIMESTAMP t1, double nHours);
00129 TIMESTAMP sync_billing(TIMESTAMP t0, TIMESTAMP t1);
00130 TIMESTAMP sync_thermostat(TIMESTAMP t0, TIMESTAMP t1);
00131 TIMESTAMP sync_panel(TIMESTAMP t0, TIMESTAMP t1);
00132
00133 int init(OBJECT *parent);
00134 int init_climate(void);
00135
00136 CIRCUIT *attach(ENDUSELOAD *target, double limit, int is220=false);
00137
00138
00139 public:
00140 double get_floor_area () { return floor_area; };
00141 double get_Tout () { return *pTout; };
00142 double get_Tair () { return Tair; };
00143 double get_Tsolar(int hour, int month, double Tair, double Tout);
00144 int set_Eigen_values();
00145 complex *get_complex(OBJECT *obj, char *name);
00146 };
00147
00148 #endif
00149