The microstructure.py module#

Summary#

MicrostructureInput

Provides input parameters for microstructure simulation.

CircleEquivalenceColumnNames

Provides column names for the circle equivalence data frame.

MicrostructureSummary

Provides the summary of a microstructure simulation.

Description#

Provides input and result summary containers for microstructure simulations.

Module detail#

class microstructure.MicrostructureInput(id: str = '', *, sample_min_x: float = DEFAULT_POSITION_COORDINATE, sample_min_y: float = DEFAULT_POSITION_COORDINATE, sample_min_z: float = DEFAULT_POSITION_COORDINATE, sample_size_x: float = DEFAULT_SAMPLE_SIZE, sample_size_y: float = DEFAULT_SAMPLE_SIZE, sample_size_z: float = DEFAULT_SAMPLE_SIZE, sensor_dimension: float = DEFAULT_SENSOR_DIMENSION, use_provided_thermal_parameters: bool = DEFAULT_USE_PROVIDED_THERMAL_PARAMETERS, cooling_rate: float = DEFAULT_COOLING_RATE, thermal_gradient: float = DEFAULT_THERMAL_GRADIENT, melt_pool_width: float = DEFAULT_MELT_POOL_WIDTH, melt_pool_depth: float = DEFAULT_MELT_POOL_DEPTH, random_seed: int = DEFAULT_RANDOM_SEED, machine: ansys.additive.core.machine.AdditiveMachine = AdditiveMachine(), material: ansys.additive.core.material.AdditiveMaterial = AdditiveMaterial())#

Provides input parameters for microstructure simulation.

Units are SI (m, kg, s, K) unless otherwise noted.

Overview#

id

User-provided ID for this simulation.

machine

Machine-related parameters.

material

Material used during simulation.

sample_min_x

Minimum x coordinate of the geometry sample (m).

sample_min_y

Minimum y coordinate of the geometry sample (m).

sample_min_z

Minimum z coordinate of the geometry sample (m).

sample_size_x

Size of the geometry sample in the x direction (m).

sample_size_y

Size of the geometry sample in the y direction (m).

sample_size_z

Size of the geometry sample in the z direction (m).

sensor_dimension

Dimension of the sensor (m).

use_provided_thermal_parameters

Flag indicating if the cooling_rate, thermal_gradient, melt_pool_depth, and melt_pool_width parameters have been provided by the user.

cooling_rate

Material cooling rate (K/s).

thermal_gradient

Material thermal gradient (K/m).

melt_pool_width

Melt pool width (m).

melt_pool_depth

Melt pool depth (m).

random_seed

Random seed for the simulation.

DEFAULT_POSITION_COORDINATE

Default X, Y, Z, position coordinate (m).

MIN_POSITION_COORDINATE

Minimum X, Y, Z, position coordinate (m).

MAX_POSITION_COORDINATE

Maximum X, Y, Z, position coordinate (m).

DEFAULT_SAMPLE_SIZE

Default sample size in each dimension (m).

MIN_SAMPLE_SIZE

Minimum sample size in each dimension (m).

MAX_SAMPLE_SIZE

Maximum sample size in each dimension (m).

DEFAULT_SENSOR_DIMENSION

Default sensor dimension (m).

MIN_SENSOR_DIMENSION

Minimum sensor dimension (m).

MAX_SENSOR_DIMENSION

Maximum sensor dimension (m).

MIN_XY_SIZE_CUSHION

Minimum cushion between sensor dimension and sample size in the X and Y dimensions (m).

MIN_Z_SIZE_CUSHION

Minimum cushion between sensor dimension and sample size in the Z dimension (m).

DEFAULT_USE_PROVIDED_THERMAL_PARAMETERS

Default flag value indicating whether to use user-provided thermal parameters.

DEFAULT_COOLING_RATE

Default cooling rate (K/s).

MIN_COOLING_RATE

Minimum cooling rate (K/s).

MAX_COOLING_RATE

Maximum cooling rate (K/s).

DEFAULT_THERMAL_GRADIENT

Default thermal gradient (K/m).

MIN_THERMAL_GRADIENT

Minimum thermal gradient (K/m).

MAX_THERMAL_GRADIENT

Maximum thermal gradient (K/m).

DEFAULT_MELT_POOL_WIDTH

Default melt pool width (m).

MIN_MELT_POOL_WIDTH

Minimum melt pool width (m).

MAX_MELT_POOL_WIDTH

Maximum melt pool width (m).

DEFAULT_MELT_POOL_DEPTH

Default melt pool depth (m).

MIN_MELT_POOL_DEPTH

Minimum melt pool depth (m).

MAX_MELT_POOL_DEPTH

Maximum melt pool depth (m).

DEFAULT_RANDOM_SEED

The default random seed, which indicates that a random seed was not provided.

MIN_RANDOM_SEED

Minimum random seed.

MAX_RANDOM_SEED

Maximum random seed.

Import detail#

from ansys.additive.core.microstructure import MicrostructureInput

Property detail#

property MicrostructureInput.id: str#

User-provided ID for this simulation.

property MicrostructureInput.machine#

Machine-related parameters.

property MicrostructureInput.material#

Material used during simulation.

property MicrostructureInput.sample_min_x: float#

Minimum x coordinate of the geometry sample (m).

Valid values are from the MIN_POSITION_COORDINATE value to the MAX_POSITION_COORDINATE value.

property MicrostructureInput.sample_min_y: float#

Minimum y coordinate of the geometry sample (m).

Valid values are from the MIN_POSITION_COORDINATE value to the MAX_POSITION_COORDINATE value.

property MicrostructureInput.sample_min_z: float#

Minimum z coordinate of the geometry sample (m).

Valid values are from the MIN_POSITION_COORDINATE value to the MAX_POSITION_COORDINATE value.

property MicrostructureInput.sample_size_x: float#

Size of the geometry sample in the x direction (m).

Valid values are from the MIN_SAMPLE_SIZE value to the MAX_SAMPLE_SIZE value. When setting the```sample_size_x`` parameter, the value must be greater than the sensor_dimension value plus the MIN_XY_SIZE_CUSHION value.

property MicrostructureInput.sample_size_y: float#

Size of the geometry sample in the y direction (m).

Valid values are from the MIN_SAMPLE_SIZE value to the MAX_SAMPLE_SIZE value. When setting the sample_size_y parameter, the value must be greater than the sensor_dimension value plus the MIN_XY_SIZE_CUSHION value.

property MicrostructureInput.sample_size_z: float#

Size of the geometry sample in the z direction (m).

Valid values are from the MIN_SAMPLE_SIZE value to the MAX_SAMPLE_SIZE value. When setting the sample_size_y parameter, the value must be greater than the sensor_dimension value plus the MIN_XY_SIZE_CUSHION value.

property MicrostructureInput.sensor_dimension: float#

Dimension of the sensor (m).

Valid values are from the MIN_SENSOR_DIMENSION value to the MAX_SENSOR_DIMENSION value.

property MicrostructureInput.use_provided_thermal_parameters: bool#

Flag indicating if the cooling_rate, thermal_gradient, melt_pool_depth, and melt_pool_width parameters have been provided by the user.

If the value is False, these values will be calculated. Default is False.

property MicrostructureInput.cooling_rate: float#

Material cooling rate (K/s).

Valid values are from the MIN_COOLING_RATE value to the MAX_COOLING_RATE value.

property MicrostructureInput.thermal_gradient: float#

Material thermal gradient (K/m).

Valid values are from the MIN_THERMAL_GRADIENT value to the MAX_THERMAL_GRADIENT value.

property MicrostructureInput.melt_pool_width: float#

Melt pool width (m).

This is the width of the melt pool measured at the top of the powder layer.

Valid values are from the MIN_MELT_POOL_WIDTH value to the MAX_MELT_POOL_WIDTH value.

property MicrostructureInput.melt_pool_depth: float#

Melt pool depth (m).

This is the depth of the melt pool as measured from the top of the powder layer.

Valid values are from the MIN_MELT_POOL_DEPTH value to the MAX_MELT_POOL_DEPTH value.

property MicrostructureInput.random_seed: int#

Random seed for the simulation.

Valid values are from the MIN_RANDOM_SEED value to the MAX_RANDOM_SEED value.

Attribute detail#

MicrostructureInput.DEFAULT_POSITION_COORDINATE = 0#

Default X, Y, Z, position coordinate (m).

MicrostructureInput.MIN_POSITION_COORDINATE = 0#

Minimum X, Y, Z, position coordinate (m).

MicrostructureInput.MAX_POSITION_COORDINATE = 10#

Maximum X, Y, Z, position coordinate (m).

MicrostructureInput.DEFAULT_SAMPLE_SIZE = 0.0015#

Default sample size in each dimension (m).

MicrostructureInput.MIN_SAMPLE_SIZE = 0.001#

Minimum sample size in each dimension (m).

MicrostructureInput.MAX_SAMPLE_SIZE = 0.01#

Maximum sample size in each dimension (m).

MicrostructureInput.DEFAULT_SENSOR_DIMENSION = 0.0005#

Default sensor dimension (m).

MicrostructureInput.MIN_SENSOR_DIMENSION = 0.0001#

Minimum sensor dimension (m).

MicrostructureInput.MAX_SENSOR_DIMENSION = 0.001#

Maximum sensor dimension (m).

MicrostructureInput.MIN_XY_SIZE_CUSHION = 0.0005#

Minimum cushion between sensor dimension and sample size in the X and Y dimensions (m).

MicrostructureInput.MIN_Z_SIZE_CUSHION = 0.001#

Minimum cushion between sensor dimension and sample size in the Z dimension (m).

MicrostructureInput.DEFAULT_USE_PROVIDED_THERMAL_PARAMETERS = False#

Default flag value indicating whether to use user-provided thermal parameters.

MicrostructureInput.DEFAULT_COOLING_RATE = 1000000.0#

Default cooling rate (K/s).

MicrostructureInput.MIN_COOLING_RATE = 100000.0#

Minimum cooling rate (K/s).

MicrostructureInput.MAX_COOLING_RATE = 10000000.0#

Maximum cooling rate (K/s).

MicrostructureInput.DEFAULT_THERMAL_GRADIENT = 10000000.0#

Default thermal gradient (K/m).

MicrostructureInput.MIN_THERMAL_GRADIENT = 100000.0#

Minimum thermal gradient (K/m).

MicrostructureInput.MAX_THERMAL_GRADIENT = 100000000.0#

Maximum thermal gradient (K/m).

MicrostructureInput.DEFAULT_MELT_POOL_WIDTH = 0.00015#

Default melt pool width (m).

MicrostructureInput.MIN_MELT_POOL_WIDTH = 7.5e-05#

Minimum melt pool width (m).

MicrostructureInput.MAX_MELT_POOL_WIDTH = 0.0008#

Maximum melt pool width (m).

MicrostructureInput.DEFAULT_MELT_POOL_DEPTH = 0.0001#

Default melt pool depth (m).

MicrostructureInput.MIN_MELT_POOL_DEPTH = 1.5e-05#

Minimum melt pool depth (m).

MicrostructureInput.MAX_MELT_POOL_DEPTH = 0.0008#

Maximum melt pool depth (m).

MicrostructureInput.DEFAULT_RANDOM_SEED = 0#

The default random seed, which indicates that a random seed was not provided.

MicrostructureInput.MIN_RANDOM_SEED = 1#

Minimum random seed.

MicrostructureInput.MAX_RANDOM_SEED#

Maximum random seed.

class MicrostructureInput.CircleEquivalenceColumnNames#

Provides column names for the circle equivalence data frame.

Overview#

GRAIN_NUMBER

Grain number.

AREA_FRACTION

Area fraction for grain.

DIAMETER

Grain diameter (ยตm).

ORIENTATION_ANGLE

Orientation angle (degrees).

Import detail#

from ansys.additive.core.microstructure import CircleEquivalenceColumnNames

Attribute detail#

CircleEquivalenceColumnNames.GRAIN_NUMBER = 'grain_number'#

Grain number.

CircleEquivalenceColumnNames.AREA_FRACTION = 'area_fraction'#

Area fraction for grain.

CircleEquivalenceColumnNames.DIAMETER = 'diameter_um'#

Grain diameter (ยตm).

CircleEquivalenceColumnNames.ORIENTATION_ANGLE = 'orientation_angle'#

Orientation angle (degrees).

class CircleEquivalenceColumnNames.MicrostructureSummary(input: MicrostructureInput, result: ansys.api.additive.v0.additive_domain_pb2.MicrostructureResult, user_data_path: str)#

Provides the summary of a microstructure simulation.

Overview#

input

Simulation input.

xy_vtk

Path to the VTK file containing the 2D grain structure data in the XY plane.

xz_vtk

Path to the VTK file containing the 2D grain structure data in the XZ plane.

yz_vtk

Path to the VTK file containing the 2D grain structure data in the YZ plane.

xy_circle_equivalence

Circle equivalence data for the XY plane.

xz_circle_equivalence

Circle equivalence data for the XZ plane.

yz_circle_equivalence

Circle equivalence data for the YZ plane.

xy_average_grain_size

Average grain size (ยตm) for the XY plane.

xz_average_grain_size

Average grain size (ยตm) for the XZ plane.

yz_average_grain_size

Average grain size (ยตm) for the YZ plane.

Import detail#

from ansys.additive.core.microstructure import MicrostructureSummary

Property detail#

property MicrostructureSummary.input#

Simulation input.

For more information, see the MicrostructureInput class.

property MicrostructureSummary.xy_vtk: str#

Path to the VTK file containing the 2D grain structure data in the XY plane.

The VTK file contains these scalar data sets: GrainBoundaries, Orientation_(deg), and GrainNumber.

property MicrostructureSummary.xz_vtk: str#

Path to the VTK file containing the 2D grain structure data in the XZ plane.

The VTK file contains these scalar data sets: GrainBoundaries, Orientation_(deg), and GrainNumber.

property MicrostructureSummary.yz_vtk: str#

Path to the VTK file containing the 2D grain structure data in the YZ plane.

The VTK file contains these scalar data sets: GrainBoundaries, Orientation_(deg), and GrainNumber.

property MicrostructureSummary.xy_circle_equivalence: pandas.DataFrame#

Circle equivalence data for the XY plane.

For data frame column names, see the CircleEquivalenceColumnNames class.

property MicrostructureSummary.xz_circle_equivalence: pandas.DataFrame#

Circle equivalence data for the XZ plane.

For data frame column names, see the CircleEquivalenceColumnNames class.

property MicrostructureSummary.yz_circle_equivalence: pandas.DataFrame#

Circle equivalence data for the YZ plane.

For data frame column names, see the CircleEquivalenceColumnNames class.

property MicrostructureSummary.xy_average_grain_size: float#

Average grain size (ยตm) for the XY plane.

property MicrostructureSummary.xz_average_grain_size: float#

Average grain size (ยตm) for the XZ plane.

property MicrostructureSummary.yz_average_grain_size: float#

Average grain size (ยตm) for the YZ plane.