FissionMunk documentation

Welcome to FissionMunk’s documentation! This is a docstring markdown documentationfor the project.

Module contents

class fissionmunk.ControlRod(length, width, position, movement_range, tag='E', material=MaterialType.BORON_CARBIDE)[source]

Bases: object

The class is used to create a control rod in the reactor space.

create_control_rod()[source]

The method is used to create the control rod.

Returns:

The body and shape of the control rod

Return type:

tuple

get_body()[source]

The method is used to get the body of the control rod.

Returns:

The body of the control rod

Return type:

pymunk.Body

get_length()[source]

The method is used to get the length of the control rod.

Returns:

The length of the control rod

Return type:

float

get_position()[source]

The method is used to get the position of the control rod.

Returns:

The position of the control rod

Return type:

tuple

get_reach_bottom()[source]

The method is used to get the reach bottom boolean of the control rod.

Returns:

The reach bottom boolean of the control rod

Return type:

bool

get_reach_top()[source]

The method is used to get the reach top boolean of the control rod.

Returns:

The reach top boolean of the control rod

Return type:

bool

get_shape()[source]

The method is used to get the shape of the control rod.

Returns:

The shape of the control rod

Return type:

pymunk.Shape

get_tag()[source]

The method is used to get the tag of the control rod.

Returns:

The tag of the control rod

Return type:

str

get_width()[source]

The method is used to get the width of the control rod.

Returns:

The width of the control rod

Return type:

float

move_control_rod(amount)[source]

The method is used to move the control rod.

Parameters:

amount (float) – The amount to move the control rod

Returns:

None

Return type:

None

set_position(position)[source]

The method is used to set the position of the control rod.

Parameters:

position (tuple) – The position of the control rod

Returns:

None

Return type:

None

set_tag(tag)[source]

The method is used to set the tag of the control rod.

Parameters:

tag (str) – The tag of the control rod

Returns:

None

Return type:

None

class fissionmunk.Core(length, width, neutron_speed=(40, 0), thermal_factor=50, cold_factor=10, fast_factor=100)[source]

Bases: object

The Core class is used to create the core of the reactor.

add_control_rod_to_core(control_rod)[source]

The method is used to add the control rod to the core.

Parameters:

control_rod (ControlRod) – The control rod object to be added to the core.

Returns:

None

Return type:

None

add_fuel_rod_to_core(fuel_rod)[source]

The method is used to add the fuel rod to the core.

Parameters:

fuel_rod (FuelRod) – The fuel rod object to be added to the core.

Returns:

None

Return type:

None

add_moderator_to_core(moderator)[source]

The method is used to add the moderator to the core.

Parameters:

moderator (Moderator) – The moderator object to be added to the core.

add_neutron_to_core(neutron)[source]

The method is used to add the neutron to the core.

Parameters:

neutron (Neutron) – The neutron object to be added to the core.

Returns:

None

Return type:

None

add_water_to_core(water)[source]

The method is used to add the water to the core.

Parameters:

water (Water) – The water object to be added to the core.

Returns:

None

Return type:

None

create_core_boundaries()[source]

The method is used to create the core boundaries.

Returns:

None

Return type:

None

get_cold_speed()[source]

This method is used to get the cold speed of the neutron.

Returns:

cold_speed

Return type:

tuple

get_control_rod_list()[source]

The method is used to get the list of control rod in the core.

Returns:

control_rod_list

Return type:

list

get_fast_speed()[source]

This method is used to get the fast speed of the neutron.

Returns:

fast_speed

Return type:

tuple

get_fuel_rod_list()[source]

The method is used to get the list of fuel rod in the core.

Returns:

fuel_rod_list

Return type:

list

get_moderator_list()[source]

The method is used to get the list of moderator in the core.

Returns:

moderator_list

Return type:

list

get_neutron_list()[source]

The method is used to get the list of neutron in the core.

Returns:

neutron_list

Return type:

list

get_space()[source]

The method is used to get the space of the core.

Returns:

space

Return type:

pymunk.Space

get_thermal_speed()[source]

This method is used to get the thermal speed of the neutron.

Returns:

thermal_speed

Return type:

tuple

get_water_list()[source]

The method is used to get the list of water in the core.

Returns:

water_list

Return type:

list

remove_control_rod_from_core(control_rod)[source]

The method is used to remove the control rod from the core.

Parameters:

control_rod (ControlRod) – The control rod object to be removed from the core.

Returns:

None

Return type:

None

remove_fuel_rod_from_core(fuel_rod)[source]

The method is used to remove the fuel rod from the core.

Parameters:

fuel_rod (FuelRod) – The fuel rod object to be removed from the core.

Returns:

None

Return type:

None

remove_moderator_from_core(moderator)[source]

The method is used to remove the moderator from the core.

Parameters:

moderator (Moderator) – The moderator object to be removed from the core.

Returns:

None

Return type:

None

remove_neutron_from_core(neutron)[source]

The method is used to remove the neutron from the core.

Parameters:

neutron (Neutron) – The neutron object to be removed from the core.

Returns:

None

Return type:

None

remove_water_from_core(water)[source]

The method is used to remove the water from the core.

Parameters:

water (Water) – The water object to be removed from the core.

Returns:

None

Return type:

None

set_cold_speed(speed)[source]

This method is used to set the cold speed of the neutron.

Parameters:

speed (tuple) – The speed of the neutron.

Returns:

None

Return type:

None

set_fast_speed(speed)[source]

This method is used to set the fast speed of the neutron.

Parameters:

speed (tuple) – The speed of the neutron.

Returns:

None

Return type:

None

set_thermal_speed(speed)[source]

This method is used to set the thermal speed of the neutron.

Parameters:

speed (tuple) – The speed of the neutron.

Returns:

None

Return type:

None

class fissionmunk.EventDispatcher[source]

Bases: object

The class is used to dispatch events to listeners.

add_listener(event_name, listener)[source]

The function is used to add a listener for a specific event.

Parameters:
  • event_name (str) – The name of the event.

  • listener (function) – The listener function to be added.

Returns:

None

Return type:

None

dispatch(event_name, *args, **kwargs)[source]

The function is used to dispatch an event to all listeners.

Parameters:
  • event_name (str) – The name of the event.

  • args (tuple) – The arguments to be passed to the listeners.

  • kwargs (dict) – The keyword arguments to be passed to the listeners.

Returns:

None

Return type:

None

remove_listener(event_name, listener)[source]

The function is used to remove a listener for a specific event.

Parameters:
  • event_name (str) – The name of the event.

  • listener (function) – The listener function to be removed.

Returns:

None

Return type:

None

class fissionmunk.Fuel(uranium_occurance_probability, xenon_occurance_probability, xenon_decay_probability, element_radius, width, position, fuel_element_gap=5)[source]

Bases: object

The class is used to create a fuel rod.

get_fuel_elements()[source]

The method is used to get the fuel elements list.

Returns:

fuel_elements

Return type:

list

get_length()[source]

The method is used to get the length of the fuel rod.

Returns:

length

Return type:

float

get_position()[source]

The method is used to get the position of the fuel rod.

Returns:

position

Return type:

tuple

get_radius()[source]

The method is used to get the radius of the fuel rod.

Returns:

radius

Return type:

int

get_width()[source]

The method is used to get the width of the fuel rod.

Returns:

width

Return type:

float

fissionmunk.Material

alias of MaterialType

class fissionmunk.Mechanics(core=None)[source]

Bases: object

The Mechanics class is responsible for handling the physics of the simulation.

generate_random_neutron(limit)[source]

The method to generate a random neutron

Parameters:

limit (float) – The limit for the probability

Returns:

The neutron object if successful, False otherwise

Return type:

Neutron

neutron_boundary_collision(arbiter, space, data)[source]

The method to handle neutron-boundary collision

Parameters:
  • arbiter (Arbiter) – arbiter object

  • space (Space) – space object

  • data (Data) – data object

Returns:

True if successful, False otherwise

Return type:

bool

neutron_control_rod_collision(arbiter, space, data)[source]

The method to handle neutron-control rod collision

Parameters:
  • arbiter (Arbiter) – arbiter object

  • space (Space) – space object

  • data (Data) – data object

Returns:

True if successful, False otherwise

Return type:

bool

neutron_fuel_element_collision(arbiter, space, data)[source]

The method to handle neutron-fuel element collision

Parameters:
  • arbiter (Arbiter) – arbiter object

  • space (Space) – space object

  • data (Data) – data object

Returns:

True if successful, False otherwise

Return type:

bool

neutron_moderator_collision(arbiter, space, data)[source]

The method to handle neutron-moderator collision

Parameters:
  • arbiter (Arbiter) – arbiter object

  • space (Space) – space object

  • data (Data) – data object

Returns:

True if successful, False otherwise

Return type:

bool

neutron_water_collision_add(arbiter, space, data)[source]

The method to handle neutron-water collision

Parameters:
  • arbiter (Arbiter) – arbiter object

  • space (Space) – space object

  • data (Data) – data object

Returns:

True if successful, False otherwise

Return type:

bool

neutron_water_collision_remove(arbiter, space, data)[source]

The method to handle neutron-water collision

Parameters:
  • arbiter (Arbiter) – arbiter object

  • space (Space) – space object

  • data (Data) – data object

Returns:

True if successful, False otherwise

Return type:

bool

neutron_xenon_collision(arbiter, space, data)[source]

The method to handle neutron-xenon collision

Parameters:
  • arbiter (Arbiter) – arbiter object

  • space (Space) – space object

  • data (Data) – data object

Returns:

True if successful, False otherwise

Return type:

bool

regulate_fuel_element_occurence()[source]

The method to regulate the fuel element occurence

Returns:

None

Return type:

None

regulate_water_temperature()[source]

The method to regulate the water temperature

Returns:

None

Return type:

None

class fissionmunk.Moderator(length, width, position, material=MaterialType.WATER)[source]

Bases: object

The Moderator class represents a moderator in the simulation.

create_moderator()[source]

The create_moderator method creates the moderator body and shape.

Returns:

The moderator body and shape.

Return type:

tuple

get_body()[source]

The get_body method returns the body of the moderator.

Returns:

The body of the moderator.

Return type:

pymunk.Body

get_length()[source]

The get_length method returns the length of the moderator.

Returns:

The length of the moderator.

Return type:

float

get_material()[source]

The get_material method returns the material of the moderator.

Returns:

The material of the moderator.

Return type:

MaterialType

get_position()[source]

The get_position method returns the position of the moderator.

Returns:

The position of the moderator.

Return type:

tuple

get_shape()[source]

The get_shape method returns the shape of the moderator.

Returns:

The shape of the moderator.

Return type:

pymunk.Shape

get_width()[source]

The get_width method returns the width of the moderator.

Returns:

The width of the moderator.

Return type:

float

set_position(position)[source]

The set_position method sets the position of the moderator.

Parameters:

position (tuple) – The position of the moderator.

Returns:

None

Return type:

None

class fissionmunk.Neutron(speed, position, mass=0.1, radius=1)[source]

Bases: object

This class represents a neutron in the simulation.

body_to_neutron = {}
create_neutron()[source]

This method creates a neutron object.

Returns:

The body and shape of the neutron.

Return type:

tuple

get_body()[source]

This method returns the body of the neutron.

Returns:

The body of the neutron.

Return type:

pymunk.Body

get_mass()[source]

This method returns the mass of the neutron.

Returns:

The mass of the neutron.

Return type:

float

get_position()[source]

This method returns the position of the neutron.

Returns:

The position of the neutron.

Return type:

tuple

get_radius()[source]

This method returns the radius of the neutron.

Returns:

The radius of the neutron.

Return type:

int

get_shape()[source]

This method returns the shape of the neutron.

Returns:

The shape of the neutron.

Return type:

pymunk.Shape

get_speed()[source]

This method returns the speed of the neutron.

Returns:

The speed of the neutron.

Return type:

tuple

initialize_moment_inertia()[source]

This method initializes the moment of inertia of the neutron.

Returns:

The moment of inertia of the neutron.

Return type:

float

remove_neutron()[source]

This method removes the neutron from the simulation.

Returns:

True if the neutron is removed, False otherwise.

Return type:

bool

set_position(position)[source]

This method sets the position of the neutron.

Parameters:

position (tuple) – The position of the neutron.

Returns:

None

Return type:

None

set_speed(speed)[source]

This method sets the speed of the neutron.

Parameters:

speed (tuple) – The speed of the neutron.

Returns:

None

Return type:

None

class fissionmunk.Water(length, width, position, coolant=True, hard_limit=30, temperature_threshold=100, material=MaterialType.WATER)[source]

Bases: object

This class represents water in the simulation.

body_to_water = {}
change_collision_type(collision_type=11)[source]

This method changes the collision type of the water.

Parameters:

collision_type (int, optional) – The collision type of the water, defaults to 11

Returns:

None

Return type:

None

change_temperature(amount)[source]

This method changes the temperature of the water.

Parameters:

amount (int) – The amount to change the temperature of the water.

create_water()[source]

This method creates the water.

Returns:

The body and shape of the water.

Return type:

tuple

decrease_number_of_neutrons_interacting(amount=1)[source]
get_body()[source]

This method returns the body of the water.

Returns:

The body of the water.

Return type:

pymunk.Body

get_collision_type()[source]

This method returns the collision type of the water.

Returns:

The collision type of the water.

Return type:

int

get_number_of_neutrons_interacting()[source]
get_position()[source]

This method returns the position of the water.

Returns:

The position of the water.

Return type:

tuple

get_shape()[source]

This method returns the shape of the water.

Returns:

The shape of the water.

Return type:

pymunk.Poly

get_temperature()[source]

This method returns the temperature of the water.

Returns:

The temperature of the water.

Return type:

int

increase_number_of_neutrons_interacting(amount=1)[source]
recreate_water()[source]

This method recreates the water in the simulation.

Returns:

None

Return type:

None

remove_water()[source]

This method removes the water from the simulation.

Returns:

None

Return type:

None

turn_off_coolant()[source]

This method turns off the coolant of the water.

Returns:

None

Return type:

None

turn_on_coolant()[source]

This method turns on the coolant of the water.

Returns:

None

Return type:

None

fissionmunk.get_probability()[source]

The function is used to generate a random number between 0 and 1.

Returns:

A random number between 0 and 1.

Return type:

float