Heat flow through concrete floor

26
16 October 2015 Finite Element Method – Flow Analysis Prepared by Maan Al-Haideri Katharina Wagner Amy Do

Transcript of Heat flow through concrete floor

Page 1: Heat flow through concrete floor

16 October 2015

Finite Element Method – Flow Analysis

Prepared by

Maan Al-Haideri

Katharina Wagner

Amy Do

Page 2: Heat flow through concrete floor

Table of content

1 Introduction 1

2 Theory 2

2.1 Strong and weak form of 2-dim transient heat flow 2

2.2 Spatial approximation of 2-dim transient heat flow: 2

2.3 Approximation in time 3

2.4 Convection 4

3 Method 5

3.1 Assumptions 5

3.2 Model 5

4 Results 6

4.1 Influence of time stepping parameters 6

4.2 Temperature distribution 8

4.3 Concrete surface 11

4.4 Supplied heat power 11

5 Discussion 12

6 References 13

7 Appendix 14

7.1 Code 14

7.2 compare time-stepping parameters 20

Page 3: Heat flow through concrete floor

1

1 Introduction To understand the heating mechanism and behaviour of a concrete floor slab with hollow cores,

a transient heat flow problem was modeled and solved. Hot air flows through every other

cylindrical cavity, and heats up the concrete surrounding it, and subsequently the air that is in

contact with the concrete. Figure 1, which is based on [1], illustrates the material and

dimensions of a cross section of the floor slab.

Figure 1: Geometry of the concrete floor problem, modified from [1]

Because the problem was symmetric, to simplify the solution, only one element, looking like

Figure 2, of the floor slab was considered.

Figure 2: Boundary conditions of the concrete floor problem, modified from [1]. Red shows the borders of the modelled system

Page 4: Heat flow through concrete floor

2

A convection layer at the surface of the concrete was modelled using the boundary condition

qn = α(T-T∞), with α being the inverse of the internal flow resistance Rsi and T∞ being the

temperature far away from the concrete surface, i.e. room temperature. A finite element model

was set up and solved using MatLab with the geometry and boundary conditions illustrated

above. An explanation of the basic transient heat flow theory is provided to aid the

understanding of the solution.

2 Theory

2.1 Strong and weak form of 2-dim transient heat flow This transient heat flow problem was solved using the finite element method. Similar to the one

dimensional transient heat flow equation, the strong form of the two dimensional transient heat

flow may be derived from inserting a heat capacity term and Fourier’s law to the heat-balance

equation.

The strong form of the two dimensional transient heat flow:

𝐝𝐢𝐯(𝑡ℎ𝐃𝛁T) + 𝑡ℎ𝐐 = 𝜌𝑡ℎ𝐜𝑑𝑇

𝑑𝑡; 𝑖𝑛 𝑟𝑒𝑔𝑖𝑜𝑛 𝐴

𝑞𝑛 = ℎ 𝑜𝑛 𝐿ℎ

𝑇 = 𝑔 𝑜𝑛 𝐿𝑔

Where 𝑡ℎthe thickness, q is the flux, 𝜌 is the density of the material, c is the heat capacity, T is

the temperature, and Q is heat supply.

The weak form of the two dimensional transient heat flow may be derived from the strong form

by multiplying the balance equation with an arbitrary, time-independent weight function v(x,y)

and integrating over the region, and using the Green-Gauss theorem then using that q=-D𝛁𝑇.

This gives the weak form of two dimensional transient heat flow:

∫𝐴(𝛁𝑣)𝑇

𝑡ℎ𝑫𝛁T𝐝𝐀 + ∫𝐴𝜌𝑡ℎ𝐜𝑑𝑇

𝑑𝑡𝐝𝐀 = −∮ 𝐿ℎ

𝐯𝑡ℎℎ𝑑𝐿 − ∮ 𝐿𝑔𝑣𝑡ℎ𝐪𝐧𝑑𝐿 + ∫𝐴𝑣𝑡ℎ𝐐𝐝𝐀

𝑇 = 𝑔 𝑜𝑛 𝑠𝑢𝑟𝑓𝑎𝑐𝑒 𝑆𝑔

Since this equation contains time and also directional derivatives, the approximations for the

temperature must be made in both space and the time.

2.2 Spatial approximation of 2-dim transient heat flow: The approximation for the temperature is separated in

𝑇(𝑥, 𝑦, 𝑡) = 𝐍(𝑥, 𝑦)𝐚(𝑡)

Where 𝐍(𝑥, 𝑦) describes the shape functions and 𝐚(𝑡) are the nodal temperatures.

Since the shape function is independent from the time and the temperature function is

independent of spatial coordinates, and the weak form of the heat flow equation includes a

derivative of time and another derivative of spatial coordinates it may be written

𝛁𝐓 = 𝛁𝐍𝐚 = 𝐁𝐚 𝑑𝑇

𝑑𝑡= 𝐍

𝑑𝐚

𝑑𝑡= 𝐍�̇�

A scalar weight function v is chosen using the Galerkin method

𝑣 = 𝐍𝐜 = 𝐜𝐓𝐍𝐓

𝛁𝑣 = 𝐜𝐓𝐁𝐓 where 𝐁𝐓 = 𝛁𝐍𝐓

When the approximation and the weight functions are inserted, and after some steps the

following equation is achieved:

Which also can be written as:

Page 5: Heat flow through concrete floor

3

𝐊𝐚 + 𝐂�̇� = 𝐟𝒃 + 𝐟𝒍

Where:

2.3 Approximation in time The finite element equations have to be approximated in time as well. Different choices of the

time approximation may be made. Only a linear time approximation is considered. Since the

approximation in time is scalar, the temperature at the next time step 𝑎𝑖+1could be written

Where the average force f ̅is:

The weight parameter here is:

The point collocation method described in [2], is adopted to determine the weight parameter. A

Dirac’s function may be chosen for 𝜔 at different times in the time-step. Three common choices

were examined. 𝜏 = 0, 𝜏 =∆𝑡

2, 𝑎𝑛𝑑 𝜏 = ∆𝑡

Choosing 𝜔 = 𝛿(𝜏 − 0) gives:

, which is called forward Euler or explicit method. Here no inversion of K occurs.

Choosing 𝜔 = 𝛿(𝜏 − ∆𝑡) gives:

Being called the backward Euler or Implicit method. This requires an inversion of K.

Choosing 𝜔 = 𝛿(𝜏 −∆𝑡

2) gives:

Page 6: Heat flow through concrete floor

4

, and this method is called Crank-Nicolson. Here an inversion of K is required.

Notable is that Θ is called α in MatLab and this nomenclature will be used throughout this

report.

2.4 Convection Heat flow in a body can be written as

[𝑞𝑥

𝑞𝑦] = −𝑫 [

𝑑𝑇

𝑑𝑥𝑑𝑇

𝑑𝑦

] − [𝑘𝑥 00 𝑘𝑦

] [

𝑑𝑇

𝑑𝑥𝑑𝑇

𝑑𝑦

]

, which leads to

𝑞𝑥 = −𝑘𝑥𝑑𝑇

𝑑𝑥

𝑞𝑦 = −𝑘𝑦𝑑𝑇

𝑑𝑦 ( 1 )

Convection assumes that only flow normal to the boundaries occur. A typical model for

convection can be seen in Figure 3. The convection can be written as

𝑞𝑛 = 𝛼(𝑇 − 𝑇∞)

Figure 3: modelling of convection [3]

If it is now assumed that the normal direction points in the y-direction, qx and qy become

𝑞𝑥 = 0

𝑞𝑦 = 𝛼(𝑇 − 𝑇∞) ( 2 )

The derivatives given in 𝑞𝑦 = −𝑘𝑦𝑑𝑇

𝑑𝑦 ( 1 ) can be changed to

𝑞𝑥 = 0

𝑞𝑦 = −𝑘𝑦𝑇∞−𝑇

𝑡 ( 3 )

Comparing 𝑞𝑦 = 𝛼(𝑇 − 𝑇∞) ( 2 ) with 𝑞𝑦 = −𝑘𝑦𝑇∞−𝑇

𝑡 (

3 ) leads to 𝑘𝑦

𝑡= 𝛼

And therefore

𝐃 = [0 00 𝛼𝑡

]

Page 7: Heat flow through concrete floor

5

3 Method The stated problem was solved using a finite element approach in MatLab. In MatLab,

CALFEM and a mesh module were added, which contain commands useful for the finite

element method.

3.1 Assumptions To solve this problem a few assumptions were necessary. One assumption was that no

convection occurred in the cavities. For the heated hole this assumption was justified as long as

the heated air has a higher velocity. In the other cavities convection can be neglected since the

temperature gradients inside the holes were very small. Another assumption was that the

problem is symmetric, therefore only half a heated and unheated cavity were modelled. Since

these model borders are symmetry lines, no flow was passing these borders. The floor under

the concrete was also assumed to be impermeable, this holds true if the conductivity of the

concrete is by magnitudes bigger than the one from the other material. The last assumption was

that convection only occurred in a well-defined layer above the concrete and the heat only flows

in the normal direction. This method is commonly used to calculate convection, therefore it was

also used here.

3.2 Model The first step of modelling was to define the geometry of the system. Since the geometry also

included circle segments, special attention had to be drawn to their modelling. Depending on

the program used the approach would be different. The inside of the heated cavity was not

modelled since the whole cavity had the same temperature for every time. Additionally, this

way it was easier to define the boundary conditions, since so the cavity temperature was just

set to be the boundary condition.

As soon as the geometry was defined, the number of elements on each segment had to be chosen

to define the mesh size for this problem. Since the problem was used for the temperature the

degrees of freedom per element were set as 1 and triangular elements were used to solve this

problem. After setting all the needed parameters the mesh was created and the nodal coordinates

were extracted.

In the next step the stiffness matrix and the force vector had to be defined. Therefore, the

thickness was chosen to be one meter to calculate the values per meter depth. The element

stiffness matrices and the element capacity matrices were separately calculated for every

material, namely concrete, air and the convection layer, and assembled in the according global

stiffness matrices. The force vector stayed empty since no flow was added inside the borders of

the system.

The boundary conditions were also defined. Along the border between the heated cavity and

the concrete the boundary condition was set to be 25°C and above the convection layer the

boundary condition was set to fit the room temperature of 22°C. The flow through the remaining

boundaries was 0 according to the assumptions.

Following, the initial values for the temperature had to be defined which were given to be 15°C

everywhere. The time stepping was defined and performed. Here several step-sizes as well as

weight parameter values were tested for their reliability. With the time-stepping it was possible

to obtain Tsnap, D and V. Tsnap stored the temperature at all nodes for certain time-steps, D

stored the temperature for all time-steps for certain nodes and V stored the temperature time

derivative for every time-step at certain nodes. Here all time-steps and nodes where selected so

Tsnap and D were the same.

Page 8: Heat flow through concrete floor

6

To obtain the temperatures at certain times, these had to be extracted from Tsnap. Also the

element flows and gradients were calculated for every examined time. Several plots showing

the temperature distribution in the whole model for a certain time were created with the before

extracted values. Also the temperatures along the concrete surface were extracted for certain

times to compare the temperature distribution for different times.

Since no heat was added inside the system 𝐊𝑎 + 𝐂�̇� = 𝐟𝐛 + 𝐟𝑙 = 𝐟𝐛 + 𝟎 = 𝐫 ( 4 ) holds true

𝐊𝑎 + 𝐂�̇� = 𝐟𝐛 + 𝐟𝑙 = 𝐟𝐛 + 𝟎 = 𝐫 ( 4 )

, where r describes the heat flow

And when this calculation is done for every time step:

𝐊 ∗ 𝑫 + 𝐂 ∗ 𝐕 = 𝐫 ( 5 )

Here r contains every heat flow for every element for every time step. To obtain the power

distribution into the room the flow out of the convection layer had to be sum up for every time

step and divided by the length and depth of the model to receive the power supply per square

meter.

4 Results

4.1 Influence of time stepping parameters To decide the optimal parameters for the time-stepping operation, various combinations of dt

and α were tested. Figure 4-Figure 7 show two of these tested combinations with dt=3600s and

dt=360s and all possible values for α, so α=0, α=0.5 and α=1. Figure 4 shows clear differences

between all three curves, especially the one for α=0 clearly differs from the other two, since the

solution is oscillating. Also the temperatures in Figure 5 vary between the different α.

For dt=360s Figure 6 shows that the differences between α=0.5 and α=1 were very small and

only visible for the beginning of the heat flow. Here the curve for α=0 was not included, since

it oscillated even more and did therefore not give any useful information.

As Figure 5 and Figure 7 show, the simulation with α=0 gave temperatures outside the possible

range of 15°C-25°C, therefore these temperatures are not shown in the graph. Since it was not

able to get rid of the oscillation for α=0 for small time-steps as small as dt=3.6s, a dt was chosen

that gave similar results for α=0.5 and α=1. This time-step was selected to be dt=360s and α to

be α=1.

Page 9: Heat flow through concrete floor

7

Figure 4: power supply at the concrete surface. The time-step was chosen to be dt=3600s. This figure depicts the different

outcomes for the power supply for varying α.

Figure 5: temperature distribution on the concrete surface for different times. The time-step was chosen to be dt=3600. The

dots represent the values for α=0, the circles represent α=0.5 and the x-marks represent α=1.

Page 10: Heat flow through concrete floor

8

Figure 6: power supply at the concrete surface. The time-step was chosen to be dt=360. This figure depicts the different

outcomes for the power supply for varying α. The curve for α=0 was not plotted, since it oscillated even more than for Figure

4.

Figure 7: temperature distribution on the concrete surface for different times. The time-step was chosen to be dt=360. The

dots represent the values for α=0, the circles represent α=0.5 and the x-marks represent α=1.

4.2 Temperature distribution In the beginning, heat flowed from the area of the heated cavity and from the room into the

hollow core and the concrete. Because of the curved geometry, different initial temperatures,

different materials and the behaviour of the convection layer, however, heat did not flow in one

single direction. Eventually, the variation between temperatures in the floor slab, excluding the

convection layer, should become smaller as temperature equilibrium was approached. The

result of the finite element analysis reflected these fundamental physical rules. To illustrate this

point, Figure 8 and Figure 9 of the temperature fluxes were produced. At 1 hour, heat flow was

Page 11: Heat flow through concrete floor

9

greatest along the hot cavity, as heat was leaving this region rapidly. Some heat was also

flowing into the concrete from the room. Because concrete has a much higher thermal

conductivity than air, the heat flow through concrete was higher than that through the cold air

cavity. Much later in time, at 16 hours, flow had decreased across the floor, but there was still

some heat flow from the hot air towards the concrete surface and into the convection layer.

Figure 8: Heat flow through the model at 1 hour. The scaling factor used for the flow was 10-5

Page 12: Heat flow through concrete floor

10

Figure 9: Heat flow through the model at 16 hours. The scaling factor used for the flow was 10-5

With this understanding of the heat flow, it was easier to interpret the colour plots of the

temperature distribution over time.

Figure 10 Colour plots of the temperature distributions over time

Page 13: Heat flow through concrete floor

11

In the earlier stage, there was a great difference between temperatures throughout the model,

corresponding to the larger heat fluxes. As time progressed, the temperature inside became

higher and more evenly distributed, corresponding to smaller heat fluxes, but the temperature

would never be the same everywhere throughout the model.

4.3 Concrete surface The boundary of interest was the concrete surface, since this is where the floor comes in contact

with the air. The temperature was higher on the concrete directly above the heat source, so it

was warmer on the left of the model than on the right. Similar to the heat flow logic in 4.2, the

temperature variation between left and right decreased over time, but did never reach 0. As time

progressed, the temperature change with time also decreased, as can be seen in Figure 11 where

the temperatures for 8, 12 and 16 hours are very close together. The highest temperature reached

at 16 hours was 24.4ᵒC.

Figure 11: Temperature distribution along the top concrete surface over time

4.4 Supplied heat power The supplied power was calculated according to 𝐊 ∗ 𝑫 + 𝐂 ∗ 𝐕 = 𝐫 ( 5 ) the change of power

supply per m2 floor over time can be seen in Figure 12.

The most power was supplied into the floor around 0.2h with a value around 45.5𝑊𝑚2⁄ and

the power remained positive until around 1.7 hours. Then the power became negative, which

meant a heat flow out of the floor, and plateaued to a steady value around -15.9𝑊𝑚2⁄ .

Page 14: Heat flow through concrete floor

12

Figure 12: Total power supplied per square meter of floor area with time

5 Discussion After the investigation of suitable stepping parameters, it was decided that a time step of 360s

with a weight parameter of 1 would give the most stable and reasonable results. Increasing the

time step gave less accurate results and the weighting parameter had a strong influence on the

outcome. Changing the weight parameter from 1 to 0 would have given unstable results

independent of the time-steps. With dt = 360 s, the values for α = 0.5 and α = 1 produces very

similar results, so one of those two was selected randomly to be combined with this time-step

size.

An even smaller time-step would only improve the accuracy slightly but at the cost of

processing power. So, as always for the FEM a compromise between accuracy and time had to

be agreed on. The investigation outlined in 4.1 is an adequate analysis to decide on dt and α,

providing a reasonable accuracy.

Considering the power supplied per square meter of the floor area as a function of time, it was

observed that power was positive until around 1.7 hours, then it became negative. Given the

way the model was defined, which included a layer of air convection, a positive power means

that heat is entering the model from surrounding areas. That means during the first

approximately 1.7 hours, since the air temperature (22°C) was higher than initial concrete

temperature (15°C), the air was transferring heat into the concrete floor. Then, once enough

heat was supplied to the floor slab (both from the room and from the hot air source), the concrete

started to become warmer than the air. This was when heat started leaving the model, supplying

heat to the air and therefore the power became negative. At approximately 11.5 hours, power

reached a steady value of -15.9 W/m2. Also, comparing the figures of the flow for different

times (Figure 8 and Figure 9) it was seen that the flow inside the system decreased as it

approached steady-state conditions.

Page 15: Heat flow through concrete floor

13

6 References

[1] E. Serrano, „Hand-in assignment 2b - Transient Heat Flow,“ Lund, 2015.

[2] K. Persson, „Transient Flow,“ Lund, 2015.

[3] K. Persson, „FE formulation-two-and three-dimensional heat flow,“ Lund, 2015.

[4] „Wikipedia,“ 7 October 2015. [Online]. Available:

https://en.wikipedia.org/wiki/Properties_of_concrete. [Zugriff am 15 October 2015].

[5] „The Engineering ToolBox,“ [Online]. Available:

http://www.engineeringtoolbox.com/concrete-properties-d_1223.html. [Zugriff am 15

December 2015].

[6] „The Engineering ToolBox,“ [Online]. Available:

http://www.engineeringtoolbox.com/air-properties-d_156.html. [Zugriff am 15 October

2015].

[7] „Wikipedia,“ 7 October 2015. [Online]. Available:

https://en.wikipedia.org/wiki/Thermal_transmittance . [Zugriff am 15 October 2015].

[8] „The Engineering ToolBox,“ [Online]. Available:

http://www.engineeringtoolbox.com/thermal-conductivity-d_429.html . [Zugriff am 15

December 2015].

[9] N. P. H. Ottosen, Introduction to the Finite Element Method, Prentice Hall, 1992.

Page 16: Heat flow through concrete floor

14

7 Appendix

7.1 Code clear all; close all; %hole diameter d = 125; %hole radius ra = d/2; %distance between hole centers b = 190; %plate heigth H = 200; %define coordinates for points on the circle x1 = ra*cos(67.5*pi/180); x2 = ra*cos(45*pi/180); x3 = ra*cos(22.5*pi/180); x4 = b - ra*cos(22.5*pi/180); x5 = b - ra*cos(45*pi/180); x6 = b - ra*cos(67.5*pi/180); y1 = H/2 -ra*sin(67.5*pi/180); y2 = H/2 - ra*sin(45*pi/180); y3 = H/2-ra*sin(22.5*pi/180); y4 = H/2 + ra*sin(22.5*pi/180); y5 = H/2 + ra*sin(45*pi/180); y6 = H/2 + ra*sin(67.5*pi/180); L=10; %coordinates of nodes multiply by 1/1000 because the

values are in mm but %m is needed Vertices=1/1000*[ 0 0;%1 x2 0; x5 0; b 0; b 37.5;%5 b 70; b H/2;

b 130; b 162.5; b H;%10 x5 H; x2 H; 0 H; 0 162.5; 0 200+L;%15 0 37.5; x2 y2; x5 y2; ra H/2; b-ra H/2;%20 x2 y5; x5 y5; 160 130; 160 H/2; 160 70;%25 x1 y1; x3 y3; x3 y4; x1 y6; x6 y6;%30 x4 y4; x4 y3; x6 y1; x2 200+L; x5 200+L;%35 190 200+L];

%define the line segments from vertex numbers Segments=[ 1 2; %1 2 3; 3 4; 4 5; 5 6;%5 6 7; 7 8;

Page 17: Heat flow through concrete floor

15

8 9; 9 10; 10 11;%10 11 12; 12 13 13 14; 12 34; 15 34;%15 16 1; 2 17; 3 18; 17 18; 19 20;%20 21 22; 21 12; 22 11; 14 21; 21 19;%25 19 17; 17 16; 18 25; 20 24; 18 5; %30 20 18; 20 22; 22 9; 22 23; 23 8; %35 24 7; 25 6; 24 25; 24 23; 13 15;%40 34 35; 35 36; 11 35; 10 36];

%define the surfaces from the segment numbers

Surfaces=[ 1 17 27 16; %1 2 18 19 17; 3 4 30 18; 11 43 41 14; 19 31 20 26; %5 28 38 29 31; 30 5 37 28; 37 6 36 38; 12 14 15 40; 20 32 21 25; %10 29 39 34 32; 36 7 35 39; 24 22 12 13; 21 23 11 22; 33 9 10 23; %15 35 8 33 34; 10 44 42 43];

%define the number of elements on each segment Seed=ones(1, 44); Seed(1, 2)=3; %the middle ones are made smaller Seed(1, 19)=3; Seed(1, 20)=3; Seed(1, 21)=3; Seed(1, 11)=3; Seed(1, 41)=3; Seed=3*Seed; %scaling of the mesh Seed(1, 40)=1; %convection layer only one mesh broad Seed(1, 14)=1; Seed(1, 43)=1; Seed(1, 44)=1;

%define the curved lines iso8=zeros(1, 44); iso8(27)=26; iso8(26)=27; iso8(25)=28; iso8(24)=29;

iso8(30)=33; iso8(31) = 32; iso8(32)=31; iso8(33)=30;

% COMBINE SEED AND CURVED LINE DEFINITION

Page 18: Heat flow through concrete floor

16

Segp(1:2:88)=Seed; Segp(2:2:88)=iso8;

nen=3; dofsPerNode=1; mp=[dofsPerNode, nen];

%number the segments figure(1) geomdraw2(Vertices, Segments, Surfaces, Segp,mp);

%generate the element mesh [Coord Edof Dof meshdb]=strMeshgen(Vertices, Segments,

Surfaces, Segp, mp); %generate the element coordinates [Ex, Ey]=coordxtr(Edof,Coord,Dof,nen); %Draw the element mesh figure(2) eldraw2(Ex, Ey, [1 4 0]);

%Create element stiffness, assemble to global

stiffness, create bc's and %solve the equation system nel=size(Edof,1); ndof=length(Dof);

K=sparse(ndof,ndof); C=sparse(ndof,ndof); f=sparse(ndof,1);

%% Create element stiffness and assemble for concrete

surfaces for j=[1 2 3 5 10 13 14 15] t=1; %thickness rho=2400; % [4] c=750; % [5] ep=[t,rho,c]; k=1.7; % [6]

Dc=k*[1 0; 0 1]; elems=extrSurf(j,meshdb); %extract elements on

surface j for l=elems' %Loop over elements in elems [Ke, Ce]=flw2tt(Ex(l,:),Ey(l,:),ep,Dc); K=sparse_assem(Edof(l,:),K,Ke); C=sparse_assem(Edof(l,:),C,Ce); end end %Create element stiffness and assemble for air in hole %values chosen for 20C %http://www.engineeringtoolbox.com/air-properties-

d_156.html for j=[6 7 8 11 12 16] t=1; rho=1.205; % [6]

c=1005; % [6]

ep=[t,rho,c]; k=0.0257; % [6]

Da=k*[1 0; 0 1]; elems=extrSurf(j,meshdb); %extract elements on

surface j for l=elems' %Loop over elements in elems [Ke, Ce]=flw2tt(Ex(l,:),Ey(l,:),ep,Da); K=sparse_assem(Edof(l,:),K,Ke); C=sparse_assem(Edof(l,:),C,Ce); end end

%Convection layer for j=[4 9 17] t=1; rho=1.205; % [6] c=1005; % [6] Rsi = 0.13; % [7] k=1/Rsi; ep=[t,rho,c]; Dr=k*[0 0; 0 1*L/1000];

Page 19: Heat flow through concrete floor

17

elems=extrSurf(j,meshdb); %extract elements on

surface j for l=elems' %Loop over elements in elems [Ke, Ce]=flw2tt(Ex(l,:),Ey(l,:),ep,Dr); K=sparse_assem(Edof(l,:),K,Ke); C=sparse_assem(Edof(l,:),C,Ce); end end

%Determine degrees of freedom along segments for

boundary conditions bc1=extrSeg([24 25 26 27]',Segments,

Segp,Vertices,Dof,Coord,1); %warm air bc2=extrSeg([15 41 42]',meshdb,1); %room temperature bc3=extrSeg([12 11 10]',meshdb,1); %concrete surface %Define boundary conditions bc=[bc1, ones(length(bc1),1)*25; bc2,

ones(length(bc2),1)*22];

%define initial temperature at time t=0 a0=ones(ndof,1)*15;

%% n=10; %time-steps per hour

%define and perform time stepping for 36 hours (given

in seconds) %times at which the results is extracted ti=[0:3600/n:3600*36]; %define input for the time-stepping command ip=[3600/n 3600*36 1 [length(ti) ndof ti Dof']]; %Perform time-stepping [Tsnap,D,V]=step1(K,C,a0,ip,f,bc);

%Extract element temperatures after 1 hour Ed1=extract(Edof,Tsnap(:,n));

%Calculate element heat fluxes after 1 hour

for j=1:17 if(j==1)|

(j==2)|(j==3)|(j==5)|(j==10)|(j==13)|(j==14)|(j==15) Dm=Dc; else if (j==9)|(j==4)|(j==17) Dm=Dr; else Dm=Da; end end elemens=extrSurf(j,meshdb); for i=elemens'

[Es1(i,:),Et1(i,:)]=flw2ts(Ex(i,:),Ey(i,:),Dm,Ed1(i,:))

; end end

%Plot flux vectors after 1 hour figure(3) eldraw2(Ex,Ey, [1 3 0]); elflux2(Ex, Ey, Es1, [1, 1], 10e-5); xlabel('length in m') ylabel('height in m')

%Extract element temperatures after 2 hours Ed2=extract(Edof,Tsnap(:,2*n)); %Calculate element heat fluxes after 2 hours for j=1:17 if(j==1)|

(j==2)|(j==3)|(j==5)|(j==10)|(j==13)|(j==14)|(j==15) Dm=Dc; else if (j==9)|(j==4)|(j==17) Dm=Dr; else Dm=Da; end

Page 20: Heat flow through concrete floor

18

end elemens=extrSurf(j,meshdb); for i=elemens'

[Es2(i,:),Et2(i,:)]=flw2ts(Ex(i,:),Ey(i,:),Dm,Ed2(i,:))

; end end

%Extract element temperatures after 4 hours Ed4=extract(Edof,Tsnap(:,4*n)); %Calculate element heat fluxes after 4 hours for j=1:17 if(j==1)|

(j==2)|(j==3)|(j==5)|(j==10)|(j==13)|(j==14)|(j==15) Dm=Dc; else if (j==9)|(j==4)|(j==17) Dm=Dr; else Dm=Da; end end elemens=extrSurf(j,meshdb); for i=elemens'

[Es4(i,:),Et4(i,:)]=flw2ts(Ex(i,:),Ey(i,:),Dm,Ed4(i,:))

; end end

%Extract element temperatures after 8 hours Ed8=extract(Edof,Tsnap(:,8*n)); %Calculate element heat fluxes after 8 hours for j=1:17 if(j==1)|

(j==2)|(j==3)|(j==5)|(j==10)|(j==13)|(j==14)|(j==15) Dm=Dc; else

if (j==9)|(j==4)|(j==17) Dm=Dr; else Dm=Da; end end elemens=extrSurf(j,meshdb); for i=elemens'

[Es8(i,:),Et8(i,:)]=flw2ts(Ex(i,:),Ey(i,:),Dm,Ed8(i,:))

; end end

%Extract element temperatures after 12 hours Ed12=extract(Edof,Tsnap(:,12*n)); %Calculate element heat fluxes after 12 hours for j=1:17 if(j==1)|

(j==2)|(j==3)|(j==5)|(j==10)|(j==13)|(j==14)|(j==15) Dm=Dc; else if (j==9)|(j==4)|(j==17) Dm=Dr; else Dm=Da; end end elemens=extrSurf(j,meshdb); for i=elemens'

[Es12(i,:),Et12(i,:)]=flw2ts(Ex(i,:),Ey(i,:),Dm,Ed12(i,

:)); end end

%Extract element temperatures after 16 hours Ed16=extract(Edof,Tsnap(:,16*n)); %Calculate element heat fluxes after 16 hours

Page 21: Heat flow through concrete floor

19

for j=1:17 if(j==1)|

(j==2)|(j==3)|(j==5)|(j==10)|(j==13)|(j==14)|(j==15) Dm=Dc; else if (j==9)|(j==4)|(j==17) Dm=Dr; else Dm=Da; end end elemens=extrSurf(j,meshdb); for i=elemens'

[Es16(i,:),Et16(i,:)]=flw2ts(Ex(i,:),Ey(i,:),Dm,Ed16(i,

:)); end end

%Plot flux vectorsafter 16 hours figure(4) eldraw2(Ex,Ey, [1 3 0]); elflux2(Ex, Ey, Es16, [1, 1], 10e-5); xlabel('length in m') ylabel('heigth in m')

%% Colour plots of the temperature distribution figure(11) subplot(2,2,1) fill(Ex',Ey',Ed1') caxis([15 25]) axis('equal') title('t=1 hour') xlabel('length in m') ylabel('height in m') subplot(2,2,2) fill(Ex',Ey',Ed2') caxis([15 25])

axis('equal') title('t=2 hours') xlabel('length in m') ylabel('height in m') subplot(2,2,3) fill(Ex',Ey',Ed8') caxis([15 25]) axis('equal') title('t=8 hours') xlabel('length in m') ylabel('height in m') subplot(2,2,4) fill(Ex',Ey',Ed16') caxis([15 25]) axis('equal') title('t=16 hours') xlabel('length in m') ylabel('height in m') colorbar colormap('jet')

%%Extract element temperatures along bc3 after 1, 4, 8

and 16 hours figure (12) X1=Coord(bc3,1); T1 = Tsnap(bc3, n); T2 = Tsnap(bc3, 2*n); T4 = Tsnap(bc3, 4*n); T8 = Tsnap(bc3, 8*n); T12= Tsnap(bc3, 12*n); T16 = Tsnap(bc3, 16*n);

hold on plot(X1, T1, '.r'); plot(X1, T2, '.g'); plot(X1, T4, '.b'); plot(X1, T8, '.m'); plot(X1, T12, '.c'); plot (X1, T16, '.k');

Page 22: Heat flow through concrete floor

20

legend ('1 hour', '2 hours','4 hours', '8 hours','12

hours', '16 hours'); xlabel('length in m') ylabel('temperature in °C') hold off

%power as a function of time: r = Ka + Ca r=K*D+C*V; %divide by square meter of floor r2=r/(1*b/1000); figure(13) tt = linspace(1/n,36+1/n,length(ti)); %right scale plot(tt,sum(r2(bc2,:))) xlabel('time in h') ylabel('power supply in W/m^2')

7.2 compare time-stepping parameters clear all; close all; %hole diameter d = 125; %hole radius ra = d/2; %distance between hole centers b = 190; %plate heigth H = 200; %define coordinates for points on the circle x1 = ra*cos(67.5*pi/180); x2 = ra*cos(45*pi/180); x3 = ra*cos(22.5*pi/180); x4 = b - ra*cos(22.5*pi/180); x5 = b - ra*cos(45*pi/180); x6 = b - ra*cos(67.5*pi/180); y1 = H/2 -ra*sin(67.5*pi/180); y2 = H/2 - ra*sin(45*pi/180); y3 = H/2-ra*sin(22.5*pi/180); y4 = H/2 + ra*sin(22.5*pi/180);

y5 = H/2 + ra*sin(45*pi/180); y6 = H/2 + ra*sin(67.5*pi/180); L=10; %coordinates of nodes multiply by 1/1000 because the

values are in mm but %m is needed Vertices=1/1000*[ 0 0;%1 x2 0; x5 0; b 0; b 37.5;%5 b 70; b H/2; b 130; b 162.5; b H;%10 x5 H; x2 H; 0 H; 0 162.5; 0 200+L;%15 0 37.5; x2 y2; x5 y2; ra H/2; b-ra H/2;%20 x2 y5; x5 y5; 160 130; 160 H/2; 160 70;%25 x1 y1; x3 y3; x3 y4; x1 y6; x6 y6;%30 x4 y4; x4 y3; x6 y1;

Page 23: Heat flow through concrete floor

21

x2 200+L; x5 200+L;%35 190 200+L];

%define the line segments from vertex numbers Segments=[ 1 2; %1 2 3; 3 4; 4 5; 5 6;%5 6 7; 7 8; 8 9; 9 10; 10 11;%10 11 12; 12 13 13 14; 12 34; 15 34;%15 16 1; 2 17; 3 18; 17 18; 19 20;%20 21 22; 21 12; 22 11; 14 21; 21 19;%25 19 17; 17 16; 18 25; 20 24; 18 5; %30 20 18; 20 22; 22 9;

22 23; 23 8; %35 24 7; 25 6; 24 25; 24 23; 13 15;%40 34 35; 35 36; 11 35; 10 36];

%define the surfaces from the segment numbers Surfaces=[ 1 17 27 16; %1 2 18 19 17; 3 4 30 18; 11 43 41 14; 19 31 20 26; %5 28 38 29 31; 30 5 37 28; 37 6 36 38; 12 14 15 40; 20 32 21 25; %10 29 39 34 32; 36 7 35 39; 24 22 12 13; 21 23 11 22; 33 9 10 23; %15 35 8 33 34; 10 44 42 43];

%define the number of elements on each segment Seed=ones(1, 44); Seed(1, 2)=3; %the middle ones are made smaller Seed(1, 19)=3; Seed(1, 20)=3; Seed(1, 21)=3; Seed(1, 11)=3;

Page 24: Heat flow through concrete floor

22

Seed(1, 41)=3; Seed=3*Seed; %scaling of the mesh Seed(1, 40)=1; %convection layer only one mesh broad Seed(1, 14)=1; Seed(1, 43)=1; Seed(1, 44)=1;

%define the curved lines iso8=zeros(1, 44); iso8(27)=26; iso8(26)=27; iso8(25)=28; iso8(24)=29;

iso8(30)=33; iso8(31) = 32; iso8(32)=31; iso8(33)=30;

% COMBINE SEED AND CURVED LINE DEFINITION Segp(1:2:88)=Seed; Segp(2:2:88)=iso8;

nen=3; dofsPerNode=1; mp=[dofsPerNode, nen];

%number the segments figure(1) geomdraw2(Vertices, Segments, Surfaces, Segp,mp);

%generate the element mesh [Coord Edof Dof meshdb]=strMeshgen(Vertices, Segments,

Surfaces, Segp, mp); %generate the element coordinates [Ex, Ey]=coordxtr(Edof,Coord,Dof,nen); %Draw the element mesh figure(2) eldraw2(Ex, Ey, [1 4 0]);

%Create element stiffness, assemble to global

stiffness, create bc's and %solve the equation system nel=size(Edof,1); ndof=length(Dof);

K=sparse(ndof,ndof); C=sparse(ndof,ndof); f=sparse(ndof,1);

%Create element stiffness and assemble for concrete

surfaces %literature in the file for j=[1 2 3 5 10 13 14 15] t=1; %thickness rho=2400; % [4] c=750; % [5] ep=[t,rho,c]; k=1.7; % [8]/ value: concrete, stone Dc=k*[1 0; 0 1]; elems=extrSurf(j,meshdb); %extract elements on

surface j for l=elems' %Loop over elements in elems [Ke, Ce]=flw2tt(Ex(l,:),Ey(l,:),ep,Dc); K=sparse_assem(Edof(l,:),K,Ke); C=sparse_assem(Edof(l,:),C,Ce); end end %Create element stiffness and assemble for air in hole %values chosen for 20C %http://www.engineeringtoolbox.com/air-properties-

d_156.html for j=[6 7 8 11 12 16] t=1; rho=1.205; % [6] c=1005; % [6] ep=[t,rho,c]; k=0.0257; % [6] Da=k*[1 0; 0 1]; elems=extrSurf(j,meshdb); %extract elements on

surface j for l=elems' %Loop over elements in elems [Ke, Ce]=flw2tt(Ex(l,:),Ey(l,:),ep,Da); K=sparse_assem(Edof(l,:),K,Ke);

Page 25: Heat flow through concrete floor

23

C=sparse_assem(Edof(l,:),C,Ce); end end

%Convection layer for j=[4 9 17] t=1; rho=1.205; % [6]

c=1005; % [6] Rsi = 0.13; % [7] /values for inside surface k=1/Rsi; ep=[t,rho,c]; Dr=k*[0 0; 0 1*L/1000]; elems=extrSurf(j,meshdb); %extract elements on

surface j for l=elems' %Loop over elements in elems [Ke, Ce]=flw2tt(Ex(l,:),Ey(l,:),ep,Dr); K=sparse_assem(Edof(l,:),K,Ke); C=sparse_assem(Edof(l,:),C,Ce); end end

%Determine degrees of freedom along segments for

boundary conditions bc1=extrSeg([24 25 26 27]',Segments,

Segp,Vertices,Dof,Coord,1); %warm air bc2=extrSeg([15 41 42]',meshdb,1); %room temperature bc3=extrSeg([12 11 10]',meshdb,1); %concrete surface %Define boundary conditions bc=[bc1, ones(length(bc1),1)*25; bc2,

ones(length(bc2),1)*22];

%define initial temperature at time t=0 a0=ones(ndof,1)*15; %define and perform time stepping for 36 hours (given

in seconds) %times at which the results is extracted n=1; %time-steps per hour n=1 and n=10 ti=[0:3600/n:3600*36];

%% alpha=0

%define input for the time-stepping command ip0=[3600/n 3600*36 0 [length(ti) ndof ti Dof']]; %Perform time-stepping [Tsnap0,D0,V0]=step1(K,C,a0,ip0,f,bc);

%Extract element temperatures along bc3 after 1, 4, 8

and 16 hours T10 = Tsnap0(bc3, n); T20 = Tsnap0(bc3, 2*n); T40 = Tsnap0(bc3, 4*n); T80 = Tsnap0(bc3, 8*n); T120= Tsnap0(bc3, 12*n); T160 = Tsnap0(bc3, 16*n);

%power as a function of time: r = Ka + Ca r0=K*D0+C*V0; %divide by square meter of floor r20=r0/(1*b/1000);

%% alpha=0.5

%define input for the time-stepping command ip5=[3600/n 3600*36 0.5 [length(ti) ndof ti Dof']]; %Perform time-stepping [Tsnap5,D5,V5]=step1(K,C,a0,ip5,f,bc);

%%Extract element temperatures along bc3 after 1, 4, 8

and 16 hours T15 = Tsnap5(bc3, n); T25 = Tsnap5(bc3, 2*n); T45 = Tsnap5(bc3, 4*n); T85 = Tsnap5(bc3, 8*n); T125= Tsnap5(bc3, 12*n); T165 = Tsnap5(bc3, 16*n);

Page 26: Heat flow through concrete floor

24

%power as a function of time: r = Ka + Ca r5=K*D5+C*V5; %divide by square meter of floor r25=r5/(1*b/1000);

%% alpha=1

%define input for the time-stepping command ip1=[3600/n 3600*36 1 [length(ti) ndof ti Dof']]; %Perform time-stepping [Tsnap1,D1,V1]=step1(K,C,a0,ip1,f,bc);

%%Extract element temperatures along bc3 after 1, 4, 8

and 16 hours T11 = Tsnap1(bc3, n); T21 = Tsnap1(bc3, 2*n); T41 = Tsnap1(bc3, 4*n); T81 = Tsnap1(bc3, 8*n); T121= Tsnap1(bc3, 12*n); T161 = Tsnap1(bc3, 16*n);

%power as a function of time: r = Ka + Ca r1=K*D1+C*V1; %divide by square meter of floor r21=r1/(1*b/1000);

%% figure(6) tt = linspace(1/n,36+1/n,length(ti)); %right scale hold on plot(tt,sum(r20(bc2,:)), 'r'); plot(tt,sum(r25(bc2,:)), 'b'); plot(tt,sum(r21(bc2,:)), 'g'); legend('alpha=0','alpha=0.5','alpha=1'); axis([0,37,-100,100]); xlabel('time in h'); ylabel('power supply in W/m^2'); hold off

figure(7) hold on X1=Coord(bc3,1); plot(X1, T11, 'xr'); plot(X1, T21, 'xg'); plot(X1, T41, 'xb'); plot(X1, T81, 'xm'); plot(X1, T121, 'xc'); plot (X1, T161, 'xk'); plot(X1, T15, 'or'); plot(X1, T25, 'og'); plot(X1, T45, 'ob'); plot(X1, T85, 'om'); plot(X1, T125, 'oc'); plot (X1, T165, 'ok'); plot(X1, T10, '.r'); plot(X1, T20, '.g'); plot(X1, T40, '.b'); plot(X1, T80, '.m'); plot(X1, T120, '.c'); plot (X1, T160, '.k'); legend ('1 hour', '2 hours','4 hours', '8 hours','12

hours', '16 hours'); hold off xlabel('length in m'); ylabel('temperature in °C'); axis([0,0.2,15,25]);