foamgen.smesh¶
Structured meshing module¶
- synopsis
Create structured VTK mesh.
Functions
Delete unnecessary files. |
|
|
Residual function for finding target porosity and strut content. |
|
Residual function for finding target porosity. |
|
Create foam discretized on structured cartesian mesh. |
|
Create foam on equidistant cartesian mesh. |
-
foamgen.smesh.
por_fs_res
(delta, fname, dsize, porosity, strut_content)[source]¶ Residual function for finding target porosity and strut content.
Adjusts the size of the box, in which the foam is binarized and strut size parameter. Bigger box leads to thinner walls and higher porosity. Higher strut size parameter leads to higher strut content.
voxelize_morphology()
is used to create walls.foamreconstr
program is used to create struts and optimize strut content.Requires
*Tessellation.gnu
file.- Parameters
delta (float) – box size in voxels
fname (str) – base filename
dsize (float) – box size
porosity (float) – target foam porosity
strut_content (float) – target foam strut content
- Returns
squared difference between target and actual porosity
- Return type
float
-
foamgen.smesh.
por_res
(delta, fname, porosity)[source]¶ Residual function for finding target porosity.
Adjusts the size of the box, in which the foam is binarized. Bigger box leads to thinner walls and higher porosity.
voxelize_morphology()
is used to create walls.- Parameters
delta (float) – box size in voxels
fname (str) – base filename
porosity (float) – target porosity
- Returns
squared difference between target and actual porosity
- Return type
float
-
foamgen.smesh.
structured_mesh
(fname, porosity, strut_content)[source]¶ Create foam discretized on structured cartesian mesh.
Creates foam with desired porosity and strut content.
root_scalar
from scipy is used for root finding. This method is not optimal, since the solver doesn’t know that the function takes only integer arguments.Ultimate output is the
*SMesh.vtk
file.- Parameters
fname (str) – base filename
porosity (float) – target foam porosity
strut_content (float) – target foam strut content