Encyclopaedia Index

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

Contents

  1. Overview
  2. The structure of the grid files
  3. Block links
  4. Linking the blocks in Q1
  5. Unnatural links
  6. Boundary and Source Locations
  7. Example Q1 and grid files

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

        READ(LU, '(5(1PE13.6))') ((XC(I, J, K),J=1,NJ),I=1,NI)

        READ(LU, '(5(1PE13.6))') ((YC(I, J, K),J=1,NJ),I=1,NI)

        READ(LU, '(5(1PE13.6))') ((ZC(I, J, K),J=1,NJ),I=1,NI)

      ENDDO

where:

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.


3. Block links

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

READCO(file+) 

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 

READCO(BLK+) 

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:

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.


5. Unnatural links

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:

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:

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

READCO(i+)

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