Natural convection through a hole in a vertical wall

Numerical methods and mathematical models of Elmer
foadsf
Posts: 81
Joined: 20 Sep 2016, 23:56
Antispam: Yes
Contact:

Natural convection through a hole in a vertical wall

Post by foadsf »

Following this question, I would like to simulate the below model in 2D:

Image

where
  • a = 2m, b = 2m, D = 0.2m
  • right box has an initial condition T1 = 30°C and the red walls provide the constant boundary condition of T1
  • left box has an initial condition T2 = 23°C and the blue walls provide the constant boundary condition of T2
  • there is a hole of height D in the isolating infinitesimally thin black wall in the middle
  • there is air (ideal gas) with atmospheric pressure on both sides
  • there is gravity in the negative y-direction
  • there is free convection due to gravity/buoyancy, conduction, and diffusion, but we can ignore radiation
  • there is no-slip boundary condition on all walls (v=0 in all directions)
I tried following this example, FlowStepCompressible. However, I don't know how to start with the .grd mesh and the .sif model. I would really appreciate it if you could check my model in the attachment?
Specifically, I am not sure how to model the wall in the middle in the .sif file and the mesh file:

Code: Select all

Boundary Definitions
! type 	out 	 int
	1 	2	 1	 1
	2 	3	 1	 1
	3	0	 1	 1
End
Thanks for your support in advance.
Attachments
HoleNatConv.zip
(2.29 KiB) Downloaded 110 times
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural convection through a hole in a vertical wall

Post by kevinarden »

You have to add internal boundary elements to apply boundary conditions to them, I do not know how to do that in ElmerGrid, but could in Salome. Salome allows manually adding elements. In this case I just edited the mesh files directly using a text editor. Note that your grd is not producing 3 boundaries only 1 labeled 3.
mesh.png
(40.79 KiB) Not downloaded yet
mesh.zip
(7.97 KiB) Downloaded 108 times
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural convection through a hole in a vertical wall

Post by kevinarden »

Here is a unv file from salome that achieves the desired mesh. I partitioned the large rectangle in half and salome generate the internal boundary elements. Used groups to set the boundaries and two different bodies. to make the hole I deleted two of the internal boundary elements.
Mesh_1.unv
(453.7 KiB) Downloaded 109 times
foadsf
Posts: 81
Joined: 20 Sep 2016, 23:56
Antispam: Yes
Contact:

Re: Natural convection through a hole in a vertical wall

Post by foadsf »

Hey Kevin,

It is great to have you here with your great SALOME experience. 😉
One issue is that I prefer the parametric ElmerGrid .grd geometry/mesh. I want to play with the parameters quite often and observe the effect on the total heat transferred through the hole. Maby Peter knows if internal boundary elements are possible in the ElmerGrid?
One workaround is of course to have an infinitesimally small gap as the thickness of the wall? 🤔
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural convection through a hole in a vertical wall

Post by kevinarden »

You could have a third material in the middle that is the wall. then you could assign it thermal properties to control its transfer of heat.
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural convection through a hole in a vertical wall

Post by kevinarden »

One approach I have seen in ElmerGrid is to have a separate grd file for each half, then use the unite to bring them into one mesh, it should leave you with an internal boundary. First saw this in the blunt contact test problem

https://github.com/ElmerCSC/elmerfem/bl ... test.cmake

execute_process(COMMAND ${ELMERGRID_BIN} 14 2 blunt.msh -autoclean )
execute_process(COMMAND ${ELMERGRID_BIN} 1 2 base.grd)
execute_process(COMMAND ${ELMERGRID_BIN} 2 2 blunt -in base -unite -out mesh)
foadsf
Posts: 81
Joined: 20 Sep 2016, 23:56
Antispam: Yes
Contact:

Re: Natural convection through a hole in a vertical wall

Post by foadsf »

Kevin,

how about this:

Code: Select all

Subcell Divisions in 2D = 5 5 
Subcell Limits 1 = -2.1 -2 -0.001 0.001 2 2.1
Subcell Limits 2 = -1.1 -1 -0.1 0.1 1 1.1
Material Structure in 2D
	2	2	0	3	3
	2	1	0	1	3
	2	1	1	1	3
	2	1	0	1	3
	2	2	0	3	3
End
but I still don'w kbnow how to write the Boundary Definitions 😑
kevinarden
Posts: 2301
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Natural convection through a hole in a vertical wall

Post by kevinarden »

getting close, ran it without any boundary definitions and it created some by default, still only 1 body though, I think you need two for different initial conditions

***** ElmerGrid input file for structured grid generation *****
Version = 210903
Coordinate System = Cartesian 2D
Subcell Divisions in 2D = 5 5
Subcell Limits 1 = -2.1 -2 -0.001 0.001 2 2.1
Subcell Limits 2 = -1.1 -1 -0.1 0.1 1 1.1
Material Structure in 2D
2 2 0 3 3
2 1 0 1 3
2 1 1 1 3
2 1 0 1 3
2 2 0 3 3
End
Materials Interval = 1 1
Numbering = Vertical
Element Degree = 1
Triangles = False
Surface Elements = 500
Coordinate Ratios = 1
Minimum Element Divisions = 1 1
Element Ratios 1 = 1 0.5 3 1
Element Ratios 2 = 1 -1.4
Element Densities 1 = 1 1 1 1
Element Densities 2 = 1 1
mesh.png
(23.21 KiB) Not downloaded yet
foadsf
Posts: 81
Joined: 20 Sep 2016, 23:56
Antispam: Yes
Contact:

Re: Natural convection through a hole in a vertical wall

Post by foadsf »

let's go step by step. I can change the Material Structure to

Code: Select all

Material Structure in 2D
	3	3	0	4	4
	3	1	0	2	4
	3	1	1	2	4
	3	1	0	2	4
	3	3	0	4	4
End
Materials Interval = 1 2
then what should be the Boundary Definitions?
foadsf
Posts: 81
Joined: 20 Sep 2016, 23:56
Antispam: Yes
Contact:

Re: Natural convection through a hole in a vertical wall

Post by foadsf »

So far I could do this:
Capture.PNG
Capture.PNG (18.32 KiB) Viewed 1507 times
and the wall, when zoomed in, looks like
Capture2.PNG
(6.04 KiB) Not downloaded yet
Attachments
HoleNatConv.grd
(512 Bytes) Downloaded 98 times
Post Reply