g3d.flow.domain package

Subpackages

Submodules

g3d.flow.domain.flow_domain module

Domain class definition

class g3d.flow.domain.flow_domain.Domain(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Attributes:
auxv

Auxiliary variables placeholder

bc_mods

Boundary condition modifiers array

boundary_faces

Boundary conditions container

connectivity_faces

Grid connectivity container (block interfaces)

cons

Conservative variables placeholder

dtmv

Dynamic turbulence model variables placeholder

gas

Gas model instance

internal_faces

Internal grid faces container

mesh

Computational mesh instance

post

Postprocessing variables placeholder

tag

tag (string) used for identification

turb

Turbulence model instance

vgrad

Velocity gradients placeholder

Methods

BC_mod()

Modifies boundary condition data going through specified boundary condition modifiers

auxvr()

Updates flow domain primitive variable fields (p, u, v, w, t, c)

bc_update_conservative(boco)

Updates boundary condition conservative variables (ro, ru, rv, rw, et)

bc_update_primitive(boco)

Updates boundary condition primitive variables (p, u, v, w, t, c)

bc_update_speed_of_sound(boco)

Updates boundary condition speed of sound

cell_get_block(kc)

Get block number associated with specified cell index

cell_get_ijk(kc)

Gets cell indices in computational space (i, j, k)

check_FMP_metrics()

Checks flux molecule cell metrics for all flux molecules (internal faces, mesh block connectivity faces, and boundary faces)

check_cell_metrics(ic)

Checks cell metrics for cell with specified cell index

copy(e)

copies data from specified entity input: entity example: copy(e)

export_flow(*args, **kwargs)

Exports flow field data to file

export_mesh(*args, **kwargs)

Exports mesh to file

export_velocity_gradients(*args, **kwargs)

Exports velocity gradient data to file

generate_irsm_matrix()

Generates matrix for Implicit Residual Smoothing (IRSM) operator

generate_mesh_from_pipe_data(q1d_pipe)

Generates computational mesh from provided Q1D domain object

get_IRSM_operator()

Gets IRMS operator object

get_area([idx])

Gets average area for specific cell if cell index is specified otherwise all average cell areas are returned as an array

get_auxv_array([var])

Gets specified primitive variable array (auxiliary solver variable)

get_auxv_array_with_ghosts([var])

Gets specified primitive variable array (auxiliary solver variable) including ghost cell values

get_auxv_arrays()

Gets primitive variable arrays (auxiliary solver variables)

get_auxv_arrays_with_ghosts()

Gets primitive variable arrays (auxiliary solver variables) including ghost cell values

get_auxv_velocity_arrays()

Gets velocity vectors auxiliary solver variables placeholder

get_auxv_velocity_arrays_with_ghosts()

Gets velocity vectors auxiliary solver variables placeholder including ghost cell values

get_block_sizes(im)

Gets block node counts in three directions (ni, nj, nk)

get_cell(im, i, j, k)

Gets cell index based on provided data

get_cell_centers()

Gets cell center coordinates, (x, y, z)-vectors, for all cell in the computational domain

get_cons_array([var])

Gets specified conservative variable array (solver variable)

get_cons_array_with_ghosts([var])

Gets specified conservative variable array (solver variable) including ghost cell values

get_cons_arrays()

Gets conservative variable arrays (solver variables)

get_cons_arrays_with_ghosts()

Gets conservative variable arrays (solver variables) including ghost cell values

get_dtmv_array([var])

Gets specified dynamic turbulence model variable array

get_dtmv_array_with_ghosts([var])

Gets specified dynamic turbulence model variable array including ghost cell values

get_dtmv_arrays()

Gets dynamic turbulence model variable arrays

get_dtmv_arrays_with_ghosts()

Gets dynamic turbulence model variable arrays including ghost cell values

get_gas_properties()

Gets gas model properties (ratio of specific heats (gamma) & gas constant (R))

get_inverse_volume([idx])

Gets inverse volume for specific cell if cell index is specified otherwise all cell inverse volumes are returned as an array

get_max_FMP_size()

Gets the maximum flux molecule array size

get_node(im, i, j, k)

Gets node index based on provided data

get_node_coordinates()

Gets node coordinate arrays

get_post_array([var])

Gets specified postprocessing variable array

get_post_array_with_ghosts([var])

Gets specified postprocessing variable array including ghost cell values

get_post_arrays()

Gets postprocessing variable arrays

get_post_arrays_with_ghosts()

Gets postprocessing variable arrays including ghost cell values

get_streamtube_normal([idx])

Gets stream-tube normal for specific cell if cell index is specified otherwise all stream-tube normals are returned as an array

get_vgrad_Array([var])

Gets specified velocity gradient array

get_vgrad_array_with_ghosts([var])

Gets specified velocity gradient array including ghost cell values

get_vgrad_arrays()

Gets velocity gradient arrays

get_vgrad_arrays_with_ghosts()

Gets velocity gradient arrays including ghost cell values

get_visct_array()

Gets turbulent viscosity array

get_volume([idx])

Gets volume for specific cell if cell index is specified otherwise all cell volumes are returned as an array

import_boundary_definitions(**kwargs)

Imports boundary definitions from file

import_mesh(*args, **kwargs)

Imports mesh from file

initsol_block_from_Auxv(im, p)

Initialize flow field variables in specified mesh block using specified primitive variables object

initsol_block_from_Cons(im, q)

Initialize flow field variables in specified mesh block using specified conservative variables object

initsol_conservative(ro, ru, rv, rw, et)

Initializes flow field using specified flow property values for all cells (conservative variables)

initsol_from_Auxv(p)

Initialize flow field variables from specified primitive variables container

initsol_from_Cons(q)

Initialize flow field variables from specified conservative variables container

initsol_linear(ql, qr[, direction])

Initialize flow field variables using linear interpolation between specified left and right values (conservative variable container objects)

initsol_primitive(p, u, v, w, t)

Initializes flow field using specified flow property values for all cells (primitive variables)

initsol_region_from_Auxv(r, p)

Initialize flow field variables in specified region using specified primitive variables object

initsol_region_from_Cons(r, q)

Initialize flow field variables in specified region using specified conservative variables object

node_get_block(kp)

Get block number associated with specified node index

node_get_ijk(kp)

Gets node indices in computational space (i, j, k)

print()

prints entity data

print_flow_field_extreme_values()

Prints extreme values (min/max) of density (ro), velocity (u, v, w), pressure (p), and temperature (t)

print_velocity_gradients_extreme_values()

prints velocity gradient extreme values (min/max) of (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

set_gas_properties(gamma, R)

Sets gas model properties (ratio of specific heats (gamma) & gas constant (R))

setup_and_allocate()

Sets up and allocates all flow domain placeholders and data containers updates flux molecule metrics for all flux molecule types (internal faces, block connectivity faces, and boundary faces) allocates turbulence model if applicable

status_check()

Checks if all domain boundaries are defined

update_BC(boco, **kwargs)

Updates boundary face boundary conditions from provided boundary condition container

update_BC_family(*args, **kwargs)

Updates boundary condition family according to specifications

update_BC_type(*args, **kwargs)

Updates boundary condition type according to specifications

update_metrics()

Updates metric data - cell volumes and face areas

BC_mod() → None[source]

Modifies boundary condition data going through specified boundary condition modifiers

property auxv: AuxvField

Auxiliary variables placeholder

Returns:

auxiliary variables object

Return type:

AuxvField

auxvr() → None[source]

Updates flow domain primitive variable fields (p, u, v, w, t, c)

property bc_mods: list

Boundary condition modifiers array

Returns:

array of boundary condition modifiers

Return type:

list

bc_update_conservative(boco: BoCo) → None[source]

Updates boundary condition conservative variables (ro, ru, rv, rw, et)

Parameters:

boco (BoCo) – boundary condition container

bc_update_primitive(boco: BoCo) → None[source]

Updates boundary condition primitive variables (p, u, v, w, t, c)

Parameters:

boco (BoCo) – boundary condition container

bc_update_speed_of_sound(boco: BoCo) → None[source]

Updates boundary condition speed of sound

Parameters:

boco (BoCo) – boundary condition container

property boundary_faces: BoundaryConditionPlaceHolder

Boundary conditions container

Returns:

boundary conditions placeholder object

Return type:

BoundaryConditionPlaceHolder

cell_get_block(kc) → int[source]

Get block number associated with specified cell index

Parameters:

kc (int) – cell index

Returns:

block number

Return type:

int

cell_get_ijk(kc) → Tuple[int, int, int][source]

Gets cell indices in computational space (i, j, k)

Parameters:

kc (int) – cell index

check_FMP_metrics() → Tuple[ndarray, ...][source]

Checks flux molecule cell metrics for all flux molecules (internal faces, mesh block connectivity faces, and boundary faces)

Returns:

tuple of arrays with face check data (X, Y, Z)

Return type:

tuple

check_cell_metrics(ic: int) → None[source]

Checks cell metrics for cell with specified cell index

Parameters:

ic (int) – cell index

property connectivity_faces: InterfacePlaceHolder

Grid connectivity container (block interfaces)

Returns:

interface placeholder object

Return type:

InterfacePlaceHolder

property cons: ConsField

Conservative variables placeholder

Returns:

conservative variables object

Return type:

ConsField

property dtmv: DynamicTurbulenceModelVariables

Dynamic turbulence model variables placeholder

Returns:

dynamic turbulence model variables object

Return type:

DynamicTurbulenceModelVariables

export_flow(*args: Any, **kwargs: Any) → None[source]

Exports flow field data to file

Parameters:
  • *args (Any :) – arguments passed on to flow data exporter (filename (str)), optional

  • **kwargs (Any :) – keyword-value pairs passed on to flow data exporter, ‘filename’ -> name (str), optional

export_mesh(*args: Any, **kwargs: Any) → None[source]

Exports mesh to file

Parameters:
  • *args (Any :) – arguments passed on to mesh exporter (BinaryFormat), optional

  • **kwargs (Any :) – keyword-value pairs passed on to mesh exporter, optional valid key values: ‘format’ binary_format (defaults to BinaryFormat.NATIVE)

export_velocity_gradients(*args: Any, **kwargs: Any) → None[source]

Exports velocity gradient data to file

Parameters:
  • *args (Any :) – arguments passed on to flow data exporter (filename (str)), optional

  • **kwargs (Any :) – keyword-value pairs passed on to flow data exporter, ‘filename’ -> name (str), optional

property gas: Gas

Gas model instance

Returns:

gas model

Return type:

Gas

generate_irsm_matrix() → None[source]

Generates matrix for Implicit Residual Smoothing (IRSM) operator

generate_mesh_from_pipe_data(q1d_pipe: Q1DPipe) → None[source]

Generates computational mesh from provided Q1D domain object

Parameters:

q1d_pipe (Q1DPipe) – quasi-one-dimensional domain object

get_IRSM_operator() → IRSMOperator[source]

Gets IRMS operator object

Returns:

IRSM operator object

Return type:

IRSMOperator

get_area(idx: int | None = None) → float | ndarray[source]

Gets average area for specific cell if cell index is specified otherwise all average cell areas are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

average cell area or array of average cell areas

Return type:

float or ndarray

get_auxv_array(var: str = 'p') → ndarray[source]

Gets specified primitive variable array (auxiliary solver variable)

Parameters:

var (str) – primitive variable (any of ‘p’, ‘u’, ‘v’, ‘w’, ‘t’, ‘c), (Default value = ‘p’)

Returns:

variable array

Return type:

ndarray

get_auxv_array_with_ghosts(var: str = 'p') → ndarray[source]

Gets specified primitive variable array (auxiliary solver variable) including ghost cell values

Parameters:

var (str) – primitive variable (any of ‘p’, ‘u’, ‘v’, ‘w’, ‘t’, ‘c’), (Default value = ‘p’)

Returns:

variable array

Return type:

ndarray

get_auxv_arrays() → Tuple[ndarray, ...][source]

Gets primitive variable arrays (auxiliary solver variables)

Returns:

tuple of primitive variable arrays (p, u, v, w, t, c)

Return type:

tuple

get_auxv_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets primitive variable arrays (auxiliary solver variables) including ghost cell values

Returns:

tuple of primitive variable arrays (p, u, v, w, t, c)

Return type:

tuple

get_auxv_velocity_arrays() → Tuple[ndarray, ...][source]

Gets velocity vectors auxiliary solver variables placeholder

Returns:

tuple of velocity arrays (u, v, w)

Return type:

tuple

get_auxv_velocity_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets velocity vectors auxiliary solver variables placeholder including ghost cell values

Returns:

tuple of velocity arrays (u, v, w)

Return type:

tuple

get_block_sizes(im) → Tuple[int, int, int][source]

Gets block node counts in three directions (ni, nj, nk)

Parameters:

im (int) – block number

Returns:

block node counts (ni, nj, nk)

Return type:

tuple

get_cell(im, i, j, k) → int[source]

Gets cell index based on provided data

Parameters:
  • im (int) – block number

  • i (int) – cell index in i-direction (lowest node i-index in cell)

  • j (int) – cell index in j-direction (lowest node j-index in cell)

  • k (int) – cell index in k-direction (lowest node k-index in cell)

Returns:

cell index lc

Return type:

int

get_cell_centers() → Tuple[ndarray, ...][source]

Gets cell center coordinates, (x, y, z)-vectors, for all cell in the computational domain

Returns:

cell center coordinates (tuple of arrays)

Return type:

tuple

get_cons_array(var: str = 'ro') → ndarray[source]

Gets specified conservative variable array (solver variable)

Parameters:
  • var (str :) – conservative variable (any of ‘ro’, ‘ru’, ‘rv’, ‘rw’, ‘et’), defaults to ‘ro’

  • var – (Default value = ‘ro’)

Returns:

variable array

Return type:

ndarray

get_cons_array_with_ghosts(var: str = 'ro') → ndarray[source]

Gets specified conservative variable array (solver variable) including ghost cell values

Parameters:

var (str) – conservative variable (any of ‘ro’, ‘ru’, ‘rv’, ‘rw’, ‘et’), (Default value = ‘ro’)

Returns:

variable array

Return type:

ndarray

get_cons_arrays() → Tuple[ndarray, ...][source]

Gets conservative variable arrays (solver variables)

Returns:

tuple of conservative variable arrays (ro, ru, rv, rw, et)

Return type:

tuple

get_cons_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets conservative variable arrays (solver variables) including ghost cell values

Returns:

tuple of conservative variable arrays (ro, ru, rv, rw, et)

Return type:

tuple

get_dtmv_array(var: str = 'visct') → ndarray[source]

Gets specified dynamic turbulence model variable array

Parameters:

var (str) – dynamic turbulence model variable (any of ‘visct’), (Default value = ‘visct’)

Returns:

variable array

Return type:

ndarray

get_dtmv_array_with_ghosts(var: str = 'visct') → ndarray[source]

Gets specified dynamic turbulence model variable array including ghost cell values

Parameters:

var (str) – dynamic turbulence model variable (any of ‘visct’), (Default value = ‘visct’)

Returns:

variable array

Return type:

ndarray

get_dtmv_arrays() → Tuple[ndarray, ...][source]

Gets dynamic turbulence model variable arrays

Returns:

tuple of dynamic turbulence model variable arrays (visct)

Return type:

tuple

get_dtmv_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets dynamic turbulence model variable arrays including ghost cell values

Returns:

tuple of dynamic turbulence model variable arrays (visct)

Return type:

tuple

get_gas_properties() → Tuple[float, float][source]

Gets gas model properties (ratio of specific heats (gamma) & gas constant (R))

Returns:

ratio of specific heats (gamma) & gas constant (R)

Return type:

tuple

get_inverse_volume(idx: int | None = None) → float | ndarray[source]

Gets inverse volume for specific cell if cell index is specified otherwise all cell inverse volumes are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

inverse cell volume or array of inverse cell volumes

Return type:

float or ndarray

get_max_FMP_size() → int[source]

Gets the maximum flux molecule array size

Returns:

size

Return type:

int

get_node(im, i, j, k) → int[source]

Gets node index based on provided data

Parameters:
  • im (int) – block number

  • i (int) – node index in i-direction

  • j (int) – node index in j-direction

  • k (int) – node index in k-direction

Returns:

node index lp

Return type:

int

get_node_coordinates() → Tuple[ndarray, ...][source]

Gets node coordinate arrays

Returns:

tuple of node coordinate arrays (x, y, z)

Return type:

tuple

get_post_array(var: str = 'M') → ndarray[source]

Gets specified postprocessing variable array

Parameters:
  • var (str :) – primitive variable (any of ‘p0’, ‘t0’, ‘M’, ‘s’), defaults to ‘M’

  • var – (Default value = ‘M’)

Returns:

variable array

Return type:

ndarray

get_post_array_with_ghosts(var: str = 'M') → ndarray[source]

Gets specified postprocessing variable array including ghost cell values

Parameters:
  • var (str :) – primitive variable (any of ‘p0’, ‘t0’, ‘M’, ‘s’), defaults to ‘M’

  • var – (Default value = ‘M’)

Returns:

variable array

Return type:

ndarray

get_post_arrays() → Tuple[ndarray, ...][source]

Gets postprocessing variable arrays

Returns:

tuple of postprocessing variable arrays (Po, To, M, s)

Return type:

tuple

get_post_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets postprocessing variable arrays including ghost cell values

Returns:

tuple of postprocessing variable arrays (Po, To, M, s)

Return type:

tuple

get_streamtube_normal(idx: int | None = None) → float | ndarray[source]

Gets stream-tube normal for specific cell if cell index is specified otherwise all stream-tube normals are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

stream-tube normal or array of stream-tube normals

Return type:

float or ndarray

get_vgrad_Array(var: str = 'dudx') → ndarray[source]

Gets specified velocity gradient array

Parameters:
  • var (str :) – primitive variable (any of ‘dudx’, ‘dudy’, ‘dudz’, ‘dvdx’, ‘dvdy’, ‘dvdz’, ‘dwdx’, ‘dwdy’, ‘dwdz’), defaults to ‘dudx’

  • var – (Default value = ‘dudx’)

Returns:

variable array

Return type:

ndarray

get_vgrad_array_with_ghosts(var: str = 'dudx') → ndarray[source]

Gets specified velocity gradient array including ghost cell values

Parameters:

var (str) – primitive variable (any of ‘dudx’, ‘dudy’, ‘dudz’, ‘dvdx’, ‘dvdy’, ‘dvdz’, ‘dwdx’, ‘dwdy’, ‘dwdz’), (Default value = ‘dudx’)

Returns:

variable array

Return type:

ndarray

get_vgrad_arrays() → Tuple[ndarray, ...][source]

Gets velocity gradient arrays

Returns:

tuple of velocity gradient arrays (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

Return type:

tuple

get_vgrad_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets velocity gradient arrays including ghost cell values

Returns:

tuple of velocity gradient arrays (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

Return type:

tuple

get_visct_array() → ndarray[source]

Gets turbulent viscosity array

Returns:

turbulent viscosity array (visct)

Return type:

ndarray

get_volume(idx: int | None = None) → float | ndarray[source]

Gets volume for specific cell if cell index is specified otherwise all cell volumes are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

cell volume or array of cell volumes

Return type:

float or ndarray

import_boundary_definitions(**kwargs: Any) → None[source]

Imports boundary definitions from file

Parameters:

**kwargs (Any :) – keyword-value pairs (‘filename’ -> name (str)), optional

import_mesh(*args: Any, **kwargs: Any) → None[source]

Imports mesh from file

Parameters:
  • *args (Any :) – arguments (BinaryFormat, file base name (str)), optional

  • **kwargs (Any :) – keyword value pairs, optional valid key values: ‘format’ binary_format (defaults to BinaryFormat.NATIVE), ‘msh_file’ -> filename, ‘topo_file’ -> filename

initsol_block_from_Auxv(im: int, p: Auxv) → None[source]

Initialize flow field variables in specified mesh block using specified primitive variables object

Parameters:
  • im (int) – block number

  • p (Auxv) – primitive variables container object

initsol_block_from_Cons(im: int, q: Cons) → None[source]

Initialize flow field variables in specified mesh block using specified conservative variables object

Parameters:
  • im (int) – block number

  • q (Cons) – conservative variables container object

initsol_conservative(ro: float, ru: float, rv: float, rw: float, et: float) → None[source]

Initializes flow field using specified flow property values for all cells (conservative variables)

Parameters:
  • ro (float) – density [kg/m^3]

  • ru (float) – x-momentum [kg/(m^2 s)]

  • rv (float) – y-momentum [kg/(m^2 s)]

  • rw (float) – z-momentum [kg/(m^2 s)]

  • et (float) – total energy times density [J/m^3]

initsol_from_Auxv(p: Auxv) → None[source]

Initialize flow field variables from specified primitive variables container

Parameters:

p (Auxv) – primitive variables container object

initsol_from_Cons(q: Cons) → None[source]

Initialize flow field variables from specified conservative variables container

Parameters:

q (Cons) – conservative variables container object

initsol_linear(ql: Cons, qr: Cons, direction: str = 'x') → None[source]

Initialize flow field variables using linear interpolation between specified left and right values (conservative variable container objects)

Parameters:
  • ql (Cons) – conservative variable container objects (left-end values)

  • qr (Cons) – conservative variable container objects (right-end values)

  • direction – interpolation direction, (Default value = ‘x’)

initsol_primitive(p: float, u: float, v: float, w: float, t: float) → None[source]

Initializes flow field using specified flow property values for all cells (primitive variables)

Parameters:
  • p (float) – pressure [Pa]

  • u (float) – x-velocity [m/s]

  • v (float) – y-velocity [m/s]

  • w (float) – z-velocity [m/s]

  • t (float) – temperature [K]

initsol_region_from_Auxv(r: IJKRegion, p: Auxv) → None[source]

Initialize flow field variables in specified region using specified primitive variables object

Parameters:
  • r (IJKRegion) – computational space region

  • p (Auxv) – primitive variables container object

initsol_region_from_Cons(r: IJKRegion, q: Cons) → None[source]

Initialize flow field variables in specified region using specified conservative variables object

Parameters:
  • r (IJKRegion) – computational space region

  • q (Cons) – conservative variables container object

property internal_faces: FMPArray

Internal grid faces container

Returns:

flux molecule array object

Return type:

FMPArray

property mesh: Mesh

Computational mesh instance

Returns:

mesh object

Return type:

Mesh

node_get_block(kp) → int[source]

Get block number associated with specified node index

Parameters:

kp (int) – node index

node_get_ijk(kp) → Tuple[int, int, int][source]

Gets node indices in computational space (i, j, k)

Parameters:

kp (int) – node index

property post: PostField

Postprocessing variables placeholder

Returns:

postprocessing variables object

Return type:

PostField

print_flow_field_extreme_values() → None[source]

Prints extreme values (min/max) of density (ro), velocity (u, v, w), pressure (p), and temperature (t)

print_velocity_gradients_extreme_values() → None[source]

prints velocity gradient extreme values (min/max) of (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

set_gas_properties(gamma: float, R: float) → None[source]

Sets gas model properties (ratio of specific heats (gamma) & gas constant (R))

Parameters:
  • gamma (float) – ratio of specific heats

  • R (float) – gas constant

setup_and_allocate() → None[source]

Sets up and allocates all flow domain placeholders and data containers updates flux molecule metrics for all flux molecule types (internal faces, block connectivity faces, and boundary faces) allocates turbulence model if applicable

status_check() → None[source]

Checks if all domain boundaries are defined

property turb: TurbulenceModel

Turbulence model instance

Returns:

turbulence model

Return type:

TurbulenceModel

update_BC(boco: BoCo, **kwargs: Any) → None[source]

Updates boundary face boundary conditions from provided boundary condition container

Parameters:
  • boco (BoCo) – boundary condition container

  • **kwargs (Any) – keyword-vale pair (‘verbose’ -> value (bool)), optional

update_BC_family(*args: Any, **kwargs: Any) → None[source]

Updates boundary condition family according to specifications

Parameters:
  • *args (Any) – arguments (tag (str), bc_type (BCTypes)), optional

  • **kwargs (Any) – keyword-value pairs (‘tag’ -> tag (str), ‘bc_type’ -> bc_type (BCTypes)), optional

update_BC_type(*args: Any, **kwargs: Any) → None[source]

Updates boundary condition type according to specifications

Parameters:
  • *args (Any) – arguments (tag (str), bc_it (int)), optional

  • **kwargs (Any) – keyword-value pairs (‘tag’ -> tag (str), ‘bc_it’ -> bc_it (int)), optional

update_metrics() → None[source]

Updates metric data - cell volumes and face areas

property vgrad: VGradField

Velocity gradients placeholder

Returns:

velocity gradients object

Return type:

VGradField

g3d.flow.domain.flow_region module

FlowRegion class definition

class g3d.flow.domain.flow_region.FlowRegion(*args: Any, **kwargs: Any)[source]

Bases: IJKRegion

definition of class FlowRegion, extends IJKRegion

Attributes:
auxv

primitive variable object

cons

conservative variable object

gas

gas model

i1
return:

i2
return:

im
return:

it
return:

j1
return:

j2
return:

k1
return:

k2
return:

nc
return:

ni
return:

nj
return:

nk
return:

np
return:

post

postprocessing variable object

tag

tag (string) used for identification

vgrad

velocity gradient object

Methods

coord_is_in_region(c)

copy(r)

copies data from prototype FlowRegion object

get_def()

print()

prints entity data

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_def(im, i1, i2, j1, j2, k1, k2[, it])

set_from_auxv(a)

copies data from provided primitive variable object

set_from_cons(c)

copies data from provided conservative variable object

set_from_gas(g)

copies data from provided Gas object

set_from_key_value(key, value)

sets data from key-value pair input

set_from_post(p)

copies data from provided postprocessing variable object

set_from_vgrad(v)

copies data from provided velocity gradient object

property auxv: Auxv

primitive variable object

Returns:

allocated primitive variable object

Return type:

Auxv

property cons: Cons

conservative variable object

Returns:

allocated conservative variable object

Return type:

Cons

copy(r: FlowRegion) → None[source]

copies data from prototype FlowRegion object

Parameters:

r (FlowRegion) – prototype object - instance of class FlowRegion

property gas: Gas

gas model

Returns:

allocated gas model

Return type:

Gas

property post: Post

postprocessing variable object

Returns:

allocated postprocessing variable object

Return type:

Post

set_from_auxv(a: Auxv) → None[source]

copies data from provided primitive variable object

Parameters:

a (Auxv) – instance of primitive variable

set_from_cons(c: Cons) → None[source]

copies data from provided conservative variable object

Parameters:

c (Cons) – instance of conservative variable

set_from_gas(g: Gas) → None[source]

copies data from provided Gas object

Parameters:

g (Gas) – gas model

set_from_key_value(key: str, value: Any) → bool[source]

sets data from key-value pair input

Parameters:
  • key (str :) – keyword

  • value (Any :) – value corresponding to keyword

Returns:

status - True if key is found in list of valid keywords

Return type:

bool

set_from_post(p: Post) → None[source]

copies data from provided postprocessing variable object

Parameters:

p (Post) – instance of postprocessing variable

set_from_vgrad(v: VGrad) → None[source]

copies data from provided velocity gradient object

Parameters:

v (VGrad) – instance of velocity gradient

property vgrad: VGrad

velocity gradient object

Returns:

allocated velocity gradient object

Return type:

VGrad

Module contents

g3d/flow/domain sub library

class g3d.flow.domain.BoCo(*args: Any, **kwargs: Any)[source]

Bases: Face

Boundary condition entity BoCo (extends class Face in mesh/geo)

Attributes:
FMP
return:

FMP_size
return:

T0

To (total temperature [K])

X
return:

Y
return:

Z
return:

alpha
return:

auxv

Auxv (auxiliary (primitive) variables placeholder)

c

Speed of sound [m/s]

check
return:

cons

Cons (conservative variables placeholder)

defined

Defined status

delta
return:

et

Total energy [kg J / m^3]

face_type
return:

i0
return:

idir
return:

im
return:

it
return:

j0
return:

jdir
return:

k0
return:

npi
return:

npj
return:

p

Pressure [Pa]

p0

Po (total pressure [Pa])

ro

Density [kg/m^3]

ru

Momentum in x-direction [kg/(m^2 s)]

rv

Momentum in y-direction [kg/(m^2 s)]

rw

Momentum in z-direction [kg/(m^2 s)]

size
return:

t

Temperature [K]

t0

To (total temperature [K])

tag

tag (string) used for identification

u

Velocity in the x-direction [m/s]

v

Velocity in the y-direction [m/s]

w

Velocity in the z-direction [m/s]

x_max
return:

x_min
return:

y_max
return:

y_min
return:

z_max
return:

z_min
return:

Methods

allocate_FMP([mp])

Allocates flux molecule placeholder

allocate_XYZ([N])

backup_is_allocated()

bc_update(boco)

Update boundary condition settings based on settings of provided BoCo

bc_update_conservative(gas)

Update boundary conservative variables

bc_update_family(bc_type)

Update boundary condition family

bc_update_primitive(gas)

Update boundary primitive variables (auxiliary variables)

bc_update_speed_of_sound(gas)

Update speed of sound

bc_update_type(bc_it)

Updates bc it parameter

check_FMP_cell_metrics(ic, check_sum)

copy(boco)

Copies data from boundary condition prototype object

copy_X(*args)

copy_XYZ(*args)

copy_Y(*args)

copy_Z(*args)

copy_def(f)

generate_offset_Face(offset)

get_X([lp])

get_XYZ([lp])

get_Y([lp])

get_Z([lp])

get_cell_count()

get_def([normal])

get_delta()

get_extreme_values()

get_face_count()

get_from_backup([reset_bak])

get_index(i, j)

get_n_ghost_cells()

Get boundary ghost cell count

get_n_ghost_nodes()

Get boundary ghost node count

get_node(i, j)

get_node_count()

get_status()

Gets boundary condition status

get_velocity()

Get boundary condition velocity vector

get_x_min_x_max()

get_y_min_y_max()

get_z_min_z_max()

ghost_report()

Generates a boundary ghost report

print()

Prints boundary condition data (no input)

read_def_from_file(f)

read_from_file(f)

rotate(**kwargs)

scale(sf)

scatter_XY(plt[, m])

scatter_XZ(plt[, m])

scatter_YZ(plt[, m])

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_X(x[, lp])

set_XYZ(x, y, z[, lp])

set_Y(y[, lp])

set_Z(z[, lp])

set_def([f])

set_from_key_value(key, value)

Sets BoCo parameters from provided key => value data

shift(**kwargs)

update_status()

Changes boundary defined status

write_to_file(f)

backup

deallocate_FMP

nullify

print_extreme_values

reset_XYZ

swap_normal

property T0: float

To (total temperature [K])

Returns:

total temperature

Return type:

float

allocate_FMP(mp: int = 2) → None[source]

Allocates flux molecule placeholder

Parameters:

mp (int :) – (Default value = 2)

property auxv: Auxv

Auxv (auxiliary (primitive) variables placeholder)

Returns:

primitive variables placeholder

Return type:

Auxv

bc_update(boco: BoCo) → None[source]

Update boundary condition settings based on settings of provided BoCo

Parameters:

boco (BoCo :) – prototype - instance of boundary condition object

bc_update_conservative(gas: Gas) → None[source]

Update boundary conservative variables

Parameters:

gas (Gas :) – gas model

bc_update_family(bc_type: Any) → None[source]

Update boundary condition family

Parameters:

bc_type (BCTypes :) – boundary condition type valid options: ‘UNDEFINED’, ‘WALLS’, ‘IOFLOW’, ‘SYMM’, ‘SING’, ‘STREAM_TUBE_WALLS’

bc_update_primitive(gas: Gas) → None[source]

Update boundary primitive variables (auxiliary variables)

Parameters:

gas (Gas :) – gas model

bc_update_speed_of_sound(gas: Gas) → None[source]

Update speed of sound

Parameters:

gas (Gas :) – gas model

bc_update_type(bc_it: int) → None[source]

Updates bc it parameter

Parameters:

bc_it (int :) – boundary condition identifier

property c: float

Speed of sound [m/s]

Returns:

speed of sound

Return type:

float

property cons: Cons

Cons (conservative variables placeholder)

Returns:

conservative variables placeholder

Return type:

Cons

copy(boco: BoCo) → None[source]

Copies data from boundary condition prototype object

Parameters:

boco (BoCo :) – prototype object - instance of BoCo

property defined: bool

Defined status

Returns:

status

Return type:

bool

property et: float

Total energy [kg J / m^3]

Returns:

total energy

Return type:

float

get_n_ghost_cells() → int[source]

Get boundary ghost cell count

Returns:

ghost cell count

Return type:

int

get_n_ghost_nodes() → int[source]

Get boundary ghost node count

Returns:

ghost node count

Return type:

int

get_status() → bool[source]

Gets boundary condition status

Returns:

boundary condition status

Return type:

bool

get_velocity() → ndarray[source]

Get boundary condition velocity vector

Returns:

velocity vector

Return type:

ndarray

ghost_report() → None[source]

Generates a boundary ghost report

property p: float

Pressure [Pa]

Returns:

pressure

Return type:

float

property p0: float

Po (total pressure [Pa])

Returns:

total pressure

Return type:

float

print() → None[source]

Prints boundary condition data (no input)

property ro: float

Density [kg/m^3]

Returns:

density

Return type:

float

property ru: float

Momentum in x-direction [kg/(m^2 s)]

Returns:

x-momentum

Return type:

float

property rv: float

Momentum in y-direction [kg/(m^2 s)]

Returns:

y-momentum

Return type:

float

property rw: float

Momentum in z-direction [kg/(m^2 s)]

Returns:

z-momentum

Return type:

float

set_from_key_value(key: str, value: Any) → bool[source]

Sets BoCo parameters from provided key => value data

Parameters:
  • key (str :) – parameter key/tag

  • value (Any :) – parameter value

Returns:

key found status

Return type:

bool

property t: float

Temperature [K]

Returns:

temperature

Return type:

float

property t0: float

To (total temperature [K])

Returns:

total temperature

Return type:

float

property u: float

Velocity in the x-direction [m/s]

Returns:

x-velocity

Return type:

float

update_status() → None[source]

Changes boundary defined status

property v: float

Velocity in the y-direction [m/s]

Returns:

y-velocity

Return type:

float

property w: float

Velocity in the z-direction [m/s]

Returns:

z-velocity

Return type:

float

class g3d.flow.domain.BoundaryCondition(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Definition of class BoundaryCondition

Attributes:
bc_type

Boundary condition type

size

Placeholder size

tag

tag (string) used for identification

Methods

add_face_def(a)

Add face definition to boundary placeholder

allocate_FMPs()

Allocates boundary flux molecule placeholders

check_FMP_cell_metrics(ic, check_sum)

Check boundary flux molecule cell metrics

check_FMP_metrics(x, y, z)

Check boundary flux molecule metrics

copy(bc)

Copies data from prototype BoundaryCondition object

deallocate_FMPs()

De-allocates boundary flux molecule placeholders

get_FMP_size()

Get boundary accumulated boundary flux molecule placeholder size

get_face_count([face_type])

Get face count for specified face type

get_face_defs()

Get boundary face definitions

get_max_FMP_size()

Get max boundary flux molecule placeholder size

get_n_ghost_cells()

Get number of allocated ghost cells

get_n_ghost_nodes()

Get number of allocated ghost nodes

ghost_report()

Prints a ghost cell/node report

print()

prints entity data

print_FMP_data([face_type, face_tag, f])

Prints boundary flux molecule data

read_from_file(f, n_faces, bc_type, bc_tag)

Read face definition from file

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

update_FMP_metrics(x, y, z)

Update boundary flux molecule metrics

add_face_def(a: BoCo) → None[source]

Add face definition to boundary placeholder

Parameters:

a (BoCo :) – boundary condition definition

allocate_FMPs() → None[source]

Allocates boundary flux molecule placeholders

property bc_type: Any

Boundary condition type

Returns:

boundary condition type

Return type:

BCTypes

check_FMP_cell_metrics(ic: int, check_sum: list | ndarray) → None[source]

Check boundary flux molecule cell metrics

Parameters:
  • ic (int :) – cell index

  • check_sum (ndarray or list:) – check sum array

check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Check boundary flux molecule metrics

Parameters:
  • x (ndarray :) – x-coordinate vector

  • y (ndarray :) – y-coordinate vector

  • z (ndarray :) – z-coordinate vector

copy(bc: BoundaryCondition) → None[source]

Copies data from prototype BoundaryCondition object

Parameters:

bc (BoundaryCondition :) – instance of BoundaryCondition

deallocate_FMPs() → None[source]

De-allocates boundary flux molecule placeholders

get_FMP_size() → int[source]

Get boundary accumulated boundary flux molecule placeholder size

Returns:

size

Return type:

int

get_face_count(face_type: Any | None = None) → int[source]

Get face count for specified face type

Parameters:

face_type (BCTypes :) – face type (Default value = None)

Returns:

face count

Return type:

int

get_face_defs() → list[source]

Get boundary face definitions

Returns:

face definitions

Return type:

list

get_max_FMP_size() → int[source]

Get max boundary flux molecule placeholder size

Returns:

size

Return type:

int

get_n_ghost_cells() → int[source]

Get number of allocated ghost cells

Returns:

ghost cell count

Return type:

int

get_n_ghost_nodes() → int[source]

Get number of allocated ghost nodes

Returns:

ghost node count

Return type:

int

ghost_report() → None[source]

Prints a ghost cell/node report

print() → None[source]

prints entity data

print_FMP_data(face_type: Any = BCTypes.UNDEFINED, face_tag: str = 'all', f: Any | None = None) → None[source]

Prints boundary flux molecule data

Parameters:
  • face_type (BCTypes :) – boundary condition type (Default value = BCTypes.UNDEFINED)

  • face_tag (str :) – boundary condition face tag (Default value = ‘all’)

  • f (Any :) – file handle (Default value = None)

read_from_file(f: IO[str], n_faces: int, bc_type: Any, bc_tag: str) → None[source]

Read face definition from file

Parameters:
  • f (IO[str] :) – file handle

  • n_faces (int :) – number of faces

  • bc_type (BCTypes :) – boundary type

  • bc_tag (str :) – boundary condition face tag

property size: int

Placeholder size

Returns:

size

Return type:

int

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Update boundary flux molecule metrics

Parameters:
  • x (ndarray :) – x-coordinate vector

  • y (ndarray :) – y-coordinate vector

  • z (ndarray :) – z-coordinate vector

class g3d.flow.domain.BoundaryConditionPlaceHolder(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Definition of class BoundaryConditionPlaceHolder

Attributes:
tag

tag (string) used for identification

Methods

add_Q1D_boundary_definitions(NI[, ...])

Add quasi-one-dimensional solver boundary definitions

add_boundary(t)

Add boundary container

allocate_placeholders()

Allocate placeholder data containers

check_FMP_cell_metrics(ic, check_sum)

Checks flux molecule cell metrics

check_FMP_metrics(x, y, z)

Checks flux molecule metrics for stored boundary condition containers

copy(e)

copies data from specified entity input: entity example: copy(e)

get_boundary(t)

Get boundary condition

get_boundary_array()

Get boundary array

get_face_count([face_type])

Extract boundary face count for specified boundary type or all boundaries

get_max_FMP_size()

Get maximum flux molecule placeholder size

get_max_ghost_cells()

Finds maximum number of ghost cells in a boundary container

get_max_ghost_nodes()

Finds maximum number of ghost nodes in a boundary container

ghost_report()

Extracts boundary ghost cell/node report

print()

prints entity data

print_FMP_data([face_type, face_tag, f])

Prints flux molecule data

read_from_file(f, bc_type)

Read boundary definition from file

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

update_FMP_metrics(x, y, z)

Updates flux molecule metrics for stored boundary condition containers

add_Q1D_boundary_definitions(NI: int, left_end_BC: Any = BCTypes.IOFLOW, right_end_BC: Any = BCTypes.IOFLOW) → None[source]

Add quasi-one-dimensional solver boundary definitions

Parameters:
  • NI (int :) – node count

  • left_end_BC (BCTypes :) – left-end boundary condition (Default value = BCTypes.IOFLOW)

  • right_end_BC (BCTypes :) – right-end boundary condition (Default value = BCTypes.IOFLOW)

add_boundary(t: Any) → BoundaryCondition | None[source]

Add boundary container

Parameters:

t (BCTypes :) – boundary condition type

Returns:

boundary

Return type:

BoundaryCondition

allocate_placeholders() → None[source]

Allocate placeholder data containers

check_FMP_cell_metrics(ic: int, check_sum: list | ndarray) → None[source]

Checks flux molecule cell metrics

Parameters:
  • ic (int :) – cell index

  • check_sum (ndarray or list :) – check sum array

check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Checks flux molecule metrics for stored boundary condition containers

Parameters:
  • x (ndarray :) – x-coordinate vector

  • y (ndarray :) – y-coordinate vector

  • z (ndarray :) – z-coordinate vector

get_boundary(t: Any) → BoundaryCondition | None[source]

Get boundary condition

Parameters:

t (BCTypes :) – boundary condition type

Returns:

boundary

Return type:

BoundaryCondition

get_boundary_array() → list[source]

Get boundary array

Returns:

boundary array

Return type:

list

get_face_count(face_type: Any | None = None) → int[source]

Extract boundary face count for specified boundary type or all boundaries

Parameters:

face_type (BCTypes :) – boundary condition type (Default value = None)

Returns:

face count

Return type:

int

get_max_FMP_size() → int[source]

Get maximum flux molecule placeholder size

Returns:

size

Return type:

int

get_max_ghost_cells() → int[source]

Finds maximum number of ghost cells in a boundary container

Returns:

ghost cell count

Return type:

int

get_max_ghost_nodes() → int[source]

Finds maximum number of ghost nodes in a boundary container

Returns:

ghost node count

Return type:

int

ghost_report() → None[source]

Extracts boundary ghost cell/node report

print() → None[source]

prints entity data

print_FMP_data(face_type: Any = BCTypes.UNDEFINED, face_tag: str = 'all', f: Any | None = None) → None[source]

Prints flux molecule data

Parameters:
  • face_type (BCTypes :) – boundary condition type (Default value = BCTypes.UNDEFINED)

  • face_tag (str :) – boundary face tag (Default value = ‘all’)

  • f (Any :) – file handle (Default value = None)

read_from_file(f: IO[str], bc_type: Any) → None[source]

Read boundary definition from file

Parameters:
  • f (IO[str] :) – file handle

  • bc_type (BCTypes :) – boundary condition type

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Updates flux molecule metrics for stored boundary condition containers

Parameters:
  • x (ndarray :) – x-coordinate vector

  • y (ndarray :) – y-coordinate vector

  • z (ndarray :) – z-coordinate vector

class g3d.flow.domain.Domain(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Attributes:
auxv

Auxiliary variables placeholder

bc_mods

Boundary condition modifiers array

boundary_faces

Boundary conditions container

connectivity_faces

Grid connectivity container (block interfaces)

cons

Conservative variables placeholder

dtmv

Dynamic turbulence model variables placeholder

gas

Gas model instance

internal_faces

Internal grid faces container

mesh

Computational mesh instance

post

Postprocessing variables placeholder

tag

tag (string) used for identification

turb

Turbulence model instance

vgrad

Velocity gradients placeholder

Methods

BC_mod()

Modifies boundary condition data going through specified boundary condition modifiers

auxvr()

Updates flow domain primitive variable fields (p, u, v, w, t, c)

bc_update_conservative(boco)

Updates boundary condition conservative variables (ro, ru, rv, rw, et)

bc_update_primitive(boco)

Updates boundary condition primitive variables (p, u, v, w, t, c)

bc_update_speed_of_sound(boco)

Updates boundary condition speed of sound

cell_get_block(kc)

Get block number associated with specified cell index

cell_get_ijk(kc)

Gets cell indices in computational space (i, j, k)

check_FMP_metrics()

Checks flux molecule cell metrics for all flux molecules (internal faces, mesh block connectivity faces, and boundary faces)

check_cell_metrics(ic)

Checks cell metrics for cell with specified cell index

copy(e)

copies data from specified entity input: entity example: copy(e)

export_flow(*args, **kwargs)

Exports flow field data to file

export_mesh(*args, **kwargs)

Exports mesh to file

export_velocity_gradients(*args, **kwargs)

Exports velocity gradient data to file

generate_irsm_matrix()

Generates matrix for Implicit Residual Smoothing (IRSM) operator

generate_mesh_from_pipe_data(q1d_pipe)

Generates computational mesh from provided Q1D domain object

get_IRSM_operator()

Gets IRMS operator object

get_area([idx])

Gets average area for specific cell if cell index is specified otherwise all average cell areas are returned as an array

get_auxv_array([var])

Gets specified primitive variable array (auxiliary solver variable)

get_auxv_array_with_ghosts([var])

Gets specified primitive variable array (auxiliary solver variable) including ghost cell values

get_auxv_arrays()

Gets primitive variable arrays (auxiliary solver variables)

get_auxv_arrays_with_ghosts()

Gets primitive variable arrays (auxiliary solver variables) including ghost cell values

get_auxv_velocity_arrays()

Gets velocity vectors auxiliary solver variables placeholder

get_auxv_velocity_arrays_with_ghosts()

Gets velocity vectors auxiliary solver variables placeholder including ghost cell values

get_block_sizes(im)

Gets block node counts in three directions (ni, nj, nk)

get_cell(im, i, j, k)

Gets cell index based on provided data

get_cell_centers()

Gets cell center coordinates, (x, y, z)-vectors, for all cell in the computational domain

get_cons_array([var])

Gets specified conservative variable array (solver variable)

get_cons_array_with_ghosts([var])

Gets specified conservative variable array (solver variable) including ghost cell values

get_cons_arrays()

Gets conservative variable arrays (solver variables)

get_cons_arrays_with_ghosts()

Gets conservative variable arrays (solver variables) including ghost cell values

get_dtmv_array([var])

Gets specified dynamic turbulence model variable array

get_dtmv_array_with_ghosts([var])

Gets specified dynamic turbulence model variable array including ghost cell values

get_dtmv_arrays()

Gets dynamic turbulence model variable arrays

get_dtmv_arrays_with_ghosts()

Gets dynamic turbulence model variable arrays including ghost cell values

get_gas_properties()

Gets gas model properties (ratio of specific heats (gamma) & gas constant (R))

get_inverse_volume([idx])

Gets inverse volume for specific cell if cell index is specified otherwise all cell inverse volumes are returned as an array

get_max_FMP_size()

Gets the maximum flux molecule array size

get_node(im, i, j, k)

Gets node index based on provided data

get_node_coordinates()

Gets node coordinate arrays

get_post_array([var])

Gets specified postprocessing variable array

get_post_array_with_ghosts([var])

Gets specified postprocessing variable array including ghost cell values

get_post_arrays()

Gets postprocessing variable arrays

get_post_arrays_with_ghosts()

Gets postprocessing variable arrays including ghost cell values

get_streamtube_normal([idx])

Gets stream-tube normal for specific cell if cell index is specified otherwise all stream-tube normals are returned as an array

get_vgrad_Array([var])

Gets specified velocity gradient array

get_vgrad_array_with_ghosts([var])

Gets specified velocity gradient array including ghost cell values

get_vgrad_arrays()

Gets velocity gradient arrays

get_vgrad_arrays_with_ghosts()

Gets velocity gradient arrays including ghost cell values

get_visct_array()

Gets turbulent viscosity array

get_volume([idx])

Gets volume for specific cell if cell index is specified otherwise all cell volumes are returned as an array

import_boundary_definitions(**kwargs)

Imports boundary definitions from file

import_mesh(*args, **kwargs)

Imports mesh from file

initsol_block_from_Auxv(im, p)

Initialize flow field variables in specified mesh block using specified primitive variables object

initsol_block_from_Cons(im, q)

Initialize flow field variables in specified mesh block using specified conservative variables object

initsol_conservative(ro, ru, rv, rw, et)

Initializes flow field using specified flow property values for all cells (conservative variables)

initsol_from_Auxv(p)

Initialize flow field variables from specified primitive variables container

initsol_from_Cons(q)

Initialize flow field variables from specified conservative variables container

initsol_linear(ql, qr[, direction])

Initialize flow field variables using linear interpolation between specified left and right values (conservative variable container objects)

initsol_primitive(p, u, v, w, t)

Initializes flow field using specified flow property values for all cells (primitive variables)

initsol_region_from_Auxv(r, p)

Initialize flow field variables in specified region using specified primitive variables object

initsol_region_from_Cons(r, q)

Initialize flow field variables in specified region using specified conservative variables object

node_get_block(kp)

Get block number associated with specified node index

node_get_ijk(kp)

Gets node indices in computational space (i, j, k)

print()

prints entity data

print_flow_field_extreme_values()

Prints extreme values (min/max) of density (ro), velocity (u, v, w), pressure (p), and temperature (t)

print_velocity_gradients_extreme_values()

prints velocity gradient extreme values (min/max) of (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

set_gas_properties(gamma, R)

Sets gas model properties (ratio of specific heats (gamma) & gas constant (R))

setup_and_allocate()

Sets up and allocates all flow domain placeholders and data containers updates flux molecule metrics for all flux molecule types (internal faces, block connectivity faces, and boundary faces) allocates turbulence model if applicable

status_check()

Checks if all domain boundaries are defined

update_BC(boco, **kwargs)

Updates boundary face boundary conditions from provided boundary condition container

update_BC_family(*args, **kwargs)

Updates boundary condition family according to specifications

update_BC_type(*args, **kwargs)

Updates boundary condition type according to specifications

update_metrics()

Updates metric data - cell volumes and face areas

BC_mod() → None[source]

Modifies boundary condition data going through specified boundary condition modifiers

property auxv: AuxvField

Auxiliary variables placeholder

Returns:

auxiliary variables object

Return type:

AuxvField

auxvr() → None[source]

Updates flow domain primitive variable fields (p, u, v, w, t, c)

property bc_mods: list

Boundary condition modifiers array

Returns:

array of boundary condition modifiers

Return type:

list

bc_update_conservative(boco: BoCo) → None[source]

Updates boundary condition conservative variables (ro, ru, rv, rw, et)

Parameters:

boco (BoCo) – boundary condition container

bc_update_primitive(boco: BoCo) → None[source]

Updates boundary condition primitive variables (p, u, v, w, t, c)

Parameters:

boco (BoCo) – boundary condition container

bc_update_speed_of_sound(boco: BoCo) → None[source]

Updates boundary condition speed of sound

Parameters:

boco (BoCo) – boundary condition container

property boundary_faces: BoundaryConditionPlaceHolder

Boundary conditions container

Returns:

boundary conditions placeholder object

Return type:

BoundaryConditionPlaceHolder

cell_get_block(kc) → int[source]

Get block number associated with specified cell index

Parameters:

kc (int) – cell index

Returns:

block number

Return type:

int

cell_get_ijk(kc) → Tuple[int, int, int][source]

Gets cell indices in computational space (i, j, k)

Parameters:

kc (int) – cell index

check_FMP_metrics() → Tuple[ndarray, ...][source]

Checks flux molecule cell metrics for all flux molecules (internal faces, mesh block connectivity faces, and boundary faces)

Returns:

tuple of arrays with face check data (X, Y, Z)

Return type:

tuple

check_cell_metrics(ic: int) → None[source]

Checks cell metrics for cell with specified cell index

Parameters:

ic (int) – cell index

property connectivity_faces: InterfacePlaceHolder

Grid connectivity container (block interfaces)

Returns:

interface placeholder object

Return type:

InterfacePlaceHolder

property cons: ConsField

Conservative variables placeholder

Returns:

conservative variables object

Return type:

ConsField

property dtmv: DynamicTurbulenceModelVariables

Dynamic turbulence model variables placeholder

Returns:

dynamic turbulence model variables object

Return type:

DynamicTurbulenceModelVariables

export_flow(*args: Any, **kwargs: Any) → None[source]

Exports flow field data to file

Parameters:
  • *args (Any :) – arguments passed on to flow data exporter (filename (str)), optional

  • **kwargs (Any :) – keyword-value pairs passed on to flow data exporter, ‘filename’ -> name (str), optional

export_mesh(*args: Any, **kwargs: Any) → None[source]

Exports mesh to file

Parameters:
  • *args (Any :) – arguments passed on to mesh exporter (BinaryFormat), optional

  • **kwargs (Any :) – keyword-value pairs passed on to mesh exporter, optional valid key values: ‘format’ binary_format (defaults to BinaryFormat.NATIVE)

export_velocity_gradients(*args: Any, **kwargs: Any) → None[source]

Exports velocity gradient data to file

Parameters:
  • *args (Any :) – arguments passed on to flow data exporter (filename (str)), optional

  • **kwargs (Any :) – keyword-value pairs passed on to flow data exporter, ‘filename’ -> name (str), optional

property gas: Gas

Gas model instance

Returns:

gas model

Return type:

Gas

generate_irsm_matrix() → None[source]

Generates matrix for Implicit Residual Smoothing (IRSM) operator

generate_mesh_from_pipe_data(q1d_pipe: Q1DPipe) → None[source]

Generates computational mesh from provided Q1D domain object

Parameters:

q1d_pipe (Q1DPipe) – quasi-one-dimensional domain object

get_IRSM_operator() → IRSMOperator[source]

Gets IRMS operator object

Returns:

IRSM operator object

Return type:

IRSMOperator

get_area(idx: int | None = None) → float | ndarray[source]

Gets average area for specific cell if cell index is specified otherwise all average cell areas are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

average cell area or array of average cell areas

Return type:

float or ndarray

get_auxv_array(var: str = 'p') → ndarray[source]

Gets specified primitive variable array (auxiliary solver variable)

Parameters:

var (str) – primitive variable (any of ‘p’, ‘u’, ‘v’, ‘w’, ‘t’, ‘c), (Default value = ‘p’)

Returns:

variable array

Return type:

ndarray

get_auxv_array_with_ghosts(var: str = 'p') → ndarray[source]

Gets specified primitive variable array (auxiliary solver variable) including ghost cell values

Parameters:

var (str) – primitive variable (any of ‘p’, ‘u’, ‘v’, ‘w’, ‘t’, ‘c’), (Default value = ‘p’)

Returns:

variable array

Return type:

ndarray

get_auxv_arrays() → Tuple[ndarray, ...][source]

Gets primitive variable arrays (auxiliary solver variables)

Returns:

tuple of primitive variable arrays (p, u, v, w, t, c)

Return type:

tuple

get_auxv_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets primitive variable arrays (auxiliary solver variables) including ghost cell values

Returns:

tuple of primitive variable arrays (p, u, v, w, t, c)

Return type:

tuple

get_auxv_velocity_arrays() → Tuple[ndarray, ...][source]

Gets velocity vectors auxiliary solver variables placeholder

Returns:

tuple of velocity arrays (u, v, w)

Return type:

tuple

get_auxv_velocity_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets velocity vectors auxiliary solver variables placeholder including ghost cell values

Returns:

tuple of velocity arrays (u, v, w)

Return type:

tuple

get_block_sizes(im) → Tuple[int, int, int][source]

Gets block node counts in three directions (ni, nj, nk)

Parameters:

im (int) – block number

Returns:

block node counts (ni, nj, nk)

Return type:

tuple

get_cell(im, i, j, k) → int[source]

Gets cell index based on provided data

Parameters:
  • im (int) – block number

  • i (int) – cell index in i-direction (lowest node i-index in cell)

  • j (int) – cell index in j-direction (lowest node j-index in cell)

  • k (int) – cell index in k-direction (lowest node k-index in cell)

Returns:

cell index lc

Return type:

int

get_cell_centers() → Tuple[ndarray, ...][source]

Gets cell center coordinates, (x, y, z)-vectors, for all cell in the computational domain

Returns:

cell center coordinates (tuple of arrays)

Return type:

tuple

get_cons_array(var: str = 'ro') → ndarray[source]

Gets specified conservative variable array (solver variable)

Parameters:
  • var (str :) – conservative variable (any of ‘ro’, ‘ru’, ‘rv’, ‘rw’, ‘et’), defaults to ‘ro’

  • var – (Default value = ‘ro’)

Returns:

variable array

Return type:

ndarray

get_cons_array_with_ghosts(var: str = 'ro') → ndarray[source]

Gets specified conservative variable array (solver variable) including ghost cell values

Parameters:

var (str) – conservative variable (any of ‘ro’, ‘ru’, ‘rv’, ‘rw’, ‘et’), (Default value = ‘ro’)

Returns:

variable array

Return type:

ndarray

get_cons_arrays() → Tuple[ndarray, ...][source]

Gets conservative variable arrays (solver variables)

Returns:

tuple of conservative variable arrays (ro, ru, rv, rw, et)

Return type:

tuple

get_cons_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets conservative variable arrays (solver variables) including ghost cell values

Returns:

tuple of conservative variable arrays (ro, ru, rv, rw, et)

Return type:

tuple

get_dtmv_array(var: str = 'visct') → ndarray[source]

Gets specified dynamic turbulence model variable array

Parameters:

var (str) – dynamic turbulence model variable (any of ‘visct’), (Default value = ‘visct’)

Returns:

variable array

Return type:

ndarray

get_dtmv_array_with_ghosts(var: str = 'visct') → ndarray[source]

Gets specified dynamic turbulence model variable array including ghost cell values

Parameters:

var (str) – dynamic turbulence model variable (any of ‘visct’), (Default value = ‘visct’)

Returns:

variable array

Return type:

ndarray

get_dtmv_arrays() → Tuple[ndarray, ...][source]

Gets dynamic turbulence model variable arrays

Returns:

tuple of dynamic turbulence model variable arrays (visct)

Return type:

tuple

get_dtmv_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets dynamic turbulence model variable arrays including ghost cell values

Returns:

tuple of dynamic turbulence model variable arrays (visct)

Return type:

tuple

get_gas_properties() → Tuple[float, float][source]

Gets gas model properties (ratio of specific heats (gamma) & gas constant (R))

Returns:

ratio of specific heats (gamma) & gas constant (R)

Return type:

tuple

get_inverse_volume(idx: int | None = None) → float | ndarray[source]

Gets inverse volume for specific cell if cell index is specified otherwise all cell inverse volumes are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

inverse cell volume or array of inverse cell volumes

Return type:

float or ndarray

get_max_FMP_size() → int[source]

Gets the maximum flux molecule array size

Returns:

size

Return type:

int

get_node(im, i, j, k) → int[source]

Gets node index based on provided data

Parameters:
  • im (int) – block number

  • i (int) – node index in i-direction

  • j (int) – node index in j-direction

  • k (int) – node index in k-direction

Returns:

node index lp

Return type:

int

get_node_coordinates() → Tuple[ndarray, ...][source]

Gets node coordinate arrays

Returns:

tuple of node coordinate arrays (x, y, z)

Return type:

tuple

get_post_array(var: str = 'M') → ndarray[source]

Gets specified postprocessing variable array

Parameters:
  • var (str :) – primitive variable (any of ‘p0’, ‘t0’, ‘M’, ‘s’), defaults to ‘M’

  • var – (Default value = ‘M’)

Returns:

variable array

Return type:

ndarray

get_post_array_with_ghosts(var: str = 'M') → ndarray[source]

Gets specified postprocessing variable array including ghost cell values

Parameters:
  • var (str :) – primitive variable (any of ‘p0’, ‘t0’, ‘M’, ‘s’), defaults to ‘M’

  • var – (Default value = ‘M’)

Returns:

variable array

Return type:

ndarray

get_post_arrays() → Tuple[ndarray, ...][source]

Gets postprocessing variable arrays

Returns:

tuple of postprocessing variable arrays (Po, To, M, s)

Return type:

tuple

get_post_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets postprocessing variable arrays including ghost cell values

Returns:

tuple of postprocessing variable arrays (Po, To, M, s)

Return type:

tuple

get_streamtube_normal(idx: int | None = None) → float | ndarray[source]

Gets stream-tube normal for specific cell if cell index is specified otherwise all stream-tube normals are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

stream-tube normal or array of stream-tube normals

Return type:

float or ndarray

get_vgrad_Array(var: str = 'dudx') → ndarray[source]

Gets specified velocity gradient array

Parameters:
  • var (str :) – primitive variable (any of ‘dudx’, ‘dudy’, ‘dudz’, ‘dvdx’, ‘dvdy’, ‘dvdz’, ‘dwdx’, ‘dwdy’, ‘dwdz’), defaults to ‘dudx’

  • var – (Default value = ‘dudx’)

Returns:

variable array

Return type:

ndarray

get_vgrad_array_with_ghosts(var: str = 'dudx') → ndarray[source]

Gets specified velocity gradient array including ghost cell values

Parameters:

var (str) – primitive variable (any of ‘dudx’, ‘dudy’, ‘dudz’, ‘dvdx’, ‘dvdy’, ‘dvdz’, ‘dwdx’, ‘dwdy’, ‘dwdz’), (Default value = ‘dudx’)

Returns:

variable array

Return type:

ndarray

get_vgrad_arrays() → Tuple[ndarray, ...][source]

Gets velocity gradient arrays

Returns:

tuple of velocity gradient arrays (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

Return type:

tuple

get_vgrad_arrays_with_ghosts() → Tuple[ndarray, ...][source]

Gets velocity gradient arrays including ghost cell values

Returns:

tuple of velocity gradient arrays (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

Return type:

tuple

get_visct_array() → ndarray[source]

Gets turbulent viscosity array

Returns:

turbulent viscosity array (visct)

Return type:

ndarray

get_volume(idx: int | None = None) → float | ndarray[source]

Gets volume for specific cell if cell index is specified otherwise all cell volumes are returned as an array

Parameters:

idx (int) – cell index, optional (Default value = None)

Returns:

cell volume or array of cell volumes

Return type:

float or ndarray

import_boundary_definitions(**kwargs: Any) → None[source]

Imports boundary definitions from file

Parameters:

**kwargs (Any :) – keyword-value pairs (‘filename’ -> name (str)), optional

import_mesh(*args: Any, **kwargs: Any) → None[source]

Imports mesh from file

Parameters:
  • *args (Any :) – arguments (BinaryFormat, file base name (str)), optional

  • **kwargs (Any :) – keyword value pairs, optional valid key values: ‘format’ binary_format (defaults to BinaryFormat.NATIVE), ‘msh_file’ -> filename, ‘topo_file’ -> filename

initsol_block_from_Auxv(im: int, p: Auxv) → None[source]

Initialize flow field variables in specified mesh block using specified primitive variables object

Parameters:
  • im (int) – block number

  • p (Auxv) – primitive variables container object

initsol_block_from_Cons(im: int, q: Cons) → None[source]

Initialize flow field variables in specified mesh block using specified conservative variables object

Parameters:
  • im (int) – block number

  • q (Cons) – conservative variables container object

initsol_conservative(ro: float, ru: float, rv: float, rw: float, et: float) → None[source]

Initializes flow field using specified flow property values for all cells (conservative variables)

Parameters:
  • ro (float) – density [kg/m^3]

  • ru (float) – x-momentum [kg/(m^2 s)]

  • rv (float) – y-momentum [kg/(m^2 s)]

  • rw (float) – z-momentum [kg/(m^2 s)]

  • et (float) – total energy times density [J/m^3]

initsol_from_Auxv(p: Auxv) → None[source]

Initialize flow field variables from specified primitive variables container

Parameters:

p (Auxv) – primitive variables container object

initsol_from_Cons(q: Cons) → None[source]

Initialize flow field variables from specified conservative variables container

Parameters:

q (Cons) – conservative variables container object

initsol_linear(ql: Cons, qr: Cons, direction: str = 'x') → None[source]

Initialize flow field variables using linear interpolation between specified left and right values (conservative variable container objects)

Parameters:
  • ql (Cons) – conservative variable container objects (left-end values)

  • qr (Cons) – conservative variable container objects (right-end values)

  • direction – interpolation direction, (Default value = ‘x’)

initsol_primitive(p: float, u: float, v: float, w: float, t: float) → None[source]

Initializes flow field using specified flow property values for all cells (primitive variables)

Parameters:
  • p (float) – pressure [Pa]

  • u (float) – x-velocity [m/s]

  • v (float) – y-velocity [m/s]

  • w (float) – z-velocity [m/s]

  • t (float) – temperature [K]

initsol_region_from_Auxv(r: IJKRegion, p: Auxv) → None[source]

Initialize flow field variables in specified region using specified primitive variables object

Parameters:
  • r (IJKRegion) – computational space region

  • p (Auxv) – primitive variables container object

initsol_region_from_Cons(r: IJKRegion, q: Cons) → None[source]

Initialize flow field variables in specified region using specified conservative variables object

Parameters:
  • r (IJKRegion) – computational space region

  • q (Cons) – conservative variables container object

property internal_faces: FMPArray

Internal grid faces container

Returns:

flux molecule array object

Return type:

FMPArray

property mesh: Mesh

Computational mesh instance

Returns:

mesh object

Return type:

Mesh

node_get_block(kp) → int[source]

Get block number associated with specified node index

Parameters:

kp (int) – node index

node_get_ijk(kp) → Tuple[int, int, int][source]

Gets node indices in computational space (i, j, k)

Parameters:

kp (int) – node index

property post: PostField

Postprocessing variables placeholder

Returns:

postprocessing variables object

Return type:

PostField

print_flow_field_extreme_values() → None[source]

Prints extreme values (min/max) of density (ro), velocity (u, v, w), pressure (p), and temperature (t)

print_velocity_gradients_extreme_values() → None[source]

prints velocity gradient extreme values (min/max) of (dudx, dudy, dudz, dvdx, dvdy, dvdz, dwdx, dwdy, dwdz)

set_gas_properties(gamma: float, R: float) → None[source]

Sets gas model properties (ratio of specific heats (gamma) & gas constant (R))

Parameters:
  • gamma (float) – ratio of specific heats

  • R (float) – gas constant

setup_and_allocate() → None[source]

Sets up and allocates all flow domain placeholders and data containers updates flux molecule metrics for all flux molecule types (internal faces, block connectivity faces, and boundary faces) allocates turbulence model if applicable

status_check() → None[source]

Checks if all domain boundaries are defined

property turb: TurbulenceModel

Turbulence model instance

Returns:

turbulence model

Return type:

TurbulenceModel

update_BC(boco: BoCo, **kwargs: Any) → None[source]

Updates boundary face boundary conditions from provided boundary condition container

Parameters:
  • boco (BoCo) – boundary condition container

  • **kwargs (Any) – keyword-vale pair (‘verbose’ -> value (bool)), optional

update_BC_family(*args: Any, **kwargs: Any) → None[source]

Updates boundary condition family according to specifications

Parameters:
  • *args (Any) – arguments (tag (str), bc_type (BCTypes)), optional

  • **kwargs (Any) – keyword-value pairs (‘tag’ -> tag (str), ‘bc_type’ -> bc_type (BCTypes)), optional

update_BC_type(*args: Any, **kwargs: Any) → None[source]

Updates boundary condition type according to specifications

Parameters:
  • *args (Any) – arguments (tag (str), bc_it (int)), optional

  • **kwargs (Any) – keyword-value pairs (‘tag’ -> tag (str), ‘bc_it’ -> bc_it (int)), optional

update_metrics() → None[source]

Updates metric data - cell volumes and face areas

property vgrad: VGradField

Velocity gradients placeholder

Returns:

velocity gradients object

Return type:

VGradField

class g3d.flow.domain.FlowRegion(*args: Any, **kwargs: Any)[source]

Bases: IJKRegion

definition of class FlowRegion, extends IJKRegion

Attributes:
auxv

primitive variable object

cons

conservative variable object

gas

gas model

i1
return:

i2
return:

im
return:

it
return:

j1
return:

j2
return:

k1
return:

k2
return:

nc
return:

ni
return:

nj
return:

nk
return:

np
return:

post

postprocessing variable object

tag

tag (string) used for identification

vgrad

velocity gradient object

Methods

coord_is_in_region(c)

copy(r)

copies data from prototype FlowRegion object

get_def()

print()

prints entity data

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_def(im, i1, i2, j1, j2, k1, k2[, it])

set_from_auxv(a)

copies data from provided primitive variable object

set_from_cons(c)

copies data from provided conservative variable object

set_from_gas(g)

copies data from provided Gas object

set_from_key_value(key, value)

sets data from key-value pair input

set_from_post(p)

copies data from provided postprocessing variable object

set_from_vgrad(v)

copies data from provided velocity gradient object

property auxv: Auxv

primitive variable object

Returns:

allocated primitive variable object

Return type:

Auxv

property cons: Cons

conservative variable object

Returns:

allocated conservative variable object

Return type:

Cons

copy(r: FlowRegion) → None[source]

copies data from prototype FlowRegion object

Parameters:

r (FlowRegion) – prototype object - instance of class FlowRegion

property gas: Gas

gas model

Returns:

allocated gas model

Return type:

Gas

property post: Post

postprocessing variable object

Returns:

allocated postprocessing variable object

Return type:

Post

set_from_auxv(a: Auxv) → None[source]

copies data from provided primitive variable object

Parameters:

a (Auxv) – instance of primitive variable

set_from_cons(c: Cons) → None[source]

copies data from provided conservative variable object

Parameters:

c (Cons) – instance of conservative variable

set_from_gas(g: Gas) → None[source]

copies data from provided Gas object

Parameters:

g (Gas) – gas model

set_from_key_value(key: str, value: Any) → bool[source]

sets data from key-value pair input

Parameters:
  • key (str :) – keyword

  • value (Any :) – value corresponding to keyword

Returns:

status - True if key is found in list of valid keywords

Return type:

bool

set_from_post(p: Post) → None[source]

copies data from provided postprocessing variable object

Parameters:

p (Post) – instance of postprocessing variable

set_from_vgrad(v: VGrad) → None[source]

copies data from provided velocity gradient object

Parameters:

v (VGrad) – instance of velocity gradient

property vgrad: VGrad

velocity gradient object

Returns:

allocated velocity gradient object

Return type:

VGrad

class g3d.flow.domain.Interface(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Definition of class Interface

Attributes:
intf_type

Connectivity interface type

size

Placeholder size

tag

tag (string) used for identification

Methods

add_face_def(a, b)

Add face definition to boundary placeholder

allocate_FMPs()

Allocates interface flux molecule placeholders

check_FMP_cell_metrics(ic, check_sum)

Check interface flux molecule cell metrics

check_FMP_metrics(x, y, z)

Check interface flux molecule metrics

copy(intf)

Copies data from prototype Interface object

deallocate_FMPs()

De-allocates interface flux molecule placeholders

get_FMP_size()

Get interface accumulated boundary flux molecule placeholder size

get_face_count()

Get face count

get_face_defs()

Get interface face definitions

get_max_FMP_size()

Get max interface flux molecule placeholder size

get_n_ghost_cells()

Get number of allocated ghost cells

get_n_ghost_nodes()

Get number of allocated ghost nodes

ghost_report()

Prints a ghost cell/node report

print()

prints entity data

print_FMP_data([face_type, face_tag, f])

Prints interface flux molecule data

read_from_file(f, n_faces, intf_type, intf_tag)

Read face definition from file

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

update_FMP_metrics(x, y, z)

Update interface flux molecule metrics

add_face_def(a: Intf, b: Intf)[source]

Add face definition to boundary placeholder

Parameters:
  • a (Intf :) – face definition A-side

  • b (Intf :) – face definition B-side

allocate_FMPs() → None[source]

Allocates interface flux molecule placeholders

check_FMP_cell_metrics(ic: int, check_sum: list | ndarray) → None[source]

Check interface flux molecule cell metrics

Parameters:
  • ic (int :) – cell index

  • check_sum (ndarray :) – check sum array

check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Check interface flux molecule metrics

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

copy(intf: Interface) → None[source]

Copies data from prototype Interface object

Parameters:

intf (Interface) – prototype Interface object

deallocate_FMPs() → None[source]

De-allocates interface flux molecule placeholders

get_FMP_size() → int[source]

Get interface accumulated boundary flux molecule placeholder size

Returns:

size

Return type:

int

get_face_count() → int[source]

Get face count

Returns:

face count

Return type:

int

get_face_defs() → Tuple[list, list][source]

Get interface face definitions

Returns:

face definitions

Return type:

list

get_max_FMP_size() → int[source]

Get max interface flux molecule placeholder size

Returns:

size

Return type:

int

get_n_ghost_cells() → int[source]

Get number of allocated ghost cells

Returns:

ghost cell count

Return type:

int

get_n_ghost_nodes() → int[source]

Get number of allocated ghost nodes

Returns:

ghost node count

Return type:

int

ghost_report() → None[source]

Prints a ghost cell/node report

property intf_type: Any

Connectivity interface type

Returns:

interface type

Return type:

INTFTypes

print() → None[source]

prints entity data

print_FMP_data(face_type: Any = INTFTypes.UNDEFINED, face_tag: str = 'all', f: IO[str] | None = None) → None[source]

Prints interface flux molecule data

Parameters:
  • face_type (INTFTypes :) – interface type (Default value = INTFTypes.UNDEFINED)

  • face_tag (str :) – interface tag (Default value = ‘all’)

  • f (file :) – file handle (Default value = None)

read_from_file(f: IO[str], n_faces: int, intf_type: Any, intf_tag: str) → None[source]

Read face definition from file

Parameters:
  • f (file) – file handle

  • n_faces (int) – number of faces

  • intf_type (INTFTypes) – interface type

  • intf_tag (str) – interface tag

property size: int

Placeholder size

Returns:

size

Return type:

int

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Update interface flux molecule metrics

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

class g3d.flow.domain.InterfacePlaceHolder(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Definition of class InterfacePlaceHolder

Attributes:
tag

tag (string) used for identification

Methods

add_interface(t)

Add interface container

allocate_placeholders()

Allocate placeholder data containers

check_FMP_cell_metrics(ic, check_sum)

Checks flux molecule cell metrics

check_FMP_metrics(x, y, z)

Checks flux molecule metrics for stored interface containers

copy(e)

copies data from specified entity input: entity example: copy(e)

get_face_count()

Extract interface face count

get_interface(t)

Get interface

get_interface_array()

Get interface array

get_max_FMP_size()

Get maximum flux molecule placeholder size

get_max_ghost_cells()

Finds maximum number of ghost cells in an interface container

get_max_ghost_nodes()

Finds maximum number of ghost nodes in a boundary container

ghost_report()

Extracts boundary ghost cell/node report

print()

prints entity data

print_FMP_data([face_type, face_tag, f])

Prints flux molecule data

read_from_file(f, intf_type)

Read interface definition from file

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

update_FMP_metrics(x, y, z)

Updates flux molecule metrics for stored interface containers

add_interface(t: Any) → Interface | None[source]

Add interface container

Parameters:

t (INTFTypes :) – interface type

Returns:

interface

Return type:

Interface or None

allocate_placeholders() → None[source]

Allocate placeholder data containers

check_FMP_cell_metrics(ic: int, check_sum: ndarray) → None[source]

Checks flux molecule cell metrics

Parameters:
  • ic (int :) – cell index

  • check_sum (ndarray :) – check sum array

check_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Checks flux molecule metrics for stored interface containers

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

get_face_count() → int[source]

Extract interface face count

Returns:

face count

Return type:

int

get_interface(t: Any) → Interface | None[source]

Get interface

Parameters:

t (INTFTypes :) – interface type

Returns:

interface

Return type:

Interface or None

get_interface_array() → list[source]

Get interface array

Returns:

interface array

Return type:

list

get_max_FMP_size() → int[source]

Get maximum flux molecule placeholder size

Returns:

size

Return type:

int

get_max_ghost_cells() → int[source]

Finds maximum number of ghost cells in an interface container

Returns:

ghost cell count

Return type:

int

get_max_ghost_nodes() → int[source]

Finds maximum number of ghost nodes in a boundary container

Returns:

ghost node count

Return type:

int

ghost_report() → None[source]

Extracts boundary ghost cell/node report

print() → None[source]

prints entity data

print_FMP_data(face_type=INTFTypes.UNDEFINED, face_tag='all', f=None) → None[source]

Prints flux molecule data

Parameters:
  • face_type (INTFTypes :) – interface type (Default value = INTFTypes.UNDEFINED)

  • face_tag (str :) – interface tag (Default value = ‘all’)

  • f (file) – file handle (Default value = None)

read_from_file(f: IO[str], intf_type: Any) → None[source]

Read interface definition from file

Parameters:
  • f (file :) – file handle

  • intf_type (INTFTypes :) – interface type

update_FMP_metrics(x: ndarray, y: ndarray, z: ndarray) → None[source]

Updates flux molecule metrics for stored interface containers

Parameters:
  • x (ndarray :) – x coordinate vector

  • y (ndarray :) – y coordinate vector

  • z (ndarray :) – z coordinate vector

class g3d.flow.domain.Intf(*args: Any, **kwargs: Any)[source]

Bases: Face

Definition of class Intf, extends class Face

Attributes:
FMP
return:

FMP_size
return:

X
return:

Y
return:

Z
return:

alfa

Angular separation, rotation about x-axis (for rotational periodic boundaries)

alpha
return:

check
return:

delta
return:

dx

Spatial separation in x-direction (for translational periodic boundaries)

dy

Spatial separation in y-direction (for translational periodic boundaries)

dz

Spatial separation in z-direction (for translational periodic boundaries)

face_type
return:

i0
return:

idir
return:

im
return:

it
return:

j0
return:

jdir
return:

k0
return:

npi
return:

npj
return:

size
return:

tag

tag (string) used for identification

x_max
return:

x_min
return:

y_max
return:

y_min
return:

z_max
return:

z_min
return:

Methods

allocate_FMP([mp])

Allocates flux molecule placeholders

allocate_XYZ([N])

backup_is_allocated()

check_FMP_cell_metrics(ic, check_sum)

copy(intf)

Copies data from prototype Intf object

copy_X(*args)

copy_XYZ(*args)

copy_Y(*args)

copy_Z(*args)

copy_def(f)

generate_offset_Face(offset)

get_X([lp])

get_XYZ([lp])

get_Y([lp])

get_Z([lp])

get_cell_count()

get_def([normal])

get_delta()

get_extreme_values()

get_face_count()

get_face_delta()

Get face spatial separation in three coordinate directions (for translational periodic faces)

get_from_backup([reset_bak])

get_index(i, j)

get_n_ghost_cells()

Get number of ghost cells for interface

get_n_ghost_nodes()

Get number of ghost nodes for interface

get_node(i, j)

get_node_count()

get_x_min_x_max()

get_y_min_y_max()

get_z_min_z_max()

ghost_report()

Extracts interface ghost report

print()

prints entity data

read_def_from_file(f)

read_from_file(f)

rotate(**kwargs)

scale(sf)

scatter_XY(plt[, m])

scatter_XZ(plt[, m])

scatter_YZ(plt[, m])

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_X(x[, lp])

set_XYZ(x, y, z[, lp])

set_Y(y[, lp])

set_Z(z[, lp])

set_def([f])

set_face_delta(d)

Get face spatial separation in three coordinate directions (for translational periodic faces)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

shift(**kwargs)

write_to_file(f)

backup

deallocate_FMP

nullify

print_extreme_values

reset_XYZ

swap_normal

property alfa: float

Angular separation, rotation about x-axis (for rotational periodic boundaries)

Returns:

alfa

Return type:

float

allocate_FMP(mp: int = 2) → None[source]

Allocates flux molecule placeholders

Parameters:

mp (int :) – (Default value = 2)

copy(intf: Intf)[source]

Copies data from prototype Intf object

Parameters:

intf (Intf) – prototype Intf object

property dx: float

Spatial separation in x-direction (for translational periodic boundaries)

Returns:

dx

Return type:

float

property dy: float

Spatial separation in y-direction (for translational periodic boundaries)

Returns:

dy

Return type:

float

property dz: float

Spatial separation in z-direction (for translational periodic boundaries)

Returns:

dz

Return type:

float

get_face_delta() → ndarray[source]

Get face spatial separation in three coordinate directions (for translational periodic faces)

Returns:

[dx, dy, dz]

Return type:

ndarray

get_n_ghost_cells() → int[source]

Get number of ghost cells for interface

Returns:

number of ghost cells

Return type:

int

get_n_ghost_nodes() → int[source]

Get number of ghost nodes for interface

Returns:

number of ghost nodes

Return type:

int

ghost_report() → None[source]

Extracts interface ghost report

set_face_delta(d: ndarray | list) → None[source]

Get face spatial separation in three coordinate directions (for translational periodic faces)

Parameters:

d (ndarray) – spatial separation in three coordinates [dx, dy, dz]

class g3d.flow.domain.Smagorinsky(*args: Any, **kwargs: Any)[source]

Bases: TurbulenceModel

Attributes:
tag

tag (string) used for identification

Methods

Reynolds_stress()

copy(e)

copies data from specified entity input: entity example: copy(e)

print()

prints entity data

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

visc_t()

class g3d.flow.domain.TurbulenceModel(*args: Any, **kwargs: Any)[source]

Bases: G3DEntity

Attributes:
tag

tag (string) used for identification

Methods

Reynolds_stress()

copy(e)

copies data from specified entity input: entity example: copy(e)

print()

prints entity data

set(*args, **kwargs)

sets entity parameters according to specifications input: args, kwargs example: set(args, kwargs)

set_from_key_value(key, value)

sets entity parameters from specified key => value data input: key, value valid keys for G3DCode base class: 'tag' example: set_from_key_value(key, value)

visc_t()

Reynolds_stress() → float[source]
Returns:

visc_t() → float[source]
Returns: