Boundary condition problem

General discussion about Elmer
DePurpereWolf
Posts: 22
Joined: 13 Mar 2013, 23:46
Antispam: Yes

Boundary condition problem

Post by DePurpereWolf »

Hello, I would like to perform a thermo-mechanical simulation.
The design is like a cube. The cube is part of a much larger plate. The cube is repeated in x and y direction.
The plate can expand in x, y and z, but it cannot buckle.
A thermal gradient is applied from top to bottom.

For the x-axis symmetry, the yz planes of the cube need to stay straight. For the y-axis symmetry, the xz planes need to stay straight.
For one yz plane this means that I can set displ.x = 0. However, I can't set that boundary condition for the other side because the cube, and the plate, is allowed to expand.
Also for the xz plane, I can set one side: displ.y=0, but not the other.
The bottom of the cube is set: displ.z=0

Would I be able to apply a boundary condition such that the opposite yz plane stays perpendicular to the x axis? Yet is allowed to move in the x direction?
raback
Site Admin
Posts: 4868
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Boundary condition problem

Post by raback »

Hi

What if you set periodic BCs in x and y direction and fix just the center point in x and y?

-Peter
DePurpereWolf
Posts: 22
Joined: 13 Mar 2013, 23:46
Antispam: Yes

Re: Boundary condition problem

Post by DePurpereWolf »

Hello,

I'm getting stuck applying the correct boundary conditions. The following BCs are not giving me the correct results.
The left and right yz planes need to stay perpendicular to the xy plane. The simulation result shows a variation of x displacement in the yz plane but it can only be constant.

Code: Select all

Boundary Condition 1
  Target Boundaries(1) = 11
  Name = "Fixed"
  Temperature = 293
  Displacement 3 = 0
End

Boundary Condition 2

  Target Boundaries(1) = 12
  Name = "Flux"
  Heat Flux = 5000
End

! Periodic boundary dummy (yz plane left)
Boundary Condition 3
  Target Boundaries(2) = 13 14
  Name = "x_periodic_dummy"
End

! Periodic boundary x (yz plane right)
Boundary Condition 4
  Target Boundaries(2) = 13 14
  Name = "x_periodic"
  Periodic BC = 3
  Periodic BC Scale(3) = -1 1 1               
  Periodic BC Displacement 1 = Logical True
  Periodic BC Displacement 2 = Logical True
  Periodic BC Displacement 3 = Logical True
End

! Periodic boundary dummy (xz plane left)
Boundary Condition 5
  Target Boundaries(2) = 15 16
  Name = "y_periodic_dummy"
End

! Periodic boundary y (xz plane left)
Boundary Condition 6
  Target Boundaries(2) = 15 16
  Name = "y_periodic"
  Periodic BC = 5
  Periodic BC Scale(3) = 1 -1 1
  ! Periodic BC Translate(3) = 0.003 0 0
  Periodic BC Displacement 1 = Logical True
  Periodic BC Displacement 2 = Logical True
  Periodic BC Displacement 3 = Logical True
End

The mesh I'm using is not symmetrical so if I do it as in the examples, I get InterpolateMeshToMesh errors.

Any suggestions on how to apply these periodic boundary conditions?

I've included the .sif file and a .geo file. You will need to open the geo file with gmsh and hit '3D' and save the mesh to .msh, Than open it in elmer.
case.sif
the sif file
(4.03 KiB) Downloaded 354 times
per2.geo
GMSH geo file
(3.78 KiB) Downloaded 383 times
DePurpereWolf
Posts: 22
Joined: 13 Mar 2013, 23:46
Antispam: Yes

Re: Boundary condition problem

Post by DePurpereWolf »

Hello,

I found out that the issue is with the partitioning. If I don't partition my model the simulation works using the following boundary conditions:

Code: Select all

Boundary Condition 1
  Target Boundaries(1) = 11
  Name = "Fixed"
  Temperature = 293
  Displacement 3 = 0
End

Boundary Condition 2
  Target Boundaries(1) = 12
  Name = "Flux"
  Heat Flux = 5000
End

! Periodic boundary dummy
Boundary Condition 3
  Target Boundaries(1) = 13
  Name = "x_periodic_dummy"
End

! Periodic boundary x 
Boundary Condition 4
  Target Boundaries(1) = 14
  Name = "x_periodic"
  Periodic BC = 3
  Periodic BC Displacement 1 = Logical True
  Periodic BC Displacement 2 = Logical True
  Periodic BC Displacement 3 = Logical True
End

! Periodic boundary dummy y
Boundary Condition 5
  Target Boundaries(1) = 15
  Name = "y_periodic_dummy"
End

! Periodic boundary y 
Boundary Condition 6
  Target Boundaries(1) = 16
  Name = "y_periodic"
  Periodic BC = 5
  Periodic BC Displacement 1 = Logical True
  Periodic BC Displacement 2 = Logical True
  Periodic BC Displacement 3 = Logical True
End

Boundary Condition 7
  Target Nodes(1) = 69
  Name ="Fix node"
  Displacement 1 = 0.0
  Displacement 2 = 0.0
  Displacement 3 = 0.0
End

Can I use periodic boundary conditions with a partitioned mesh?
raback
Site Admin
Posts: 4868
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Boundary condition problem

Post by raback »

Hi

You can use periodic BCs in parallel but you should just make sure that the periodic BCs are in the same partition. For this purpose there is the "periodic" flag in ElmerGrid that can ensure periodicity for simple geoemetries. Also the "connect" flag may be used to enforce certain BCs to the same partition. This is also needed for rotational structures, for example. Now there are some limitation on how these work with different partitioning algorhitms. For example, "connect" works only with the "dual" graphs when using Metis.

-Peter
DePurpereWolf
Posts: 22
Joined: 13 Mar 2013, 23:46
Antispam: Yes

Re: Boundary condition problem

Post by DePurpereWolf »

Well, that got me a step closer, but the partitioning is only working well in one direction.
I can't seem to work out the -connect flag. It just doesn work.

My execution code is:

Code: Select all

export N_PROC=2
export MY_DIR=""
ElmerGrid 2 2 "$MY_DIR" -metis $N_PROC -periodic 1 1 0 -partoptim -out "$MY_DIR"  | tee output.elmergrid
the elmer grid output is as follows:

Code: Select all


Starting program Elmergrid
Elmergrid reading in-line arguments
The mesh will be partitioned with Metis to 2 partitions.
Aggressive optimization will be applied to node sharing.
Output will be saved to file .

Elmergrid loading data:
-----------------------
Loading mesh in ElmerSolver format from root directory.
Loading header from mesh.header
Maximum elementtype index is: 510
Allocating for 8925 knots and 5268 elements.
Loading 8925 Elmer nodes from mesh.nodes
Loading 5268 bulk elements from mesh.elements
Loading 2690 boundary elements from mesh.boundary
All done

Elmergrid creating and manipulating meshes:
-------------------------------------------

Elmergrid partitioning meshes:
------------------------------
Finding periodic nodes in dim=1
Coordinate in dimension 1 is at the interval [-4, 4]
Looking for 189 periodic nodes
Finding periodic nodes in dim=2
Coordinate in dimension 2 is at the interval [-3, 3]
Looking for 225 periodic nodes
Found all in all 414 periodic nodes.
Making a Metis partitioning for 5268 elements in 3-dimensions.
There are at least some higher order elements
The mesh seems to consist of tetrahedra
There seems to be peridic boundaries
Using 1252 nodes of 8925 possible nodes in the Metis graph
Starting graph partitioning METIS_PartMeshNodal.
Creating an inverse topology of the finite element mesh
There are from 1 to 52 connections in the inverse topology.
Set the node partitions by the dominating element partition.
There are from 4265 to 4660 nodes in the 2 partitions.
Successfully made a Metis partition using the element mesh.
Finding secondary periodic parents for boundary elements
Number of potential periodic mappings is 405
Number of potential periodic targets is 387
Maximum number of elements associated with periodic nodes is 28
Could not find a periodic counterpart: 0/1641/2724
ind = 3482 3481 734 3492 3489 3493 
Could not find a periodic counterpart: 0/1642/2723
ind = 735 734 3482 739 3493 3494 
Could not find a periodic counterpart: 0/1649/2838
ind = 736 3483 3484 3499 3501 3503 
Could not find a periodic counterpart: 0/1650/2837
ind = 737 736 3484 741 3503 3504 
Could not find a periodic counterpart: 0/1653/2795
ind = 66 737 3484 742 3504 3507 
Could not find a periodic counterpart: 0/1654/2794
ind = 3484 758 66 3506 760 3507 
Could not find a periodic counterpart: 0/1726/2950
ind = 797 3606 67 3611 3613 799 
Could not find a periodic counterpart: 0/1727/2952
ind = 761 67 3606 765 3613 3614 
Could not find a periodic counterpart: 0/1736/3079
ind = 736 737 3608 741 3625 3622 
Could not find a periodic counterpart: 0/1737/3080
ind = 3609 3608 737 3627 3625 3626 
Could not find a periodic counterpart: 0/1740/3038
ind = 800 3609 737 3631 3626 3630 
Could not find a periodic counterpart: 0/1741/3039
ind = 800 737 66 3630 742 801 
Could not find a periodic counterpart: 0/1742/3042
ind = 68 3609 764 3632 3629 769 
Could not find a periodic counterpart: 0/1743/3040
ind = 3609 800 68 3631 802 3632 
Could not find a periodic counterpart: 0/2035/3729
ind = 21 262 886 267 4031 887 
Could not find a periodic counterpart: 0/2036/3728
ind = 4026 886 262 4033 4031 4032 
Could not find a periodic counterpart: 0/2055/3572
ind = 883 4030 266 4057 4053 4056 
Could not find a periodic counterpart: 0/2056/3573
ind = 19 266 883 272 4056 884 
Could not find a periodic counterpart: 0/2158/3976
ind = 931 4196 78 4202 4204 933 
Could not find a periodic counterpart: 0/2159/3977
ind = 914 78 4196 919 4204 4205 
Could not find a periodic counterpart: 0/2166/3947
ind = 916 915 4197 921 4210 4214 
Could not find a periodic counterpart: 0/2167/3948
ind = 4198 4197 916 4212 4214 4215 
Could not find a periodic counterpart: 0/2176/3819
ind = 876 4200 925 4223 4227 4226 
Could not find a periodic counterpart: 0/2177/3817
ind = 876 74 925 882 926 4226 
Could not find a periodic counterpart: 0/2178/3821
ind = 76 918 4200 924 4225 4228 
Could not find a periodic counterpart: 0/2179/3820
ind = 4200 925 76 4227 927 4228 
Could not find a periodic counterpart: 0/2371/4489
ind = 303 26 1002 307 1003 4491 
Could not find a periodic counterpart: 0/2372/4491
ind = 303 4487 1002 4492 4493 4491 
Could not find a periodic counterpart: 0/2373/4493
ind = 83 982 1002 986 4494 1004 
Could not find a periodic counterpart: 0/2374/4492
ind = 4487 1002 982 4493 4494 4495 
Could not find a periodic counterpart: 0/2375/4508
ind = 4487 4488 303 4497 4496 4492 
Could not find a periodic counterpart: 0/2376/4507
ind = 304 303 4488 308 4496 4498 
Could not find a periodic counterpart: 0/2381/4456
ind = 4489 4488 983 4502 4500 4504 
Could not find a periodic counterpart: 0/2382/4457
ind = 983 984 4489 988 4505 4504 
Could not find a periodic counterpart: 0/2387/4574
ind = 4490 758 306 4512 4511 4507 
Could not find a periodic counterpart: 0/2388/4575
ind = 13 306 758 311 4511 759 
Could not find a periodic counterpart: 0/2391/4569
ind = 21 327 886 332 4519 887 
Could not find a periodic counterpart: 0/2392/4568
ind = 886 4514 327 4521 4520 4519 
Could not find a periodic counterpart: 0/2401/4612
ind = 4516 4515 992 4530 4528 4532 
Could not find a periodic counterpart: 0/2402/4614
ind = 992 993 4516 998 4533 4532 
Could not find a periodic counterpart: 0/2403/4515
ind = 4516 4517 329 4535 4534 4531 
Could not find a periodic counterpart: 0/2404/4513
ind = 330 329 4517 335 4534 4536 
Could not find a periodic counterpart: 0/2405/4518
ind = 4516 993 4517 4533 4537 4535 
Could not find a periodic counterpart: 0/2406/4517
ind = 993 994 4517 999 4538 4537 
Could not find a periodic counterpart: 0/2411/4473
ind = 4518 1002 331 4545 4544 4541 
Could not find a periodic counterpart: 0/2412/4471
ind = 26 331 1002 337 4544 1003 
Could not find a periodic counterpart: 0/2413/4475
ind = 995 83 4518 1001 4546 4543 
Could not find a periodic counterpart: 0/2414/4476
ind = 1002 4518 83 4545 4546 1004 
Could not find a periodic counterpart: 0/2456/4736
ind = 1040 4609 83 4614 4613 1041 
Could not find a periodic counterpart: 0/2457/4737
ind = 83 4609 982 4613 4615 986 
Could not find a periodic counterpart: 0/2458/4739
ind = 84 1005 1040 1009 4616 1042 
Could not find a periodic counterpart: 0/2459/4738
ind = 4609 1040 1005 4614 4616 4617 
Could not find a periodic counterpart: 0/2474/4822
ind = 800 4612 1008 4634 4632 4635 
Could not find a periodic counterpart: 0/2475/4824
ind = 1008 68 800 1013 802 4635 
Could not find a periodic counterpart: 0/2514/4848
ind = 4681 1030 1029 4694 1035 4690 
Could not find a periodic counterpart: 0/2515/4846
ind = 4682 4681 1030 4692 4694 4695 
Could not find a periodic counterpart: 0/2528/4719
ind = 995 4685 83 4708 4711 1001 
Could not find a periodic counterpart: 0/2529/4718
ind = 4685 1040 83 4712 1041 4711 
Could not find a periodic counterpart: 0/2530/4720
ind = 1040 4685 1033 4712 4710 4713 
Could not find a periodic counterpart: 0/2531/4721
ind = 1033 84 1040 1039 1042 4713 
Found 116 secondary parents for 176 potential sides.
Optimizing the partitioning at boundaries.
31 bulk elements with BCs removed from interface.
4 bulk elements with BCs removed from interface.
4 bulk elements with BCs removed from interface.
4 bulk elements with BCs removed from interface.
2 bulk elements with BCs removed from interface.
Ownership of 29 parents was changed at BCs
Creating a table showing all parenting partitions of nodes.
Nodes belong to 2 partitions in maximum
There are 571 shared nodes which is 6.40 % of all nodes.
The initial owner was not any of the elements for 2 nodes
Checking partitioning before optimization
Checking for partitioning
Information on partition bandwidth
Distribution of elements, nodes and shared nodes
     partition  elements   nodes      shared    
     1          2712       4658       304       
     2          2556       4267       289       
Applying aggressive optimization for load balancing
Maximum deviation in ownership 391
Average deviation in ownership 195.50
Changed the ownership of 195 nodes
Maximum deviation in ownership 1
Average deviation in ownership 0.50
Maximum deviation in ownership 1
Average deviation in ownership 0.50
Checking for problematic sharings
The partitioning was optimized.
Checking partitioning after optimization
Checking for partitioning
Information on partition bandwidth
Distribution of elements, nodes and shared nodes
     partition  elements   nodes      shared    
     1          2712       4463       499       
     2          2556       4462       94        

Elmergrid saving data with method 2:
-------------------------------------
Saving mesh in parallel ElmerSolver format to directory /partitioning.2.
Nodes belong to 2 partitions in maximum
Saving mesh for 2 partitions
   part  elements   nodes      shared   bc elems orphan  
   1     2712       4463       499      1415     27      
   2     2556       4462       94       1319     17      
Writing of partitioned mesh finished

Thank you for using Elmergrid!
Send bug reports and feature wishes to elmeradm@csc.fi
any ideas?
raback
Site Admin
Posts: 4868
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Boundary condition problem

Post by raback »

Hi

How does you geometry look like? Are the periodic BCs conforming?

The connect flag work with dual meshes only, e.g.

Code: Select all

 
-partdual -metis N_PROC 3 -connect bc1 bc2 ....
This would be the more generic way.

For cube etc. you could use simple partitioning

Code: Select all

-partition 4 4 4 -periodic 1 1 0 
-Peter
DePurpereWolf
Posts: 22
Joined: 13 Mar 2013, 23:46
Antispam: Yes

Re: Boundary condition problem

Post by DePurpereWolf »

Hi,

I can't get the connect flag to work, i'm not getting any feedback, just a segmentation fault (core dumped)
Also, with this mesh, the 3: METIS PartGraphKway routine doesn't seem to work.

I've included the mesh, the output of gmsh and in elmer format, and a picture.
The (periodic) boundary conditions are as described above.

The simple partitioing works but the problem remains.

Maybe you can shine some light on this.
elmer.png
elmer.png (50.22 KiB) Viewed 7744 times
per9.msh
(833.68 KiB) Downloaded 378 times
mesh.zip
(166.95 KiB) Downloaded 326 times
ehooi
Posts: 156
Joined: 20 Aug 2013, 16:02
Antispam: Yes

Re: Boundary condition problem

Post by ehooi »

Hi all,
I have been searching for more information about periodic condition in Elmer and came to this thread. Based on what I am reading, I get the impression that the periodic condition does not work if the mesh or the geometry is not symmetry? Is that true? In terms of pairing the periodic conditions, how do we decide which boundary is to be paired with which? Is it based on the opposite facing boundary? For instance, in a cylindrical geometry, the ends will be paired while the 4 quadrants along the circumference will be paired. Is that correct?


Thanks.
Best wishes,
EH
raback
Site Admin
Posts: 4868
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Boundary condition problem

Post by raback »

Hi

Periodic BCs can work if there is a combination of scaling, rotation and translation that will map the geometry of one boundary to another. Of course an important subset here is geometries with symmetry but the periodic BCs are not limited to those. Also they are not limited to conforming meshes. Also the periodic BCs may be antiperiodic and have an offset etc.

-Peter
Post Reply