Source code
 
License
Because we believe in free software, we have made the code for this project freely available to anyone who is interested. For convenience, we have appended the most recent revision of the code at the time of this writing. You may access the up-to-date version from the repository at http://code.google.com/p/scc08/. This code is distributed under the GNU General Public License v3. You can view this license at http://www.gnu.org/licenses/gpl.html. 

    scc08 – heat diffusion model
    Copyright (C) 2009  Ben Batha, Daniel Cox, Gannon Nelson, William Phillips, and Jake Poston

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.


Physical Constants (constants.py)
location: trunk/constants.py
size: 637 bytes
last updated: r147 (April, 2009)

1	class Constants:
2	    stephan_boltzmann_constant = 1.3806503 * 10 ** -23
3	    SPECIFIC_HEATS = {
4	    # all specific heats are in J / kg / K
5	    'concrete': 1000.,
6	    'soil': 800.,
7	    'air': 1005.,
8	    }
9	    THERMAL_CONDUCTIVITIES = {
10	    # all thermal conductivities are in W / m / K
11	    'concrete': .38,
12	    'soil': .50,
13	    'air': .0257,
14	    }
15	    DENSITIES = {
16	    # all densities are in kg / m^3
17	    'concrete': 1200.,
18	    'soil': 1300.,
19	    'air': 1.205,
20	    }
21	    EMISSIVITIES = {
22	    # emissivities are scalars
23	    'concrete': 0.92,    # http://www.infrared-thermography.com/material-1.htm
24	    'soil': 0.89,
25	    'air': 0.30,
26	    }


Single Cell (cell.py)
location: trunk/cell.py
size: 539 bytes
last updated: r88 (March 23, 2009)

1	from constants import Constants as c
2	class Cell:
3	    def __init__(self, material, temperature=300.):
4	        self.material = material        # string to describe material (try ground, concrete, or air)
5	        self.temperature = temperature
6	        (self.density, self.thermal_conductivity, self.specific_heat_capacity, self.emissivity) = \
7	            (c.DENSITIES[material], c.THERMAL_CONDUCTIVITIES[material], c.SPECIFIC_HEATS[material], c.EMISSIVITIES[material])
8	
9	    def __str__(self):
10	        return "<" + str(self.temperature) + ">"


2D Grid (grid.py)
location: trunk/grid.py
size: 3.6 KB
last updated: r88 (March 23, 2009)
1	from numpy import shape as npshape
2	from constants import Constants as c
3	
4	class Grid:
5	    def __init__(self, fields, delta_x, delta_y, delta_t, sink_temperature):
6	        self.fields = fields
7	        self.shape = npshape(fields)
8	
9	        self.iteration = 0
10	        self.sink_temperature = sink_temperature
11	
12	        self.delta_x = delta_x
13	        self.delta_y = delta_y
14	
15	        self.delta_t = delta_t
16	
17	        print (delta_x, delta_y, delta_t)
18	
19	        # Your code has to do the work to create a field that works. It must be a 2D array of Cells
20	
21	    def __str__(self):
22	        return str(self.fields)
23	
24	    def downflux(self, i, j):
25	        if(j == 0):  # 2000 leagues under the sea
26	            return 0
27	        dimensions = self.delta_x / self.delta_y
28	        theta = self.delta_t / (self.fields[i][j].density * self.delta_x * self.delta_y * self.fields[i][j].specific_heat_capacity)
29	        thermal_conductivity_avg = (self.fields[i][j].thermal_conductivity + self.fields[i][j-1].thermal_conductivity) / 2.0
30	        delta_temperature = (self.fields[i][j-1].temperature - self.fields[i][j].temperature)
31	
32	        return dimensions * theta * thermal_conductivity_avg * delta_temperature
33	
34	    def upflux(self, i, j):
35	        if(j == self.shape[1] - 1): # watchin' the stars
36	            return self.blackbodyflux(i, j)
37	        dimensions = self.delta_x / self.delta_y
38	        theta = self.delta_t / (self.fields[i][j].density * self.delta_x * self.delta_y * self.fields[i][j].specific_heat_capacity)
39	        thermal_conductivity_avg = (self.fields[i][j].thermal_conductivity + self.fields[i][j+1].thermal_conductivity) / 2.0
40	        delta_temperature = (self.fields[i][j+1].temperature - self.fields[i][j].temperature)
41	
42	        return dimensions * theta * thermal_conductivity_avg * delta_temperature
43	
44	    def leftflux(self, i, j):
45	        if(i == 0): # far left... dude
46	            return 0
47	        dimensions = self.delta_y / self.delta_x
48	        theta = self.delta_t / (self.fields[i][j].density * self.delta_x * self.delta_y * self.fields[i][j].specific_heat_capacity)
49	        thermal_conductivity_avg = (self.fields[i][j].thermal_conductivity + self.fields[i-1][j].thermal_conductivity) / 2.0
50	        delta_temperature = (self.fields[i-1][j].temperature - self.fields[i][j].temperature)
51	
52	        return dimensions * theta * thermal_conductivity_avg * delta_temperature
53	
54	    def rightflux(self, i, j):
55	        if(i == self.shape[0] - 1): # far right, sir.
56	            return 0
57	        dimensions = self.delta_y / self.delta_x
58	        theta = self.delta_t / (self.fields[i][j].density * self.delta_x * self.delta_y * self.fields[i][j].specific_heat_capacity)
59	        thermal_conductivity_avg = (self.fields[i][j].thermal_conductivity + self.fields[i+1][j].thermal_conductivity) / 2.0
60	        delta_temperature = (self.fields[i+1][j].temperature - self.fields[i][j].temperature)
61	
62	        return dimensions * theta * thermal_conductivity_avg * delta_temperature
63	
64	    def blackbodyflux(self, i, j):
65	        theta = self.delta_t / (self.fields[i][j].density * self.delta_x * self.delta_y * self.fields[i][j].specific_heat_capacity)
66	        temperature_flux = self.fields[i][j].temperature ** 4 - self.sink_temperature ** 4
67	        return -1.0 * theta * c.stephan_boltzmann_constant * self.delta_x * self.fields[i][j].emissivity * temperature_flux
68	
69	    def calculate(self, i, j):
70	        return self.fields[i][j].temperature + self.upflux(i,j) + self.downflux(i,j) + self.leftflux(i,j) + self.rightflux(i,j) \
71	            + self.blackbodyflux(i,j)
72	
73	    def step(self):
74	        for i in range(self.shape[0]):
75	            for j in range(self.shape[1]):
76	                self.fields[i][j].temperature = self.calculate(i,j)


Cell → XML Converter (CelltoXML.py)
location: trunk/CelltoXML.py
size: 2.8 KB
last updated: r128 (March 25, 2009)
1	#! /usr/bin/python
2	
3	import cell as cell
4	from xml.dom.minidom import Document
5	from os.path import exists
6	import psyco
7	
8	psyco.full()
9	
10	def toXML(cellArray, filename = ''):
11	    # Create the minidom document
12	    doc = Document()
13	
14	    # Create the <wml> base element
15	    wml = doc.createElement("Run1")
16	    doc.appendChild(wml)
17	    for i in range (0, len(cellArray)):
18	        for j in range (0, len(cellArray[i])):
19	
20	            # Create the main <card> element
21	            material = ""
22	            temperature = ""
23	            density = ""
24	            thermal_conductivity = ""
25	            specific_heat_capacity = ""
26	            emissivity = ""
27	            material += cellArray[i][j].material
28	            temperature += "%s"% cellArray[i][j].temperature
29	            thermal_conductivity += "%s"% cellArray[i][j].thermal_conductivity
30	            specific_heat_capacity += "%s"% cellArray[i][j].specific_heat_capacity
31	            emissivity  += "%s"% cellArray[i][j].emissivity
32	            Node = doc.createElement("Cell")# +"%s"% j)
33	            wml.appendChild(Node)
34	            Coor = doc.createElement("Material-" + "%s"% i + "-" + "%s"% j)
35	            Coor.setAttribute("Type ", material)
36	            Node.appendChild(Coor)
37	
38	            Temp = doc.createElement("Temperature-" + "%s"% i + "-" + "%s"% j)
39	            Temp.setAttribute("u ", temperature)
40	            Node.appendChild(Temp)
41	
42	            Specific = doc.createElement("Specific_Heat-" + "%s"% i + "-" + "%s"% j)
43	            Specific.setAttribute("c", specific_heat_capacity)
44	            Node.appendChild(Specific)
45	
46	            Emissivity = doc.createElement("Emissivity-" + "%s"% i + "-" + "%s"% j)
47	            Emissivity.setAttribute("e", emissivity)
48	            Node.appendChild(Emissivity)
49	
50	            tConductivity = doc.createElement("Thermal_Conductivity-" + "%s"% i + "-" + "%s"% j)
51	            tConductivity.setAttribute("k", thermal_conductivity)
52	            Node.appendChild(tConductivity)
53	    kw = False
54	    i = 0
55	
56	    while(kw == False):
57	        if(filename == ""):
58	            if (exists("test" + "%s"% i + ".xml") == False):
59	                out_file = open("test" + "%s"% i + ".xml", "w")
60	                out_file.write(doc.toprettyxml(indent="  "))
61	                out_file.close()
62	                kw = True
63	            else:
64	                i += 1
65	        else:
66	            if (exists(filename + ".xml") == False):
67	                    out_file = open(filename + ".xml", "w")
68	                    out_file.write(doc.toprettyxml(indent="  "))
69	                    out_file.close()
70	            elif (exists(filename + "%s"% i + ".xml") == False):
71	                    out_file = open(filename + "%s"% i +  ".xml", "w")
72	                    out_file.write(doc.toprettyxml(indent="  "))
73	                    out_file.close()
74	                    kw = True
75	            else:
76	                    i += 1

XML → Cell Converter (XMLtoCell.py)
location: trunk/XMLtoCell.py
size: 1.5 KB
last updated: r128 (March 25, 2009)
1	#! /usr/bin/python
2	
3	from xml.dom import minidom
4	import urllib, sys
5	import psyco
6	
7	psyco.full()
8	
9	class readXML():
10	    def _init_(self):
11	
12	    def data(self):
13	        return self.data
14	    def read(self):
15	        Count = 0
16	        Data = []
17	
18	        for i in range (0, len(xmldoc.getElementsByTagName("Cell"))):
19	            for j in range (0, 15):
20	                data_list = xmldoc.getElementsByTagName("Material-" + "%s"% i + "-" + "%s"% j)#  "[" + "%s"% i + "]" + "[" + "%s"% j + "]")
21	                for data_element in data_list:
22	                    type = data_element.getAttribute("Type")
23	
24	                data_list = xmldoc.getElementsByTagName("Temperature-" + "%s"% i + "-" + "%s"% j)
25	                for data_element in data_list:
26	                    t = data_element.getAttribute("u")
27	
28	                data_list = xmldoc.getElementsByTagName("Specific_Heat-" + "%s"% i + "-" + "%s"% j)
29	                for data_element in data_list:
30	                    c = data_element.getAttribute("c")
31	
32	                data_list = xmldoc.getElementsByTagName("Emissivity-" + "%s"% i + "-" + "%s"% j)
33	                for data_element in data_list:
34	                    e = data_element.getAttribute("e")
35	
36	                data_list = xmldoc.getElementsByTagName("Thermal_Conductivity-" + "%s"% i + "-" + "%s"% j)
37	                for data_element in data_list:
38	                    k = data_element.getAttribute("k")
39	                
40	                Data.append([str(type),float(t),float(c),float(e),float(k)])

Driver (driver.py)
location: trunk/driver.py
size: 4.6 KB
last updated: r129 (March 26, 2009)

1	import psyco
2	import numpy as np
3	from cell import Cell
4	from grid import Grid
5	import copy as cp
6	#import matplotlib.pyplot as plt
7	#from pylab import *
8	import CelltoXML as xml
9	import time
10	import math
11	
12	psyco.full()
13	
14	class Driver():
15	
16	    def __init__(self, deltax, deltay, deltat, case, bridge, dimensions, soilTemp, airTemp, concreteTemp):
17	        """
18	        Creates a grid to run, initializes all of the cells
19	        with the data, bridge stores (startx, starty, endx, endy)
20	        dimensions are the (height, and width of the bridge
21	        case 1: air
22	        case 2: air and ground
23	        """
24	
25	        #initialize class variables
26	        self.deltax = deltax
27	        self.deltay = deltay
28	        self.deltat = deltat
29	        self.bridge = bridge
30	        #initialize useful variables
31	        self.dimensions = dimensions
32	        self.ground = Cell('soil', soilTemp)
33	        self.air = Cell('air', airTemp)
34	        self.concrete = Cell('concrete', concreteTemp)
35	
36	        self.fields = []
37	        if case == 1:
38	            self.fillAir()
39	        else:
40	            self.fillGround()
41	
42	        self.myGrid = Grid(self.fields, self.deltax, self.deltay, self.deltat, 2.725)
43	
44	
45	    def run(self, iterations):
46	        """
47	        Runs the grid for a specified number of iterations
48	        """
49	        #print self.myGrid
50	        #print self.myGrid.fields
51	
52	        for i in range(iterations):
53	            self.myGrid.step()
54	
55	
56	    def fillAir(self):
57	        """
58	        Initializes the cells in the grid, with concrete surronded by air
59	        """
60	
61	        for i in range(self.dimensions[1]):
62	            for j in range(self.dimensions[0]):
63	                if ((i >= self.bridge[0] and i <= self.bridge[2]) \
64	                and (j >= self.bridge[1] and j <= self.bridge[3])):
65	                    self.fields.append(cp.deepcopy(self.concrete))
66	                else:
67	                    self.fields.append(cp.deepcopy(self.air))
68	
69	        self.fields = np.reshape(self.fields, (self.dimensions[0],self.dimensions[1]))
70	
71	    def fillGround(self):
72	        """
73	        Initializes the cells in the grid, with concrete surronded by ground
74	        """
75	
76	        for i in range(self.dimensions[1]):
77	            for j in range(self.dimensions[0]):
78	                if (i >= self.bridge[0] and i <= self.bridge[2]):
79	                    if(j >= self.bridge[1] and j <= self.bridge[3]):
80	                        self.fields.append(cp.deepcopy(self.concrete))
81	                    else:
82	                        self.fields.append(cp.deepcopy(self.ground))
83	
84	                elif (i > self.bridge[2]):
85	                    self.fields.append(cp.deepcopy(self.ground))
86	
87	                else:
88	                    self.fields.append(cp.deepcopy(self.air))
89	
90	
91	        self.fields = np.reshape(self.fields, (self.dimensions[1],self.dimensions[0]))
92	
93	    def changeAir(self, amount):
94	        for i in self.fields:
95	            for j in i:
96	                if j.material == 'air':
97	                    j.temperature + amount
98	
99	    def dayNight(self, time):
100	        amount = 10 * math.sin(  (2 * math.pi * time) / ( 86400 ) - math.pi / 3 )
101	        self.changeAir(amount)
102	        
103	    def toXML(self, numIter, name): #, interval, cellArray):
104	        for i in range(numIter):
105	            self.myGrid.step()
106	            self.dayNight(self.deltat * i)
107	            xml.toXML(self.myGrid.fields, name) #enter name
108	
109	    def checkCement(self):
110	        for i in self.fields:
111	            for j in i:
112	                if(j.material == 'concrete'):
113	                    if(j.temperature <= 273.13):
114	                        return False
115	                    else:
116	                        return True
117	
118	    def tillFrozen(self, increment, name):
119	        """runs the model until the first cement is frozen"""
120	        i = 0
121	        while self.checkCement():
122	            self.myGrid.step()
123	            self.dayNight(self.deltat * i)
124	            i += increment
125	            xml.toXML(self.myGrid.fields, name) #enter name
126	        return i
127	
128	    def rapidChange(self, increment, name, when, amount):
129	        """runs the model until the first cement is frozen"""
130	        i = 0
131	        happened = False
132	        while self.checkCement():
133	            self.myGrid.step()
134	            self.dayNight(self.deltat * i)
135	            if(happened == False and i >= when):
136	                self.changeAir(amount)
137	                happened = True
138	            i += increment
139	            xml.toXML(self.myGrid.fields, name) #enter name
140	        return i
141	
142	if __name__ == "__main__":
143	    dr = Driver(.5, .5, 0.0004, 2, (7,7,9,9), (16,16), 300,300,300) # don't use time steps over 4 * 10 ** -4
144	
145	    dr.toXML(2, "filename")

Graphical User Interface (gui.py)
location: trunk/gui.py
size: 3.1 KB
last updated: r148 (April 1, 2009)
1	import psyco
2	import numpy as np
3	from cell import Cell
4	from grid import Grid
5	import copy as cp
6	from pylab import *
7	import time
8	from driver import Driver
9	
10	psyco.full()
11	
12	
13	def updateData(dr):
14	    data = []
15	    temp = dr.myGrid.fields
16	    for i in range(len(temp)):
17	        data.append([])
18	        for j in range(len(temp[i])):
19	            data[i].append(temp[i][j].temperature)
20	    return data
21	
22	def getMats(dr):
23	    mats = []
24	    temp = dr.myGrid.fields
25	    for i in range(len(temp)):
26	        mats.append([])
27	        for j in range(len(temp[i])):
28	            mats[i].append(temp[i][j].density)
29	    return mats
30	
31	def setLabels(type):
32	    xlabel("Meters")
33	    ylabel("Meters")
34	    if (type == 2):
35	        title("A road")
36	    else:
37	        title("A bridge")
38	
39	def setUserInput():
40	    str = raw_input("What do you want: Ground or Air? (The default is air) \n")
41	    str
42	    if(str == "Ground" or str == "ground"):
43	        type = 2
44	    else:
45	        type = 1
46	    return type
47	
48	def getAirPts(dr):
49	    temp = dr.myGrid.fields
50	    for i in range(len(temp)):
51	        for j in range(len(temp[i])):
52	            if(temp[i][j].material == 'air'):
53	                return temp[i][j].temperature
54	
55	def getBridgePts(dr):
56	    temp = dr.myGrid.fields
57	    for i in range(len(temp)):
58	        for j in range(len(temp[i])):
59	            if(temp[i][j].material == 'cement'):
60	                return temp[i][j].temperature
61	
62	def getGroundPts(dr, type):
63	    if (type != 2):
64	        return None
65	    else:
66	        temp = dr.myGrid.fields
67	        for i in range(len(temp)):
68	            for j in range(len(temp[i])):
69	                if(temp[i][j].material == 'ground'):
70	                    return temp[i][j].temperature
71	def run():
72	    type = setUserInput()
73	    dr = Driver(.5, .5, 0.0004, type, (7,7,9,9), (16,16), 300,300,300) # don't use time steps over 4 * 10 ** -4
74	    current = updateData(dr)
75	    gmats = getMats(dr)
76	    countsteps = 0
77	    ion()
78	    
79	    setLabels(type)
80	    airdata = []
81	    grounddata = []
82	    bridgedata = []
83	    airdata.append(getAirPts(dr))
84	    grounddata.append(getGroundPts(dr, type))
85	    bridgedata.append(getBridgePts(dr))
86	
87	    datapts = plot(airdata, 'g+', grounddata, 'b+')#, bridgedata, 'r*')
88	    
89	    subplot(211)
90	    airdata.append(getAirPts(dr))
91	    grounddata.append(getGroundPts(dr, type))
92	    bridgedata.append(getBridgePts(dr))
93	    CS = contour(gmats, type+1)
94	    subplot(212)
95	    grid(True)
96	    xlabel("The timestep is: " + str(countsteps*.004))
97	    ylabel("Temperature")
98	    datapts = plot(airdata, 'gD-', grounddata, 'bs-') #, bridgedata, 'r*')
99	    for i in range(1,20000):
100	        dr.run(10)
101	        current = updateData(dr)
102	#        clf()
103	        airdata.append(getAirPts(dr))
104	        grounddata.append(getGroundPts(dr, type))
105	        bridgedata.append(getBridgePts(dr))
106	        subplot(211)
107	        CSF = contourf(current)
108	        CD = colorbar(CSF, extend ='both')
109	        subplot(212)
110	        datapts  = plot(airdata, 'gD-', grounddata, 'bs-')#, bridgedata, 'r*')
111	        xlabel("The timestep is: " + str(countsteps*.004))
112	        countsteps += 10
113	#        show()
114	#        draw()
115	
116	
117	if __name__ == "__main__":
118	    run()

Automatic Runner (jake.py)
location: trunk/jake.py
size: 6.6 KB
last updated: r125 (March 25, 2009)
1	import copy as cp
2	import numpy as np
3	from driver import Driver
4	
5	savedir = "output/"
6	
7	#                        deltax, deltay, deltat, (concrete locs), (dimensions), soil, air, concrete
8	coldfrontroad = Driver(.5, .5, 0.0004, 2, (56,56,72,72), (128,128), 300, 300, 300)
9	end = coldfrontroad.rapidChange(10, "coldfrontroad1Temp", 10000, -30)
10	print "running the first"
11	f = open(savedir + "coldfrontroad1Temp.data")
12	f.write(end + "\n" "for regular, temperature 300,300,300")
13	f.close()
14	print "done"
15	
16	
17	coldfrontroad = Driver(.5, .5, 0.0004, 2, (56,56,72,72), (128,128), 330, 340, 320)
18	end = coldfrontroad.rapidChange(10, "coldfrontroad2Temp", 10000, -30)
19	print "running the first"
20	a = open(savedir + "coldfrontroad2Temp.data")
21	a.write(end + "\n" "for regular, temperature 330,340,320" )
22	a.close()
23	print "done"
24	
25	
26	coldfrontroad = Driver(.5, .5, 0.0004, 2, (56,56,72,72), (128,128), 315, 360, 273)
27	end = coldfrontroad.rapidChange(10, "coldfrontroad3Temp", 10000, -30)
28	print "running the first"
29	b = open(savedir + "coldfrontroad3Temp.data")
30	b.write(end + "\n" "for regular, temperature 315,360,273")
31	b.close()
32	print "done"
33	###############################################################################################################################
34	
35	largeboundaryroad = Driver(.5, .5, 0.0004, 2, (56,56,72,72), (128,128), 300, 300, 300)
36	end = coldfrontroad.tillFrozen(10, "largeboundaryroad1Temp")
37	print "running the first"
38	c = open(savedir + "largeboundaryroad1Tempdata")
39	c.write(end + "\n" "for (56,56,72,72) - (128,128)  temperature 300,300,300")
40	c.close()
41	print "done"
42	
43	
44	
45	coldfrontroad = Driver(.5, .5, 0.0004, 2, (56,56,72,72), (128,128), 330, 340, 320)
46	end = coldfrontroad.tillFrozen(10, "largeboundaryroad2Temp")
47	print "running the first"
48	d = open(savedir + "largeboundaryroad2Temp.data")
49	d.write(end + "\n" "for (56,56,72,72) - (128,128)  temperature 330,340,320")
50	d.close()
51	print "done"
52	
53	
54	
55	
56	coldfrontroad = Driver(.5, .5, 0.0004, 2, (56,56,72,72), (128,128), 315, 360, 273)
57	end = coldfrontroad.tillFrozen(10, "largeboundaryroad3Temp")
58	print "running the first"
59	e = open(savedir + "largeboundaryroad3Temp.data")
60	e.write(end + "\n" + "for (56,56,72,72) - (128,128) temperature 315,360,273")
61	e.close()
62	print "done"
63	
64	################################################################################################################################
65	
66	coldfrontroad = Driver(.5, .5, 0.0004, 2, (20,20,108,108), (128,128), 300, 300, 300)
67	end = coldfrontroad.tillFrozen(10, "largeroad1Temp")
68	print "running the first"
69	g = open(savedir + "largeroad1Temp.data")
70	g.write(end + "\n" + "for (20,20,108,108) - (128,128) temperature 300,300,300")
71	g.close()
72	print "done"
73	
74	
75	coldfrontroad = Driver(.5, .5, 0.0004, 2, (20,20,108,108), (128,128), 330, 340, 320)
76	end = coldfrontroad.tillFrozen(10, "largeroad2Temp")
77	print "running the first"
78	h = open(savedir + "largeroad2Temp.data")
79	h.write(end + "\n" + "for (20,20,108,108) - (128,128) temperature 330,340,320")
80	h.close()
81	print "done"
82	
83	
84	coldfrontroad = Driver(.5, .5, 0.0004, 2, (20,20,108,108), (128,128), 315, 360, 273)
85	end = coldfrontroad.tillFrozen(10, "largeroad1Temp")
86	print "running the first"
87	i = open(savedir + "largeroad1Temp.data", )
88	i.write(end + "\n" + "for (20,20,108,108) - (128,128) temperature 315,360,273")
89	i.close()
90	print "done"
91	
92	#################################################################################################################################
93	
94	import copy as cp
95	import numpy as np
96	from driver import Driver
97	
98	#                        deltax, deltay, deltat, what, (concrete locs), (dimensions), soil, air, concrete
99	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (56,56,72,72), (128,128), 300, 300, 300)
100	end = coldfrontbridge.rapidChange(10, "coldfrontbridge1Temp", 10000, -30)
101	print "running the first"
102	f = open(savedir + "coldfrontbridge1Temp.data")
103	f.write(end + "\n" "for regular, temperature 300,300,300")
104	f.close()
105	print "done"
106	
107	
108	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (56,56,72,72), (128,128), 330, 340, 320)
109	end = coldfrontbridge.rapidChange(10, "coldfrontbridge2Temp", 10000, -30)
110	print "running the first"
111	a = open(savedir + "coldfrontbridge2Temp.data")
112	a.write(end + "\n" "for regular, temperature 330,340,320" )
113	a.close()
114	print "done"
115	
116	
117	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (56,56,72,72), (128,128), 315, 360, 273)
118	end = coldfrontbridge.rapidChange(10, "coldfrontbridge3Temp", 10000, -30)
119	print "running the first"
120	b = open(savedir + "coldfrontbridge3Temp.data")
121	b.write(end + "\n" "for regular, temperature 315,360,273")
122	b.close()
123	print "done"
124	###############################################################################################################################
125	
126	largeboundarybridge = Driver(.5, .5, 0.0004, 1, (56,56,72,72), (128,128), 300, 300, 300)
127	end = coldfrontbridge.tillFrozen(10, "largeboundarybridge1Temp")
128	print "running the first"
129	c = open(savedir + "largeboundarybridge1Tempdata")
130	c.write(end + "\n" "for (56,56,72,72) - (128,128)  temperature 300,300,300")
131	c.close()
132	print "done"
133	
134	
135	
136	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (56,56,72,72), (128,128), 330, 340, 320)
137	end = coldfrontbridge.tillFrozen(10, "largeboundarybridge2Temp")
138	print "running the first"
139	d = open(savedir + "largeboundarybridge2Temp.data")
140	d.write(end + "\n" "for (56,56,72,72) - (128,128)  temperature 330,340,320")
141	d.close()
142	print "done"
143	
144	
145	
146	
147	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (56,56,72,72), (128,128), 315, 360, 273)
148	end = coldfrontbridge.tillFrozen(10, "largeboundarybridge3Temp")
149	print "running the first"
150	e = open(savedir + "largeboundarybridge3Temp.data")
151	e.write(end + "\n" + "for (56,56,72,72) - (128,128) temperature 315,360,273")
152	e.close()
153	print "done"
154	
155	################################################################################################################################
156	
157	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (20,20,108,108), (128,128), 300, 300, 300)
158	end = coldfrontbridge.tillFrozen(10, "largebridge1Temp")
159	print "running the first"
160	g = open(savedir + "largebridge1Temp.data")
161	g.write(end + "\n" + "for (20,20,108,108) - (128,128) temperature 300,300,300")
162	g.close()
163	print "done"
164	
165	
166	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (20,20,108,108), (128,128), 330, 340, 320)
167	end = coldfrontbridge.tillFrozen(10, "largebridge2Temp")
168	print "running the first"
169	h = open(savedir + "largebridge2Temp.data")
170	h.write(end + "\n" + "for (20,20,108,108) - (128,128) temperature 330,340,320")
171	h.close()
172	print "done"
173	
174	
175	coldfrontbridge = Driver(.5, .5, 0.0004, 1, (20,20,108,108), (128,128), 315, 360, 273)
176	end = coldfrontbridge.tillFrozen(10, "largebridge1Temp")
177	print "running the first"
178	i = open(savedir + "largebridge1Temp.data", )
179	i.write(end + "\n" + "for (20,20,108,108) - (128,128) temperature 315,360,273")
180	i.close()
181	print "done"

http://code.google.com/p/scc08/http://www.gnu.org/licenses/gpl.htmlhttp://www.gnu.org/licenses/http://www.infrared-thermography.com/material-1.htmshapeimage_2_link_0shapeimage_2_link_1shapeimage_2_link_2shapeimage_2_link_3