
Recent Posts
Recent Comments
 R.P. Churchill on A Simulationist’s Framework for Business Analysis: Round Two
 LN on A Simulationist’s Framework for Business Analysis: Round Two
 R.P. Churchill on Starting to Learn About the Java Memory Model
 R.P. Churchill on Multidimensional Arrays in Javascript
 Link on Multidimensional Arrays in Javascript
Categories
Meta
Tag Archives: thermodynamics
Prettying Up the 3D Graph Output
Here I’ve prettied the graph up so the lines change color every 100 degrees F, and I’ve added a legend. I suppose I could choose consecutive colors with a bit more contrast.
Graphing the Matrix Output
Here I continually run the heating routine for a piece with an initial temperature of 70 degrees in a furnace set to 2300 degrees. The temperature scale, expressed vertically, runs from 02500 degrees. The bottom of the piece, which sits … Continue reading
Finally Solving the Matrix
Once we get all the parameters calculated and the matrix loaded, then we can finally solve the thing. Here’s how the code looks:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 
function loadMatrix(index,fceTemp) { var i; var j; var k; var tsa; var tfa; var ts3; var tf4; tfa = arrayTfce[index] + Tabs; tf4 = tfa * tfa * tfa * tfa; for (k = 0; k <= sizeNodes; k++) { ZSRCE[k] = 0.0; ZAUX[k] = 0.0; for (i = 0; i <= sizeBandWidth; i++) ZMATX[k][i] = 0.0; } k = 0; for (j = 0; j < nodesHigh; j++) for (i = 0; i < nodesWide; i++) { k++; //nodal energy ZMATX[k][1] += arrayRho[i][j] * arrayCp[i][j]; ZSRCE[k] += arrayRho[i][j] * arrayCp[i][j] * arrayT[i][j]; //conduction to right if (arrayKright[i][j] > 0.0) { ZMATX[k][1] += arrayKright[i][j]; ZMATX[k][2] = arrayKright[i][j]; ZMATX[k+1][1] += arrayKright[i][j]; } //conduction up if (arrayKup[i][j] > 0.0) { ZMATX[k][1] += arrayKup[i][j]; ZMATX[k][1+nodesWide] = arrayKup[i][j]; ZMATX[k+nodesWide][1] += arrayKup[i][j]; } //radiation if (arrayRad[i][j] > 0.0) { tsa = arrayT[i][j]; ts3 = tsa * tsa * tsa; ZMATX[k][1] += arrayRad[i][j] * ts3; ZSRCE[k] += arrayRad[i][j] * tf4; } } } //loadMatrix function oneCalc(index) { calcParams(index); for (var i=0; i<nodesWide; i++) { for (var j=0; j<nodesHigh; j++) { arrayT[i][j] = arrayTpieces[index][i][j] + Tabs; } } loadMatrix(index); calcMatrix(); k = 0; for (var j=0; j<nodesHigh; j++) { for (var i=0; i<nodesWide; i++) { k++; arrayTpieces[index][i][j] = ZSRCE[k]  Tabs; } } } //oneCalc var loopCount = 0; var s="Temperatures after "+loopCount+" time steps<br />"; for (var j=nodesHigh1; j>=0; j) { for (var i=0; i<=nodesWide1; i++) { s += arrayTpieces[0][i][j].toPrecision(7) + ", "; } s += "<br />"; } document.getElementById("stuff").innerHTML = s; function runOneTime() { if (loopCount == 0) { for (var i=0; i< pieceCount; i++) { for (var j=0; j<nodesWide; j++) { for (var k=0; k<nodesHigh; k++) { arrayTpieces[i][j][k] = 70.0; } } } } else { oneCalc(0); } var s="Temperatures after "+loopCount+" time steps<br />"; for (var j=nodesHigh1; j>=0; j) { for (var i=0; i<=nodesWide1; i++) { s += arrayTpieces[0][i][j].toPrecision(7) + ", "; } s += "<br />"; } document.getElementById("stuff").innerHTML = s; loopCount++; if (loopCount > 20) { loopCount = 0; } } var intervalID = setInterval(runOneTime, 1000); 
We start with a 7×7node workpiece where the interior nodes are two inches wide and two … Continue reading
Dimensions and Other Considerations Before We Solve the Matrix
Yesterday’s post showed how some of the constants and parameters are initialized or calculated. Today we’ll describe a few more. This exercise defines a crosssection of a steel billet that is 8 inches by 8 inches and divided into five … Continue reading
Static and Dynamic Coefficients in Matrix Thermal Solutions
Recalling yesterday’s initial heat balance equation for each node: it should be noted that the values of both the specific heat and the thermal conductivity of steel are themselves functions of temperature. That means that these values need to be … Continue reading
A Specific Example of Equations To Be Solved By Matrix
Dividing a crosssection of a steel billet into nodes, we can start by looking at the energy balance for each node: All this equation is saying is that the change in the quantity of energy in a given node per … Continue reading
The Steam Table Form… Finally!
About two months ago I started making a web form that allowed a user to calculate thermodynamic values for saturated water as functions of either temperature and pressure. I got sidetracked for quite a while working on the graphing capability … Continue reading
Posted in Tools and methods
Tagged curve fitting, jQuery, thermodynamics, user entry forms
Leave a comment
Extending the Thermodynamic Functions To Their Full Range: Functions vs. Pressure
While finishing up the process of generating the plots of the thermodynamic functions vs. pressure I found an issue with how plots are drawn on the xaxis when the xaxis has a logarithmic scale. I calculated numeric values for every … Continue reading
Extending the Thermodynamic Functions To Their Full Range
Today I extended all 24 functions to their full range, 0705.44 °F and 0.088663203.6 psi. I’ve shown the functions vs. temperature; the functions vs. pressure are generally derived from the same lines in the steam tables so the only difference … Continue reading
Fixing the Thermodynamic Functions for Saturated Water As A Function of Temperature
I’ve updated five of the thermodynamic property functions vs. temperature. Note that most of these define properties only up to a bit above 600 °F and, more importantly, to 1800 psi. The values for saturated water are defined up to … Continue reading