summaryrefslogtreecommitdiffstats
path: root/Temparray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Temparray.cpp')
-rw-r--r--Temparray.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/Temparray.cpp b/Temparray.cpp
index 17889ae..115d199 100644
--- a/Temparray.cpp
+++ b/Temparray.cpp
@@ -240,7 +240,7 @@ void Temparray::calcTemp(){
temperatureold(i, j-1, k, l, m))*(1-exp(-(1/tau21))));
}
- /*if(m == 0) {
+ if(m == 0) {
area = (sqrt(pow((depth-innerdepth)/2, 2) + pow((width-innerwidth)/2, 2))* height) /
0.9 * meterperunit;
@@ -331,8 +331,8 @@ void Temparray::calcTemp(){
temperaturenew(i, j, k, l, 0) =
temperaturenew(i, j, k, l, 0) + ((temperatureold(i, j, k, l, 3) -
temperatureold(i, j, k, l, 0))*(1-exp(-(1/tau21))));
- }*/
- if(j == sy-1) {
+ }
+ if(j == 0) {
if(m % 2 == 0)area = (((depth - innerdepth)/2)*((width + innerwidth)/2))
/ 0.9 * meterperunit;
if(m % 2 == 1)area = (((width - innerwidth)/2)*((depth + innerdepth)/2))
@@ -349,8 +349,29 @@ void Temparray::calcTemp(){
tau12 = capacity * thermalresistance;
- temperaturenew(i, j, k, 0, m) =
- temperaturenew(i, j, k, 0, m) - ((temperatureold(i, j, k, 0, m) - earthtemp)
+ temperaturenew(i, j, k, l, m) =
+ temperaturenew(i, j, k, l, m) - ((temperatureold(i, j, k, l, m) - earthtemp)
+ *(1-exp(-(1/tau12))));
+ }
+ if(j == sy-1) {
+ if(m % 2 == 0)area = (((depth - innerdepth)/2)*((width + innerwidth)/2))
+ / 0.9 * meterperunit;
+ if(m % 2 == 1)area = (((width - innerwidth)/2)*((depth + innerdepth)/2))
+ / 0.9 * meterperunit;
+
+ thermalresistance = (3 + height/2) / 0.9 * meterperunit /(conductivity * area);
+
+ if(m % 2 == 0)capacity = specificcapacity *((((depth - innerdepth)/2)*
+ ((width + innerwidth)/2)*height)
+ / 0.9 * meterperunit);
+ if(m % 2 == 1)capacity = specificcapacity *((((width - innerwidth)/2)*
+ ((depth + innerdepth)/2)*height)
+ / 0.9 * meterperunit);
+
+ tau12 = capacity * thermalresistance;
+
+ temperaturenew(i, j, k, l, m) =
+ temperaturenew(i, j, k, l, m) - ((temperatureold(i, j, k, l, m) - basementtemp)
*(1-exp(-(1/tau12))));
}
}
@@ -379,8 +400,8 @@ void Temparray::calcTemp(){
temperatureold(i-1, j, k, 0, 3))*(1-exp(-(1/tau12))));
}
if (i == 0 || i == sx-1) {
- int h=3;
- if(i == sx-1) h=1;
+ int h=1;
+ if(i == sx-1) h=3;
width = cubehole(i, j, k, 0).getWidth();
height = cubehole(i, j, k, 0).getHeight();
@@ -425,8 +446,8 @@ void Temparray::calcTemp(){
temperatureold(i, j, k-1, 0, 0))*(1-exp(-(1/tau12))));
}
if(k == 0 || k == sz-1) {
- int h=0;
- if(i == sz-1) h=2;
+ int h=2;
+ if(k == sz-1) h=0;
width = cubehole(i, j, k, 0).getWidth();
height = cubehole(i, j, k, 0).getHeight();