MaterialDefinition
This class is an abstract representation of the target material of a collision.
It is used, for example, in defining the geometry of Monte Carlo simulations.
Materials are treated as ideal gases in goupil, meaning they are mixtures
of non-interacting atoms. Therefore, a material is fully defined by its atomic
composition.
Constructor
- class MaterialDefinition(name, mass_composition=None, mole_composition=None)
Basic materials can be defined by their chemical formula, for example
>>> goupil.MaterialDefinition("H2O") H2O
More sophisticated constructions are possible by explicitly defining the mass or mole composition as a sequence of weighted AtomicElement (or their corresponding
strsymbols), e.g>>> goupil.MaterialDefinition( ... name = "Water", ... mole_composition = ((2, "H"), (1, "O")) ... ) ... Water
Composites, which are mixtures of different materials, may also be defined as
>>> goupil.MaterialDefinition( ... name = "WetSand", ... mass_composition = ((0.7, "SiO2"), (0.3, "H2O")) ... ) ... WetSand
Note
When explicitly defining the mass or mole composition of the material, it is also necessary to specify a name.
Attributes
- MaterialDefinition.mass: float
The molar mass of the substance, expressed in grams per mole. For compounds, it is the sum of the molar masses of its constituent parts, and for mixtures, it is the average molar mass of its constituent parts. For instance
>>> H2O.mass 18.0167
- MaterialDefinition.mass_composition: tuple[float, AtomicElement]
The composition of the material in terms of mass, represented as a tuple of AtomicElement with corresponding mass fractions.
- MaterialDefinition.mole_composition: tuple[float, AtomicElement]
The material’s atomic composition, represented as a tuple of AtomicElement with corresponding mole fractions.
- MaterialDefinition.name: str
A name that identifies the material and is used to index it in a MaterialRegistry.
Methods
- MaterialDefinition.electrons() ElectronicStructure
Calculates the electronic structure based on the atomic composition of the material.