Encyclopaedia Index

Contents list

Space and Time Grids

Spatial Grids

Switching Co-ordinate Systems

Cartesian and Cylindrical-Polar Co-ordinates

Displaying the Grid
The Default Grid - Auto Meshing
Modifying the Grid

Changing the Auto-mesh Rules
Manually Changing the Grid by Region

Advice on Grid Settings

Body-Fitted Co-ordinates

Displaying the BFC Grid
Moving the Probe
Modifying the BFC Grid

Creating a Grid with the PHOENICS Grid Generator
Importing a Grid Created by an External Grid Generator
Creating a Grid with PIL
Modifying the Grid for an Existing Case

Time Grids

Switching Between Steady and Transient
Setting the Time-Step Distribution
Saving Intermediate Results
Restarting Transient Cases


Spatial Grids

There are three kinds of spatial grids:


Switching Co-ordinate Systems

To switch between the co-ordinate systems, click on Menu / Geometry, then on Co-ordinate system. The Cartesian grid is the default.


IMAGE: Grid Mesh Settings Dialog

The change between Cartesian and Cylindrical-polar can be made at will in either direction.

Note that whilst it is (often) possible to convert existing cases to BFC, it is not possible to reverse the procedure.

Cartesian/Polar cases which cannot be converted are those which use geometries other than cuboids.


Cartesian and Cylindrical-Polar Co-ordinates

Displaying the Grid

Turning the mesh toggle on the hand-set ON by clicking on the Grid mesh button causes the current grid to be displayed on the graphics image:


Image: GRID

The grid is displayed on a plane at the probe location. The plane is normal to the co-ordinate axis nearest the view direction. For example, if the view direction is along, or close to, +Z, the X-Y plane will be displayed. As the probe is moved or view directions are changed, the grid display will also change to follow.


The Default Grid - Auto Meshing

The orange lines shown in the above image are region boundaries. These are automatically created to match the edges of the object bounding boxes (see VR-Editor Object Dialogs - Object Size, Object Positioning). They are also grid lines.

As objects are introduced, removed and re sized, the region lines will adapt to match the object layout.

The blue lines are 'ordinary' grid lines. By default, these are distributed by the auto-mesher according to the current set of rules. These are:

  1. The maximum cell size is not allowed to exceed a set fraction (0.05 by default) of the domain size.
  2. The ratios between the sizes of the first cell in the current region and the last cell in the previous region, and the last cell in the current region and the first cell in the next region, are not allowed to exceed a set limit (1.5 by default).
  3. If the ratios are exceeded, the number of cells in that region is increased, and the spacing is set according to a geometrical or power-law progression using a set expansion ratio (geometrical 1.2 by default), until either the ratio criterion is satisfied at both ends of the region, or the cells at both ends are below a set minimum fraction (0.005 by default) of the domain size.

Note that if there are no region boundaries in a direction, the auto-meshing will usually assume that only one cell is required in that direction. This is appropriate for 2D cases in which all objects cover the whole domain in the third direction.

If there is an INLET, FAN, OUTLET or PLATE object on the edge of the domain, the auto-meshing will assume that grid is required in that direction, even if there is only one region.

The user should always inspect the grid visually to satisfy themselves that it is appropriate. The default auto-mesh settings give a fairly coarse grid which is suitable for model-building purposes. In most cases they will require adjustment before a final run is made.


Modifying the Grid

Clicking anywhere in the image whilst the grid mesh display is on will show the Grid Mesh Settings Dialog. By default, the auto-meshing feature is turned on, as shown in the image below:


Image: GRID Mesh SETTINGS - Auto

The grayed-out values cannot be changed from this dialog unless the auto-mesh is turned off for any direction, as shown here:


Image: GRID Mesh SETTINGS - Manual

Settings on this dialog which are common to auto-mesh on or off are:

Changing the Auto-mesh Rules

To change the auto-mesh settings for any direction, click 'Edit all regions in' on the Grid Mesh Settings dialog for the direction in question. The following dialog will appear:


Image: X Direction Auto-mesh Settings

The grayed-out values cannot be changed manually unless the auto-meshing is turned off. They reflect the settings generated by the current auto-mesh control parameters.

The following settings influence the auto-meshing:

Manually Changing the Grid by Region

When the auto-meshing for a direction is turned off, the number of cells in any region, and the distribution within any region, can be set by clicking on the region to be modified. The initial region settings will be those created by the auto-mesher. Clicking on X region 3 and Y region 1 of the example shown previously, for example, brings up the dialog box shown below:

Image: GRID Mesh SETTINGS - manual

The diagram below shows a simple three-part grid. Region 1 has 10 cells with a power of -1.5. Region 2 has 10 cells with a symmetric power of 1.5, and region 3 has 10 cells with a power of +1.5.


Image: DIAGRAM 1

The next diagram shows the same grid, but with geometrical expansions in all three regions:


Image: DIAGRAM 2

Advice on Grid Settings

The user is advised to use the power-law or geometrical expansions to reduce the change in grid-size between regions. This will assist convergence of the Earth solver. With the auto-meshing turned on, this is controlled by reducing the minimum cell size and adjusting the maximum size ratio. Reducing both these values will act to reduce the rate of change of grid size across region boundaries, but also increase the number of cells.

The tolerance can be adjusted to eliminate very thin regions where objects nearly line up.


Body-Fitted Co-ordinates

All BFC library cases, and all user-generated BFC cases can be loaded into PHOENICS-VR.

The possible methods of grid generation are:


Displaying the Grid

Turning the mesh toggle on the hand-set ON by clicking on the Grid mesh button causes the current grid to be displayed on the graphics image:


Image: BFC Grid

The grid is displayed on a plane at the probe location. The plane is normal to the co-ordinate axis nearest the view direction. For example, if the view direction is along, or close to, +Z, the X-Y plane will be displayed. As the probe is moved or view directions are changed, the grid display will also change to follow.

In a multi-block grid, the grid will be displayed in the block containing the probe.


Moving the Probe

In BFC, the probe can only be moved from cell-centre to cell-centre. The probe location is always in IX, IY, IZ.

In a multi-block case, these are shown in 'big' grid co-ordinates, not in local block co-ordinates. Any cell can be moved to directly by typing the cell IX,IY,IZ values into the hand-set.

Note the colouring of the block containing the probe:

In a complex multi-block case, this will help in identifying which way to move the probe.

To move the probe from one block to the next, move up to a linked face, and then step through it by continuing to move in that direction.

The axis colouring will jump to the next block. If the Move probe button is kept pressed, and the IJK orientation of the next block is different, the probe may take off in an unexpected direction - it may even jump back to the previous block if the axes are reversed!


Modifying the Grid

Creating a Grid with the PHOENICS Grid Generator

To enter the Grid Generator, turn the grid display ON by clicking on the Grid mesh button. Click on the grid anywhere in the domain. The BFC Menu will appear.


IMAGE: BFC Menu

The main functions on the BFC Menu are:

For those users not familiar with the BFC grid generator, several tutorials are available, reached from POLIS / Learn / BFC tutorials. There is also a lecture, reached from POLIS / Learn /Lectures describing... / Body-fitted co-ordinates; introduction describing the fundamentals of BFC Grid generation.

The images above show the geometry created by the BFC tutorials.


Importing a Grid Created by an External Grid Generator

Whichever external grid generator is used, the outcome will be a skeleton Q1, and at least one grid file. If the case is a multi-block case, there will be one grid file for each block.

The skeleton Q1 file will contain a READCO command to read the grid file(s), and instructions for linking the blocks.

An example skeleton file for a single-block grid stored in the grid file grid1 must contain at the very least:

TALK=T; RUN(1,1)
BFC=T
READCO(grid1)
STOP

It may also contain (M)PATCH statements locating boundary conditions, and also COVAL commands setting inlet values.

In GeoGrid (Note: this software is no longer available, but the images are shown for illustrative purposes) the name of the Q1 will be project.Q1, where project is the name of the GeoGrid project.

To import this into PHOENICS-VR, click on File - Open existing case from the top bar of the main VR-Editor/Viewer graphics window. Double-click on project.Q1 to open it in PHOENICS-VR.

The first image shows a very simple 3-block example in GeoGrid.

 

One inlet (purple, on the left) and one outlet (blue, on the right) have been designated.

 

The second image shows the same case imported into PHOENICS-VR.

Note: The grid files must be in the current working directory, OR the READCO(filename+) command must be modified to include the path to where they are.

If a grid generator other than GeoGrid is used, please ensure that the skeleton Q1 is copied to the working directory as case.Q1, together with all the necessary grid files. Use File - Open existing case to open case.Q1.


Creating a Grid with PIL

If the user is familiar with the PIL GSET suite of commands, the Q1 can be edited to create the grid in any convenient way. PHOENICS-VR will recognise and retain all GSET commands.

It does not recognise the older SETPT, DOMAIN, SETLIN or MAGIC commands. If the grid is built with these, or some of these commands are used to smooth parts of the grid, use the DUMPC(name) command to write out a grid file, and supply PHOENICS-VR with a  Q1 that just contains:

TALK=T;RUN(1,1)
BFC=T
READCO(name)
STOP

The final result should be a file called case.Q1, which either contains the required GSET commands, or a READCO to read an existing grid file (or files).


Modifying the Grid for an Existing Case

In many cases, once a case has been set up and run, it becomes obvious that the original grid is inadequate. It may be generally too coarse, or grid may be concentrated in the wrong places.

If the grid was generated in the PHOENICS Grid Generator, this can be used to modify the grid as required. On exit from the Grid Generator, most of the objects will have to be re-located and re-sized , as they will still be in their original IJK positions.

If the grid was generated externally, in many cases this can be avoided. Re-enter the grid generator, say GeoGrid, and modify the grid as required. Save the PHOENICS output file with a different name to that used for the original grid.

In VR-Editor, click on Main Menu - Geometry - Read new geometry from file. This will bring up a file browsing window, which will allow the selection of the new Q1 written by the grid generator. The new grid will be read in, and boundary condition locations will be remapped to the new grid when Open is clicked. Note that only boundary conditions common to both grids will be remapped.


Time Grids

To simulate transient behaviour, time is discretised in a similar way to the space dimensions. The Earth solver produces a solution for each step in time before advancing to the next step. An extra term is automatically added to the equations solved, which expresses the influence of the previous time-step.

The default equation formulation is implicit, so there are no extra stability criteria to satisfy when setting the size of the time-steps. If the steps are too large, the details of the transient behaviour will not be picked up.

In Transient mode, objects representing sources will have additional dialogs allowing start and end times to be set.

Switching Between Steady and Transient

To switch from Steady to Transient, click on the Steady button on the   Grid Mesh Settings dialog,

or in BFC,

 

on the BFC menu dialog. A new button labeled Time Steps will appear.

The Steady button will now be labeled Transient. To switch back to Steady, click on Transient.


Setting the Time-Step Distribution

Clicking on the Time Steps button displays the Time Step Settings dialog.


IMAGE: Time Step Settings dialog

Time can be divided into regions by the Split Regions button. Within each time region, the number of time steps can be set, together with a geometrical or power-law size distribution.


Saving Intermediate Results

To save intermediate results for plotting in the VR-Viewer or any other post-processor, click on 'Main menu', 'Output', 'Field dumping'. The following dialog will appear:


IMAGE: Transient Field dumping dialog

Set the first and last time steps to be dumped, and the step frequency for dumping. If the first and last steps are left as zero, the program will assume the first and last steps for the current run. Set a start letter for the intermediate output files. A start letter of A, and a dump frequency of 1 will result in files called A1, A2, A3 etc being dumped at the end of each time step.

The letter Q should not be used, as the file dumped on step 1 will overwrite the Q1 input file!

The size of the intermediate files can be reduced by choosing not to dump each variable to the file. Changing the Y to an N in the OUTPUT 3 DUMP line will prevent that variable from being written to the intermediate file. If the property-marked variable, PRPS, is so excluded, Viewer will not be able to determine which cells are blocked. Depending on which variables are excluded, it may not be possible to restart the calculation from the intermediate files. All variables are written to the final solution files (PHIDA or PHI and PBCL.DAT) regardless of the dump settings.

If the case is 2D in X and Y, the start letter can be left blank. In this case, a special output file called PARADA or PARPHI is written, in which the results of each time step are saved as a Z plane. In the viewer, sweeping through Z in effect sweeps through time.

To print flow fields to the RESULT file every time step, go to 'Main menu', 'Output', 'Field printout', and set NTPRIN to 1. Note that NTPRIN may be displayed on the next page of the menu. Click 'Page down' to display settings on the next page.

Note that the intermediate output files are optionally saved by 'File', 'Save as a Case', and restored by 'File', 'Open existing case'. The output files can be big and numerous, so it may be better to either ZIP them up, or copy them to a CD for safe-keeping.

The intermediate files can be selected for plotting in the Viewer by choosing ‘Use intermediate step files – Yes’ on the ‘File names’ dialog displayed when the Viewer starts.


Restarting Transient Cases

There are two main possibilities:

  1. Restarting to continue with more time steps
  2. Restart from some intermediate point and re-calculate some steps.

To restart and continue the run, bring up the Time step setting dialog. In the 'Time at end of last step' box, enter the new extended end time of the run. Leave 'Time at start of step 1' at zero. In the 'Last step number' box, enter the new total number of steps. In the 'First step number' box, enter the previous last step+1. A dialog will appear asking if a restart is to be activated. Click 'Yes'. The restart will be activated, and the names of the restart files will be deduced from the start letter chosen for saving the intermediate fields.

Please check that the names are correct. To force a restart from the final solution files which are guaranteed to contain all the solved and stored variables, set the 'Solution file' to phida (or phi) and the 'Cut-cell file' to pbcl.dat.

For example, the original run did 100 steps from time 0.0s to 10.0s ( thus giving time steps of 0.1s each). It is now desired to do the next 10.0s with the same time step size. Set 'Time at end of last step' to 20.0, 'Last step number' to 200, and 'First step number' to 101. To activate the restart, click on 'Yes' when asked about activating the restart.

To restart from an intermediate step, say step 50, just set 'First step number' to 51. A dialog will appear asking if a restart is to be activated. Click 'Yes'. The restart will be activated, and the names of the restart files will be deduced from the start letter chosen for saving the intermediate fields.


IMAGE: Time Step Settings dialog for restart

The names of the restart files are also displayed on (and can be set from) the 'Main Menu', 'Initialisation' panel. An active restart is shown by all the initial values (FIINIT) being shown as READFI.


Contents list