models.grain.geometries¶
Concrete grain segment geometries, both analytical and FMM-based.
2D (constant cross-section):
BatesSegment— Cylindrical grain with an axial core, the most common amateur geometry (analytical).RodAndTubeGrainSegment— Central rod surrounded by an outer tube (FMM-based).MultiPortGrainSegment— Multiple circular ports arranged radially in the cross-section (FMM-based).StarGrainSegment— Star-shaped port with configurable point count, length, and width (FMM-based).DGrainSegment— D-shaped slot port (FMM-based).WagonWheelGrainSegment— Multi-spoke geometry with a central core and radial ports (FMM-based).
3D (varying cross-section):
ConicalGrainSegment— Linearly tapered core from upper to lower diameter.FinocylGrainSegment— Central circular bore with radial fins over a partial axial section (FMM-based).
All segments implement the GrainSegment interface and can be mixed within a single Grain.
machwave.models.grain.geometries
¶
BatesSegment
¶
Bases: GrainSegment2D
BATES grain segment: cylindrical with circular central port.
Source code in machwave/models/grain/geometries/bates.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 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 139 140 141 142 143 144 145 146 147 148 149 150 | |
__init__(outer_diameter, core_diameter, length, density_ratio=1.0)
¶
Initialize a BATES grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outer_diameter
|
float
|
Outer diameter [m]. |
required |
core_diameter
|
float
|
Core (port) diameter [m]. |
required |
length
|
float
|
Segment length [m]. |
required |
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/bates.py
get_center_of_gravity(web_distance=0.0)
¶
Return the center of gravity of a BATES 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 [m]. Unused for BATES due to symmetry; included for API consistency. |
0.0
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
Center of gravity as |
NDArray[float64]
|
closest to nozzle). Always returns [length/2, 0, 0] for symmetric |
NDArray[float64]
|
BATES grains. |
Source code in machwave/models/grain/geometries/bates.py
get_core_area(web_distance)
¶
Return the core (inner cylindrical) surface area [m^2].
Source code in machwave/models/grain/geometries/bates.py
get_core_diameter(web_distance)
¶
get_face_area(web_distance)
¶
Return the annular face area at a given web distance [m^2].
Source code in machwave/models/grain/geometries/bates.py
get_moment_of_inertia(ideal_density, web_distance=0.0)
¶
Return the moment of inertia tensor of the BATES segment.
Treats the segment as a hollow cylinder and evaluates the tensor 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()
¶
Return the optimal length for neutral burn of a BATES segment [mm].
See: https://www.nakka-rocketry.net/th_grain.html.
Source code in machwave/models/grain/geometries/bates.py
get_port_area(web_distance)
¶
Return the port area at a given web distance [m^2].
get_web_thickness()
¶
Return the BATES web thickness [m].
See: https://www.nakka-rocketry.net/design1.html.
validate()
¶
Validate BATES segment geometry.
Source code in machwave/models/grain/geometries/bates.py
ConicalGrainSegment
¶
Bases: FMMGrainSegment3D
Grain segment with a conical port tapering between two diameters.
Source code in machwave/models/grain/geometries/conical.py
__init__(length, outer_diameter, upper_core_diameter, lower_core_diameter, inhibited_surfaces=None, grid_resolution=grain_fmm.DEFAULT_GRID_RESOLUTION, density_ratio=1.0)
¶
Initialize a conical grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Segment length [m]. |
required |
outer_diameter
|
float
|
Outer diameter [m]. |
required |
upper_core_diameter
|
float
|
Core diameter at the upper (bulkhead) end [m]. |
required |
lower_core_diameter
|
float
|
Core diameter at the lower (nozzle) end [m]. |
required |
inhibited_surfaces
|
InhibitedSurfaces | None
|
Surfaces inhibited from burning. |
None
|
grid_resolution
|
int
|
Grid points per axis of the cross-section. |
DEFAULT_GRID_RESOLUTION
|
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/conical.py
generate_initial_face_map()
¶
Return the initial face map for the conical port.
Source code in machwave/models/grain/geometries/conical.py
validate()
¶
Validate conical segment geometry.
Source code in machwave/models/grain/geometries/conical.py
DGrainSegment
¶
Bases: FMMGrainSegment2D
D-shaped grain segment with a single offset planar slot.
Source code in machwave/models/grain/geometries/d_grain.py
__init__(length, outer_diameter, slot_offset, inhibited_surfaces=None, grid_resolution=grain_fmm.DEFAULT_GRID_RESOLUTION, density_ratio=1.0)
¶
Initialize a D-grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Segment length [m]. |
required |
outer_diameter
|
float
|
Outer diameter [m]. |
required |
slot_offset
|
float
|
Distance from the grain center to the slot face [m]. |
required |
inhibited_surfaces
|
InhibitedSurfaces | None
|
Surfaces inhibited from burning. |
None
|
grid_resolution
|
int
|
Grid points per axis of the cross-section. |
DEFAULT_GRID_RESOLUTION
|
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/d_grain.py
generate_initial_face_map()
¶
Return the initial face map for the D-grain port.
Source code in machwave/models/grain/geometries/d_grain.py
validate()
¶
Validate D-grain segment geometry.
Source code in machwave/models/grain/geometries/d_grain.py
FinocylGrainSegment
¶
Bases: FMMGrainSegment3D
Grain segment with a central bore and radial fins over a partial axial section.
Source code in machwave/models/grain/geometries/finocyl.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 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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
__init__(length, outer_diameter, core_diameter, number_of_fins, fin_length, fin_width, finned_length, fin_axial_offset=0.0, transition_length=0.0, inhibited_surfaces=None, grid_resolution=grain_fmm.DEFAULT_GRID_RESOLUTION, density_ratio=1.0)
¶
Initialize a finocyl grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Segment length [m]. |
required |
outer_diameter
|
float
|
Outer diameter [m]. |
required |
core_diameter
|
float
|
Central bore diameter [m]. |
required |
number_of_fins
|
int
|
Number of evenly spaced radial fins. |
required |
fin_length
|
float
|
Radial penetration of each fin, measured from the bore edge. |
required |
fin_width
|
float
|
Tangential thickness of each fin slot [m]. |
required |
finned_length
|
float
|
Axial extent of the finned section [m]. |
required |
fin_axial_offset
|
float
|
Axial position where the finned section begins, measured from the aft (nozzle) end [m]. |
0.0
|
transition_length
|
float
|
Axial length over which the fins taper linearly in depth between full depth and the surrounding cylindrical bore, applied at each interface between the finned and cylindrical sections. A value of 0.0 gives an abrupt step [m]. |
0.0
|
inhibited_surfaces
|
InhibitedSurfaces | None
|
Surfaces inhibited from burning. |
None
|
grid_resolution
|
int
|
Grid points per axis of the cross-section. |
DEFAULT_GRID_RESOLUTION
|
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/finocyl.py
generate_initial_face_map()
¶
Return the initial face map for the finocyl port.
Source code in machwave/models/grain/geometries/finocyl.py
validate()
¶
Validate finocyl segment geometry.
Source code in machwave/models/grain/geometries/finocyl.py
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 139 140 141 142 143 144 145 146 147 148 | |
MultiPortGrainSegment
¶
Bases: FMMGrainSegment2D
Grain segment with multiple circular ports arranged radially.
Source code in machwave/models/grain/geometries/multi_port.py
__init__(length, outer_diameter, port_diameter, port_radial_count, port_level_count, inhibited_surfaces=None, grid_resolution=grain_fmm.DEFAULT_GRID_RESOLUTION, density_ratio=1.0)
¶
Initialize a multi-port grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Segment length [m]. |
required |
outer_diameter
|
float
|
Outer diameter [m]. |
required |
port_diameter
|
float
|
Diameter of each port [m]. |
required |
port_radial_count
|
float
|
Number of ports per concentric ring. |
required |
port_level_count
|
float
|
Number of concentric rings of ports. |
required |
inhibited_surfaces
|
InhibitedSurfaces | None
|
Surfaces inhibited from burning. |
None
|
grid_resolution
|
int
|
Grid points per axis of the cross-section. |
DEFAULT_GRID_RESOLUTION
|
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/multi_port.py
generate_initial_face_map()
¶
NOTE: Still needs to correctly implement wagon wheel ports.
Source code in machwave/models/grain/geometries/multi_port.py
validate()
¶
Validate multi-port segment geometry.
Source code in machwave/models/grain/geometries/multi_port.py
RodAndTubeGrainSegment
¶
Bases: FMMGrainSegment2D
Rod-and-tube grain segment: central rod inside a concentric tube.
Source code in machwave/models/grain/geometries/rod_and_tube.py
__init__(length, outer_diameter, rod_outer_diameter, tube_inner_diameter, inhibited_surfaces=None, grid_resolution=grain_fmm.DEFAULT_GRID_RESOLUTION, density_ratio=1.0)
¶
Initialize a rod-and-tube grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Segment length [m]. |
required |
outer_diameter
|
float
|
Outer (tube outer) diameter [m]. |
required |
rod_outer_diameter
|
float
|
Central rod outer diameter [m]. |
required |
tube_inner_diameter
|
float
|
Tube inner diameter [m]. |
required |
inhibited_surfaces
|
InhibitedSurfaces | None
|
Surfaces inhibited from burning. |
None
|
grid_resolution
|
int
|
Grid points per axis of the cross-section. |
DEFAULT_GRID_RESOLUTION
|
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/rod_and_tube.py
generate_initial_face_map()
¶
NOTE: Still needs to correctly implement wagon wheel ports.
Source code in machwave/models/grain/geometries/rod_and_tube.py
validate()
¶
Validate rod-and-tube segment geometry.
Source code in machwave/models/grain/geometries/rod_and_tube.py
StarGrainSegment
¶
Bases: FMMGrainSegment2D
Star grain segment with a radial point pattern as the port.
Source code in machwave/models/grain/geometries/star.py
__init__(length, outer_diameter, number_of_points, point_length, point_width, inhibited_surfaces=None, grid_resolution=grain_fmm.DEFAULT_GRID_RESOLUTION, density_ratio=1.0)
¶
Initialize a star grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Segment length [m]. |
required |
outer_diameter
|
float
|
Outer diameter [m]. |
required |
number_of_points
|
int
|
Number of star points (must be < 12). |
required |
point_length
|
float
|
Radial length of each point [m]. |
required |
point_width
|
float
|
Width of each point at the base [m]. |
required |
inhibited_surfaces
|
InhibitedSurfaces | None
|
Surfaces inhibited from burning. |
None
|
grid_resolution
|
int
|
Grid points per axis of the cross-section. |
DEFAULT_GRID_RESOLUTION
|
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/star.py
generate_initial_face_map()
¶
Return the initial face map for a star grain segment.
Source code in machwave/models/grain/geometries/star.py
validate()
¶
Validate star segment geometry.
Source code in machwave/models/grain/geometries/star.py
WagonWheelGrainSegment
¶
Bases: FMMGrainSegment2D
Wagon-wheel grain segment with a central core and radial spoke ports.
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
__init__(length, outer_diameter, core_diameter, number_of_ports, port_inner_diameter, port_outer_diameter, port_angular_width, inhibited_surfaces=None, grid_resolution=grain_fmm.DEFAULT_GRID_RESOLUTION, density_ratio=1.0)
¶
Initialize a wagon-wheel grain segment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
length
|
float
|
Segment length [m]. |
required |
outer_diameter
|
float
|
Outer diameter [m]. |
required |
core_diameter
|
float
|
Central core diameter [m]. |
required |
number_of_ports
|
int
|
Number of radial spoke ports (must be even). |
required |
port_inner_diameter
|
float
|
Inner radial extent of each spoke port [m]. |
required |
port_outer_diameter
|
float
|
Outer radial extent of each spoke port [m]. |
required |
port_angular_width
|
float
|
Angular width of each spoke port [deg]. |
required |
inhibited_surfaces
|
InhibitedSurfaces | None
|
Surfaces inhibited from burning. |
None
|
grid_resolution
|
int
|
Grid points per axis of the cross-section. |
DEFAULT_GRID_RESOLUTION
|
density_ratio
|
float
|
Ratio of real to ideal propellant density. |
1.0
|
Source code in machwave/models/grain/geometries/wagon_wheel.py
generate_initial_face_map()
¶
NOTE: Still needs to correctly implement wagon wheel ports.
Source code in machwave/models/grain/geometries/wagon_wheel.py
validate()
¶
Validate wagon-wheel segment geometry.