ntrfc.meshquality package

Submodules

ntrfc.meshquality.aspect_ratio module

ntrfc.meshquality.aspect_ratio.compute_cell_aspect_ratios(grid: UnstructuredGrid) ndarray

Compute the aspect ratio of each cell in an unstructured grid.

The aspect ratio of a cell is defined as the ratio of the longest edge length to the shortest edge length of the cell.

Parameters:

grid (pv.UnstructuredGrid) – The unstructured grid.

Returns:

An array of aspect ratios, one for each cell in the grid.

Return type:

np.ndarray

ntrfc.meshquality.grid_convergece_index module

ntrfc.meshquality.grid_convergece_index.calcp(x0, A, N1, N2, N3, fc1, fc2, fc3, D)
ntrfc.meshquality.grid_convergece_index.func_p(x0, a, b, c, A)
ntrfc.meshquality.grid_convergece_index.getGCI(N1, N2, N3, fc1, fc2, fc3, D, Fs=1.25)
ntrfc.meshquality.grid_convergece_index.prel(p_opt, P)

ntrfc.meshquality.meshexpansion module

ntrfc.meshquality.meshexpansion.compute_expansion_factors(grid: UnstructuredGrid) ndarray
ntrfc.meshquality.meshexpansion.get_neighbor_cell_ids(grid, cell_idx)

Helper to get neighbor cell IDs.

ntrfc.meshquality.nondimensionals module

Created on Fri Apr 24 23:33:53 2020

@author: malte

ntrfc.meshquality.nondimensionals.calc_dimensionless_gridspacing(volmesh, surfaces, use_velfield, use_rhofield, mu_0)
Parameters:
  • volmesh – pyvista-vtk object

  • surfaces – pyvista-vtk object

  • use_velfield – string, name of the velocity field array

  • use_rhofield – string, name of the density field array

  • mu_0 – float. kinematic viscosity

Returns:

volmesh_walladjacent: pyvista-vtk object with the nondimensionals

ntrfc.meshquality.nondimensionals.calc_dimensionless_yplus(volmesh, surfaces, use_velfield, use_rhofield, mu_0)
ntrfc.meshquality.nondimensionals.cellDirections(cellUMean, wallNorm)
ntrfc.meshquality.nondimensionals.cellSpans(solutionMesh, calcFrom)
ntrfc.meshquality.nondimensionals.compute_scalar_gradient(mesh, arrayname)
ntrfc.meshquality.nondimensionals.constructWallMesh(surfaces)
ntrfc.meshquality.nondimensionals.get_wall_shear_stress_velocity(mesh, dynamic_viscosity, density_fieldname, velocity_fieldname)

Calculate the wall shear stress velocity at various points on a surface in a CFD simulation.

Parameters: mesh (pv.PolyData): A mesh that represents the solution_utils of the CFD simulation. dynamic_viscosity (float): The dynamic viscosity of the fluid. density_fieldname (str): The name of the field that contains the density of the fluid. velocity_fieldname (str): The name of the field that contains the velocity of the fluid.

Returns: wall_shear_stress_velocity (np.ndarray): An array containing the velocity at which a fluid layer adjacent to the surface would need to move in order to experience the same shear stress as the actual fluid layer in contact with the surface.

ntrfc.meshquality.skewness module

ntrfc.meshquality.skewness.compute_cell_skewness(grid)

Compute the skewness of each cell in an unstructured grid.

Parameters:

grid (pyvista.UnstructuredGrid) – The input unstructured grid.

Returns:

skewness – A list of the skewness of each cell in the grid.

Return type:

list

ntrfc.meshquality.skewness.skewness(points)

Compute the skewness of a set of points.

The skewness is defined as the difference between the maximum and minimum distances from the centroid of the points to the vertices of the cell, divided by the median distance from the centroid to the vertices of the cell.

Parameters:

points (numpy array) – The points of the cell, represented as a 2D array with shape (n, 3), where n is the number of points and the columns are the x, y, and z coordinates.

Returns:

skewness – The skewness of the points.

Return type:

float

Module contents