Stretching Functions

From HOPR
Jump to: navigation, search


Parameter File

This is the parameter file, which is also found in

tutorials/1-04-cartbox_multiple_stretch/parameter.ini

Definition of Stretching Functions

With stretching functions one can generate a mesh consisting of a boxes with a stretched element arrangement. Therefore two new parameters can be defined in the parameter file: factor and l0. Each one can used to stretch the elements of a box. Their meaning and connection is shown as one-dimensional case in picture 1.

Picture 1: "Stretch parameters" factor and l0

In case of a stretched element arrangement the next element of a box is always stretched by a factor f in the direction of the coordinate axis.Thereby the value of factor f can have a positive or a negative sign. Here f has either a negative and an absolute value >1 or a positive sign and an abolute value <1. The length of the first element is called l_{0}. All streched N elements together has the length l_{ges}.

Building a Cartesian Box with Stretched Elements

To get a single cartesian box with a stretched element arrangement it is important to know that the parameters l_{0} and N are defined even before one define the stretching parameters factor and l0. The length l_{ges} is defined by the boundarys of the cartesian box and the number of elements per box in the direction of the cartesian coordinate axes, called N in the following, was defined with the parameter nElems.

For a stretched element arrangement either the parameter factor or the parameter l0 has to be defined. The other missing parameter will be calculated internally by using the following equation:

 \frac{l_{ges}}{l_0} = \sum_{i=1}^{N} f^{i-1} = \frac{1-f^N}{1-f}

The structure of both parameters are explained below. A description of all parameters of the parameterfile can be found in List of Parameters.

Parameters Setting Description
factor (/-1.75,1,-1.5/) Stretching factor of the elements in the direction of the cartesian coordinate axes. A value >1 means an increase of the element size in the direction of the coordinate axis, however, a value of the intervall (0,1) means a decrease. The Value 1 does not affect the element sizes just as the value 0 which means an deactivation of the stretching function for this axis. Furthermore the stretching behaviour can be mirrored by adding a negative sign to the values. A combination with the parameter l0 ignores the element number of the defined box.
In case of (/-1.75,1,-1.5/) each following element in the direction of the x-axis is compressed by the factor -1.75 and in the direction of the z-axis by the factor -1.5. The element arrangement in the direction of the y-axis was not changed.
l0 (/0,1,5,0/) The length of the first element of a stretched element arrangement of a cartesian box. Each component of the vector stands for an axis of the cartesian coordinate system. The value 0 means an deactivation of the stretching function for this axis. A negative sign defines the length of the first element of the other side of the box. A combination with the parameter factor ignores the element number of the defined box.
Here the stretching function is deactivated for the x- and z-axis, whereas the first element in the direction of the y-axis has a size of 1.5.

Variable Definition of Stretching Functions

There are several ways to get a stretched element arrangement due to the two different stretching parameters factor and l0. These cases are:

  • Defining of factor:
    In this case the next element of a box is stretched by a factor f in the direction of the coordinate axis. The parameter l0 will be calculated internally by the equation provided above. The number of elements N which is defined by the parameter nElems is retained.
  • Defining of l0:
    In this case the length of the first element (or the last by using a negative sign) is defined in the direction of the coordinate axis. The parameter factor will be calculated internally by the equation provided above. The number of elements N which is defined by the parameter nElems is retained.
  • Defining of factor and l0:
    In this case the parameters have to be defined by the equation provided above manually. Otherwise the stretched element arrangement will most likely not achieved the desired shape. In case of an inaccurate definition the parameter factor is adjusted to the parameter l0 which means that factor will changed internally. Furthermore, the number of elements N which is defined by the parameter nElems is probably not retained. Instead, N is rounded to nearest natural number.


These three different cases are presented below with a small cube with an edge length of one and with four elements per axis. For a better understanding just x- and y- values were changed und visualized.

Picture 2: Non-stretched element arrangement
nElems   =(/4,4,4/)    
factor   =(/0,0,0/)    
l0       =(/0,0,0/)
Picture 3: Stretched element arrangement. The element size in the direction of the x-axis increases by a factor of 1.5. In the direction of the y-axis it decreases by the factor of -1.2.
nElems   =(/4,4,4/)    
factor   =(/1.5,-1.2,0/)    
l0       =(/0,0,0/)
Picture 4: Stretched element arrangement. The first element in the direction of the x-axis has a length of 0.5 and a length of 0.2 in the direction of the y-axis. The parameter factor is adjusted.
nElems   =(/4,4,4/)    
factor   =(/0,0,0/)    
l0       =(/0.5,0.2,0/)
Picture 5: Stretched element arrangement with a combination of factor and l0. The parameter l0 defines the side lengths of the first element. The following element sizes are multiplied by the compontens of the parameter factor. The number of elements N which is defined by the parameter nElems is not retained.
nElems   =(/4,4,4/)    
factor   =(/1.5,-1.2,0/)    
l0       =(/0.5,0.2,0/)

Building Multiple Cartesian Boxes with Stretched Elements

For building a mesh consisting of multiple cartesian boxes with a stretched element arrangement at least one of the parameters factor and l0 has to be defined for each cartesian box. The reason for this is that if there shall be a contact between two boxes the surfaces' corner nodes have to coincide. This means that defining a stretch function to a cartesian box leads to a need of a stretch function of the adjacent cartesian box. A visualization of this issue one can see in the sketch of the tutorial's problem.

Sketch

In the following an exemplary mesh of multiple cartesian boxes with a stretched element arrangement is presented. The belonging parameter file can be found in Parameterfile Stretching Functions. The arrangement of the cartesian boxes corresponds to the one of the tutorial Multiple Cartesian Boxes but instead of equidistant elements a stretched element arrangement is produced by inserting the parameters factor and l0. Furthermore the number of elements of each box were increased by changing the parameter nElems for a better visualization of the stretched element arrangement. The picture below shows the way the elements will be stretched.

Picture 6: Sketch of a mesh with multiple cartesian boxes with a stretched element arrangement. The arrows show in which direction the elements are compressed. The elements are getting smaller the closer the elements get to the cartesian x-y-plane and y-z-plane. The elements in the direction of the cartesian y-axis remain equidistant.

It has to be taken into account that the picture above just demonstrates in which directions the elements are stretched respectively compressed. Wether the number of elements per box nor the cartesian boxes'sizes represented here corresponds to the parameters of the Parameterfile Stretching Functions.

Output Visualization

If there is a need for assistance of visualizing the HOPR output visit Visualization.

These are visualizations of the cartbox_multiple_stretch_mesh.h5 file.

Picture 7: Side view of the mesh of the multiple cartesian boxes with a stretched element arrangement.
Picture 8: Mesh of the multiple cartesian boxes with a stretched element arrangement

Next Tutorial: Curved Structured Mesh