summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Temparray.cpp41
1 files changed, 32 insertions, 9 deletions
diff --git a/Temparray.cpp b/Temparray.cpp
index c03ea48..ed45074 100644
--- a/Temparray.cpp
+++ b/Temparray.cpp
@@ -39,25 +39,48 @@ Temparray::Temparray(float initialtemp, int x0, int y0, int z0){
void Temparray::calcTemp(){
float specificconductivity = 0.7;
- float areasmall, areabig, distance, capacity, volume;
+ float areasmall, areabig, distance, capacity, capacity2, volume, thermalresistance, tau12, tau21;
float meterperunit = 3.0;
+ float width, height, depth, innerwidth, innerdepth;
+ float width2, height2, depth2, innerwidth2, innerdepth2;
for(int i = 0; i < sx; ++i) {
for(int j = 0; j < sy; ++j) {
for(int k = 0; k < sz; ++k) {
for(int l = 5; l > 0; --l) {
for(int m = 0; m < 4; m++) {
+ width = cubehole(i, j, k, l).getWidth();
+ width2 = cubehole(i, j, k, l-1).getWidth();
+ height = cubehole(i, j, k, l).getHeight();
+ height2 = cubehole(i, j, k, l-1).getHeight();
+ depth = cubehole(i, j, k, l).getDepth();
+ depth2 = cubehole(i, j, k, l-1).getDepth();
+ innerwidth = cubehole(i, j, k, l).getInnerWidth();
+ innerwidth2 = cubehole(i, j, k, l-1).getInnerWidth();
+ innerdepth = cubehole(i, j, k, l).getInnerDepth();
+ innerdepth2 = cubehole(i, j, k, l-1).getInnerDepth();
+
if(m % 2 == 0) {
- areasmall = ((cubehole(i, j, k, l).getWidth() + cubehole(i, j, k, l).getInnerWidth())/2)*
- cubehole(i, j, k, l).getHeight();
- areabig = ((cubehole(i, j, k, l-1).getWidth() + cubehole(i, j, k, l-1).getInnerWidth())/2)*
- cubehole(i, j, k, l-1).getHeight();
+ areasmall = (((width + innerwidth)/2)*height) / 0.9 * meterperunit;
+ areabig = (((width2 + innerwidth2)/2)*height2) / 0.9 * meterperunit;
+
+ thermalresistance = ((depth2 / 2 - (depth2 - innerdepth2)/4) -
+ (depth / 2 - (depth - innerdepth)/4)) / 0.9 * meterperunit /
+ (specificconductivity * ((areasmall + areabig) / 2));
+
+ capacity = specificconductivity *((((width + innerwidth)/2)*height)/0.9*meterperunit);
+ capacity2 = specificconductivity *((((width2 + innerwidth2)/2)*height2)/0.9*meterperunit);
}
else if(m % 2 == 1) {
- areasmall = ((cubehole(i, j, k, l).getDepth()+ cubehole(i, j, k, l).getInnerDepth())/2)*
- cubehole(i, j, k, l).getHeight();
- areabig = ((cubehole(i, j, k, l-1).getDepth()+ cubehole(i, j, k, l-1).getInnerDepth())/2)*
- cubehole(i, j, k, l-1).getHeight();
+ areasmall = (((depth + innerdepth)/2)*height) / 0.9 * meterperunit;
+ areabig = (((depth2 + innerdepth2)/2)*height2) / 0.9 * meterperunit;
+
+ thermalresistance = ((width2 / 2 - (width2 - innerwidth2)/4) -
+ (width / 2 - (width - innerwidth)/4)) / 0.9 * meterperunit /
+ (specificconductivity * ((areasmall + areabig) / 2));
+
+ capacity = specificconductivity *((((depth + innerdepth)/2)*height)/0.9*meterperunit);
+ capacity2 = specificconductivity *((((depth2 + innerdepth2)/2)*height2)/0.9*meterperunit);
}
}
}