g3d.flow.solver.rhs package

Subpackages

Submodules

g3d.flow.solver.rhs.flux module

flux variable placeholder and related operators (Flux class definition)

class g3d.flow.solver.rhs.flux.Flux(*args: Any, **kwargs: Any)[source]

Bases: ConsField

Attributes:
et

Total energy [J/m^3]

first

First index

last

Last index

n_cells

Number of cells

n_ghosts

Number of ghost cells

n_var

Number of variables

ro

Density [kg/m^3]

ru

X-momentum [kg/(m^2 s)]

rv

Y-momentum [kg/(m^2 s)]

rw

Z-momentum [kg/(m^2 s)]

size

Placeholder size

tag

tag (string) used for identification

variables

Defined container variables

Methods

AXPBY(A, B, Y)

Vector operation a * X + b * Y where Y is an instance of FlowDataPlaceholder and X is this placeholder

AXPY(A, Y)

Vector operation a * X + Y where Y is an instance of FlowDataPlaceholder and X is this placeholder

CellToNode(c)

Convert cell values to node values

GetNGhosts()

Gets number of allocated ghost cells

Interpolate(nodes, cells, node_cons)

Interpolate cell-centered flow field data to node-centered data

WAXPY(A, X, Y)

Vector operation W = a * X + Y where X and Y are instances of FlowDataPlaceholder and W is this placeholder

associate(dom, dt)

backup()

Copies data to backup arrays

copy(fd)

Copies data from prototype FlowDataPlaceHolder object

copy_values(from_idx, to_idx)

Copies from one array element to another

de_allocate_placeholders()

De allocates placeholders - nullifies all arrays

export(name[, var])

Exports placeholder data to file (binary)

get_Cons(idx)

Extracts an instance of conservative variable object for specified cell index

get_array([var])

Get array for specified variable string

get_array_with_ghosts([var])

Get array for specified variable string including ghost cell values

get_arrays()

Gets conservative flow data arrays

get_arrays_with_ghosts()

Gets conservative flow data arrays including ghost cell values

get_by_index(idx)

Gets tuple of conservative variable values for cell with specified index

get_extreme_value_array([value_type])

Gets array with calculated variable extreme values

get_extreme_values([var])

Updates placeholder variables extreme values (min/max)

get_from_backup([reset_bak])

Restores data from backup arrays

get_keys()

Gets defined variable keys

get_max_norm([var])

Updates variable max norm values (max absolute values)

get_max_values([var])

Updates placeholder max values

get_min_values([var])

Updates placeholder min values

get_momentum_vector(idx)

Get momentum vector for cell with specified index

get_pointers()

Gets list of array pointers

get_range()

Gets placeholder range (first, last)

get_shock_capturing_field()

get_value(idx[, var])

Get variable value for specified cell index

import_data(name[, var])

Imports placeholder data from file (binary)

import_var_data_from_binary(f[, var])

Imports variable data from binary file

initialize([val, var])

Initialize placeholder

is_allocated()

Placeholder allocation status

normalize_extreme_values(norm_values[, ...])

Normalizes extreme values

nullify()

Nullifies all array elements for all defined variables

nullify_by_index(idx)

Nullifies all variables for specified cell index

point_wise_scale(sf)

Element data scaling using provided scaling factor array

print()

prints entity data

print_extreme_value_locations()

Prints extreme values including location to stdout

print_extreme_values([var])

Prints calculated extreme values to stdout

print_extreme_values_by_type([value_type, var])

Prints calculated extreme values by type to stdout

print_flow_data(idx)

Prints stored variable information for specified cell index to stdout

read_from_file(f)

Reads placeholder variable arrays from file (binary format)

scale(idx, sf)

Scales all variable values for specified cell index

set(*args, **kwargs)

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

set_by_index_from_Cons(idx, c)

Set array values for cell with specified cell index from provided conservative variable object

set_from_Cons(c)

Set array values from provided conservative variable object

set_from_array(from_array[, var])

Set flow data for specified variable from array

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

Set data from provided arrays

set_from_cons_field(c)

Copy data from provided conservative variables placeholder object

set_from_key_value(key, value)

Sets data from key-value pair input

set_momentum_vector(idx, r_vel)

Set momentum vector for cell with specified index

set_value(idx, val[, var])

Sets variable value for specified cell index

set_values(ro, ru, rv, rw, et[, idx])

Sets array values for all cells or cell with specified cell index to a set of initial values or data from provided arrays

setup(**kwargs)

vector_scale(v)

Scales all variable values for all elements using specified scaling array

write_to_file(f)

Writes placeholder variable arrays to file (binary format)

change_eqn_mode

diff_flux_check

evaluate

flux_check

associate(dom: Domain, dt: ndarray) → None[source]
Parameters:
  • dom

  • dt

change_eqn_mode() → None[source]
diff_flux_check() → None[source]
evaluate() → None[source]
flux_check() → None[source]
get_shock_capturing_field() → ndarray[source]
Returns:

setup(**kwargs: Any) → None[source]
Parameters:

kwargs

g3d.flow.solver.rhs.moc module

method of characteristics (MOC) operator (MOC class definition)

class g3d.flow.solver.rhs.moc.MOC[source]

Bases: object

Attributes:
c_a
return:

c_m
return:

et_m
return:

p_l
return:

p_m
return:

p_r
return:

ro_a
return:

ro_l
return:

ro_m
return:

ro_r
return:

ru_m
return:

rv_m
return:

rw_m
return:

sl
return:

sx
return:

sy
return:

sz
return:

u_a
return:

u_l
return:

u_m
return:

u_r
return:

v_a
return:

v_l
return:

v_m
return:

v_r
return:

w_a
return:

w_l
return:

w_m
return:

w_r
return:

Methods

associate(gas)

evaluate

update

associate(gas: Gas) → None[source]
Parameters:

gas

property c_a: float

return:

property c_m: float

return:

property et_m: float

return:

evaluate() → None[source]
property p_l: float

return:

property p_m: float

return:

property p_r: float

return:

property ro_a: float

return:

property ro_l: float

return:

property ro_m: float

return:

property ro_r: float

return:

property ru_m: float

return:

property rv_m: float

return:

property rw_m: float

return:

property sl: float

return:

property sx: float

return:

property sy: float

return:

property sz: float

return:

property u_a: float

return:

property u_l: float

return:

property u_m: float

return:

property u_r: float

return:

update() → None[source]
property v_a: float

return:

property v_l: float

return:

property v_m: float

return:

property v_r: float

return:

property w_a: float

return:

property w_l: float

return:

property w_m: float

return:

property w_r: float

return:

g3d.flow.solver.rhs.tvd module

TVD limiters (density, turbulence model variables, generic)

class g3d.flow.solver.rhs.tvd.TVD[source]

Bases: object

Methods

evaluate(ev, r, val_r, val_l)

evaluate(ev, r, val_r, val_l)[source]
Parameters:
  • ev

  • r

  • val_r

  • val_l

class g3d.flow.solver.rhs.tvd.TVDGeneric[source]

Bases: TVD

Methods

evaluate(ev, r, val_r, val_l)

reset

evaluate(ev: float, r: ndarray | list[float], val_r: float, val_l: float) → float[source]
Parameters:
  • ev

  • r

  • val_r

  • val_l

Returns:

reset() → None[source]
class g3d.flow.solver.rhs.tvd.TVDTurb[source]

Bases: TVDGeneric

Methods

evaluate(ev, r, val_r, val_l)

reset

evaluate(ev: float, r: ndarray | list[float], val_r: float, val_l: float) → float[source]
Parameters:
  • ev

  • r

  • val_r

  • val_l

class g3d.flow.solver.rhs.tvd.TVDro[source]

Bases: TVDGeneric

Methods

evaluate(ev, r, val_r, val_l)

reset

evaluate(ev: float, r: ndarray | list[float], val_r: float, val_l: float) → float[source]
Parameters:
  • ev

  • r

  • val_r

  • val_l

Module contents

g3d/flow/solver/rhs sub library

class g3d.flow.solver.rhs.Flux(*args: Any, **kwargs: Any)[source]

Bases: ConsField

Attributes:
et

Total energy [J/m^3]

first

First index

last

Last index

n_cells

Number of cells

n_ghosts

Number of ghost cells

n_var

Number of variables

ro

Density [kg/m^3]

ru

X-momentum [kg/(m^2 s)]

rv

Y-momentum [kg/(m^2 s)]

rw

Z-momentum [kg/(m^2 s)]

size

Placeholder size

tag

tag (string) used for identification

variables

Defined container variables

Methods

AXPBY(A, B, Y)

Vector operation a * X + b * Y where Y is an instance of FlowDataPlaceholder and X is this placeholder

AXPY(A, Y)

Vector operation a * X + Y where Y is an instance of FlowDataPlaceholder and X is this placeholder

CellToNode(c)

Convert cell values to node values

GetNGhosts()

Gets number of allocated ghost cells

Interpolate(nodes, cells, node_cons)

Interpolate cell-centered flow field data to node-centered data

WAXPY(A, X, Y)

Vector operation W = a * X + Y where X and Y are instances of FlowDataPlaceholder and W is this placeholder

associate(dom, dt)

backup()

Copies data to backup arrays

copy(fd)

Copies data from prototype FlowDataPlaceHolder object

copy_values(from_idx, to_idx)

Copies from one array element to another

de_allocate_placeholders()

De allocates placeholders - nullifies all arrays

export(name[, var])

Exports placeholder data to file (binary)

get_Cons(idx)

Extracts an instance of conservative variable object for specified cell index

get_array([var])

Get array for specified variable string

get_array_with_ghosts([var])

Get array for specified variable string including ghost cell values

get_arrays()

Gets conservative flow data arrays

get_arrays_with_ghosts()

Gets conservative flow data arrays including ghost cell values

get_by_index(idx)

Gets tuple of conservative variable values for cell with specified index

get_extreme_value_array([value_type])

Gets array with calculated variable extreme values

get_extreme_values([var])

Updates placeholder variables extreme values (min/max)

get_from_backup([reset_bak])

Restores data from backup arrays

get_keys()

Gets defined variable keys

get_max_norm([var])

Updates variable max norm values (max absolute values)

get_max_values([var])

Updates placeholder max values

get_min_values([var])

Updates placeholder min values

get_momentum_vector(idx)

Get momentum vector for cell with specified index

get_pointers()

Gets list of array pointers

get_range()

Gets placeholder range (first, last)

get_shock_capturing_field()

get_value(idx[, var])

Get variable value for specified cell index

import_data(name[, var])

Imports placeholder data from file (binary)

import_var_data_from_binary(f[, var])

Imports variable data from binary file

initialize([val, var])

Initialize placeholder

is_allocated()

Placeholder allocation status

normalize_extreme_values(norm_values[, ...])

Normalizes extreme values

nullify()

Nullifies all array elements for all defined variables

nullify_by_index(idx)

Nullifies all variables for specified cell index

point_wise_scale(sf)

Element data scaling using provided scaling factor array

print()

prints entity data

print_extreme_value_locations()

Prints extreme values including location to stdout

print_extreme_values([var])

Prints calculated extreme values to stdout

print_extreme_values_by_type([value_type, var])

Prints calculated extreme values by type to stdout

print_flow_data(idx)

Prints stored variable information for specified cell index to stdout

read_from_file(f)

Reads placeholder variable arrays from file (binary format)

scale(idx, sf)

Scales all variable values for specified cell index

set(*args, **kwargs)

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

set_by_index_from_Cons(idx, c)

Set array values for cell with specified cell index from provided conservative variable object

set_from_Cons(c)

Set array values from provided conservative variable object

set_from_array(from_array[, var])

Set flow data for specified variable from array

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

Set data from provided arrays

set_from_cons_field(c)

Copy data from provided conservative variables placeholder object

set_from_key_value(key, value)

Sets data from key-value pair input

set_momentum_vector(idx, r_vel)

Set momentum vector for cell with specified index

set_value(idx, val[, var])

Sets variable value for specified cell index

set_values(ro, ru, rv, rw, et[, idx])

Sets array values for all cells or cell with specified cell index to a set of initial values or data from provided arrays

setup(**kwargs)

vector_scale(v)

Scales all variable values for all elements using specified scaling array

write_to_file(f)

Writes placeholder variable arrays to file (binary format)

change_eqn_mode

diff_flux_check

evaluate

flux_check

associate(dom: Domain, dt: ndarray) → None[source]
Parameters:
  • dom

  • dt

change_eqn_mode() → None[source]
diff_flux_check() → None[source]
evaluate() → None[source]
flux_check() → None[source]
get_shock_capturing_field() → ndarray[source]
Returns:

setup(**kwargs: Any) → None[source]
Parameters:

kwargs

class g3d.flow.solver.rhs.MOC[source]

Bases: object

Attributes:
c_a
return:

c_m
return:

et_m
return:

p_l
return:

p_m
return:

p_r
return:

ro_a
return:

ro_l
return:

ro_m
return:

ro_r
return:

ru_m
return:

rv_m
return:

rw_m
return:

sl
return:

sx
return:

sy
return:

sz
return:

u_a
return:

u_l
return:

u_m
return:

u_r
return:

v_a
return:

v_l
return:

v_m
return:

v_r
return:

w_a
return:

w_l
return:

w_m
return:

w_r
return:

Methods

associate(gas)

evaluate

update

associate(gas: Gas) → None[source]
Parameters:

gas

property c_a: float

return:

property c_m: float

return:

property et_m: float

return:

evaluate() → None[source]
property p_l: float

return:

property p_m: float

return:

property p_r: float

return:

property ro_a: float

return:

property ro_l: float

return:

property ro_m: float

return:

property ro_r: float

return:

property ru_m: float

return:

property rv_m: float

return:

property rw_m: float

return:

property sl: float

return:

property sx: float

return:

property sy: float

return:

property sz: float

return:

property u_a: float

return:

property u_l: float

return:

property u_m: float

return:

property u_r: float

return:

update() → None[source]
property v_a: float

return:

property v_l: float

return:

property v_m: float

return:

property v_r: float

return:

property w_a: float

return:

property w_l: float

return:

property w_m: float

return:

property w_r: float

return:

class g3d.flow.solver.rhs.TVD[source]

Bases: object

Methods

evaluate(ev, r, val_r, val_l)

evaluate(ev, r, val_r, val_l)[source]
Parameters:
  • ev

  • r

  • val_r

  • val_l