g3d.flow.domain.boco package

Submodules

g3d.flow.domain.boco.bc_mod module

Boundary condition modifiers

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

Bases: BoCo

Definition of class BCMode, extends class BoCo: used for boundary condition modification

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:

end_iter

Ramp end iteration

end_val

Ramp end value

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:

start_iter

Ramp start iteration

start_val

Ramp start value

t

Temperature [K]

t0

To (total temperature [K])

tag

tag (string) used for identification

type

Ramp type

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)

evaluate(gas)

Evaluates ramp

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 data from key-value pair input

shift(**kwargs)

update_status()

Changes boundary defined status

write_to_file(f)

backup

deallocate_FMP

nullify

print_extreme_values

reset_XYZ

swap_normal

property end_iter: int

Ramp end iteration

Returns:

end iteration

Return type:

int

property end_val: float

Ramp end value

Returns:

end value

Return type:

float

evaluate(gas: Gas) → None[source]

Evaluates ramp

Parameters:

gas (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

property start_iter: int

Ramp start iteration

Returns:

start iteration

Return type:

int

property start_val: float

Ramp start value

Returns:

start value

Return type:

float

property type: Any

Ramp type

Returns:

ramp type

Return type:

RampType

g3d.flow.domain.boco.boundaries module

Boundary condition placeholders. BoCo class definition

class g3d.flow.domain.boco.boundaries.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.boco.boundaries.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.boco.boundaries.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

Module contents

g3d/flow/domain/boco sub library

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

Bases: BoCo

Definition of class BCMode, extends class BoCo: used for boundary condition modification

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:

end_iter

Ramp end iteration

end_val

Ramp end value

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:

start_iter

Ramp start iteration

start_val

Ramp start value

t

Temperature [K]

t0

To (total temperature [K])

tag

tag (string) used for identification

type

Ramp type

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)

evaluate(gas)

Evaluates ramp

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 data from key-value pair input

shift(**kwargs)

update_status()

Changes boundary defined status

write_to_file(f)

backup

deallocate_FMP

nullify

print_extreme_values

reset_XYZ

swap_normal

property end_iter: int

Ramp end iteration

Returns:

end iteration

Return type:

int

property end_val: float

Ramp end value

Returns:

end value

Return type:

float

evaluate(gas: Gas) → None[source]

Evaluates ramp

Parameters:

gas (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

property start_iter: int

Ramp start iteration

Returns:

start iteration

Return type:

int

property start_val: float

Ramp start value

Returns:

start value

Return type:

float

property type: Any

Ramp type

Returns:

ramp type

Return type:

RampType

class g3d.flow.domain.boco.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.boco.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.boco.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