@ -8,7 +8,7 @@
@@ -8,7 +8,7 @@
//Global Variables for Turkey
density = 1050 ; // kg/m3 Assuming Density of Water 1000 kg/m3
cp = 2810 // J/kg K for Turkey
cp = 4300 // 2810 J/kg K for Turkey
heatConvection = 5 ; // W/m2 K Some Reasonable estimate for natural Convection. Change as needed. 5-25
thermalConduct = 0.412 // W/m K // Chicken
globalTime = 0 ;
@ -107,7 +107,7 @@ this.setTemp = 20;
@@ -107,7 +107,7 @@ this.setTemp = 20;
this . steadyTemp = 20 ;
this . steadyTimer = 0 ;
var proportional = 0.004 ; // This value is arbitrary to how fast you want the temperatures to converge. (Or oscillate, which could be realistic as well)
var errorTolerance = 25 ; //Stove is accurate to 25 degree Celcius Should hopefully oscillate below that value.
var errorTolerance = 10 ; //Stove is accurate to 25 degree Celcius Should hopefully oscillate below that value.
this . changeTemp = function ( setTemp ) {
this . setTemp = setTemp ;
@ -155,19 +155,19 @@ this.core.waterLost = this.core.volume*waterMultiplier
@@ -155,19 +155,19 @@ this.core.waterLost = this.core.volume*waterMultiplier
this . cookCondition = function ( cookValue , volume ) {
var multiplier = 1 ;
if ( cookValue >= multiplier * 8 0000) {
if ( cookValue >= multiplier * 25 0000) {
return ( "House Fire" )
}
else if ( cookValue >= multiplier * 55 000) {
else if ( cookValue >= multiplier * 150 000) {
return ( "Charcoal" )
}
else if ( cookValue >= multiplier * 4 0000) {
else if ( cookValue >= multiplier * 8 0000) {
return ( "Dry" )
}
else if ( cookValue >= multiplier * 165 00 ) {
else if ( cookValue >= multiplier * 180 00 ) {
return ( "Cooked" )
}
else if ( cookValue >= multiplier * 8 000) {
else if ( cookValue >= multiplier * 5 000) {
return ( "Undercooked" )
}
else {
@ -224,7 +224,7 @@ var denominator = (sphereSurfaceArea(innerRadius) + sphereSurfaceArea(outerRadiu
@@ -224,7 +224,7 @@ var denominator = (sphereSurfaceArea(innerRadius) + sphereSurfaceArea(outerRadiu
return ( sphereSurfaceArea ( outerRadius ) / denominator )
}
function waterLoss ( temperature ) {
loss = ( 1 ) * Math . pow ( 7 , ( temperature - 20 ) / 156 ) - 1
loss = ( 1 ) * Math . pow ( 10 , ( temperature - 20 ) / 80 ) - 1
return ( loss )
}
@ -267,16 +267,16 @@ return(tempAtTimeAndRadius)
@@ -267,16 +267,16 @@ return(tempAtTimeAndRadius)
//Running the Program Stuff
ovenObject = new oven ( ) ;
turkey = new turkeyModel ( 8 ) ;
turkey = new turkeyModel ( poundsToKilograms ( 7.26 ) ) ;
setInterval ( function ( ) { time ( ) } , 15.625 ) ;
setInterval ( function ( ) { time ( ) } , 10 ) ;
//setTimeout(function(){alert(ovenObject.steadyTemp)},360000)
totalCookTime = 0 ;
scale = 1
function time ( ) {
console . clear ( )
var equalized = ovenObject . equalizeTemp ( )
if ( ovenObject . steadyTimer >= 6 0* scale && equalized ) {
if ( ovenObject . steadyTimer >= 8 0* scale && equalized ) {
ovenObject . steadyTimer = 0 ;
ovenObject . steadyTemp = ovenObject . tempInfini
turkey . resetLayerTemps ( ) ;
@ -291,6 +291,6 @@ function time() {
@@ -291,6 +291,6 @@ function time() {
console . log ( ovenObject . tempInfini )
console . log ( ovenObject . steadyTemp )
console . log ( ovenObject . steadyTimer )
console . log ( totalCookTime + " second s" )
console . log ( totalCookTime / 60 / 60 + " hour s")
turkey . updateLayerTemps ( ) ;
}