Meshing

In order to run a computational fluid dynamics simulation, the domain must be discretised into a ‘mesh’ of cells. turbigen supports structured grids in polar coordinates of any multi-block topology.

H-meshing

The simplest topology is an H-mesh. Each blade row is a single block, indexed in the streamwise, spanwise, and pitchwise directions. No special setup is required for H-meshing as it is performed using native turbigen code.

Configuration options

class HMeshConfig(**kwargs)[source]

Override default parameters using keyword args.

ER_stream = 1.2

Expansion ratio of streamwise grid from first LE to inlet boundary.

AR_stream = 2.0

Aspect ratio in blade-to-blade plane of cells at outlet boundary.

AR_passage = 1.6

Nominal aspect ratio in blade-to-blade plane of mid-passage cells.

AR_merid = 1.0

Aspect ratio of mid-chord cells in meridional plane.

AR_merid_unbladed = 2.0

Aspect ratio of mid-chord cells in meridional plane.

ER_span = 1.2

Expansion ratio of spanwise grid away from hub and casing.

dm_LE = 0.002

Streamwise grid spacing at LE, normalised by meridional chord.

ni_TE = 9

Number of streamwise points across trailing edge.

dm_TE = 0.0

Normalised meridional length over which to cluster the TE points, 0. for the true actual TE.

dspf_mid = 0.03

Spanwise grid spacing at midspan, as a fraction of span.

ER_pitch = 1.2

Expansion ratio away from aerofoil surfaces.

nchord_relax = 1.0

Number of meridional chords over which pitchwise clustering is relaxed.

resolution_factor = 1.0

Multiply the number of points in each direction, keeping relative spacings.

rtol_smooth = 0.0

Tolerance on smoothing convergence.

maxiter_smooth = 0

Number of smoothing iterations, zero to disable smoothing.

pitchwise_grid(drt_row, pitch_chord, AR_row, resample=True)[source]

Evaluate a pitchwise grid vector given surface spacing.

pitchwise_grid_fixed_npts(drt_row, pitch_chord, AR_row, npts)[source]

Evaluate a pitchwise grid vector given surface spacing.

make_grid(mac, mesh_config, dhub, dcas, dsurf, unbladed)[source]

Generate a Grid object for a machine geometry.

OH-meshing

Placing an O-mesh around the blade gives better resolution of the boundary layers, and removes H-mesh grid distortions at the leading edge and with highly staggered blades. Additional H blocks placed around the O-mesh discretise the remainder of the fluid domain, yielding an OH-mesh for the entire passage.

Setting up

turbigen accomplishes OH-meshing by scripting the commercial software AutoGrid. In general, the machine we want to run the CFD on is not the same one as for the meshing. So we need to start a server process on a remote machine with access to an AutoGrid license. On the machine with AutoGrid, install turbigen and run:

$ turbigen-autogrid-server

The server will stay running indefinitely, waiting for jobs. If the server finds a job it will perform the meshing. Meanwhile, the turbigen process on the HPC will wait for the meshing to finish and copy back the results for preprocessing.

We will be connecting to the AutoGrid machine frequently. So, on the CFD machine, add an entry in ~/.ssh/config to allow connection reuse:

Host autogrid-box
    ControlMaster auto
    ControlPath ~/.ssh/control-%C
    ControlPersist yes
    ServerAliveInterval 240

where autogrid-box is the hostname of the AutoGrid machine. If you do not have SSH keys set up for password-free access to the AutoGrid machine, you will have to do that first by, on the CFD machine, running some combination of:

# Make an ssh private/public key pair
$ ssh-keygen

# Copy to the remote machine
$ ssh-copy-id autogrid-box

# Load keys into agent to save your passphrase
$ eval `ssh-agent` && ssh-add

Before moving on, check you can connect from the CFD machine to the AutoGrid machine without being prompted for a password by running,

$ ssh autogrid-box

Configuration options

class OHMeshConfig(**kwargs)[source]

Initialise a configuration, overriding defaults with keyword arguments.

spf_ref = 0.5

Set blade-to-blade mesh parameters based on geometry at this span fraction.

dspf_mid = 0.03

Spanwise grid spacing at midspan, as a fraction of span.

remote_host = ''

Remote host on which AutoGrid server is running.

span_interpolation = 2.0

Spanwise % spacing between optimisations of the mesh, interpolate between.

via_host = ''

Jump host for SSH connection to the AutoGrid server.

queue_path = '~/.ag_queue.txt'

File on remote host to append our queued meshing jobs.

gbcs_path = ''

Location of pre-made mesh, or ‘reuse’ to take from workdir/mesh.{g,bcs}.

ni_inlet = 65

Number of streamwise points in inlet.

ni_outlet = 65

Number of streamwise points in outlet.

refine_factor = 0

Divide each edge into 2**(refine_factor) sub-edges.