Encyclopaedia Index

## Multi-block Grid and Block Linkage Definition for PHOENICS-GCV

Contents

### 1. Overview

The GCV (Generalised Co-located Velocity) method is an alternative algorithm for solving the Navier Stokes equations. It is described in an Encyclopaedia article. It allows an unstructured grid to be created by linking structured blocks in an unstructured way.

This article describes in detail the format of the grid files, and the commands used to link the blocks. The linking commands should be placed into a 'skeleton' Q1, which can then be completed using the PHOENICS menu systems.

### 2. The structure of the grid file

The grid for each block of a multi-block grid is written to a separate grid file. These files should be structured so that they can be read with the FORTRAN sequence:

```      READ(LU,'(3I5)') NI, NJ, NK
DO K = 1, NK
ENDDO```

where:

• NI, NJ and NK are the numbers of nodes (cell corners) in the I, J and K directions,
• XC, YC and ZC are the Cartesian co-ordinates of the nodes.

Note that

I goes from West to East,
J goes from South to North, and
K goes from Low to High.

The convention is that I, J & K count nodes (cell corners), and IX, IY & IZ count cells. NX, NY and NZ are the numbers of cells in the I (IX), J (IY) & K (IZ) directions.

The GCV solver uses overlapping cells at block joints. These cells must exist in the individual block grid files.

Only the linked faces of a block require an extra layer of dummy cells. If a block is linked at the low-I (WEST) side, then an extra plane of nodes must be inserted at I=1, shifting all the others up one. Similarly, if the block is linked on the high-I (EAST) face, another plane of nodes must be added at I=NI.

These extra nodes are most conveniently copied exactly from the 'real' edge nodes, so that they are invisible to any viewing program.

Example

Block 1 has 10 cells in IX, and is linked at EAST of IX=10 to Block 2.
Block 2 has 20 cells in IX, and is linked at WEST of IX=1 to Block 1, and EAST of IX=20 to Block 3.
Block 3 has 15 cells in IX, and is linked at WEST of IX=1 to block 2.

The grid files required will contain:

Block 1 - 11 cells in IX, plane I=12 and I=11 identical
Block 2 - 22 cells in IX, plane I=1 and I=2 identical, I=22 and I=23 identical
Block 3 - 16 cells in IX, plane I=16 and I=17 identical.

The copying should be done automatically in the interface, and not be seen by the user.

Blocks can be linked in any convenient order and orientation. Partial links between faces are allowed. One face may be linked to any number of faces of other blocks, or to itself. All blocks must be right-handed in IJK and XYZ co-ordinates.

The linked nodes must be identical - there is no many-to-one option.

### 4. Linking the blocks in Q1

First of all, the blocks must be assembled with the lines:

```NUMBLK=n

where n is the number of blocks, and file is a base file name, up to 14 characters long, with no embedded blanks. For example,

```NUMBLK=50

would link the files BLK1, BLK2, BLK3, ... , BLK50 to make a single linked grid.

The next step is to define how the individual blocks are linked. This is done with pairs of MPATCH commands. These look like:

```MPATCH(i, MBLiabcd, dir, ixf,ixl, iyf,iyl, izf,izl, 1,1)
MPATCH(j, MBLjabcd, dir, ixf,ixl, iyf,iyl, izf,izl, 1,1) ```

where:

• i,j are the numbers of two blocks to be linked
• MBLiabcd is an (up to) eight-character string in which MBL is a required parameter, i and j are the numbers of the blocks being linked, and abcd is a further user-defined string which makes the whole string unique. A convenient, though not necessary, convention is to make the name of the first patch MBLi.j, and the second MBLj.i.
• dir is one of EAST,WEST,NORTH,SOUTH,HIGH,LOW which defines the face of the block to be linked
• ixf, ..., izl are the first and last cells in each co-ordinate direction. These numbers include the dummy cells, and must define only the active cells. They are counted in the local co-ordinates of each block.

To link the faces of blocks 1&2 and 2&3 in the example above would require:

```MPATCH(1, MBL1-2, EAST, 10,10, 1,ny, 1,nz, 1,1)
MPATCH(2, MBL2-1, WEST,  2, 2, 1,ny, 1,nz, 1,1) ```
```MPATCH(2, MBL2-3, EAST, 21,21, 1,ny, 1,nz, 1,1)
MPATCH(3, MBL3-2, WEST,  2, 2, 1,ny, 1,nz, 1,1) ```

where ny, nz are the numbers of cells in J and K in the respective blocks. Note that any dummy cells in the J&K directions also have to be omitted.

If the link is 'natural', by which is meant that the blocks share the same IJK orientation, the above settings are sufficient. If the IJK orientations are different, one more line is required. This specifies how the IJK of the second block line up with the IJK of the first block.

The extra line takes the form

`SPEDAT(SET, GCV, MBLjabcd, C, def) `

where:

• SET,GCV and C are required parameters,
• MBLjabcd is the name of the second link-patch of a pair, and
• def is a 3 character string. The valid characters are selected from E W N S H L.

This string defines how the N, E and H faces of the first block link to the second block. The default, natural, link would be S W L i.e. North to South, East to West and High to Low.

Examples follow.

```
----------------------
|         E           |
|N      Block 2      S|
|            W        |
----------------------------------------
|          N         |       H          |
|W      Block 1     E|N    Block 3     S|
|          S         |       L          |
---------------------------------------- ```
```Block 1 - 2
MPATCH (1, MBL1.2, NORTH, ......
MPATCH (2, MBL2.1, WEST, ......
SPEDAT (SET, GCV, MBL2.1, C, WNL) ```
```Block 1 - 3
MPATCH (1, MBL1.3, EAST, ......
MPATCH (3, MBL3.1, NORTH, ......
SPEDAT (SET, GCV, MBL3.1, C, LNE) ```
```Block 2 - 3
MPATCH (2, MBL2.3, WEST, ......
MPATCH (3, MBL3.2, HIGH, ......
SPEDAT (SET, GCV, MBL3.2, C, SLE) ```

### 6. Boundary and Source Locations

The MPATCH command is also used to define the locations of any required boundary conditions, sources, blockages etc. The format of the command is:

`MPATCH( i, name, type, ixf,ixl, iyf,iyl, izf,izl, itf,itl)`

where:

• i is the number of the block the source is located in,
• name is a user-specified unique identifying string, up to 8 characters long,
• type is any of the valid PHOENICS PATCH types,
• ixf, ..., izl are the first and last cells in the local block co-ordinates, and
• itf,itl are the first and last time step the source is to be active.

In order for the PHOENICS menu system to correctly identify the type of source, especially inlets and outlets, the following commands are required:

Inlets

The patch name must start with the characters BFC, and COVAL commands must exist for P1, U1, V1 and W1:

```MPATCH( i, BFCname, type, ixf,ixl, iyf,iyl, izf,izl, itf,itl)
COVAL(BFCname, P1, FIXFLU,GRND1)
COVAL(BFCname, U1, ONLYMS,GRND1)
COVAL(BFCname, V1, ONLYMS,GRND1)
COVAL(BFCname ,W1,ONLYMS,GRND1)
```

Outlets

A COVAL command must exist for P1:

```MPATCH( i, name, type, ixf,ixl, iyf,iyl, izf,izl, itf,itl)
COVAL(name, P1, 1000.0, 0.0)
```

### 7. Example Q1 and grid files

The files below show a simple 3 block case. A picture of the case is shown here. The block structure is:

```
--------------------------------------
|             L                     /|
|                                  / |
|                                 /  |
|                                /   |
|E        Block 3             W /    |
|                              / L   |
|                             /      |
|                            /       |
|             H             /        |
----------------------------         |
|          L               |         |
|                          |         |
|                          | Block 2 |
|E      Block 1           W|E       W|
|                          |         |
|                          |         |
|         H                |    H    |
--------------------------------------```

Blocks 1&2 and 1&3 are linked 'naturally' - West to East and Low to High, whilst the link between 2&3 is 'unnatural' - a Low face is linked to a West face. All blocks have a nominal grid of 2*2*2. There is an inlet of 1 m/s in the X direction on the East face of Block 3, and an outlet to a relative pressure of 0.0 Pa on the West face of Block 2.

The resulting Q1 is shown below.

Q1

``` TALK=T;RUN( 1, 1)
*********************************************************
Group 6. Body-Fitted co-ordinates
BFC=T
NUMBLK=    3
MPATCH(   1,MBL1_3,LOW  ,   2,   3,   1,   2,   2,   2,1,1)
MPATCH(   3,MBL3_1,HIGH ,   2,   3,   1,   2,   2,   2,1,1)
```
```MPATCH(   1,MBL1_2,WEST ,   2,   2,   1,   2,   2,   3,1,1)
MPATCH(   2,MBL2_1,EAST ,   2,   2,   1,   2,   2,   3,1,1)
```
```MPATCH(   2,MBL2_3,LOW  ,   1,   2,   1,   2,   2,   2,1,1)
MPATCH(   3,MBL3_2,WEST ,   2,   2,   1,   2,   1,   2,1,1)
SPEDAT(SET, GCV, MBL3_2, C, SLE)
```
```     Group 7. Variables: STOREd,SOLVEd,NAMEd
GCV     =    T
SOLVE(P1, U1, V1, W1)
STORE(PRPS)
```
```     Group 13. Boundary conditions and special sources
```
```   *** Fixed pressure boundary OUT7     for block     2
MPATCH(   2,OUT     ,   WEST,   1,   1,   1,   2,   2,   3,1,1)
COVAL(OUT, P1, 1000.0, 0.0)```
```   *** Inlet boundary INLET12  for block     3
MPATCH(   3,BFCIN   ,   EAST,   3,   3,   1,   2,   1,   2,1,1)
COVAL(BFCIN, P1, FIXFLU,GRND1)
COVAL(BFCIN,U1,ONLYMS,GRND1)
COVAL(BFCIN,V1,ONLYMS,GRND1)
COVAL(BFCIN,W1,ONLYMS,GRND1)
COVAL(BFCIN,UCRT,0, 1.0)```
`STOP`

Grid file i1

```    4    3    4
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 5.000000E-01 5.000000E-01 0.000000E+00
0.000000E+00 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 5.000000E-01 5.000000E-01 0.000000E+00
0.000000E+00 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 5.000000E-01 5.000000E-01 0.000000E+00
0.000000E+00 0.000000E+00
5.000000E-01 5.000000E-01 5.000000E-01 5.000000E-01 5.000000E-01
5.000000E-01 5.000000E-01 5.000000E-01 5.000000E-01 5.000000E-01
5.000000E-01 5.000000E-01
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 5.000000E-01 5.000000E-01 0.000000E+00
0.000000E+00 0.000000E+00
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
0.000000E+00 0.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00```

Grid file i2

```    4    3    4
2.000000E+00 2.000000E+00 2.000000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
2.000000E+00 2.000000E+00 2.000000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
2.000000E+00 2.000000E+00 2.000000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
2.000000E+00 2.000000E+00 2.000000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
2.000000E+00 2.000000E+00 2.000000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 7.500000E-01 7.500000E-01
7.500000E-01 5.000000E-01 5.000000E-01 5.000000E-01 5.000000E-01
5.000000E-01 5.000000E-01
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
2.000000E+00 2.000000E+00 2.000000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
0.000000E+00 0.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00```

Grid file i3

```    4    3    4
2.000000E+00 2.000000E+00 2.000000E+00 2.000000E+00 2.000000E+00
2.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 0.000000E+00
0.000000E+00 0.000000E+00
2.000000E+00 2.000000E+00 2.000000E+00 2.000000E+00 2.000000E+00
2.000000E+00 2.000000E+00 2.000000E+00 2.000000E+00 2.000000E+00
2.000000E+00 2.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
1.500000E+00 1.500000E+00 1.500000E+00 1.500000E+00 1.500000E+00
1.500000E+00 7.500000E-01 7.500000E-01 7.500000E-01 0.000000E+00
0.000000E+00 0.000000E+00
1.500000E+00 1.500000E+00 1.500000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.500000E+00 1.500000E+00 1.500000E+00 1.500000E+00
1.500000E+00 1.500000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 5.000000E-01 5.000000E-01 0.000000E+00
0.000000E+00 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 5.000000E-01 5.000000E-01 0.000000E+00
0.000000E+00 0.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00 1.000000E+00
1.000000E+00 1.000000E+00
1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00 5.000000E-01
0.000000E+00 1.000000E+00 5.000000E-01 0.000000E+00 1.000000E+00
5.000000E-01 0.000000E+00```