thermferm/simulator.c

changeset 264
91c358556ecf
parent 263
93c1f91adaa7
child 265
63a003914b72
--- a/thermferm/simulator.c	Sat Aug 23 23:43:11 2014 +0200
+++ b/thermferm/simulator.c	Sun Aug 24 14:41:31 2014 +0200
@@ -41,7 +41,7 @@
     time_t		now, last = (time_t)0;
     int			seconds = 0;
     double		k_room_air, sqm_room_air, thick_room_air, heat_transfer;
-    double		t_change, vhc_air = 0.00121, vhc_water = 4.1796;
+    double		t_change, vhc_air = 1.21, vhc_water = 4179.6;
 
     syslog(LOG_NOTICE, "Thread my_simulator_loop started");
     if (debug)
@@ -67,10 +67,11 @@
 	    	 * the room temperature.
 	    	 */
 		sqm_room_air = (cbrtl(simulator->volume_air) * cbrtl(simulator->volume_air) * 6) / 100;	/* square meters all fridge sides */
-		thick_room_air = 0.02;	/* 4 cm walls	*/
+		thick_room_air = 0.04;	/* 4 cm walls	*/
 		k_room_air = 0.03;	/* Polystrene	*/
 		heat_transfer=(k_room_air * sqm_room_air * (simulator->room_temperature - simulator->air_temperature)) / thick_room_air;
 		if (heat_transfer != 0)
+//		    t_change = heat_transfer * vhc_air * (simulator->volume_air / 1000);
 		    t_change = vhc_air / (heat_transfer * (simulator->volume_air * 1000));
 		else
 		    t_change = 0.0;

mercurial