turbo_moc.geometry.passage_2d module#
Geometry source: blade construction and periodic passage placement.
Sections: input validation; spline construction; clearance and placement; blade assembly. Matplotlib views live in ../visualization/geometry_mpl.py; Gmsh operations live in ../meshing/mesh_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.passage_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.passage_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.passage_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.passage_2d.blade_contour(blade)[source]#
Return the closed fitted blade, including its trailing-edge arc.
- turbo_moc.geometry.passage_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.passage_2d.build_geometry(nozzle, config)[source]#
Rebuild the blade and periodic passage from the current parameters.
- turbo_moc.geometry.passage_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.passage_2d.extension_curve(start, end, tangent_start, tangent_end, length_start, length_end, num_points, *, kind, side)[source]#
Smooth blend or tangent-aligned straight line to the same axial cap.
Straight extensions preserve the blade-reference tangent and cap y, allowing the pitchwise cap position to change. Handles apply only to blends.
- turbo_moc.geometry.passage_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. Smooth far-field pitchwise positions assume half of each extension’s axial travel occurs at the blade angle; straight extensions continue the blade tangent for the full travel. Handle lengths are proportions of the respective extension’s axial length, not its arc length.
- turbo_moc.geometry.passage_2d.metal_direction(angle)[source]#
Unit downstream tangent for a signed metal angle in degrees.
- turbo_moc.geometry.passage_2d.midline_flow_domain(blade, inlet_chords, outlet_chords, smooth)[source]#
Passage on the blade’s own midline, for staggers the camberline passage cannot contain.
At high exit angles the thin divergent blade runs nearly tangential and wanders off the straight MoC-axis reference by more than half a pitch. The rotor’s construction, a smooth reference through the blade’s slice midpoints with the metal angles at its ends, follows the blade instead, and the half-pitch periodics then run along the flow channels.
- turbo_moc.geometry.passage_2d.point_segment_distances(points, polyline)[source]#
Shortest distance and nearest point on polyline for every input point.
- turbo_moc.geometry.passage_2d.resample_curve(points, count)[source]#
Uniform arclength samples of a polyline.
- turbo_moc.geometry.passage_2d.validate_domain_shift(mode, shift)[source]#
Manual shift is a signed fraction of pitch; auto ignores its value.