thermferm/simulator.c

changeset 550
04c942cded91
parent 497
18ace27338e5
child 552
8b56f1b4e7ec
--- a/thermferm/simulator.c	Sat Jul 21 20:40:02 2018 +0200
+++ b/thermferm/simulator.c	Mon Jul 23 14:41:21 2018 +0200
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Copyright (C) 2008-2014
+ * Copyright (C) 2008-2018
  *   
  * Michiel Broek <mbroek at mbse dot eu>
  *
@@ -42,8 +42,8 @@
     simulator_list	*simulator;
     time_t		now, last = (time_t)0;
     int			seconds = 0;
-    double		k_room_air, k_beer_air, sqm_room_air, sqm_beer_air, thick_room_air, thick_beer_air, air_heat_transfer, beer_heat_transfer;
-    double		air_change, /* beer_change, */ vhc_air = 0.00121 /*, vhc_water = 4.1796 */;
+    double		k_room_air, sqm_room_air, thick_room_air, air_heat_transfer;
+    double		air_change, vhc_air = 0.00121;
 
     syslog(LOG_NOTICE, "Thread my_simulator_loop started");
     if (debug)
@@ -119,17 +119,6 @@
 		}
 
 	    	/*
-	    	 * Calculate the extra beer temperatur rise to simulate the heat produced by the
-	    	 * fermentation process. Peak about one day after start and slowly decrease after
-	    	 * that.
-	    	 */
-		sqm_beer_air = (cbrtl(simulator->volume_beer) * cbrtl(simulator->volume_beer) * 6) / 100; /* Simple, the beer is in a cubic box */
-		thick_beer_air = 0.001;
-		k_beer_air = 0.5;	/* HDPE */
-		beer_heat_transfer=(k_beer_air * sqm_beer_air * (simulator->air_temperature - simulator->beer_temperature)) / thick_beer_air;
-		/* beer_change = 0; */
-
-	    	/*
 	    	 * Calculate final temperature of the beer and the air.
 	    	 */
 		// Cheap trick, just follow slowly the air temp.
@@ -139,10 +128,9 @@
 		syslog(LOG_NOTICE, "air=%.3f beer=%.3f heater=%.3f cooler=%.3f", simulator->air_temperature, simulator->beer_temperature,
 				simulator->s_heat_temp, simulator->s_cool_temp);
 
-		if (debug)
-		    fprintf(stdout, "sqm_room_air=%f air=%f air_heat_transfer=%f air_change=%f  sqm_beer_air=%f beer=%f beer_heat_transfer=%f\n",
-			sqm_room_air, simulator->air_temperature, air_heat_transfer, air_change,
-			sqm_beer_air, simulator->beer_temperature, beer_heat_transfer);
+//		if (debug)
+//		    fprintf(stdout, "sqm_room_air=%f air=%f air_heat_transfer=%f air_change=%f beer=%f\n",
+//			sqm_room_air, simulator->air_temperature, air_heat_transfer, air_change, simulator->beer_temperature);
 	    }
 	    usleep(100000);
 	}

mercurial