Box with Periodic Boundary Conditions

From HOPR
Jump to: navigation, search


Parameter File

This is the parameter file, which is also found in

tutorials/1-02-cartbox_periodic/parameter.ini

Description of Parameters

In the following parameters of the parameter file are explained. This description consists only of parameters which are necessary to generate a periodic boundary condition. A description of all parameters of the parameterfile can be found in the previous tutorial Cartesian Box and List of Parameters.

Parameters Setting Description
BoundaryName BC_zminus Name of the boundary condition
BoundaryType (/1,0,0,-1/) For each periodic boundary condition three parameters are mandatory, the BoundaryName, the BoundaryType and the displacement vector vv. The Type parameter consists of four components to set: (/ Type, curveIndex, State, alpha /). For a periodic boundary condition the component Type has always to set to "1". The fourth component alpha assigns a displacement vector vv and its direction (-/+) to the periodic boundary. An alpha of "-1" means that the first ("1") defined displacement vector is assigned to this surface in the opposite direction ("-1") as he was defined.
For a simple cartesian box the other components curveIndex and State have to be set 0; The further description of the components can be found in the next tutorials or in the List of Parameters.
vv (/0.,0.,1./) The displacement vector has to specify in the three-dimensional cartesian coordinate system, has to be normal to a surface the vector was assigned to. In addition the displacement vector has to show to the inside of the cartesian box. In case of two parallel surface-planes, both with periodic boundary conditions, just one displacement vector has to be defined. Therefore the different directions of the vectors can be compensated by switching the sign of alpha, the fourth component of the BoundaryType vector.

It has to be taken into account that the displacement vector has to be as long as the distance between the surfaces the vector was assigned to. Also the index of a displacement vector is defined by the position of its definition like the parameter BCIndex. Several definitions of boundary conditions between two definitions of displacement vectors will not affect the index of the displacement vectors.

Boundary Conditions and Sketch

Picture 1 shows the sketch of the current problem. It is similar to the problem in the tutorial Cartesian Box but instead of Dirichlet periodic boundary conditions are assigned to the surfaces one, two, four and six. Further below one can see an excerpt of the parameter file which deals with the periodic boundary conditions. In this code's excerpt some text elements are colored to show the connection between boundary conditions and their related displacement vectors. The same colors are used for the visualization in picture 1.

Picture 1: Sketch of the current problem; For a greater clarity in this picture the displacement vectors are shown shorter than they are. In truth the vector arrows are as long as the side length of the cartesian box.

As one can see the first four boundary conditions are periodic because the last alpha components of the BoundaryType parameters are not equal to zero. In the definitions of the first two boundary conditions which are assigned to the surfaces on and six (see BCindex) the alpha component is set to 1. That means that the related displacement vector is the first defined displacement vector in the parameterfile. The sign of alpha can be explained by the position of the related surfaces. On the one hand the vector has to show to the inside of the cartesian box. On the other hand the vector also has to show to the other surfaces which was assigned with the periodic boundary condition. The vector itself has to show in the direction of the z-axis because it has to be normal to the surface. In addition, the side lengths of the cartesian box is one and so all defined displacement vectors has a length of one.
For the other two periodic boundary conditions of the surfaces two and four the second defined displacement vector is consulted (see alpha value of the BoundaryType parameters). The components of the displacement vector (/0.,1.,0./) results from the necessary perpendicularity to the surfaces and the side length of the cartesian box


Cartbox periodic ini.jpg

Next Tutorial: Multiple Cartesian Boxes