1 June 2012

Physica Mbrick3 beginners guide

I may have mentioned that for my MSc project I designed a website that should make it clearer what lines are available for what module and what they do. This is so you can create an inform file. To run physica you do need a geometry file as well. There is one called MBrick and this creates a file (meshfilename.mb) this then creates a geometry file (meshfilename.geo) when run in physica and will then produce some outputs.
This will be your beginners guide to using MBrick (also known as MB3).
first it would be a good idea to have a vague idea of what you are going to mesh, so start off with a picture (the measurements are in mm). The thickness of the block is 5mm.
This maybe a bit over the top with markings but you do now see what is trying to be modelled. The following will be how you approach the problem if you are entering the data here. The text based approach and description is available here
First we want to know whether the mesh will have deformations(-8) or not(-9). In this case no deformations so '-9'. Now we want to know scale, scale is measured in meters. Since our model is in millimetres we will put in 0.001. The next decision is whether this is a cylindrical model, it's not so '0'.
Next we have Spans we have to divide up the block into sections and measure them
Length Divisions Comment
8.0 8 Inlet width
5.0 1 Slice thickness
20.0 16 pipe length
15.0 12 lower space height
10.0 8 upper space height
20.0 16 space width
12.0 10 outlet width
For deri-left and deri-right stick to the default 1.0. Deri-left and deri-right control mesh spacing. If for instance both (deri-left and deri-right) are greater than 1.0 then the mesh will start bunching up nearer to the middle. If however both are less than 1.0 then the mesh will bunch at the left and right ends. A combinations of higher or lower deri-right and deri-left maybe what you need, for the time being stick with default. Our spans now look like this:
 1   8.0   8  1.0  1.0    inlet width
 2   5.0   1  1.0  1.0    slice thickness
 3  20.0  16  1.0  1.0    pipe length
 4  15.0  12  1.0  1.0    lower space height
 5  10.0   8  1.0  1.0    upper space height
 6  20.0  16  1.0  1.0    space width
 7  12.0  10  1.0  1.0    outlet width

If you think about there is now have 6 rectangles which has to be created. Next we have to specify the 'Zero Mark' this is where you specify the starting point for the model. So x, y and z coordinate is all 0.0 and the Mark_ID is 0 as well.
From (0.0, 0.0, 0.0) you work up and outwards, what spans do we add in the x, y and z direction (NB The thickness is going to be in the y plane). The image should help you make sense of how you add in the x, y and z direction. First we move in x, y and z direction, in x we have 'inlet length', in y we have 'thickness' and z we have 'pipe length'. Second we only move in x and z, x we move 'pipe length', in z we move 'lower space height'. Finally third we move in x and z only, in x we move 'outlet width' and z we move 'upper space height'. The Marks including 'Zero Mark' look like this:
 0   0.0  0.0  0.0
 1   1   2   3
 2   6   0   4
 3   7   0   5
What has been created is a block, a solid block, we want to specify which volumes we are interested in to get to our model. First the goal is to specify where the pipe is. From the previous picture you can see it is located between mark 0 and mark 1 in x direction, mark 0 and mark 1 in y and mark 0 and 1 in z direction. The first line then is:
 0  1   0  1   0  1    2        inlet pipe
The last number, '2' is the zone number.

I'm ignoring the next line in zones because it is complicated (find out more after you see the text).

Second line we want to specify the big section. This section lies between 0 and 2 in the x direction (horizontal), in the z direction (vertical) it is between 1 and 3. The y direction (thickness) is between 0 and 1. The specification for this is:
 0  2   0  1   1  3    2        central space
The zone number for this is also 2.
Third and fourth area is similar to specify. For zones we have:
 0  1   0  1   0  1    2        inlet pipe
-12  0 0. 1 0.  0 0. 1 0.  0 0. 0 10.  1      initial level
 0  2   0  1   1  3    2        central space
 2  3   0  1   1  2    3        under outlet
 2  3   0  1   2  3    4        cut away

NB Additional feature: if mx0 = -12, the numbers after it are interpreted as follows:
i0 dx0 i1 dx1 j0 dy0 j1 dy1 k0 dz0 k1 dz1 zone_ID [c]
i0, i1 - lower and upper reference marks along x
dx0, dx1 - x-displacements of lower and upper zone ends from their ref. marks
j0, j1 - lower and upper reference marks along y
dy0, dy1 - y-displacements of lower and upper zone ends from their ref. marks
k0, k1 - lower and upper reference marks along z
dz0, dz1 - z-displacements of lower and upper zone ends from their ref. marks

The above "additional feature" is a cheat. What it does in this case is re writes the bottom half of the pipe and labels it as being zone 1.
What should have been done instead, which is a lot easier to understand is re-write the spans as being:
 1   8.0   8  1.0  1.0    inlet width
 2   5.0   1  1.0  1.0    slice thickness
 3  10.0   8  1.0  1.0    lower pipe length
 4  10.0   8  1.0  1.0    upper pipe length
 5  15.0  12  1.0  1.0    lower space height
 6  10.0   8  1.0  1.0    upper space height
 7  20.0  16  1.0  1.0    space width
 8  12.0  10  1.0  1.0    outlet width
and then re write the marks as being:
 0   0.0  0.0  0.0
 1   1   2   3
 2   7   0   4
 3   8   0   5
 4   0   0   6
after that you then re write your zones as being:
 0  1   0  1   0  1    1      initial level
 0  1   0  1   0  2    2        inlet pipe
 0  2   0  1   2  4    2        central space
 2  3   0  1   2  3    3        under outlet
 2  3   0  1   3  4    4        cut away
Easy. Anyway next up we have to specify the patch numbers. What you may not know is that when this runs it produces a file called 'bricks.txt' which shows you what the zones look like and the number of divisions (it wont show you spacing of the divisions). At the sides of this model, there will be numbers -1 will be on the left, -6 on top, -2 on the right, -5 on the bottom and unfortunately it won't show you the thickness (y) direction. There you would have seen -3 nearest to you, -4 furthest from you. These number are in fact zones. By the way bricks.txt number grid looks like this:
 0-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6 0
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4-2
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4-2
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4-2
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4-2
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4-2
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4-2
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4 4 4 4-2
-1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 4 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0 0 0 0 0-2
 0-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5-5 0
The patches are listed below:
-1  0   5       central symmetry
-2  3   4       side free slip
-3  0   7       symm. low  y
-4  0   8       symm. high y
-5  1   1       inlet
-6  0   6       top free slip
 0  1   3       walls
 0  2   3
 0  3   3
 4  2   9       upper side
 4  3   2       oulet

The first one might be slightly confusing, the '-1' is the left hand side of the model, the '0' being in the second column means it actually is the same as:

-1   1   5
-1   2   5

So you can see it includes everything next to '-1'. The next patch i.e. patch 4 is the border between -2 and zone 3. The rest is similar. Patch 3 however is slight different. As you see in bricks.txt there is a lot of '0', well if any of them are next to 3, 2 or 1 then they are patch 3.

The final bit of the MBrick is material number. The entry is:
1  1
2  1
3  1
4  0

That is to say zone 1, 2 and 3 are material 1 and zone 4 will not be meshed. zone 4 is only needed to specify the outlet in patch format.

The overall text for the MBrick file looks like this:
  -9    0.001    0
 1   8.   8  1.2  0.5    inlet width
 2   5.   1   1.  1.     slice thickness
 3  20.  16  1.0  0.5    pipe length
 4  15.  12  0.4  0.6    lower space height
 5  10.   8  0.6  0.6    upper space height
 6  20.  16  0.4  0.8    space width
 7  12   10  0.8  0.5    outlet width
 -9
 0   0.  0.  0.
 1   1   2   3
 2   6   0   4
 3   7   0   5
 -9
 0  1   0  1   0  1    2        inlet pipe
-12  0 0. 1 0.  0 0. 1 0.  0 0. 0 10.  1      initial level
 0  2   0  1   1  3    2        central space
 2  3   0  1   1  2    3        under outlet
 2  3   0  1   2  3    4        cut away
  -9
-1  0   5       central symmetry
-2  3   4       side free slip
-3  0   7       symm. low  y
-4  0   8       symm. high y
-5  1   1       inlet
-6  0   6       top free slip
 0  1   3       walls
 0  2   3
 0  3   3
 4  2   9       upper side
 4  3   2       oulet
 -9
1  1
2  1
3  1
4  0
-9