Skip to content

MNT: EmptyMotor class inherits from Motor(ABC) #530

@Gui-FernandesBR

Description

@Gui-FernandesBR

Is your feature request related to a problem? Please describe.

The current EmptyMotor class is a hardcoded class which comes with a large TODO in its docstring.
This approach is complicated because the new additions to the Motor class will not automatically be applied to the EmptyMotor class.

Describe the solution you'd like

  • Define EmptyMotor using EmptyMotor(Motor) inheritance.

Additional context

Here is a code suggestion:

class EmptyMotor(Motor):
    """..."""

    def __init__(self):
        super().__init__(
            thrust_source=Function(0),
            dry_mass=1e-32,
            dry_inertia=(0, 0, 0),
            nozzle_radius=0,
            center_of_dry_mass_position=0,
            nozzle_position=0,
            burn_time=(0, 1),
            reshape_thrust_curve=False,
            interpolation_method="linear",
            coordinate_system_orientation="nozzle_to_combustion_chamber",
        )

    def all_info(self):
        return None

    @cached_property
    def center_of_propellant_mass(self):
        return Function(0)

    @cached_property
    def exhaust_velocity(self):
        return Function(0)

    @cached_property
    def propellant_I_11(self):
        return Function(0)

    @cached_property
    def propellant_I_12(self):
        return Function(0)

    @cached_property
    def propellant_I_13(self):
        return Function(0)

    @cached_property
    def propellant_I_22(self):
        return Function(0)

    @cached_property
    def propellant_I_23(self):
        return Function(0)

    @cached_property
    def propellant_I_33(self):
        return Function(0)

    @cached_property
    def propellant_initial_mass(self):
        return Function(0)

Metadata

Metadata

Labels

Type

Projects

Status

Closed

Relationships

None yet

Development

No branches or pull requests

Issue actions