turbo_moc.meshing.mesh_2d module#
Meshing source: Gmsh CAD, inflation, periodic mesh, export, and diagnostics.
Sections: settings; CAD; sizing; conformity; CGNS export; quality metrics; report writing; generation workflow. All lengths are mm.
Transfer the existing fitted B-spline exactly to OpenCASCADE, close the trailing edge with circular arcs, and mesh the surrounding fluid with inflation layers.
- turbo_moc.meshing.mesh_2d.add_blade_boundary(blade, mesh_size)[source]#
Transfer a fitted stator or segmented rotor boundary to common CAD.
- turbo_moc.meshing.mesh_2d.add_inflation_layers(blade_curves, numerics)[source]#
Create quadrilateral layers normal to every blade-boundary curve.
- turbo_moc.meshing.mesh_2d.add_periodic_passage(curves, blade_curves, pitch, mesh_size)[source]#
Transfer the selected smooth domain and constrain translated 1D meshes.
- turbo_moc.meshing.mesh_2d.analyze_mesh(xy, cells, element_tags, boundary_edges, *, periodic_map=None, inflation=None, gmsh_quality=None, worst_cells=10, inflation_tolerance=0.35)[source]#
Pure-Python geometric analysis; connectivity uses zero-based node indices.
- turbo_moc.meshing.mesh_2d.calculate_inflation_profile(inflation)[source]#
Resolve the complete geometric layers that fit the thickness limit.
These are nominal values: Gmsh may shorten or merge columns near curvature and neighbouring boundaries. The three user inputs are never adjusted.
- turbo_moc.meshing.mesh_2d.check_periodic_conformity(boundaries)[source]#
Verify complete node bijections, translations, and matching 1D edges.
- turbo_moc.meshing.mesh_2d.collect_fluid_mesh(fluid_surface, boundaries)[source]#
Renumber used nodes and orient cells/edges with fluid on their left.
CAD control points and other unused Gmsh nodes are excluded. Each exterior cell edge must belong to exactly one named boundary. This follows the section extraction used by ParaBlade’s annular_mesh.py.
- turbo_moc.meshing.mesh_2d.collect_periodic_nodes(boundaries, local, xy)[source]#
Merge per-curve maps into one checked right-to-left node bijection.
- turbo_moc.meshing.mesh_2d.compute_mesh_report(fluid_surface, boundaries, *, inflation=None, worst_cells=10, inflation_tolerance=0.35)[source]#
Analyze an active Gmsh 2D surface before gmsh.finalize().
- turbo_moc.meshing.mesh_2d.configure_core_transition(blade_curves, numerics, profile, pitch=None, use_mesh=False)[source]#
Install local, periodic sizing; refresh from actual wall edges after 1D.
Before the 1D mesh exists, CAD samples and curvature estimate tangential spacing. Afterwards, actual blade-edge lengths replace that estimate. The blade’s 1D sizing remains separate from the core’s area-based sizing.
- turbo_moc.meshing.mesh_2d.configure_recombination(fluid_surface, numerics)[source]#
Recombine the fluid surface, as in ParaBlade’s 2D mesh builder.
Algorithm 8 prepares triangles for recombination; setRecombine actually enables their conversion to quadrilaterals outside the inflation layers. The minimum is Gmsh’s recombination quality, not an equiangular-skewness limit. Retain triangles when recombination would produce poor quads.
- turbo_moc.meshing.mesh_2d.core_mesh_size(distance, tangent_size, profile, domain_size, recombine=True)[source]#
Match the nominal last-layer area, then grade towards the far field.
Last-layer area is estimated as tangential spacing times normal height. Convert it to a square/equilateral-triangle size; this keeps the two wall directions independent. A small linear size gradient gives approximately CORE_AREA_GROWTH between successive regular core cells.
- turbo_moc.meshing.mesh_2d.create_mesh(blade, curves, settings, output_dir, show_gui=True)[source]#
Generate, check, export and report a mesh using the caller’s logging setup.
- turbo_moc.meshing.mesh_2d.distribution(values)[source]#
JSON-safe count, extrema, mean, standard deviation, and quantiles.
- turbo_moc.meshing.mesh_2d.export_fluent_cgns(filename, fluid_surface, boundaries, settings)[source]#
Write a true 2D CGNS/ADF mesh with named BCs and periodic connectivity.
A CGNS mesh describes boundary types, not pressures, temperatures, or a Fluent case setup. Coordinate scaling affects only this export. Mixed cells use the CGNS 3.4 layout supported by the ParaBlade ADF converter.
- turbo_moc.meshing.mesh_2d.main(config_file, output_dir='output', *, row_id=None)[source]#
Run the planar workflow using execution and viewer options from its YAML.
- turbo_moc.meshing.mesh_2d.mesh_statistics(fluid_surface, boundaries)[source]#
Check cell quality and periodic node correspondence before saving.
- turbo_moc.meshing.mesh_2d.reconstruct_inflation(xy, cells, owners, wall_edges, settings, tolerance=0.35)[source]#
Trace opposite-edge quad columns consistent with the configured layers.
Membership is an estimate: recombined core quads do not carry a public BoundaryLayer provenance tag. Reject heights inconsistent with the geometric series, stop at the configured thickness allowance, and expose column depth/coverage rather than asserting a uniform layer count.
- turbo_moc.meshing.mesh_2d.set_mesh_sizes(blade_curves, numerics, profile=None, pitch=None)[source]#
Set blade resolution and automatically grade the surrounding core.