blocks.Assembly()

class feign.blocks.Assembly(N, M)

A class used to represent a rectangular Assembly.

Parameters
  • N (int) – number of positions in y direction

  • M (int) – number of positions in x direction

N

number of positions in y direction

Type

int

M

number of positions in x direction

Type

int

pitch

pitch size of the lattice in cm

Type

float

pins

pins in the assembly

Type

Pins()

fuelmap

fuelmap to describe which pins are filled in the positions

Type

2D array

coolant

Material._id of the coolant (ie. materal filled between pins)

Type

str

pool

pool in which the assembly is placed. Within the pool coolant material is filled, outside the pool surrounding material is filled.

Type

Rectangle() (optional)

surrounding

Material._id of the surrounding material (ie. material filled around pool)

Type

str (mandatory if pool is present)

source

Material._id identifiers of material emitting gamma particles

Type

list of str

add_pin(*argv)

The function to add Pin objects to an Assembly, which may have already included pins. If one wants to rewrite the existing pins, then the Assembly.set_pins() has to be called.

Parameters

*argv (Pin() or more Pin() objects) – Pin() objects to be added in the Assembly

Examples

>>> fuel=Pin('1')
>>> guide=Pin('2')
>>> assembly=Assembly(2,2)
>>> assembly.set_pins()
>>> assembly.pins
{}
>>> assembly.add_pin(fuel)
>>> assembly.add_pin(guide)
>>> assembly.pins
{'1': Pin(pinID=1), '2': Pin(pinID=2)}
Raises
  • TypeError – if the parameter is not Pin()

  • ValueError – if the Pin is already included

checkComplete()

The function to check whether everything is defined correctly in an Assembly() object. Prints messages indicating any problem.

  • checks whether any attribute is not defined (pool does not need to be defined)

  • checks whether any pin contains any region with radius greater than the pitch

  • checks whether all the pins in the fuelmap are attributed to the assembly

  • in case a pool is defined, it is checked whether the pool is around the assembly.

Returns

True if everything is correct and complete, False otherwise

Return type

bool

remove_pin(*argv)

The function to remove Pin objects from an Assembly which already has previously included pins.

Parameters

*argv (Pin() or more Pin() objects) – Pin() objects to be added in the Assembly

Examples

>>> fuel=Pin('1')
>>> guide=Pin('2')
>>> assembly=Assembly(2,2)
>>> assembly.set_pins(fuel,guide)
>>> assembly.pins
{'1': Pin(pinID=1), '2': Pin(pinID=2)}
>>> assembly.remove_pin(guide)
>>> assembly.pins
{'1': Pin(pinID=1)}
>>> assembly.remove_pin(guide)
ID 2 is not in dict yet
Raises
  • TypeError – if the parameter is not Pin()

  • ValueError – if the Pin is already included

  • TypeError – if pins is None.

set_coolant(coolant=None)

The function to set the coolant material in the Assembly

Parameters

coolant (Material()) – the coolant material

set_fuelmap(fuelmap=None)

The function to set the fuelmap of the Assembly

Parameters

fuelmap (2D array (NxM shape)) – fuelmap of the lattice

Example

>>> fuel=Pin('1')
>>> fuel.add_region(uo2,0.5)
>>> fuel.add_region(he,0.51)
>>> fuel.add_region(zr,0.61)
>>> fuelmap=[['1','1'],
             ['1','1']]
>>> assy=Assembly(2,2)
>>> assy.set_fuelmap(fuelmap)
set_pins(*argv)

The function to include Pin objects in an Assembly

Parameters

*argv (Pin() or more Pin() objects) – Pin() objects to be included in the Assembly

Examples

>>> fuel=Pin('1')
>>> guide=Pin('2')
>>> assembly=Assembly(2,2)
>>> assembly.pins
>>> assembly.set_pins(fuel,guide)
>>> assembly.pins
{'1': Pin(pinID=1), '2': Pin(pinID=2)}
Raises
  • TypeError – if the parameter is not Pin()

  • ValueError – if the Pin is already included

set_pitch(pitch=None)

The function to set the pitch of the lattice of Assembly

Parameters

pitch (float) – pitch of lattice in cm

set_pool(pool=None)

The function to set the pool around the Assembly

Parameters

pool (Rectangle()) – the shape of the pool

set_source(*args)

The function to set the source material(s) in the Assembly

Parameters

*args (Material() instances) – the source material(s)

set_surrounding(surrounding=None)

The function to set the surrounding material around the Assembly

Parameters

surrounding (Material()) – the surrounding material