Example Toolboxes 2D building

In this example, we will build a thermal model of the building. The strategy is to complicate the simple 2D model by adding physical parameters and using equivalent approximation terms and numerical methods of finite element. The Toolboxe heat will be used to solve the problem.

The construction of the model requires a well-posed problem, that is to say, if from a theoretical point of view the equations have many unique solutions. For this, we need to make the weak formulations of the equations we will use. This is a part that remains important, because if the problem is poorly posed, then we may have no solution or several. This gives false numerical schemes and the simulations made may be wrong.

1. Running the case

The command line to run this case is

mpirun -np 8 feelpp_toolbox_heat --case "github:{repo:toolbox,path:examples/modules/heat/examples/2Dbuilding}"
mpirun
Case option
--case "github:{repo:toolbox,path:examples/modules/heat/examples/2Dbuilding}"

2. Data files

The case data files are available in Github here

3. 2D thermal model

The 2D thermal model of two parts separated by plaster is considered. It is an object of R2, it is subdivided into different domains Ωi,i=1,2,3 (see the image). The sources of heat heateri,i=1,2 are the two radiators each of which is located downstairs in each room. The heat T released in the subdomains is calculated thanks to the equation of heat transfer.

We use model multi-physique of heat tranfert with ki(y) which is the thermal conductivity which depends the coordinate from the stem height:[y], and we have 0yH.

ki(y)=kgroundi+yH(kroofikgroundi)

We notice that in this first model, taking the parameter ki(y) increasing linear, varied according to the height, we can simulate the effect that the cold air is at the bottom and the warm air diffuses towards the ceiling. This is the effect of natural convection. This is an improvement of the model with k constant.

Table 1. Géometry of Ω=3i=1Ωi with Ω=ΓDΓR

geo model1

The conditions at the edges:

  • Condition of Dirichlet

T=heateriinΓDi
  • Condition of Robin

ki(y)Tn=hi(TText)inΓRi

Conditions at the interface Γij=ΩiΩj

Ti=TjkiTni=kjTnj

Initial condition to t=0s

T=T0

3.1. Input

Table 2. Parameter table
Notation Description Value Unit Note

Paramètres globale

t

times

s

T

temperature

K

Text

outside temperature

280

K

T0

initial temperature

280

K

H

height

1,2,3

m

Air

k1(y)

thermal conductivity

W.m3.K1

kground1

k_1(0)

1.,1.5.,2.

W.m3.K1

kroof1

k_1(H)

4.,5.,6.

W.m3.K1

ρ1

mass volumique

1

kg/(m3)

C1

thermal capacity

1004

J/(kgK)

h1

heat transfer coefficient

1.0/(0.06+0.01/0.5 + 0.3/0.8 + 0.20/0.032 +0.016/0.313 +0.14)

W.m2.K1

heater1

heat source

310

K

Air2

k2(y)

thermal conductivity

W.m3.K1

kground2

k_2(0)

1.,1.5.,2.

W.m3.K1

kroof2

k_2(H)

4.,5.,6.

W.m3.K1

ρ2

mass volumique

1

kg/(m3)

C2

thermal capacity

1004

J/(kgK)

h2

heat transfer coefficient

1.0/(0.06+0.01/0.5 + 0.3/0.8 + 0.20/0.032 +0.016/0.313 +0.14)

W.m2.K1

heater2

heat source

300

K

Plâtre

k3(y)

thermal conductivity

W.m3.K1

kground3

k_3(0)

0.25

W.m3.K1

kroof3

k_3(H)

0.25

W.m3.K1

ρ3

mass volumique

150

kg/(m3)

C3

thermal capacity

1000

J/(kgK)

h3

heat transfer coefficient

1.0/(0.06+0.01/0.5 + 0.3/0.8 + 0.20/0.032 +0.016/0.313 +0.14)

W.m2.K1

3.2. Numerical experiences

3.2.1. Geometry

Table 3. Geometry with GMSH

geo1 model1

Table 4. Mesh with GMSH

mesh model1

Parameter to vary
h=0.1;
hHeater=h/5.;

W=2; //height
w=1; //width
ep1=0.1; //plaster width
cpp

4. Implementation

Note on the definition of the function ki(y) in the .cfg file

directory=applications/ibat/heat-transfert/toolbox
case.dimension=2
ini

mesh.filename=$cfgdir/thermo2d.geo gmsh.hsize=0.01#0.05

filename=$cfgdir/thermo2d.json

initial-solution.temperature=280

#do_export_all=true #verbose=1 #verbose_solvertimer=1 reuse-prec=1 pc-type=gamg

order=2

time-step=300 time-final=5e4 restart.at-last-save=true

{
    "Name": "Thermo dynamics",
    "ShortName":"ThermoDyn",
    //"Model":"Thermic",
    "Parameters":
    {
         "kground":"0.001",
         "kroof":"2.9"
    },
    "Materials":
    {
        "air":
        {
	    "markers":"air",
            //"k":"2.9",//[0.0262 W/(m*K) ]
            "rho":"1",
            "mu":"2.65e-2",
            "k":"kground+ (y^6)*(kroof-kground):y:kroof:kground",
            "Cp":"1004"
        },
        "air2":
        {
	    "markers":"air2",
            //"k":"2.9",//0.0262[ W/(m*K) ]
            "rho":"1",
            "mu":"2.65e-2",
            "k":"kground+ (y^6)*(kroof-kground):y:kroof:kground",
            "Cp":"1004"
        },
        "internal-walls":
        {
	    "markers":"internal-walls",
            "k":"0.25",//[ W/(m*K) ]
            //"k11":"0.0262"//[ W/(m*K) ]
            "Cp":"1000", //[ J/(kg*K) ]
            "rho":"150" //[ kg/(m^3) ]
        }
    },
    "BoundaryConditions":
    {
        "temperature":
        {
            "Dirichlet":
            {
                "heater1": { "expr":"310"/*"330"*/ },
                "heater2": { "expr":"310"/*"320"*/ }
            },
            "Robin":
            {
                "exterior-walls":
                {
                    "expr1":"1.0/(0.06+0.01/0.5 + 0.3/0.8 + 0.20/0.032 +0.016/0.313 +0.14)",// h coeff
		    "expr2":"280"// temperature exterior
                },
		"exterior-walls-iw":
		{
		    "expr1":"1.0/(0.06+0.01/0.5 + 0.3/0.8 + 0.20/0.032 +0.016/0.313 +0.14)",// h coeff
		    "expr2":"280"// temperature exterior
		}
            }
        }
    },
    "PostProcess":
    {
	"Exports":
	{
        "fields":["temperature","pid"]
	}
    }
json

}

Command line to execute
mpirun -np 16 feelpp_toolbox_heat_2d --config-file thermo2d.cfg
sh
Command line to execute using the case with link to folder which represents a remote data in a github repository.
mpirun -np 8 feelpp_toolbox_heat --case "github:{repo:toolbox,path:examples/modules/heat/examples/2Dbuilding}"
sh

You can also use some options to change the variables like time-final, taille du maillage hsize, …​

mpirun -np 8 feelpp_toolbox_heat --case "github:{repo:toolbox,path:examples/modules/heat/examples/2Dbuilding}" --ts.time-final 3000
sh

5. Result

Choose k following an equivalent value keq=2.9 (see [1]) then generate the value of kground and kroof follow a normal distribution

Table 5. Illustration

600

Table 6. kground=2.356,kroof=3.443,tmax=1000,dt=0.01

600

Utilise la fonction k(y) non linéaire

ki(y)=kgroundi+(kroofikgroundi)y4

kground=0.,kroof=2.9,tmax=1000,dt=0.01

kground=0.,kroof=2.9,tmax=150000,dt=500

600

600

Uses the function k(y) nonlinear with powerful 6

ki(y)=kgroundi+(kroofikgroundi)y6

kground=0.,kroof=2.9,tmax=1000

kground=0.,kroof=2.9,tmax=1000,dt=300

600

600

6. References

  • [[1]] A.W.M (Jos) van Schijndel, Building Energy Simulation using Finite Element Methods