Flow (house-keeping) module

Flow-solution manipulation funtions.

blockflow2d

blockflow2d.py: Pick up the flow data for mbcns2 block-structured grids.

Author: PAJ

Version: 11-Apr-2007 : first cut after talking about it for so long

cfpylib.flow.blockflow2d.apply_uflowz(val)

Cleanly flush small float values to zero (for the benefit of Paraview).

class cfpylib.flow.blockflow2d.BlockFlow2D(ni=None, nj=None, label=None, nsp=1, nvib=0, separate_electron_energy=0, radiation=0, k_omega=0, scalar_pdf=0, debug=0)

Storage and service functions for a block of cells within a block-structured grid.

__init__(ni=None, nj=None, label=None, nsp=1, nvib=0, separate_electron_energy=0, radiation=0, k_omega=0, scalar_pdf=0, debug=0)

Prepare to store the data.

Parameters:
  • ni – number of cells in the i-index direction
  • nj – number of cells in the j-index direction
  • label – (optional) string label for the block

If the number of vertices are specified in each direction, we actually create the storage arrays now. The number of grid vertices in each index-direction will be one more than the number of finite-volume cells in that direction.

init_arrays()

Create the storage arrays at the previously-specified sizes.

Note that the mass fractions are stored in an array of lists. (Each list contains the species mass fractions for a cell.) The same arrangement is used for the vibrational energies and temperatures.

read(fp, debug=0)

Read the next available block of flow data.

The solution file may contain several solution times, each with several blocks of data

read_solution_for_cell(fp, i, j)

Read the next available flow data and store it in the i,j cell.

This function must be kept in sync with read_solution_for_cell() which is found in lib/fv_core/source/cns_cell.cxx.

vtk_xml_writer

vtk_xml_writer.py: Writing of BlockGrid2D and BlockFlow2D (mbcns2) objects to VTK XML files.

Author: Rowan J. Gollan

Date: 15-Jun-2007

cfpylib.flow.vtk_xml_writer.write_vtk_xml_unstructured_grid_2D(grid, block, filename, data_list)

This function writes a serial vtk file in XML format for an unstructured grid.

Parameters:
  • grid – A BlockGrid2D object
  • block – A BlockFlow2D onject which corresponds to grid
  • filename – A filename for the output file (without extension)
  • data_list – A list of keys for the desired data from the block
cfpylib.flow.vtk_xml_writer.write_vtk_xml_multi_block_2D(grid_and_blocks, filename, data_list)

This function writes a multi block of flow data as individual files and a coordinating file.

Parameters:
  • grid_and_blocks – A list of tuples containing (grid, block) objects.
  • filename – The base name for the collection of files.
  • data_list – A list of tuples of the form (symbol, name)

tecplot_writer

tecplot_writer.py: Writing of BlockGrid2D and BlockFlow2D (mbcns2) objects to VTK XML files.

Author: Rowan Gollan

Date: 22-Oct-2007

cfpylib.flow.tecplot_writer.write_tecplot_structured_block_2D(grid, block, filename, data_list)

This function writes an unstructured grid in tecplot format.

Parameters:
  • grid – A BlockGrid2D object
  • block – A BlockFlow2D object which corresponds to grid
  • filename – A filename for the output file (without extension)
Data_list:

A list of keys for the desired data from the block

cfpylib.flow.tecplot_writer.write_tecplot_file_per_block(grid_and_blocks, filename, data_list)

This function writes a structured grid in tecplot format.

Parameters:
  • grid_and_blocks – A list of tuples containing (grid, block) objects.
  • filename – A filename for the output file (without extension)
  • data_list – A list of keys for the desired data from the block
cfpylib.flow.tecplot_writer.write_tecplot_single_file(grid_and_blocks, filename, data_list)

This function writes a structured grid in tecplot format.

Parameters:
  • grid_and_blocks – A list of tuples containing (grid, block) objects.
  • filename – A filename for the output file (without extension)
  • data_list – A list of keys for the desired data from the block

Table Of Contents

Previous topic

Gas Dynamics module

Next topic

Geometry module

This Page