RASizeDistributionList#

class ansys.rocky.app.ra_size_distribution.RASizeDistributionList(id: str, model_id: str | None = None)#

Bases: ansys.rocky.app.ra_list.RAList[RASizeDistribution]

Rocky PrePost Scripting wrapper to manipulate the size properties in a single Particle.

To get the RASizeDistributionList from a RAParticle, use:

size_distribution_list = particle.GetSizeDistributionList()

RASizeDistributionList contains methods to set the size type and add, remove and retrieve individual size distribution entries. It corresponds to the items on a Particle’s “Size” tab on the Rocky UI.

The following examples add, remove and access individual entries in the size distribution list:

# Add new items
size_distribution = size_distribution_list.New()

# Access and modify items
size_distribution = size_distribution_list[0]
size_distribution.SetSize(1.0, 'm')

# Remove items
size_distribution_list.Remove(size_distribution)
del size_distribution_list[0]
size_distribution_list.Clear()

Note that this list is used even if the configured particle only has a single size, such as when it is composed of Multiple Elements. In these cases, the single size refers to the first item on the list (and no other items are used).

The RASizeDistributionList is a list of RASizeDistribution.

Overview#

GetCgmScaleFactor

Get the value of “Cgm Scale Factor”.

SetCgmScaleFactor

Set the value of “Cgm Scale Factor”.

GetSizeType

Get “Size Type” as a string.

SetSizeType

Set the value of “Size Type”.

GetValidSizeTypeValues

Get a list of all possible values for “Size Type”.

Import detail#

from ansys.rocky.app.ra_size_distribution import RASizeDistributionList

Method detail#

classmethod RASizeDistributionList.GetWrappedClass()#
classmethod RASizeDistributionList.GetClassName()#
RASizeDistributionList.GetCgmScaleFactor() float#

Get the value of “Cgm Scale Factor”.

RASizeDistributionList.SetCgmScaleFactor(value: str | float) None#

Set the value of “Cgm Scale Factor”.

Parameters:

value – The value to set. This value can be an expression with input variables or float type.

RASizeDistributionList.GetSizeType() str#

Get “Size Type” as a string.

Returns:

The returned value will be one of [‘sieve’, ‘equivalent_diameter’, ‘original_size_scale’].

RASizeDistributionList.SetSizeType(value: str) None#

Set the value of “Size Type”.

Parameters:

value – The value to set. Must be one of [‘sieve’, ‘equivalent_diameter’, ‘original_size_scale’].

Raises:

RockyApiError – If value is not a valid “Size Type” option.

RASizeDistributionList.GetValidSizeTypeValues() list[str]#

Get a list of all possible values for “Size Type”.

Returns:

The returned list is [‘sieve’, ‘equivalent_diameter’, ‘original_size_scale’].