models.grain.geometries¶
Concrete grain segment geometries, both analytical and FMM-based.
2D (constant cross-section):
BatesSegment— Standard cylindrical grain with axial core (the most common hobby/amateur geometry).TubularSegment— Thin-walled tube, burns from inner and/or outer surfaces.RodAndTubeSegment— Central rod surrounded by an outer tubular section.MultiPortGrainSegment— Multiple circular ports arranged radially in the cross-section.StarGrainSegment— Star-shaped port (FMM-based). Configurable point count, length, and width.DGrainSegment— D-shaped slot port (FMM-based).
3D (varying cross-section):
ConicalGrainSegment— Linearly tapered core from upper to lower diameter.WagonWheelSegment— Complex multi-spoke geometry (FMM-based).
All segments implement the GrainSegment interface and can be mixed within a single Grain.
machwave.models.grain.geometries
¶
BatesSegment
¶
Bases: GrainSegment2D
Source code in machwave/models/grain/geometries/bates.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
get_center_of_gravity(web_distance=0.0)
¶
Calculate the center of gravity of the BATES grain segment.
BATES is a symmetrical 2D geometry that burns radially. Due to its cylindrical symmetry, the center of gravity remains constant at the geometric center regardless of web distance burned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
web_distance
|
float
|
Web distance traveled (unused for BATES due to symmetry), in meters. Included for API consistency. |
0.0
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Center of gravity in 3D space [x, y, z], in meters, measured from |
NDArray[float64]
|
the aft end (port, closest to nozzle). Always returns [length/2, 0, 0] |
NDArray[float64]
|
for symmetric BATES grains. |
Source code in machwave/models/grain/geometries/bates.py
get_moment_of_inertia(ideal_density, web_distance=0.0)
¶
Calculate the moment of inertia tensor of the BATES grain segment (hollow cylinder) at its center of gravity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ideal_density
|
float
|
Propellant ideal density [kg/m^3]. |
required |
web_distance
|
float
|
Web distance traveled [m]. |
0.0
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
A 3x3 inertia tensor [kg-m^2]. |
Source code in machwave/models/grain/geometries/bates.py
get_optimal_length()
¶
Returns the optimal length for BATES segment. More details on the calculation: https://www.nakka-rocketry.net/th_grain.html
:return: Optimal length for neutral burn of BATES segment :rtype: float
Source code in machwave/models/grain/geometries/bates.py
get_web_thickness()
¶
More details on the web thickness of BATES grains can be found in: https://www.nakka-rocketry.net/design1.html
MultiPortGrainSegment
¶
Bases: FMMGrainSegment2D
Source code in machwave/models/grain/geometries/multi_port.py
get_initial_face_map()
¶
NOTE: Still needs to correctly implement wagon wheel ports.
Source code in machwave/models/grain/geometries/multi_port.py
RodAndTubeGrainSegment
¶
Bases: FMMGrainSegment2D
Source code in machwave/models/grain/geometries/rod_and_tube.py
get_initial_face_map()
¶
NOTE: Still needs to correctly implement wagon wheel ports.
Source code in machwave/models/grain/geometries/rod_and_tube.py
StarGrainSegment
¶
Bases: FMMGrainSegment2D
Source code in machwave/models/grain/geometries/star.py
get_initial_face_map()
¶
This method returns the initial face map for a star grain segment.
References: openMotor, https://github.com/reilleya/openMotor
Source code in machwave/models/grain/geometries/star.py
WagonWheelGrainSegment
¶
Bases: FMMGrainSegment2D
Source code in machwave/models/grain/geometries/wagon_wheel.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
get_initial_face_map()
¶
NOTE: Still needs to correctly implement wagon wheel ports.