g3d.flow.domain package
Subpackages
- g3d.flow.domain.boco package
- Submodules
- g3d.flow.domain.boco.bc_mod module
- g3d.flow.domain.boco.boundaries module
BoCoBoCo.T0BoCo.allocate_FMP()BoCo.auxvBoCo.bc_update()BoCo.bc_update_conservative()BoCo.bc_update_family()BoCo.bc_update_primitive()BoCo.bc_update_speed_of_sound()BoCo.bc_update_type()BoCo.cBoCo.consBoCo.copy()BoCo.definedBoCo.etBoCo.get_n_ghost_cells()BoCo.get_n_ghost_nodes()BoCo.get_status()BoCo.get_velocity()BoCo.ghost_report()BoCo.pBoCo.p0BoCo.print()BoCo.roBoCo.ruBoCo.rvBoCo.rwBoCo.set_from_key_value()BoCo.tBoCo.t0BoCo.uBoCo.update_status()BoCo.vBoCo.w
BoundaryConditionBoundaryCondition.add_face_def()BoundaryCondition.allocate_FMPs()BoundaryCondition.bc_typeBoundaryCondition.check_FMP_cell_metrics()BoundaryCondition.check_FMP_metrics()BoundaryCondition.copy()BoundaryCondition.deallocate_FMPs()BoundaryCondition.get_FMP_size()BoundaryCondition.get_face_count()BoundaryCondition.get_face_defs()BoundaryCondition.get_max_FMP_size()BoundaryCondition.get_n_ghost_cells()BoundaryCondition.get_n_ghost_nodes()BoundaryCondition.ghost_report()BoundaryCondition.print()BoundaryCondition.print_FMP_data()BoundaryCondition.read_from_file()BoundaryCondition.sizeBoundaryCondition.update_FMP_metrics()
BoundaryConditionPlaceHolderBoundaryConditionPlaceHolder.add_Q1D_boundary_definitions()BoundaryConditionPlaceHolder.add_boundary()BoundaryConditionPlaceHolder.allocate_placeholders()BoundaryConditionPlaceHolder.check_FMP_cell_metrics()BoundaryConditionPlaceHolder.check_FMP_metrics()BoundaryConditionPlaceHolder.get_boundary()BoundaryConditionPlaceHolder.get_boundary_array()BoundaryConditionPlaceHolder.get_face_count()BoundaryConditionPlaceHolder.get_max_FMP_size()BoundaryConditionPlaceHolder.get_max_ghost_cells()BoundaryConditionPlaceHolder.get_max_ghost_nodes()BoundaryConditionPlaceHolder.ghost_report()BoundaryConditionPlaceHolder.print()BoundaryConditionPlaceHolder.print_FMP_data()BoundaryConditionPlaceHolder.read_from_file()BoundaryConditionPlaceHolder.update_FMP_metrics()
- Module contents
BCModBoCoBoCo.T0BoCo.allocate_FMP()BoCo.auxvBoCo.bc_update()BoCo.bc_update_conservative()BoCo.bc_update_family()BoCo.bc_update_primitive()BoCo.bc_update_speed_of_sound()BoCo.bc_update_type()BoCo.cBoCo.consBoCo.copy()BoCo.definedBoCo.etBoCo.get_n_ghost_cells()BoCo.get_n_ghost_nodes()BoCo.get_status()BoCo.get_velocity()BoCo.ghost_report()BoCo.pBoCo.p0BoCo.print()BoCo.roBoCo.ruBoCo.rvBoCo.rwBoCo.set_from_key_value()BoCo.tBoCo.t0BoCo.uBoCo.update_status()BoCo.vBoCo.w
BoundaryConditionBoundaryCondition.add_face_def()BoundaryCondition.allocate_FMPs()BoundaryCondition.bc_typeBoundaryCondition.check_FMP_cell_metrics()BoundaryCondition.check_FMP_metrics()BoundaryCondition.copy()BoundaryCondition.deallocate_FMPs()BoundaryCondition.get_FMP_size()BoundaryCondition.get_face_count()BoundaryCondition.get_face_defs()BoundaryCondition.get_max_FMP_size()BoundaryCondition.get_n_ghost_cells()BoundaryCondition.get_n_ghost_nodes()BoundaryCondition.ghost_report()BoundaryCondition.print()BoundaryCondition.print_FMP_data()BoundaryCondition.read_from_file()BoundaryCondition.sizeBoundaryCondition.update_FMP_metrics()
BoundaryConditionPlaceHolderBoundaryConditionPlaceHolder.add_Q1D_boundary_definitions()BoundaryConditionPlaceHolder.add_boundary()BoundaryConditionPlaceHolder.allocate_placeholders()BoundaryConditionPlaceHolder.check_FMP_cell_metrics()BoundaryConditionPlaceHolder.check_FMP_metrics()BoundaryConditionPlaceHolder.get_boundary()BoundaryConditionPlaceHolder.get_boundary_array()BoundaryConditionPlaceHolder.get_face_count()BoundaryConditionPlaceHolder.get_max_FMP_size()BoundaryConditionPlaceHolder.get_max_ghost_cells()BoundaryConditionPlaceHolder.get_max_ghost_nodes()BoundaryConditionPlaceHolder.ghost_report()BoundaryConditionPlaceHolder.print()BoundaryConditionPlaceHolder.print_FMP_data()BoundaryConditionPlaceHolder.read_from_file()BoundaryConditionPlaceHolder.update_FMP_metrics()
- g3d.flow.domain.glue package
- Submodules
- g3d.flow.domain.glue.connectivity module
InterfaceInterface.add_face_def()Interface.allocate_FMPs()Interface.check_FMP_cell_metrics()Interface.check_FMP_metrics()Interface.copy()Interface.deallocate_FMPs()Interface.get_FMP_size()Interface.get_face_count()Interface.get_face_defs()Interface.get_max_FMP_size()Interface.get_n_ghost_cells()Interface.get_n_ghost_nodes()Interface.ghost_report()Interface.intf_typeInterface.print()Interface.print_FMP_data()Interface.read_from_file()Interface.sizeInterface.update_FMP_metrics()
InterfacePlaceHolderInterfacePlaceHolder.add_interface()InterfacePlaceHolder.allocate_placeholders()InterfacePlaceHolder.check_FMP_cell_metrics()InterfacePlaceHolder.check_FMP_metrics()InterfacePlaceHolder.get_face_count()InterfacePlaceHolder.get_interface()InterfacePlaceHolder.get_interface_array()InterfacePlaceHolder.get_max_FMP_size()InterfacePlaceHolder.get_max_ghost_cells()InterfacePlaceHolder.get_max_ghost_nodes()InterfacePlaceHolder.ghost_report()InterfacePlaceHolder.print()InterfacePlaceHolder.print_FMP_data()InterfacePlaceHolder.read_from_file()InterfacePlaceHolder.update_FMP_metrics()
Intf
- Module contents
InterfaceInterface.add_face_def()Interface.allocate_FMPs()Interface.check_FMP_cell_metrics()Interface.check_FMP_metrics()Interface.copy()Interface.deallocate_FMPs()Interface.get_FMP_size()Interface.get_face_count()Interface.get_face_defs()Interface.get_max_FMP_size()Interface.get_n_ghost_cells()Interface.get_n_ghost_nodes()Interface.ghost_report()Interface.intf_typeInterface.print()Interface.print_FMP_data()Interface.read_from_file()Interface.sizeInterface.update_FMP_metrics()
InterfacePlaceHolderInterfacePlaceHolder.add_interface()InterfacePlaceHolder.allocate_placeholders()InterfacePlaceHolder.check_FMP_cell_metrics()InterfacePlaceHolder.check_FMP_metrics()InterfacePlaceHolder.get_face_count()InterfacePlaceHolder.get_interface()InterfacePlaceHolder.get_interface_array()InterfacePlaceHolder.get_max_FMP_size()InterfacePlaceHolder.get_max_ghost_cells()InterfacePlaceHolder.get_max_ghost_nodes()InterfacePlaceHolder.ghost_report()InterfacePlaceHolder.print()InterfacePlaceHolder.print_FMP_data()InterfacePlaceHolder.read_from_file()InterfacePlaceHolder.update_FMP_metrics()
Intf
- g3d.flow.domain.models package
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:
auxvAuxiliary variables placeholder
bc_modsBoundary condition modifiers array
boundary_facesBoundary conditions container
connectivity_facesGrid connectivity container (block interfaces)
consConservative variables placeholder
dtmvDynamic turbulence model variables placeholder
gasGas model instance
internal_facesInternal grid faces container
meshComputational mesh instance
postPostprocessing variables placeholder
tagtag (string) used for identification
turbTurbulence model instance
vgradVelocity 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)
Checks flux molecule cell metrics for all flux molecules (internal faces, mesh block connectivity faces, and boundary faces)
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
Generates matrix for Implicit Residual Smoothing (IRSM) operator
generate_mesh_from_pipe_data(q1d_pipe)Generates computational mesh from provided Q1D domain object
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
Gets primitive variable arrays (auxiliary solver variables)
Gets primitive variable arrays (auxiliary solver variables) including ghost cell values
Gets velocity vectors auxiliary solver variables placeholder
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
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
Gets conservative variable arrays (solver variables)
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
Gets dynamic turbulence model variable arrays
Gets dynamic turbulence model variable arrays including ghost cell values
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
Gets the maximum flux molecule array size
get_node(im, i, j, k)Gets node index based on provided data
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
Gets postprocessing variable arrays
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
Gets velocity gradient arrays
Gets velocity gradient arrays including ghost cell values
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)
Initialize flow field variables from specified primitive variables container
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
Prints extreme values (min/max) of density (ro), velocity (u, v, w), pressure (p), and temperature (t)
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))
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
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
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:
- 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:
- 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:
- property cons: ConsField
Conservative variables placeholder
- Returns:
conservative variables object
- Return type:
- property dtmv: DynamicTurbulenceModelVariables
Dynamic turbulence model variables placeholder
- Returns:
dynamic turbulence model variables object
- Return type:
- 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
- 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:
- 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)
- 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
- initsol_region_from_Cons(r: IJKRegion, q: Cons) None[source]
Initialize flow field variables in specified region using specified conservative variables object
- property internal_faces: FMPArray
Internal grid faces container
- Returns:
flux molecule array object
- Return type:
- 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:
- 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
- property turb: TurbulenceModel
Turbulence model instance
- Returns:
turbulence model
- Return type:
- 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
- property vgrad: VGradField
Velocity gradients placeholder
- Returns:
velocity gradients object
- Return type:
g3d.flow.domain.flow_region module
FlowRegion class definition
- class g3d.flow.domain.flow_region.FlowRegion(*args: Any, **kwargs: Any)[source]
Bases:
IJKRegiondefinition of class FlowRegion, extends IJKRegion
- Attributes:
auxvprimitive variable object
consconservative variable object
gasgas 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:
postpostprocessing variable object
tagtag (string) used for identification
vgradvelocity 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])copies data from provided primitive variable object
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
copies data from provided postprocessing variable object
copies data from provided velocity gradient object
- property auxv: Auxv
primitive variable object
- Returns:
allocated primitive variable object
- Return type:
- property cons: Cons
conservative variable object
- Returns:
allocated conservative variable object
- Return type:
- copy(r: FlowRegion) None[source]
copies data from prototype FlowRegion object
- Parameters:
r (FlowRegion) – prototype object - instance of class FlowRegion
- property post: Post
postprocessing variable object
- Returns:
allocated postprocessing variable object
- Return type:
- 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
Module contents
g3d/flow/domain sub library
- class g3d.flow.domain.BoCo(*args: Any, **kwargs: Any)[source]
Bases:
FaceBoundary condition entity BoCo (extends class Face in mesh/geo)
- Attributes:
FMP- return:
FMP_size- return:
T0To (total temperature [K])
X- return:
Y- return:
Z- return:
alpha- return:
auxvAuxv (auxiliary (primitive) variables placeholder)
cSpeed of sound [m/s]
check- return:
consCons (conservative variables placeholder)
definedDefined status
delta- return:
etTotal 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:
pPressure [Pa]
p0Po (total pressure [Pa])
roDensity [kg/m^3]
ruMomentum in x-direction [kg/(m^2 s)]
rvMomentum in y-direction [kg/(m^2 s)]
rwMomentum in z-direction [kg/(m^2 s)]
size- return:
tTemperature [K]
t0To (total temperature [K])
tagtag (string) used for identification
uVelocity in the x-direction [m/s]
vVelocity in the y-direction [m/s]
wVelocity 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
Update boundary conservative variables
bc_update_family(bc_type)Update boundary condition family
bc_update_primitive(gas)Update boundary primitive variables (auxiliary variables)
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 boundary ghost cell count
Get boundary ghost node count
get_node(i, j)get_node_count()Gets boundary condition status
Get boundary condition velocity vector
get_x_min_x_max()get_y_min_y_max()get_z_min_z_max()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)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:
- 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:
- 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
- property p: float
Pressure [Pa]
- Returns:
pressure
- Return type:
float
- property p0: float
Po (total pressure [Pa])
- Returns:
total pressure
- Return type:
float
- 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
- 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:
G3DEntityDefinition of class BoundaryCondition
- Attributes:
Methods
add_face_def(a)Add face definition to boundary placeholder
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
De-allocates boundary flux molecule placeholders
Get boundary accumulated boundary flux molecule placeholder size
get_face_count([face_type])Get face count for specified face type
Get boundary face definitions
Get max boundary flux molecule placeholder size
Get number of allocated ghost cells
Get number of allocated ghost nodes
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
- property bc_type: Any
Boundary condition type
- Returns:
boundary condition type
- Return type:
- 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
- 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
- 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
- class g3d.flow.domain.BoundaryConditionPlaceHolder(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntityDefinition of class BoundaryConditionPlaceHolder
- Attributes:
tagtag (string) used for identification
Methods
add_Q1D_boundary_definitions(NI[, ...])Add quasi-one-dimensional solver boundary definitions
add_boundary(t)Add boundary container
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_face_count([face_type])Extract boundary face count for specified boundary type or all boundaries
Get maximum flux molecule placeholder size
Finds maximum number of ghost cells in a boundary container
Finds maximum number of ghost nodes in a boundary container
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:
- 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:
- 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
- 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)
- class g3d.flow.domain.Domain(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntity- Attributes:
auxvAuxiliary variables placeholder
bc_modsBoundary condition modifiers array
boundary_facesBoundary conditions container
connectivity_facesGrid connectivity container (block interfaces)
consConservative variables placeholder
dtmvDynamic turbulence model variables placeholder
gasGas model instance
internal_facesInternal grid faces container
meshComputational mesh instance
postPostprocessing variables placeholder
tagtag (string) used for identification
turbTurbulence model instance
vgradVelocity 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)
Checks flux molecule cell metrics for all flux molecules (internal faces, mesh block connectivity faces, and boundary faces)
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
Generates matrix for Implicit Residual Smoothing (IRSM) operator
generate_mesh_from_pipe_data(q1d_pipe)Generates computational mesh from provided Q1D domain object
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
Gets primitive variable arrays (auxiliary solver variables)
Gets primitive variable arrays (auxiliary solver variables) including ghost cell values
Gets velocity vectors auxiliary solver variables placeholder
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
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
Gets conservative variable arrays (solver variables)
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
Gets dynamic turbulence model variable arrays
Gets dynamic turbulence model variable arrays including ghost cell values
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
Gets the maximum flux molecule array size
get_node(im, i, j, k)Gets node index based on provided data
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
Gets postprocessing variable arrays
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
Gets velocity gradient arrays
Gets velocity gradient arrays including ghost cell values
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)
Initialize flow field variables from specified primitive variables container
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
Prints extreme values (min/max) of density (ro), velocity (u, v, w), pressure (p), and temperature (t)
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))
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
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
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:
- 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:
- 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:
- property cons: ConsField
Conservative variables placeholder
- Returns:
conservative variables object
- Return type:
- property dtmv: DynamicTurbulenceModelVariables
Dynamic turbulence model variables placeholder
- Returns:
dynamic turbulence model variables object
- Return type:
- 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
- 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:
- 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)
- 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
- initsol_region_from_Cons(r: IJKRegion, q: Cons) None[source]
Initialize flow field variables in specified region using specified conservative variables object
- property internal_faces: FMPArray
Internal grid faces container
- Returns:
flux molecule array object
- Return type:
- 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:
- 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
- property turb: TurbulenceModel
Turbulence model instance
- Returns:
turbulence model
- Return type:
- 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
- property vgrad: VGradField
Velocity gradients placeholder
- Returns:
velocity gradients object
- Return type:
- class g3d.flow.domain.FlowRegion(*args: Any, **kwargs: Any)[source]
Bases:
IJKRegiondefinition of class FlowRegion, extends IJKRegion
- Attributes:
auxvprimitive variable object
consconservative variable object
gasgas 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:
postpostprocessing variable object
tagtag (string) used for identification
vgradvelocity 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])copies data from provided primitive variable object
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
copies data from provided postprocessing variable object
copies data from provided velocity gradient object
- property auxv: Auxv
primitive variable object
- Returns:
allocated primitive variable object
- Return type:
- property cons: Cons
conservative variable object
- Returns:
allocated conservative variable object
- Return type:
- copy(r: FlowRegion) None[source]
copies data from prototype FlowRegion object
- Parameters:
r (FlowRegion) – prototype object - instance of class FlowRegion
- property post: Post
postprocessing variable object
- Returns:
allocated postprocessing variable object
- Return type:
- 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
- class g3d.flow.domain.Interface(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntityDefinition of class Interface
- Attributes:
Methods
add_face_def(a, b)Add face definition to boundary placeholder
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
De-allocates interface flux molecule placeholders
Get interface accumulated boundary flux molecule placeholder size
Get face count
Get interface face definitions
Get max interface flux molecule placeholder size
Get number of allocated ghost cells
Get number of allocated ghost nodes
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
- 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
- get_FMP_size() int[source]
Get interface accumulated boundary flux molecule placeholder size
- Returns:
size
- 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
- 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
- class g3d.flow.domain.InterfacePlaceHolder(*args: Any, **kwargs: Any)[source]
Bases:
G3DEntityDefinition of class InterfacePlaceHolder
- Attributes:
tagtag (string) used for identification
Methods
Add interface container
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)
Extract interface face count
Get interface
Get interface array
Get maximum flux molecule placeholder size
Finds maximum number of ghost cells in an interface container
Finds maximum number of ghost nodes in a boundary container
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
- 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_interface(t: Any) Interface | None[source]
Get interface
- Parameters:
t (INTFTypes :) – interface type
- Returns:
interface
- Return type:
Interface or None
- 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
- 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)
- class g3d.flow.domain.Intf(*args: Any, **kwargs: Any)[source]
Bases:
FaceDefinition of class Intf, extends class Face
- Attributes:
FMP- return:
FMP_size- return:
X- return:
Y- return:
Z- return:
alfaAngular separation, rotation about x-axis (for rotational periodic boundaries)
alpha- return:
check- return:
delta- return:
dxSpatial separation in x-direction (for translational periodic boundaries)
dySpatial separation in y-direction (for translational periodic boundaries)
dzSpatial 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:
tagtag (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 spatial separation in three coordinate directions (for translational periodic faces)
get_from_backup([reset_bak])get_index(i, j)Get number of ghost cells for interface
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()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])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
- class g3d.flow.domain.Smagorinsky(*args: Any, **kwargs: Any)[source]
Bases:
TurbulenceModel- Attributes:
tagtag (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:
tagtag (string) used for identification
Methods
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()