Version 6 of Heat Engine Combustion and Calculator Demo Example

Updated 2013-08-10 09:24:19 by gold

Heat Engine Combustion and Calculator Demo Example

This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER in your comment with the same courtesy that I will give you. Its very hard to reply intelligibly without some background of the correspondent. Thanks,gold


gold Here is some eTCL starter code for calculating efficiency of heat engines from source temperature, fuel, and combustion chamber dimensions. The Novikov efficiency rating can be compared with a process fraction of useful work in an eTCL calculator, developed from some code on a firebox. The impetus for these calculations was checking rated efficiency in some heat engines. These heat engines are called endoreversible engines. These endoreversible engines are rated from the (equation) Chambadal-Novikov efficiency (Nu) = 1.- sqrt(sink temperature low over temperature source high) or Nu = 1.-sqrt(tl/t2). These efficiency ratings are related to the Carnot engine, which was rated as Carnot efficiency (Nu)=1.-(t1/t2). As an electrical analog, the chart of a Novikov engine looks somewhat like a voltage source to resistors/LED to ground, where the output light is offset by resistor losses. For another example, the fire in a brick oven will cook the pizza with energy called the process heat fraction here, but much of the heat energy goes into heating the oven and the brick walls. Most of the testcases involve modeled data, using assumptions and rules of thumb .


Ideal Heat


Common sizes or ranges of burning chamber

Coefficients


Testcases Section

In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines).

Testcase 1

Pizza is baked for 20 minutes or 20*60, 1200 seconds in a brick oven, wood fired Sink temperature T1 (300) and source temperature T2 ( 900 ) are inputs.. The calculations should be carried out in Kelvin degrees. Exhaust or low temperature T1 is fixed at 300 degrees kelvin. Firing max temperature is calculated on a separate track, solving T**4 equation in chamber.

%| testcases | T1| T2|Carnot Nu | Endoreversible Nu

Endo fraction process K2*Nu|%
1 300 900 0.666 0.422 0.166
2 300 12000.75 0.5 0.187
3 300 14000.785 0.537 0.196
4 300 7000.57 0.345 0.142
quantityvalue
testcase number 1
piston diameter meters .5
piston height meters .5
piston firing seconds 1200
volume cubic meters 0.098
total energy MJ 153.962
piston volume m*m*m 0.0981
heat source temperature T2 900.
heat sink temperature T1 300.
max room fuel kg 83.448
estimated fuel, kg 11.404
total heat megajoules 153.962
firing max temperature 1202
man workdays to load fuel 0.0327
Carnot efficiency 0.666
Novikov efficiency 0.422
process fraction applied/total 0.166

Testcase 4

Testcase 5

One MMBtu = 1,000,000 Btu
mass_flow_rate = burning_area* fuel_burn_rate*fuel_density
   where fuel_burn_rate= initial_rate +  (e**+c*kelvin)

Testcase 6

testcase number: 6
max room fuel kg 2705.181
                                     
testcase number: 6
calculator inputs known values comment

Screenshots Section

figure 1. http://imageshack.us/a/img90/8319/nob.gif


References:

  • Kenyan Ceramic Jiko cooking stove, by Hugh Allen
  • Endoreversible Thermodynamics, Katharina Wagner,
  • thesis pub. Chemnitz University of Technology, July 07, 2008
  • [L1 ]
  • Introduction toEndoreversible Thermodynamics , Karl Heinz Hoffman,
  • Atti dell’Accademia Peloritana,February 01, 2008
  • Summary of heat engines, Lecture 12,
  • Endoreversible thermodynamics, wikipedia
  • Comment on concept of endoreversibility, Bjarne Andresen,
  • Oersted Laboratory, University of Copenhagen
  • Specific Heat Ratio of an Endoreversible Otto Cycle,R. Ebrahimi,Shahrekord University

Appendix Code

appendix TCL programs and scripts

        # pretty print from autoindent and ased editor
        # heat engine combustion calculator
        # written on Windows XP on eTCL
        # working under TCL version 8.5.6 and eTCL 1.0.1
        # gold on TCL WIKI , 9aug2013
        package require Tk
        namespace path {::tcl::mathop ::tcl::mathfunc}
        frame .frame -relief flat -bg aquamarine4
        pack .frame -side top -fill y -anchor center
        set names {{} {combustion chamber diameter meters:} }
        lappend names {combustion chamber height meters:}
        lappend names {heat source temperature input: }
        lappend names {heat sink temperature input: }
        lappend names {answer: volume cubic meters}
        lappend names {total heat units, megajoules:}
        lappend names {endo process, applied/total energy: }
        foreach i {1 2 3 4 5 6 7} {
    label .frame.label$i -text [lindex $names $i] -anchor e
    entry .frame.entry$i -width 35 -textvariable side$i
grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1         }
        proc about {} {
            set msg "Calculator for Heat Engine Combustion
            from TCL WIKI,
            written on eTCL "
            tk_messageBox -title "About" -message $msg }
        proc pi {} {expr acos(-1)}
        proc pistonvolumex { d h } {
            set  pistonvolumexxx [* .25 [pi] $d $d $h ]
            return $pistonvolumexxx
        }
        proc heatx { vol density } {
            set fuel_mass [* $vol $density]
            set total_heat [* $fuel_mass 40.1]
            return $total_heat
        }
        proc endothermic { theatsource tlow  } {
            set endo [expr { 1.-sqrt($tlow)/sqrt($theatsource)} ]
            return $endo
        }
        proc carnotthermic { theatsource tlow  } {
            set theatsource [* 1. $theatsource]
            set tlow  [* 1. $tlow]
            set carnot [- 1. [/ $tlow $theatsource]]
            return $carnot
        }
        proc endoprocess { theatsource tlow  } {
            set theatsource [* 1. $theatsource]
            set tlow  [* 1. $tlow]
            set endoprocess [* .25 [- 1. [/ $tlow $theatsource]]]
            return $endoprocess
            }        
        proc firebox { total_heat burn_time                            cross_section temp_ambient temp_flame} {
            set d $cross_section
            set firing_temp 1
            set heat_flux [/ $total_heat $burn_time]
            set heat_flux_persec [/ $heat_flux $burn_time]
            set cross_section [ / [* [pi] $d $d ] 4.]
            set item 25
            set temp_ambient 25
            set temp_flame 1488.
            set tx  $temp_ambient
            set taxx $temp_flame
            set t 25
            set h [/ $heat_flux_persec $cross_section]
            while {$item <= 4000} {
                incr item
                set t [+ $t 1 ]
                set term1 [* 1. $t $t $t $t]
                set term2 [* 1. $tx $tx $tx $tx]
                set term1 [* .000000000056703 [ - $term1                 $term2]]
                set term2 [* $h  1.1 [/ [- $taxx $t]  [ -                 $taxx $tx ]]]
                set difference  [abs [- $term1 $term2]]
                if {$difference < 2.} { set temp_answer $t }
            }
            return $temp_answer
        }
        proc calculate {     } {
            global answer2
            global side1 side2 side3 side4 side5
            global side6 side7 testcase_number fuel
            global piston_volume piston_temperature_exp
            global workdays total_heat massfromvolume
            global total_heat firebox_temp heatsourcetemp2
            global carnotefficiency novikovefficiency
            global idealappliedovertotal piston_firing_time
            global heatsinktemp1
            incr testcase_number
            set piston_diameter $side1
            set piston_height $side2
            set piston_firing_time [* 2 60 10]
            set heatsourcetemp2 $side3
            set heatsinktemp1 $side4
            set piston_volume 1
            set piston_volume [pistonvolumex $piston_diameter             $piston_height]
            set fuel_density 850
            set massfromvolume [* $piston_volume             $fuel_density]
            set fuel [* [ /  8.2 60.   ] $massfromvolume]
            set total_heat [* 13.5 $fuel]
            set temp_amb 25.
            set temp_flame 1488.
            set piston_temperature_exp $temp_flame
            set total_heat_joules [* $total_heat 1.0E6]
            set firebox_temp [firebox $total_heat_joules             $piston_firing_time $piston_diameter $temp_amb $temp_flame]
            if  {$piston_temperature_exp > 1200.}      {set                 piston_temperature_exp 1200}
            set workdays [/ $piston_volume 3. ]
            set carnotefficiency [ carnotthermic $heatsourcetemp2 $heatsinktemp1]
            set novikovefficiency [ endothermic $heatsourcetemp2 $heatsinktemp1]
            set idealappliedovertotal [ endoprocess $heatsourcetemp2 $heatsinktemp1]
            set fractionwork [ endoprocess $heatsourcetemp2 $heatsinktemp1]
            set side5 $piston_volume
            set side6 $total_heat
            set side7 $fractionwork  }
        proc fillup {aa bb cc dd ee ff gg} {
            .frame.entry1 insert 0 "$aa"
            .frame.entry2 insert 0 "$bb"
            .frame.entry3 insert 0 "$cc"
            .frame.entry4 insert 0 "$dd"
            .frame.entry5 insert 0 "$ee"
            .frame.entry6 insert 0 "$ff"
            .frame.entry7 insert 0 "$gg"}
        proc clearx {} {
            foreach i {1 2 3 4 5 6 7} {
                .frame.entry$i delete 0 end } }
        proc reportx {} {
            global side1 side2 side3 side4 side5
            global side6 side7 testcase_number fuel
            global piston_temperature massfromvolume
            global piston_volume workdays
            global total_heat firebox_temp
            global piston_temperature_exp
            global carnotefficiency novikovefficiency
            global idealappliedovertotal
            global piston_firing_time heatsourcetemp2
            global heatsinktemp1
            console show;
            puts "testcase number: $testcase_number"
            puts "piston diameter meters: $side1 "
            puts "piston height meters: $side2 "
            puts "piston firing seconds: $piston_firing_time "
            puts "volume cubic meters: $side5 "
            puts "total energy MJ: $side6 "
            puts "piston volume m*m*m: $piston_volume "
            puts "heat source temperature T2 $heatsourcetemp2"
            puts "heat sink temperature T1 $heatsinktemp1"
            puts "max room fuel kg $massfromvolume"
            puts "estimated fuel, kg $fuel"
            puts "total heat megajoules $total_heat"
            puts "firing max temperature  $firebox_temp "
            puts "man workdays to load fuel  $workdays"
            puts "Carnot  efficiency $carnotefficiency"
            puts "Novikov efficiency $novikovefficiency"
            puts "ideal applied/total $idealappliedovertotal "
            }
         frame .buttons -bg aquamarine4
        ::ttk::button .calculator -text "Solve" -command { calculate   }
        ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup .5 .5 900. 300. 0.0981  153.9 .166 }
        ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 1.5 1.5 1200. 300. 2.65  4156. .1875 }
        ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 2. 2. 1400. 300. 6.28  9853. .196 }
        ::ttk::button .clearallx -text clear -command {clearx }
        ::ttk::button .about -text about -command about
        ::ttk::button .cons -text report -command { reportx }
        ::ttk::button .exit -text exit -command {exit}
        pack .calculator  -in .buttons -side top -padx 10 -pady 5
        pack  .clearallx .cons .about .exit .test4 .test3 .test2   -side bottom -in .buttons
        grid .frame .buttons -sticky ns -pady {0 10}
        . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30
        wm title . "Heat Engine Combustion Calculator "       

Pushbutton Operation


For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console, but takes away from computer "efficiency". While the testcases are in meters, the units either cancel out or are carried through in the calculator equations. So the units could be entered as English feet, Egyptian royal cubits, Sumerian gars, or Chinese inches and the outputs of volume will in the same (cubic) units. This is an advantage since the units in the ancient Sumerian, Indian, and Chinese texts are open to question. In some benign quarters of the globe, feet and cubic feet were still being used for design in the 1970's.

For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers (which numbers will be cleared on the next solve button.) The command { calculate; reportx } or { calculate ; reportx; clearx } can be added or changed to report automatically, but is not recommended as computer efficiency is impaired. Another wrinkle would be to print out the current text, delimiters, and numbers in a TCL wiki style table as

  puts " %| testcase $testcase_number | value| units |comment |%"
  puts " &| volume| $volume| cubic meters |based on length $side1 and width $side2   |&"  

Initial Console Program


Comments Section

Please place any comments here, Thanks.