46 int seconds = 0; |
46 int seconds = 0; |
47 double k_room_air, sqm_room_air, thick_room_air, air_heat_transfer; |
47 double k_room_air, sqm_room_air, thick_room_air, air_heat_transfer; |
48 double air_change, vhc_air = 0.00121; |
48 double air_change, vhc_air = 0.00121; |
49 |
49 |
50 syslog(LOG_NOTICE, "Thread my_simulator_loop started"); |
50 syslog(LOG_NOTICE, "Thread my_simulator_loop started"); |
51 if (debug) |
|
52 fprintf(stdout, "Thread my_simulator_loop started\n"); |
|
53 |
51 |
54 for (simulator = Config.simulators; simulator; simulator = simulator->next) { |
52 for (simulator = Config.simulators; simulator; simulator = simulator->next) { |
55 /* |
53 /* |
56 * Heater and cooler have the air temperature |
54 * Heater and cooler have the air temperature |
57 */ |
55 */ |
126 // Cheap trick, just follow slowly the air temp. |
124 // Cheap trick, just follow slowly the air temp. |
127 simulator->beer_temperature += ((simulator->air_temperature - simulator->beer_temperature) / 500.0); |
125 simulator->beer_temperature += ((simulator->air_temperature - simulator->beer_temperature) / 500.0); |
128 simulator->air_temperature += ((simulator->beer_temperature - simulator->air_temperature) / 2500.0); |
126 simulator->air_temperature += ((simulator->beer_temperature - simulator->air_temperature) / 2500.0); |
129 simulator->chiller_temperature = simulator->cooler_temp; // Libk these |
127 simulator->chiller_temperature = simulator->cooler_temp; // Libk these |
130 |
128 |
131 if ((seconds % 15) == 0) |
129 // if ((seconds % 15) == 0) |
132 syslog(LOG_NOTICE, "air=%.3f beer=%.3f heater=%.3f cooler=%.3f", simulator->air_temperature, simulator->beer_temperature, |
130 // syslog(LOG_NOTICE, "air=%.3f beer=%.3f heater=%.3f cooler=%.3f", simulator->air_temperature, simulator->beer_temperature, |
133 simulator->s_heat_temp, simulator->s_cool_temp); |
131 // simulator->s_heat_temp, simulator->s_cool_temp); |
134 |
132 |
135 // if (debug) |
133 // if (debug) |
136 // fprintf(stdout, "sqm_room_air=%f air=%f air_heat_transfer=%f air_change=%f beer=%f\n", |
134 // fprintf(stdout, "sqm_room_air=%f air=%f air_heat_transfer=%f air_change=%f beer=%f\n", |
137 // sqm_room_air, simulator->air_temperature, air_heat_transfer, air_change, simulator->beer_temperature); |
135 // sqm_room_air, simulator->air_temperature, air_heat_transfer, air_change, simulator->beer_temperature); |
138 } |
136 } |