00001
00010 #ifndef _REFRIGERATOR_H
00011 #define _REFRIGERATOR_H
00012
00013 #include "residential.h"
00014 #include "residential_enduse.h"
00015
00016 class refrigerator : public residential_enduse {
00017 private:
00018 double *pTout;
00019 public:
00020
00021 typedef enum e_state {
00022 RS_DEFROST=1,
00023 RS_COMPRESSSOR_OFF_NORMAL=2,
00024 RS_COMPRESSSOR_ON_NORMAL=3,
00025 RS_COMPRESSSOR_ON_LONG=4,
00026 } REFRIGERATOR_STATE;
00027
00028
00029 public:
00030 double size;
00031 double rated_capacity;
00032 double thermostat_deadband;
00033 double UA;
00034 double UAr;
00035 double UAf;
00036 double Tair;
00037 double Tout;
00038 double Tset;
00039 double Cf;
00040 double Qr;
00041 double COPcoef;
00042 double energy_used;
00043 double energy_needed;
00044 double cycle_time;
00045 double total_power;
00046 bool is_240;
00047
00048 bool initial_state;
00049 bool check_icemaking;
00050 double ice_making_no;
00051 double ice_making;
00052 int32 return_time;
00053 int door_return_time;
00054 TIMESTAMP start_time;
00055
00056 bool icemaker_running;
00057 int32 check_DO;
00058 int32 DO_random_opening;
00059
00060 int32 FF_Door_Openings;
00061 int DO_Thershold;
00062 int last_dr_mode;
00063 double defrostDelayed;
00064 double compressor_defrost_time;
00065
00066 bool long_compressor_cycle_due;
00067 double long_compressor_cycle_time;
00068 double long_compressor_cycle_power;
00069 double long_compressor_cycle_energy;
00070 double long_compressor_cycle_threshold;
00071
00072 double refrigerator_power;
00073 bool run_defrost;
00074 bool check_defrost;
00075 int32 no_of_defrost;
00076
00077 double compressor_off_normal_energy;
00078 double compressor_off_normal_power;
00079 double compressor_on_normal_energy;
00080 double compressor_on_normal_power;
00081 double defrost_energy;
00082 double defrost_power;
00083 double icemaking_energy;
00084 double icemaking_power;
00085
00086 double sweatheater_power;
00087 double delay_defrost_time;
00088
00089 double ice_making_probability;
00090 int hourly_door_opening;
00091 int door_open_time;
00092 int door_next_open_time;
00093 int door_time;
00094 double door_opening_criterion;
00095 int daily_door_opening;
00096 double door_opening_power;
00097 double door_opening_energy;
00098 int *next_door_openings;
00099 bool door_open;
00100 bool door_to_open;
00101 bool door_energy_calc;
00102 int door_array_size;
00103 double total_compressor_time;
00104
00105 bool new_running_state;
00106
00107 double Tevent;
00108
00109 typedef enum { DM_UNKNOWN=0,
00110 DM_LOW=1,
00111 DM_NORMAL=2,
00112 DM_HIGH=3,
00113 DM_CRITICAL=4,
00114 };
00115 enumeration dr_mode;
00116
00117 typedef enum {
00118 DC_TIMED=1,
00119 DC_DOOR_OPENINGS=2,
00120 DC_COMPRESSOR_TIME=3,
00121 };
00122 enumeration defrost_criterion;
00123
00124 double dr_mode_double;
00125
00126 enumeration state;
00127 TIMESTAMP last_time, next_time;
00128 double* ice_making_time;
00129
00130 public:
00131
00132 static CLASS *oclass, *pclass;
00133 refrigerator(MODULE *module);
00134 ~refrigerator();
00135
00136 int create();
00137 int init(OBJECT *parent);
00138 int isa(char *classname);
00139 TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
00140 void thermostat(TIMESTAMP t0, TIMESTAMP t1);
00141 TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
00142 TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1);
00143 double update_refrigerator_state(double dt, TIMESTAMP t1);
00144 };
00145
00146 #endif // _REFRIGERATOR_H
00147