# Tutorial¶

This tutorial provides a walkthrough for how to prepare input files for PreVABS given a cross section design.

## The design of a cross section¶

Figure 3 A box-beam cross section.

The box-beam cross section shown in Fig. 3 will be used in this tutorial. All four walls and two webs are made from composite laminates. The two webs are symmetric about a middle vertical line. They are inclined such that the upper portion of both webs are closer to each other than the lower portion. The central space enclosed by the top and bottom walls and two webs is filled with an isotropic material.

The overall shape is described using four parameters, with the following values:

• The width $$w = 4$$ m;
• The height $$h = 2$$ m;
• The distance $$d = 1$$ m;
• The angle $$a = 100^\circ$$.

The materials used in this cross section are listed in Table 2 and Table 3. The layups used in this cross section are listed in Table 4.

Table 2 Isotropic material properties
Name Density $$E$$ $$\nu$$
$$\mathrm{kg/m^3}$$ $$10^3\ \mathrm{Pa}$$
m0 1.00 25.00 0.30
Table 3 Orthotropic material properties
Name Density $$E_{1}$$ $$E_{2}$$ $$E_{3}$$ $$G_{12}$$ $$G_{13}$$ $$G_{23}$$ $$\nu_{12}$$ $$\nu_{13}$$ $$\nu_{23}$$
$$10^3\ \mathrm{kg/m^3}$$ $$10^9\ \mathrm{Pa}$$ $$10^9\ \mathrm{Pa}$$ $$10^9\ \mathrm{Pa}$$ $$10^9\ \mathrm{Pa}$$ $$10^9\ \mathrm{Pa}$$ $$10^9\ \mathrm{Pa}$$
m1 1.86 37.00 9.00 9.00 4.00 4.00 4.00 0.28 0.28 0.28
m2 1.83 10.30 10.30 10.30 8.00 8.00 8.00 0.30 0.30 0.30
Table 4 Layups
Component Name Material Ply thickness Orientation Number of plies
m degree
Walls layup_1 m1 0.02 45 1
m1 0.02 -45 1
m2 0.05 0 1
m1 0.02 0 2
Webs layup_2 m2 0.05 0 1
m1 0.02 0 3
m2 0.05 0 1

## Steps of preparing input files¶

In PreVABS, a cross section is composed of components, each of which can either be a laminate or a fill. The laminate type component is composed of segments with different layups. For a realistic cross section, there may be several different ways to decompose it, which may need different information in the input files to build the model.

Hence, the first step is to decide a way of decomposition of the cross section.

For this example, the first step is trivial. The cross section can be decomposed into three components: the walls, the webs, and the fill.

At the same time, the order of creating components should also be decided. This is done by figuring out the dependence relationships between components. For this example, the exact shape of each web depends on the shape of the walls, and the shape of the fill depends on both the webs and the walls. Then the order of creation should be: first creating the walls, then the webs, and at last the fill, as shown in Fig. 4.

Figure 4 Order of components creation.

The next step is to prepare various input files based on all design parameters listed above. In this example, all files are in the XML format. A brief summary of these input files is listed below.

• A baseline file (baselines.xml), storing definitions of geometric elements.
• A material file (MaterialDB.xml), storing definitions of materials and laminae.
• A layup file (layups.xml), storing definitions of layups.
• A main cross section file (box.xml), storing definitions of components and other configurations of modeling and analysis.

All files can have arbitrary file names and be placed at any working directory, except the material database, which must be named as MaterialDB.xml and placed at the same location as where the PreVABS executable is.

### Prepare geometric elements¶

As shown in Fig. 5, seven points are used to define the shape of the cross section. Points p1 to p4 define the walls, p5 and p6 define the webs, and p0 indicates the space which should be filled with some material. The origin of the coordinate system is placed at the centroid of the rectangular. Based on the design parameters $$w$$, $$h$$ and $$d$$, coordinates of all points are found and listed in Table 5.

Figure 5 Key points defining the shape of the cross section.

Table 5 Key points
Name Coordinate
p0 (0, 0)
p1 (2, 1)
p2 (-2, 1)
p3 (-2, -1)
p4 (2, -1)
p5 (1, 0)
p6 (-1, 0)

Base lines are created based on key points defined above. As shown in Fig. 6, three lines are created. Line 1 is defined by connecting the four points (p1 -> p2 -> p3 -> p4 -> p1). Line 2 and 3 are defined by a single point with an incline angle. For line 2, it is the point p5 with an angle of 100 degrees. For line 3, it is the point p6 with an angle of 80 degrees.

The direction of each base line is important. It is related with how the laminate is created for each segment, and how the local coordinate system is defined for each element.

The completed input file for geometry is shown in Listing 1.

Figure 6 Base lines defining the shape of the cross section.

Listing 1 Input file for geometric elements (baseline.xml).
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  0 0 2 1 -2 1 -2 -1 2 -1 1 0 -1 0 p1,p2,p3,p4,p1 p5 100 p6 80 

### Prepare materials and layups¶

Material data are stored in the material database. As stated above, this file must be named as MaterialDB.xml and placed at the directory where the PreVABS executable is. The format of this file is shown in Listing 2. Arrangement of data under the <elastic> element are different for different material types, which can be isotropic, orthotropic, or anisotropic.

Another part of the file is the lamina data. A lamina is a unique combination of material and ply thickness. For this example, according to the layup table (:Table 4) given above, there are two laminae. One has material m1 and thickness 0.02, and another one has material m2 and thickness 0.05. It is the lamina, instead of the material, that will be used to define each layer of the layup.

Listing 2 Input file for materials (MaterialDB.xml).
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47  1.0 25.0e3 0.3 1.86E+03 3.70E+10 9.00E+09 9.00E+09 4.00E+09 4.00E+09 4.00E+09 0.28 0.28 0.28 m1 0.02 1.83E+03 1.03E+10 1.03E+10 1.03E+10 8.00E+09 8.00E+09 8.00E+09 0.30 0.30 0.30 m2 0.05 

Layup information is stored in a separate file. Based on the layup table, the input file can be prepared with the format shown in Listing 3. The order of the layers defines the laying sequence from the base line. The number in the <layer> element stands for the orientation. If there is a colon, then the number behind it stands for the number of plies in this layer. If there is no number at all, then by default this layer has only one ply with orientation of 0 degree.

Listing 3 Input file for layups (layups.xml).
  1 2 3 4 5 6 7 8 9 10 11 12 13  45 -45 0 0:2 0:3 

### Create components¶

There are two types of components in PreVABS, laminate and fill. For this example, based on the decomposition we did at the begining of this section, there are three laminate-type components and one fill-type component. Besides, the sequence of creating components is important as stated at the beginning of this section. This is defined by declaring which components are needed before creating the current one.

Each laminate-type component is composed of one or more segments. Each segment is a unique combination of a base line and a layup. The layup can be created on either side of the base line. This is controlled by an attribute direction, which can be either left or right. This can be understood as the left- or right-hand side when walking along the base line, as shown in Fig. 7.

As for the ordering, the walls should be completed first, since its inner boundary is needed to trim the base lines of both webs. Hence, each web component depends on the walls component, as shown in Listing 4.

Figure 7 Layup directions for each segment.

Listing 4 Input elements for the laminate-type components
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  line1 layup1 line2 layup2 line3 layup2 

The fill-type component is defined by a point and a material. Here, the point p0 is used to indicate that the material should be filled in the space in the middle enclosed by the walls and both webs. At the same time, the dependent components are also decided, as shown in Listing 5.

Figure 8 The fill-type component.

Listing 5 Input elements for the fill-type component
 1 2 3 4  p0 m0 

### Set other configurations and complete the main input file¶

Besides the definitions of components, the main input file of the cross section contains several other required or optional settings.

The first part is the <include> settings, which is required. This contains names of the base lines and layups files.

The second part is the <analysis> settings, which is optional. This contains configurations used by VABS for the cross-sectional analysis. For this example, the <model> setting is set to 1, which means that the Timoshenko beam model will be used and the 6x6 stiffness matrix will be calculated.

The last part is the <general> settings, which is optional. This part contains global configurations for the shape and meshing of the cross section. Here, the global mesh size is set to 0.02.

The completed main input file for the cross section is shown in Listing 6.

Listing 6 Input file for the cross section
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34  baselines layups 1 0.02 line1 layup1 line2 layup2 line3 layup2 p0 m0 

## Execution and results¶

Once all input files are prepared, the cross section can be created and homogenized using the following command:

prevabs -i box.xml -h -v -e


If everything works successfully, Gmsh will be called and the cross section will be plotted as shown in Fig. 9 (the display of element edges is turned off in the figure for clarity), and VABS homogenization analysis will be carried out and effective beam properties can be found in the file box.sg.K. The effective Timoshenko stiffness matrix is listed in Table 6.

Figure 9 The cross section created by PreVABS and plotted by Gmsh.

 3.991e+10 -166200 -40.37 4.204e+07 -4358 28.67 -166200 6.743e+09 39450 -2.918e+08 -1.577e+07 -4150 -40.37 39450 6.165e+09 8220 -2897 -8.7e+06 4.204e+07 -2.918e+08 8220 1.972e+10 272100 330.3 -4358 -1.577e+07 -2897 272100 2.173e+10 -30250 28.67 -4150 -8.7e+06 330.3 -30250 6.728e+10