-
Notifications
You must be signed in to change notification settings - Fork 0
/
refrigerator.h
148 lines (123 loc) · 3.72 KB
/
refrigerator.h
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
/** $Id: refrigerator.h,v 1.10 2008/02/13 01:26:12 d3j168 Exp $
Copyright (C) 2008 Battelle Memorial Institute
@file refrigerator.h
@addtogroup refrigerator
@ingroup residential
@{
**/
#ifndef _REFRIGERATOR_H
#define _REFRIGERATOR_H
#include "residential.h"
#include "residential_enduse.h"
class refrigerator : public residential_enduse {
private:
double *pTout;
public:
typedef enum e_state {
RS_DEFROST=1,
RS_COMPRESSSOR_OFF_NORMAL=2,
RS_COMPRESSSOR_ON_NORMAL=3,
RS_COMPRESSSOR_ON_LONG=4,
} REFRIGERATOR_STATE;
public:
double size; ///< refrigerator volume (cf)
double rated_capacity; ///< rated capacity (Btu/h)
double thermostat_deadband; ///< refrigerator thermostat hysterisys (degF)
double UA;
double UAr; ///< UA of Refrigerator compartment
double UAf; ///< UA of the food-air
double Tair; ///< Refirgerator air temperature (degF)
double Tout; ///< House air temperature
double Tset; ///< Refrigerator control set point temperature (degF)
double Cf; ///< heat capapcity of the food
double Qr; ///< heat rate from the cooling system
double COPcoef; ///< compressor COP
double energy_used;
double energy_needed;
double cycle_time;
double total_power;
bool is_240;
//bool new_running_state;
bool initial_state;
bool check_icemaking;
double ice_making_no;
double ice_making;
int32 return_time;
int door_return_time;
TIMESTAMP start_time;
bool icemaker_running;
int32 check_DO;
int32 DO_random_opening;
int32 FF_Door_Openings;
int DO_Thershold;
int last_dr_mode;
double defrostDelayed;
double compressor_defrost_time;
bool long_compressor_cycle_due;
double long_compressor_cycle_time;
double long_compressor_cycle_power;
double long_compressor_cycle_energy;
double long_compressor_cycle_threshold;
double refrigerator_power;
bool run_defrost;
bool check_defrost;
int32 no_of_defrost;
double compressor_off_normal_energy;
double compressor_off_normal_power;
double compressor_on_normal_energy;
double compressor_on_normal_power;
double defrost_energy;
double defrost_power;
double icemaking_energy;
double icemaking_power;
double sweatheater_power;
double delay_defrost_time;
double ice_making_probability;
int hourly_door_opening;
int door_open_time;
int door_next_open_time;
int door_time;
double door_opening_criterion;
int daily_door_opening;
double door_opening_power;
double door_opening_energy;
int *next_door_openings;
bool door_open;
bool door_to_open;
bool door_energy_calc;
int door_array_size;
double total_compressor_time;
bool new_running_state;
double Tevent; ///< Temperature we will switch the motor on or off. Available for SmartGrid PLC code to nudge.
typedef enum { DM_UNKNOWN=0, ///< mode is unknown
DM_LOW=1, ///< low signal
DM_NORMAL=2, ///< normal signal
DM_HIGH=3, ///< high demand response signal
DM_CRITICAL=4, ///< critical demand response signal
};
enumeration dr_mode;
typedef enum {
DC_TIMED=1, ///< For the timed option
DC_DOOR_OPENINGS=2, ///< For the door openings option
DC_COMPRESSOR_TIME=3, ///< For the compressor time option
};
enumeration defrost_criterion;
double dr_mode_double; ///temporary variable for testing
enumeration state;
TIMESTAMP last_time, next_time;
double* ice_making_time;
public:
static CLASS *oclass, *pclass;
refrigerator(MODULE *module);
~refrigerator();
int create();
int init(OBJECT *parent);
int isa(char *classname);
TIMESTAMP presync(TIMESTAMP t0, TIMESTAMP t1);
void thermostat(TIMESTAMP t0, TIMESTAMP t1);
TIMESTAMP sync(TIMESTAMP t0, TIMESTAMP t1);
TIMESTAMP postsync(TIMESTAMP t0, TIMESTAMP t1);
double update_refrigerator_state(double dt, TIMESTAMP t1);
};
#endif // _REFRIGERATOR_H
/**@}**/