turbo_moc.geometry.geometry_2d module#
Geometry source: blade construction, periodic passage placement, and plotting.
Sections: input validation; spline construction; clearance and placement; blade assembly; Matplotlib views. Gmsh operations live in ../meshing/meshing_2d.py.
Coordinates are millimetres: x is pitchwise, y is axial, flow toward -y. The reference is the integrated convergent metal-angle law followed by the straight planar MoC symmetry-axis direction, translated to the fitted LE. It is a construction camberline, not a recovered mean-thickness blade line. The joins are tangent-continuous (G1); curvature continuity is not imposed.
- turbo_moc.geometry.geometry_2d.apply_domain_shift(blade, domain, domain_shift)[source]#
Set an absolute manual shift without accumulating slider movements.
Returns a new dictionary; the input arrays and splines remain unchanged. Use this function on a cached domain for inexpensive GUI slider updates.
- turbo_moc.geometry.geometry_2d.assess_clearance(blade, domain, *, clearance_samples=600, inflation_thickness=0.0, transition_clearance=0.0)[source]#
Report Euclidean gaps, containment, and protected-envelope feasibility.
The envelope is the contour dilated by inflation + transition distance. Comparing boundary-to-contour distances avoids unreliable normal offsets around the rounded LE. Neighbor overlap is checked against blade + pitch.
- turbo_moc.geometry.geometry_2d.auto_center_flow_domain(blade, baseline, *, max_shift_pitch=0.5, shift_tolerance=0.001, clearance_samples=200)[source]#
Maximize the smaller Euclidean gap with one rigid x translation.
max_shift_pitch bounds
|shift| / pitch. shift_tolerance is in mm. A coarse search brackets a local bounded solve; it is not a global proof.
- turbo_moc.geometry.geometry_2d.blade_contour(blade)[source]#
Return the closed fitted blade, including its trailing-edge arc.
- turbo_moc.geometry.geometry_2d.blade_reference_camberline(blade, wall, num_points=200)[source]#
Return convergent and divergent references anchored at the fitted LE.
Integrate d(eta)/d(xi)=tan(beta(xi)), with beta linear from inlet to throat, exactly rather than reusing the sparsely sampled suction side. The MoC symmetry axis is straight and rotated by the outlet metal angle. After anchoring at the fitted LE, continue this direction to the blade’s downstream axial extremum, so the exit blend begins beyond the blade.
- turbo_moc.geometry.geometry_2d.build_geometry(nozzle, config)[source]#
Rebuild the blade and periodic passage from the current parameters.
- turbo_moc.geometry.geometry_2d.cubic_blend(start, end, tangent_start, tangent_end, length_start, length_end, num_points=200)[source]#
Return samples, control points, and a clamped degree-3 B-spline.
The four-control-point spline is also a cubic Bezier curve. Endpoint derivatives are 3*(P1-P0) and 3*(P3-P2), so handle lengths control the rate of turning independently at each end. Lengths are in mm.
- turbo_moc.geometry.geometry_2d.draw_domain(blade, curves, ax)[source]#
Draw the selected domain and report numerical side clearances.
- turbo_moc.geometry.geometry_2d.generate_flow_domain(blade, wall, *, inlet_chords, outlet_chords, smooth=None, domain_shift_mode='manual', domain_shift=0.0)[source]#
Build the extended reference, +/- half-pitch periodics, and flat caps.
Cap axial positions use the contour extrema and nominal axial chord. Far-field pitchwise positions assume half of each extension’s axial travel occurs at the blade angle. Handle lengths are proportions of the respective extension’s axial length, not its arc length.
- turbo_moc.geometry.geometry_2d.metal_direction(angle)[source]#
Unit downstream tangent for a signed metal angle in degrees.
- turbo_moc.geometry.geometry_2d.plot_construction(blade, curves, *, figure_size=(14, 8))[source]#
Overlay construction features on the package’s Matplotlib blade plots.
- turbo_moc.geometry.geometry_2d.plot_flow_domain(ax, domain)[source]#
Plot boundaries, reference sections, and extension control polygons.
- turbo_moc.geometry.geometry_2d.point_segment_distances(points, polyline)[source]#
Shortest distance and nearest point on polyline for every input point.
- turbo_moc.geometry.geometry_2d.resample_curve(points, count)[source]#
Uniform arclength samples of a polyline.
- turbo_moc.geometry.geometry_2d.validate_domain_shift(mode, shift)[source]#
Manual shift is a signed fraction of pitch; auto ignores its value.