Block Mesh Dict¶
-
class
apmapflow.openfoam.block_mesh_dict.
BlockMeshDict
(field, avg_fact=1.0, mesh_params=None, offset_field=None)[source]¶ This is a special subclass of OpenFoamFile used to generate and output a blockMeshDict for OpenFoam
-
__init__
(field, avg_fact=1.0, mesh_params=None, offset_field=None)[source]¶ Takes a field object and a set of mesh params to set the properties of the blockMeshDict
field : DataField, field that is storing the aperture map data avg_fact : float, optional, number of voxels along the X and Z axes. mesh_params : dict, optional, a dictionary containing parameters to use instead of the defaults offset_field : DataField, field object that stores the offset data for an aperture map
-
_create_blocks
(cell_mask)[source]¶ Sets up the vertices and blocks.
- cell_mask is a boolean array in the shape of the data_map
telling the function what blocks to include.
vert_map stores the 4 vertex indices that make up the back surface and the front surface is ‘+ 1’ the index of the corresponding lower point. In terms of the very first block vert_map[i,j,0] is at the orgin (0,0), bottom left corner vert_map[i,j,1] is bottom right corner (1,0) vert_map[i,j,2] is the top right corner (1,1) vert_map[i,j,3] is the top left corner (0,1)
-
generate_threshold_mesh
(min_value=0.0, max_value=1000000000.0)[source]¶ Generates a mesh excluding all blocks below the min_value arg. Regions that are isolated by the thresholding are also automatically removed.
-
set_boundary_patches
(boundary_blocks, reset=False)[source]¶ Sets up boundary patches based on the dictionary passed in. Overlapping declarations are overwritten by the last patch to use that face. The boundary blocks dictionary contains a dictionary entry for each patch name.
- boundary_blocks dictionary has the format of:
- {patch_name: {
<side>: [ block-list ], <side>: [ block-list ], ...
} where <side> is left, right, bottom, top, front or back and block list is a list of blocks to add that patch to the side of.
- reset - boolean : if True then the face labels dictionary
and _faces array are re-initialized to default values
-
write_foam_file
(path='.', create_dirs=True, overwrite=False)[source]¶ Writes a full blockMeshDict file based on stored geometry data
-