Skip to content

Representation

Particula Index / Particula / Particles / Representation

Auto-generated documentation for particula.particles.representation module.

ParticleRepresentation

Show source in representation.py:22

Everything needed to represent a particle or a collection of particles.

Represents a particle or a collection of particles, encapsulating the strategy for calculating mass, radius, and total mass based on a specified particle distribution, density, and concentration. This class allows for flexibility in representing particles.

Attributes

  • strategy : The computation strategy for particle representations.
  • activity : The activity strategy for the partial pressure calculations.
  • surface : The surface strategy for surface tension and Kelvin effect.
  • distribution : The distribution data for the particles, which could represent sizes, masses, or another relevant metric.
  • density : The density of the material from which the particles are made.
  • concentration : The concentration of particles within the distribution.
  • charge : The charge on each particle.
  • volume : The air volume for simulation of particles in the air, default is 1 m^3. This is only used in ParticleResolved Strategies.

Methods

  • get_strategy : Return the distribution strategy (optionally cloned).
  • get_strategy_name : Return the name of the distribution strategy.
  • get_activity : Return the activity strategy (optionally cloned).
  • get_activity_name : Return the name of the activity strategy.
  • get_surface : Return the surface strategy (optionally cloned).
  • get_surface_name : Return the name of the surface strategy.
  • get_distribution : Return the distribution array (optionally cloned).
  • get_density : Return the density array (optionally cloned).
  • get_concentration : Return the concentration array (optionally cloned).
  • get_total_concentration : Return the total concentration (1/m^3).
  • get_charge : Return the per-particle charge (optionally cloned).
  • get_volume : Return the representation volume in m^3 (optionally cloned).
  • get_species_mass : Return the mass per species, in kg.
  • get_mass : Return the array of total particle masses, in kg.
  • get_mass_concentration : Return the total mass concentration in kg/m^3.
  • get_radius : Return the array of particle radii in meters.
  • add_mass : Add mass to the distribution in each bin.
  • add_concentration : Add concentration to the distribution in each bin.
  • collide_pairs : Collide pairs of indices (ParticleResolved strategies).

Signature

class ParticleRepresentation:
    def __init__(
        self,
        strategy: DistributionStrategy,
        activity: ActivityStrategy,
        surface: SurfaceStrategy,
        distribution: NDArray[np.float64],
        density: NDArray[np.float64],
        concentration: NDArray[np.float64],
        charge: NDArray[np.float64],
        volume: float = 1,
    ): ...

See also

ParticleRepresentation().str

Show source in representation.py:87

Returns a string representation of the particle representation.

Returns

  • A string representation of the particle representation.

Examples

Get String Representation
str_rep = str(particle_representation)
print(str_rep)

Signature

def __str__(self) -> str: ...

ParticleRepresentation().add_concentration

Show source in representation.py:455

Add concentration to the particle distribution.

Arguments

  • added_concentration : The concentration to be added per bin (1/m^3).
  • added_distribution : Optional distribution array to merge into the existing distribution. If None, the current distribution is reused.

Examples

Add Concentration
particle_representation.add_concentration(added_concentration)

Signature

def add_concentration(
    self,
    added_concentration: NDArray[np.float64],
    added_distribution: Optional[NDArray[np.float64]] = None,
) -> None: ...

ParticleRepresentation().add_mass

Show source in representation.py:436

Add mass to the particle distribution and update parameters.

Arguments

  • added_mass : The mass to be added per distribution bin, in kg.

Examples

Add Mass
particle_representation.add_mass(added_mass)

Signature

def add_mass(self, added_mass: NDArray[np.float64]) -> None: ...

ParticleRepresentation().collide_pairs

Show source in representation.py:490

Collide pairs of particles, used for ParticleResolved Strategies.

Arguments

  • indices : The indices of the particles to collide.

Examples

Collide Pairs
particle_representation.collide_pairs(indices)

Signature

def collide_pairs(self, indices: NDArray[np.int64]) -> None: ...

ParticleRepresentation().get_activity

Show source in representation.py:145

Return the activity strategy used for partial pressure calculations.

Arguments

  • clone : If True, then return a deepcopy of the activity strategy.

Returns

  • The activity strategy used for partial pressure calculations.

Examples

Get Activity Strategy
activity = particle_representation.get_activity()

Signature

def get_activity(self, clone: bool = False) -> ActivityStrategy: ...

See also

ParticleRepresentation().get_activity_name

Show source in representation.py:165

Return the name of the activity strategy used for partial pressure calculations.

Returns

  • The name of the activity strategy used for partial pressure calculations.

Examples

Get Activity Strategy Name
activity_name = particle_representation.get_activity_name()
print(activity_name)

Signature

def get_activity_name(self) -> str: ...

ParticleRepresentation().get_charge

Show source in representation.py:299

Return the charge per particle.

Arguments

  • clone : If True, then return a copy of the charge array.

Returns

  • The charge of the particles (dimensionless).

Examples

Get Charge Array
charge = particle_representation.get_charge()

Signature

def get_charge(self, clone: bool = False) -> NDArray[np.float64]: ...

ParticleRepresentation().get_concentration

Show source in representation.py:257

Return the volume concentration of the particles.

For ParticleResolved Strategies, this is the number of particles per self.volume. Otherwise, it's per 1/m^3.

Arguments

  • clone : If True, then return a copy of the concentration array.

Returns

  • The concentration of the particles in 1/m^3.

Examples

Get Concentration Array
concentration = particle_representation.get_concentration()

Signature

def get_concentration(self, clone: bool = False) -> NDArray[np.float64]: ...

ParticleRepresentation().get_density

Show source in representation.py:238

Return the density of the particles.

Arguments

  • clone : If True, then return a copy of the density array.

Returns

  • The density of the particles.

Examples

Get Density Array
density = particle_representation.get_density()

Signature

def get_density(self, clone: bool = False) -> NDArray[np.float64]: ...

ParticleRepresentation().get_distribution

Show source in representation.py:219

Return the distribution of the particles.

Arguments

  • clone : If True, then return a copy of the distribution array.

Returns

  • The distribution of the particles.

Examples

Get Distribution Array
distribution = particle_representation.get_distribution()

Signature

def get_distribution(self, clone: bool = False) -> NDArray[np.float64]: ...

ParticleRepresentation().get_mass

Show source in representation.py:358

Return the mass of the particles as calculated by the strategy.

Arguments

  • clone : If True, then return a copy of the mass array.

Returns

  • The mass of the particles in kg.

Examples

Get Mass
mass = particle_representation.get_mass()

Signature

def get_mass(self, clone: bool = False) -> NDArray[np.float64]: ...

ParticleRepresentation().get_mass_concentration

Show source in representation.py:379

Return the total mass per volume of the simulated particles.

The mass concentration is calculated from the distribution and concentration arrays.

Arguments

  • clone : If True, then return a copy of the mass concentration value.

Returns

  • The mass concentration in kg/m^3.

Examples

Get Mass Concentration
mass_concentration = (
    particle_representation.get_mass_concentration()
)
print(mass_concentration)

Signature

def get_mass_concentration(self, clone: bool = False) -> np.float64: ...

ParticleRepresentation().get_radius

Show source in representation.py:415

Return the radius of the particles as calculated by the strategy.

Arguments

  • clone : If True, then return a copy of the radius array.

Returns

  • The radius of the particles in meters.

Examples

Get Radius
radius = particle_representation.get_radius()

Signature

def get_radius(self, clone: bool = False) -> NDArray[np.float64]: ...

ParticleRepresentation().get_species_mass

Show source in representation.py:337

Return the masses per species in the particles.

Arguments

  • clone : If True, then return a copy of the computed mass array.

Returns

  • The mass of the particles per species in kg.

Examples

Get Species Mass
species_mass = particle_representation.get_species_mass()

Signature

def get_species_mass(self, clone: bool = False) -> NDArray[np.float64]: ...

ParticleRepresentation().get_strategy

Show source in representation.py:110

Return the strategy used for particle representation.

Arguments

  • clone : If True, then return a deepcopy of the strategy.

Returns

  • The strategy used for particle representation.

Examples

Get Strategy
strategy = particle_representation.get_strategy()

Signature

def get_strategy(self, clone: bool = False) -> DistributionStrategy: ...

See also

ParticleRepresentation().get_strategy_name

Show source in representation.py:130

Return the name of the strategy used for particle representation.

Returns

  • The name of the strategy used for particle representation.

Examples

Get Strategy Name
strategy_name = particle_representation.get_strategy_name()
print(strategy_name)

Signature

def get_strategy_name(self) -> str: ...

ParticleRepresentation().get_surface

Show source in representation.py:182

Return the surface strategy used for surface tension and Kelvin effect.

Arguments

  • clone : If True, then return a deepcopy of the surface strategy.

Returns

  • The surface strategy used for surface tension and Kelvin effect.

Examples

Get Surface Strategy
surface = particle_representation.get_surface()

Signature

def get_surface(self, clone: bool = False) -> SurfaceStrategy: ...

See also

ParticleRepresentation().get_surface_name

Show source in representation.py:202

Return the name of the surface strategy used for surface tension and Kelvin effect.

Returns

  • The name of the surface strategy used for surface tension and Kelvin effect.

Examples

Get Surface Strategy Name
surface_name = particle_representation.get_surface_name()
print(surface_name)

Signature

def get_surface_name(self) -> str: ...

ParticleRepresentation().get_total_concentration

Show source in representation.py:279

Return the total concentration of the particles.

Arguments

  • clone : If True, then return a copy of the concentration array.

Returns

  • The total number concentration of the particles in 1/m^3.

Examples

Get Total Concentration
total_concentration = (
    particle_representation.get_total_concentration()
)
print(total_concentration)

Signature

def get_total_concentration(self, clone: bool = False) -> np.float64: ...

ParticleRepresentation().get_volume

Show source in representation.py:318

Return the volume used for the particle representation.

Arguments

  • clone : If True, then return a copy of the volume value.

Returns

  • The volume of the particles in m^3.

Examples

Get Volume
volume = particle_representation.get_volume()

Signature

def get_volume(self, clone: bool = False) -> float: ...