58 lines
1.5 KiB
ReStructuredText
58 lines
1.5 KiB
ReStructuredText
Mesh generation
|
|
===============
|
|
|
|
The main goal for the current meshes is to achieve the following points:
|
|
|
|
* fine mesh on ``strips`` surfaces (minimum 3-4 elements per width/radius)
|
|
* stabilize count of 3d volumes from small :math:`\theta` to final
|
|
* keep an adequate time of calculation for number of elements
|
|
* make very fine mesh (prisms) near the walls for the better calculation and convergence of the solution
|
|
|
|
Example:
|
|
|
|
.. code-block:: python
|
|
:linenos:
|
|
|
|
shape, groups = simple(0.28, True, [1, 0, 0])
|
|
lengths = [ geompy.BasicProperties(edge)[0] for edge in geompy.SubShapeAll(shape, geompy.ShapeType["EDGE"]) ]
|
|
meanSize = sum(lengths) / len(lengths)
|
|
|
|
# master mesh
|
|
maxSize = meanSize
|
|
minSize = meanSize * 1e-1
|
|
chordalError = maxSize / 2
|
|
growthRate = 0.7
|
|
nbSegsPerEdge = 0.3
|
|
nbSegsPerRadius = 1
|
|
|
|
mesh = smesh.Mesh(shape)
|
|
netgen123 = mesh.Tetrahedron(algo = smeshBuilder.NETGEN_1D2D3D)
|
|
|
|
param123 = netgen123.Parameters()
|
|
# ...
|
|
status = mesh.AddHypothesis(shape, param123)
|
|
|
|
vlayer123 = netgen123.ViscousLayers()
|
|
# ...
|
|
status = mesh.AddHypothesis(shape, vlayer123)
|
|
|
|
# strips
|
|
maxSize = meanSize * 1e-1
|
|
minSize = meanSize * 1e-3
|
|
chordalError = minSize * 1e+1
|
|
growthRate = 0.2
|
|
nbSegsPerEdge = 2
|
|
nbSegsPerRadius = 3
|
|
|
|
netgen12 = mesh.Triangle(algo = smeshBuilder.NETGEN_1D2D, geom = strips)
|
|
|
|
param12 = netgen12.Parameters()
|
|
#...
|
|
status = mesh.AddHypothesis(strips, param12)
|
|
|
|
# compute
|
|
isDone = mesh.Compute()
|
|
|
|
# groups
|
|
# ...
|