Module “additive_manufacturing”¶
- class tc_python.am.AdditiveManufacturingCalculation(calculation)¶
Bases:
objectAbstract base class for an Additive Manufacturing calculation.
- disable_fluid_flow_marangoni()¶
Disables the fluid flow modelling of the Marangoni effect.
Default: Enabled
- Returns:
This
AdditiveManufacturingCalculationobject
- disable_separate_materials()¶
Disables separate material properties for powder and solid material.
Default: Disabled
- Returns:
This
AdditiveManufacturingCalculationobject
- enable_fluid_flow_marangoni()¶
Enables the fluid flow modelling of the Marangoni effect.
Default: Enabled
Note
This option is not possible to use in conjunction with the option separate material, which is therefore automatically disabled.
- Returns:
This
AdditiveManufacturingCalculationobject
- enable_separate_materials()¶
Enables separate material properties for powder and solid material.
Default: Disabled
Note
This option is not possible to use in conjunction with the option Marangoni fluid flow, which is therefore automatically disabled.
- Returns:
This
AdditiveManufacturingCalculationobject
- get_configuration_as_string() str¶
Returns detailed information about the current state of the calculation object.
Warning
The structure of the calculation objects is an implementation detail and might change between releases without notice. Therefore do not rely on the internal object structure.
- invalidate()¶
Invalidates the object and frees the disk space used by it. This is only required if the disk space occupied by the object needs to be released during the calculation. No data can be retrieved from the object afterward.
- set_ambient_temperature(temperature: float = 296.15)¶
Sets the ambient temperature.
Default: 23 degree Celsius
- Parameters:
temperature – The ambient temperature [K]
- Returns:
This
AdditiveManufacturingCalculationobject
- set_base_plate_temperature(temperature: float = 303.15)¶
Sets the baseplate temperature.
Default: 30 degree Celsius
- Parameters:
temperature – The baseplate temperature [K]
- Returns:
This
AdditiveManufacturingCalculationobject
- set_gas_pressure(pressure: float = 100000.0)¶
Sets the gas pressure.
Default: 1.0e5 Pa
- Parameters:
pressure – The pressure [Pa]
- Returns:
This
AdditiveManufacturingCalculationobject
- set_height(height: float = 0.002)¶
Sets the height of the simulation domain.
Default: 2.0e-3 m
- Parameters:
height – The height [m]
- Returns:
This
AdditiveManufacturingCalculationobject
- set_layer_thickness(layer_thickness: float = 4e-05)¶
Sets the layer thickness.
Default: 40.0e-6 m
- Parameters:
layer_thickness – The layer thickness [m]
- Returns:
This
AdditiveManufacturingCalculationobject
- set_powder_density(powder_density: float = 80.0)¶
Sets the powder density.
Default: 80.0%
- Parameters:
powder_density – The powder density [%]
- Returns:
This
AdditiveManufacturingCalculationobject
- with_heat_source(heat_source: HeatSource)¶
Sets the heat source.
- Parameters:
heat_source – The heat source
- Returns:
This
AdditiveManufacturingCalculationobject
- with_material_properties(material_properties: MaterialProperties)¶
Sets the material properties.
Tip
Material properties can be defined like this:
MaterialProperties.from_library("IN718")orMaterialProperties.from_scheil_result(scheil_result).- Parameters:
material_properties – The material properties
- Returns:
This
AdditiveManufacturingCalculationobject
- with_mesh(mesh: Mesh)¶
Sets the mesh.
- Parameters:
mesh – The mesh
- Returns:
This
AdditiveManufacturingCalculationobject
- with_numerical_options(numerical_options: NumericalOptions)¶
Sets the numerical options.
- Parameters:
numerical_options – The numerical options
- Returns:
This
AdditiveManufacturingCalculationobject
- with_top_boundary_conditions(boundary_conditions: TopBoundaryConditions)¶
Sets the boundary conditions.
- Parameters:
boundary_conditions – The boundary conditions
- Returns:
This
AdditiveManufacturingCalculationobject
- class tc_python.am.AdditiveManufacturingResult(result)¶
Bases:
AbstractResultBase class for additive manufacturing results.
- get_data_over_line(name: str, point1: List[float], point2: List[float], n: int) Tuple[List[float], List[float]]¶
Obtains the data of property name over a line from point1 to point2 :param name: The name of property to obtain the data from :param point1: The first point of the line :param point2: The second point of the line :param n: The number of points to obtain :return: A tuple (distance to point 1 [m], data value)
- get_pyvista_mesh(scalar: Scalar = Scalar.TEMPERATURE, material_type: MaterialType = MaterialType.SHOW_ALL)¶
Returns a pyvista mesh object that can be added to a pyvista plotter.
More details about pyvista meshes can be found in their documentation: https://docs.pyvista.org/version/stable/api/plotting/_autosummary/pyvista.Plotter.add_mesh.html
Tip
This method is typically used to obtain additional meshes with other settings if the plot object has already been retrieved with
get_pyvista_plotter().- Parameters:
scalar – The quantity to be visualized in the plot
material_type – The material type to be visualized in the plot
- Returns:
A
pyvista.DataSetobject
- get_pyvista_plotter(scalar: Scalar = Scalar.TEMPERATURE, material_type: MaterialType = MaterialType.SHOW_ALL, camera: Optional[Dict[str, List[float]]] = None, anti_aliasing: str = 'msaa', multi_samples: int = 16, color_map: str = 'jet', enable_camera_orientation_widget: bool = False, render_lines_as_tubes: bool = True, background: str = 'LightSteelBlue', shape: Optional[bool] = None, view_buttons: bool = True, update_plot_callback: Optional[Callable] = None)¶
Returns a pyvista plotter and a mesh object containing the data from this result. They can be used to create 3D-plots visualizing the results of the AM calculation. More details about the pyvista settings can be found in their documentation: https://docs.pyvista.org/version/stable/api/plotting/_autosummary/pyvista.Plotter.html
The most simple usage of this method is:
plotter, mesh = result.get_pyvista_plotter() plotter.add_mesh(mesh) plotter.show()
- Parameters:
scalar – The quantity to be visualized in the plot
material_type – The material type to be visualized in the plot, only available if
AdditiveManufacturingCalculation.enable_separate_materials()has been usedcamera – Defining the camera position, view-up vector and focus point, the default is
DEFAULT_CAMERA, for example: {‘position’: [-2, -2, 1], ‘viewup’: [0, 0, 1], ‘focal_point’: [0.0, 0.0, 0.0]}. More details can be found here: https://docs.pyvista.org/version/stable/api/core/camera.htmlanti_aliasing – The pyvista antialiasing setting, can be one of: “msaa” - Multi-Sample Anti-Aliasing, “fxaa” - Fast Approximate Anti-Aliasing or “ssaa” - Super-Sample Anti-Aliasing. More details can be found here: https://docs.pyvista.org/version/stable/examples/02-plot/anti-aliasing.html
multi_samples – The number of samples used for antialiasing
color_map – The pyvista colormap. Can be any colormap provided by Matplotlib and some other plotting libraries. More details can be found here: https://docs.pyvista.org/version/stable/examples/02-plot/cmap.html
enable_camera_orientation_widget – Enables the pyvista camera orientation widget in the plotter
render_lines_as_tubes – Controls if lines are rendered as tubes
background – The pyvista background color, either a string, rgb list or hex color string. https://docs.pyvista.org/version/stable/api/plotting/_autosummary/pyvista.Plotter.background_color.html
shape – The shape of the plot, i.e. how many subplots will be created - a tuple (y, x), for example (2, 2). They are accessed using
pyvista.Plotter.subplot.view_buttons – If buttons for quick navigation between camera and x-, y-, or z-direction view should be added to the plot
update_plot_callback – A plot update function that will be called every time the slider with simulation time is dragged in the plot windows, this can be used to dynamically apply changes to the plot, required syntax:
def update_plot(plotter: pv.Plotter, mesh: pv.DataSet)
- Returns:
Tuple containing the
pyvista.Plotterand thepyvista.DataSetmesh object
- get_result_file_path() str¶
Returns the path to the main result file (for example a ParaView
*.pvdfile) on disk containing the complete result data set. Its directory contains also further result data that can be useful.Tip
The Python API of ParaView can be used to extract any kind of data from the result in a programmatic way. See here for more details: https://kitware.github.io/paraview-docs/latest/python/
- Returns:
The path to the main result file
- get_thermal_gradient_and_melting_rate() List[List[float]]¶
Evaluate the thermal gradient and melting rate at the liquidus isotherm :return [[Thermal gradient], [melting rate], [x], [y], [z]]
- get_thermal_gradient_and_solidification_rate() List[List[float]]¶
Evaluate the thermal gradient and solidification rate at the liquidus isotherm :return [[Thermal gradient], [solidification rate], [x], [y], [z]]
- class tc_python.am.Automatic¶
Bases:
FileSavingStrategyAn automatic saving strategy.
- get_type() str¶
Returns the type of the file saving strategy.
- Returns:
The type
- set_max_number_of_files_stored(max_number: int = 1000000)¶
Sets the maximum number of files that are stored.
Default: unlimited
- Parameters:
max_number – The maximum number of files that is stored
- Returns:
This
FileSavingStrategyobject
- set_saving_interval_strategy(saving_interval_strategy=AutomaticSavingIntervalStrategy.LINEAR)¶
Sets the saving interval strategy.
Default: A linear saving interval strategy.
- Parameters:
saving_interval_strategy – The saving interval strategy
- Returns:
This
FileSavingStrategyobject
- store_unlimited_number_of_files()¶
Sets the maximum number of files that are stored to unlimited.
- Returns:
This
FileSavingStrategyobject
- class tc_python.am.AutomaticSavingIntervalStrategy(value)¶
Bases:
EnumThe strategy for choosing the time interval for saving files in automatic mode.
- EXPONENTIALLY_INCREASING = 2¶
An exponentially increasing time interval
- LINEAR = 1¶
A linear time interval
- class tc_python.am.BiDirectionalScanningStrategy¶
Bases:
ScanningStrategyA bidirectional scanning strategy (flipping scanning direction of the heat source between alternate tracks).
- get_type() str¶
Returns the type of scanning strategy.
- Returns:
The type
- set_angle(angle: float = 0.0)¶
Sets the rotation of the scanning direction between two consecutive layers.
Note
The scanning direction of the first layer is always aligned parallel to the x-axis.
Default: 0 degree
- Parameters:
angle – The angle [degree]
- Returns:
This
BiDirectionalScanningStrategyobject
- set_hatch_spacing(hatch_spacing: float = 0.0)¶
Sets the horizontal separation between two consecutive tracks.
Default: 0 m
- Parameters:
hatch_spacing – The hatch spacing [m]
- Returns:
This
BiDirectionalScanningStrategyobject
- set_lift_time(lift_time: float = 0.0)¶
Sets the lift time, i.e. the time between two tracks where the heat source is inactive.
Default: 0 s
- Parameters:
lift_time – The lift time [s]
- Returns:
This
BiDirectionalScanningStrategyobject
- set_margin(margin: float = 0.001)¶
Sets the margin.
This is the offset of the scanning path from the sides of the computational domain.
Default: 1.0e-3 [m]
- Parameters:
margin – The margin [m]
- Returns:
This
BiDirectionalScanningStrategyobject
- set_number_of_layers(number_of_layers: int = 1)¶
Sets the number of layers.
Default: 1
- Parameters:
number_of_layers – The number of layers
- Returns:
This
BiDirectionalScanningStrategyobject
- set_powder_fill_time(powder_fill_time: float = 0.0)¶
Sets the powder fill time.
Default: 0 s
- Parameters:
powder_fill_time – The powder fill time [s]
- Returns:
This
BiDirectionalScanningStrategyobject
- class tc_python.am.CalculatedGaussianHeatSource(absorptivity_factor: float = 1.0, wave_length: float = 1064.0)¶
Bases:
objectA Gaussian heat source (with calculated absorptivity)
- disable_keyhole_model()¶
Disables using a keyhole model in the simulation.
- Returns:
This
GaussianHeatSourceobject
- static get_type() str¶
Returns the type of heat source.
- Returns:
The type
- set_absorptivity_pre_factor(pre_factor: float = 1)¶
- Parameters:
pre_factor – The absorptivity prefactor value to set, default is 1.
- Returns:
This
GaussianHeatSourceobject
- set_beam_radius(beam_radius: float = 0.00011)¶
Sets the beam radius.
Default: 110.0e-6 m
- Parameters:
beam_radius – The beam radius [m]
- Returns:
This
GaussianHeatSourceobject
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
GaussianHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
GaussianHeatSourceobject
- set_wave_length(wave_length: float = 1064)¶
- Parameters:
wave_length – The wavelength to be set for the heat source, defaults to 1064 nm.
- Returns:
This
GaussianHeatSourceobjectT
- with_keyhole_model(config: KeyholeModel)¶
Sets the keyhole model applied in the simulation.
Default: None
- Parameters:
config – The keyhole model
- Returns:
This
GaussianHeatSourceobject
- class tc_python.am.CalibratedConicalHeatSource(java_calibrated_heat_source)¶
Bases:
objectA calibrated conical heat source.
- get_absorptivity() float¶
Returns the absorptivity of the heat source.
- Returns:
The absorptivity [%]
- get_hi() float¶
Returns the Hi dimension of the heat source.
- Returns:
The Hi dimension [micrometer]
- get_re() float¶
Returns the Re dimension of the heat source.
- Returns:
The Re dimension [micrometer]
- get_ri() float¶
Returns the Ri dimension of the heat source.
- Returns:
The Ri dimension [micrometer]
- get_type() HeatSourceType¶
Returns the type of heat source.
- Returns:
The type
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
CalibratedConicalHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
CalibratedConicalHeatSourceobject
- class tc_python.am.CalibratedDoubleEllipsoidalHeatSource(java_calibrated_heat_source)¶
Bases:
objectA calibrated double-ellipsoidal heat source.
- get_absorptivity() float¶
Returns the absorptivity of the heat source.
- Returns:
The absorptivity [%]
- get_af() float¶
Returns the Af dimension of the heat source.
- Returns:
The Af dimension [micrometer]
- get_ar() float¶
Returns the Ar dimension of the heat source.
- Returns:
The Ar dimension [micrometer]
- get_b() float¶
Returns the B dimension of the heat source.
- Returns:
The B dimension [micrometer]
- get_c() float¶
Returns the C dimension of the heat source.
- Returns:
The C dimension [micrometer]
- get_type() HeatSourceType¶
Returns the type of heat source.
- Returns:
The type
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
CalibratedConicalHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
CalibratedDoubleEllipsoidalHeatSourceobject
- class tc_python.am.CalibratedGaussianHeatSource(java_calibrated_heat_source)¶
Bases:
objectA calibrated Gaussian heat source.
- get_absorptivity() float¶
Returns the absorptivity of the heat source.
- Returns:
The absorptivity [%]
- get_absorptivity_prefactor() float¶
Returns the absorptivity prefactor value of the calibrated heat source.
- Returns:
The absorptivity [%]
- get_beam_radius() float¶
Returns the beam radius of the heat source.
- Returns:
The beam radius [micrometer]
- get_type() HeatSourceType¶
Returns the type of heat source.
- Returns:
The type
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
CalibratedGaussianHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
CalibratedGaussianHeatSourceobject
- class tc_python.am.CalibratedHeatSource¶
Bases:
HeatSourceA calibrated heat source.
- abstract set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
CalibratedHeatSourceobject
- abstract set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
CalibratedHeatSourceobject
- class tc_python.am.CoarseMesh¶
Bases:
MeshAn initially coarse mesh.
Note
It is adaptive and will be automatically refined as required.
- class tc_python.am.ConicalHeatSource¶
Bases:
objectA conical heat source.
- get_type() str¶
Returns the type of heat source.
- Returns:
The type
- set_absorptivity(absorptivity: float = 60.0)¶
Sets the absorptivity.
Default: 60%
- Parameters:
absorptivity – The absorptivity [%]
- Returns:
This
ConicalHeatSourceobject
- set_hi(hi_dim: float = 0.0001)¶
Sets the parameter Hi that defines the dimensions of the heat source.
Tip
See Thermo-Calc Online Help for details about this heat source model.
Default: 100.0e-6 m
- Parameters:
hi_dim – The Hi parameter [m]
- Returns:
This
ConicalHeatSourceobject
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
ConicalHeatSourceobject
- set_re(re_dim: float = 0.0001)¶
Sets the parameter Re that defines the dimensions of the heat source.
Tip
See Thermo-Calc Online Help for details about this heat source model.
Default: 100.0e-6 m
- Parameters:
re_dim – The Re parameter [m]
- Returns:
This
ConicalHeatSourceobject
- set_ri(ri_dim: float = 6e-05)¶
Sets the parameter Ri that defines the dimensions of the heat source.
Tip
See Thermo-Calc Online Help for details about this heat source model.
Default: 60.0e-6 m
- Parameters:
ri_dim – The Ri parameter [m]
- Returns:
This
ConicalHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
ConicalHeatSourceobject
- class tc_python.am.CustomMesh(minimum_element_size: float = 1e-05, maximum_element_size: float = 0.0001)¶
Bases:
MeshAn initial mesh with explicitly defined dimensions.
Note
It is adaptive and will be automatically refined as required.
- Parameters:
minimum_element_size – The minimum element size [m]
maximum_element_size – The maximum element size [m]
- tc_python.am.DEFAULT_CAMERA = {'position': [-2, -2, 1], 'viewup': [0, 0, 1]}¶
The default pyvista camera view.
- class tc_python.am.DoubleEllipsoidalHeatSource¶
Bases:
objectA double ellipsoidal heat source.
- get_type() str¶
Returns the type of heat source.
- Returns:
The type
- set_absorptivity(absorptivity: float = 60.0)¶
Sets the absorptivity.
Default: 60%
- Parameters:
absorptivity – The absorptivity [%]
- Returns:
This
DoubleEllipsoidalHeatSourceobject
- set_af(af: float = 7e-05)¶
Sets the parameter Af that defines the dimensions of the heat source.
Tip
See Thermo-Calc Online Help for details about this heat source model.
Default: 70.0e-6 m
- Parameters:
af – The Af parameter [m]
- Returns:
This
DoubleEllipsoidalHeatSourceobject
- set_ar(ar: float = 70.0)¶
Sets the parameter Ar that defines the dimensions of the heat source.
Tip
See Thermo-Calc Online Help for details about this heat source model.
Default: 70.0e-6 m
- Parameters:
ar – The Ar parameter [m]
- Returns:
This
DoubleEllipsoidalHeatSourceobject
- set_b(b: float = 8.5e-05)¶
Sets the parameter B that defines the dimensions of the heat source.
Tip
See Thermo-Calc Online Help for details about this heat source model.
Default: 85.0e-6 m
- Parameters:
b – The B parameter [m]
- Returns:
This
DoubleEllipsoidalHeatSourceobject
- set_c(c: float = 0.0002)¶
Sets the parameter C that defines the dimensions of the heat source.
Tip
See Thermo-Calc Online Help for details about this heat source model.
Default: 200.0e-6 m
- Parameters:
c – The C parameter [m]
- Returns:
This
DoubleEllipsoidalHeatSourceobject
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
DoubleEllipsoidalHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
DoubleEllipsoidalHeatSourceobject
- class tc_python.am.EveryNthTimeStep¶
Bases:
FileSavingStrategySaving at every n-th time step.
- get_type() str¶
Returns the type of the file saving strategy.
- Returns:
The type
- set_n(n: int = 1)¶
Sets at which n-th time step files are saved.
Default: 1
- Parameters:
n – The n-th time step where files are saved
- Returns:
This
FileSavingStrategyobject
- class tc_python.am.EveryTimeInterval¶
Bases:
FileSavingStrategySaving after regular time intervals.
- get_type() str¶
Returns the type of the file saving strategy.
- Returns:
The type
- set_time_interval(time_interval: float = 0.01)¶
Sets the time interval at which files are saved.
Default: 0.01 s
- Parameters:
time_interval – The time interval [s]
- Returns:
This
FileSavingStrategyobject
- class tc_python.am.FileSavingStrategy¶
Bases:
objectThe strategy for how result files are saved on disk. Both the number and time point of saving can be controlled.
- classmethod automatic()¶
An automatic saving strategy. This is the default.
- classmethod every_n_th_time_step()¶
Saving at every n-th time step.
- classmethod every_time_interval()¶
Saving after regular time intervals.
- class tc_python.am.FineMesh¶
Bases:
MeshAn initially fine mesh.
Note
It is adaptive and will be automatically refined as required.
- class tc_python.am.GaussianHeatSource(absorptivity: float = 60.0)¶
Bases:
objectA Gaussian heat source.
- disable_keyhole_model()¶
Disables using a keyhole model in the simulation.
- Returns:
This
GaussianHeatSourceobject
- get_type() str¶
Returns the type of heat source.
- Returns:
The type
- set_absorptivity(absorptivity: float = 60.0)¶
Sets the absorptivity as a constant.
Default: 60%
- Parameters:
absorptivity – The absorptivity [%]
- Returns:
This
GaussianHeatSourceobject
- set_beam_radius(beam_radius: float = 0.00011)¶
Sets the beam radius.
Default: 110.0e-6 m
- Parameters:
beam_radius – The beam radius [m]
- Returns:
This
GaussianHeatSourceobject
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
GaussianHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
GaussianHeatSourceobject
- with_keyhole_model(config: KeyholeModel)¶
Sets the keyhole model applied in the simulation.
Default: None
- Parameters:
config – The keyhole model
- Returns:
This
GaussianHeatSourceobject
- class tc_python.am.HeatSource¶
Bases:
objectThe heat source.
The heat source model has either a Gaussian, double ellipsoidal or conical distribution.
Default: A Gaussian heat source.
- classmethod conical()¶
A conical heat source.
The default is a Gaussian heat source.
- Returns:
A new
ConicalHeatSourceobject
- classmethod conical_from_library(heat_source_name: str, power: float = 120.0, beam_speed: float = 0.5)¶
Read a conical heat source given its name.
Tip
The available heat sources can be obtained using
HeatSource.get_available_calibrated_heat_source_names(). Their types are then available with the methodget_type()for each heat source.- Parameters:
heat_source_name – The name of the conical heat source to read
power – The beam power, default: 120 W [W]
beam_speed – The beam speed, default: 500e-3 m/s [m/s]
- Returns:
A new
CalibratedConicalHeatSourceobject
- classmethod double_ellipsoidal()¶
A double ellipsoidal heat source.
The default is a Gaussian heat source.
- Returns:
A new
DoubleEllipsoidalHeatSourceobject
- classmethod double_ellipsoidal_from_library(heat_source_name: str, power: float = 120.0, beam_speed: float = 0.5)¶
Read a double-ellipsoidal heat source given its name.
Tip
The available heat sources can be obtained using
HeatSource.get_available_calibrated_heat_source_names(). Their types are then available with the methodget_type()for each heat source.- Parameters:
heat_source_name – The name of the double-ellipsoidal heat source to read
power – The beam power, default: 120 W [W]
beam_speed – The beam speed, default: 500e-3 m/s [m/s]
- Returns:
A new
CalibratedDoubleEllipsoidalHeatSourceobject
- classmethod from_library(heat_source_name: str, power: float = 120.0, beam_speed: float = 0.5)¶
Read a heat source given its name.
Tip
The available heat sources can be obtained using
HeatSource.get_available_calibrated_heat_source_names(). Their types are then available with the methodget_type()for each heat source.- Parameters:
heat_source_name – The name of the heat source to read
power – The beam power, default: 120 W [W]
beam_speed – The beam speed, default: 500e-3 m/s [m/s]
- Returns:
A new
CalibratedHeatSourceobject
- classmethod gaussian()¶
A Gaussian heat source.
- Returns:
A new
GaussianHeatSourceobject
- classmethod gaussian_from_library(heat_source_name: str, power: float = 120.0, beam_speed: float = 0.5)¶
Read a Gaussian heat source given its name.
Tip
The available heat sources can be obtained using
HeatSource.get_available_calibrated_heat_source_names(). Their types are then available with the methodget_type()for each heat source.- Parameters:
heat_source_name – The name of the Gaussian heat source to read
power – The beam power, default: 120 W [W]
beam_speed – The beam speed, default: 500e-3 m/s [m/s]
- Returns:
A new
CalibratedGaussianHeatSourceobject
- classmethod gaussian_with_calculated_absorptivity(absorptivity_factor: float = 1.0, wave_length: float = 1064.0)¶
A gaussian heat source with calculated absorptivity.
- Parameters:
absorptivity_factor – A factor that adjusts the absorptivity of the heat source. Default is 1.0.
wave_length – The wavelength is used for calculating absorptivity. Default is 1064.0 nm.
- Returns:
A new
CalculatedGaussianHeatSourceobject
- classmethod gaussian_with_constant_absorptivity(absorptivity: float = 60.0)¶
A gaussian heat source with constant absorptivity.
- Parameters:
absorptivity – A constant value for absorptivity. Default is 60.0 %.
- Returns:
A new
GaussianHeatSourceobject
- classmethod gaussian_with_user_defined_function_absorptivity(function: str = '60')¶
A gaussian heat source with user defined function for absorptivity.
- Parameters:
function – The user defined function string for absorptivity, which can be constant, or a function of temperature (T), e.g. -1.6e-7*T*T+2.5e-3*T+31.
- Returns:
A new
UserDefinedGaussianHeatSourceobject
- classmethod get_available_calibrated_heat_source_names() List[str]¶
Retrieves a list of available heat source names.
Tip
The heat sources can then be read using
HeatSource.from_library().- Returns:
A list of strings representing the names of available heat sources
- classmethod get_calibrated_heatsource_names() List[str]¶
Returns a list of the names of the available calibrated heat sources.
The name can then be used with the function
get_path_of_calibrated_heatsource().- Returns:
The list of names
- classmethod get_path_of_calibrated_heatsource(optimized_heatsource_name: str) str¶
Returns the file path of the calibrated heat source.
- Parameters:
optimized_heatsource_name – The name of the calibrated heat source
- Returns:
The file path
- class tc_python.am.HeatSourceType(value)¶
Bases:
EnumAn enumeration.
- CONICAL = 2¶
- DOUBLE_ELLIPSOIDAL = 1¶
- GAUSSIAN = 0¶
- class tc_python.am.KeyholeModel¶
Bases:
objectA model for an “analytic” keyhole in the AM calculation.
- set_rayleigh_length(rayleigh_length: float = 0.0025)¶
Sets the Rayleigh length.
Default: 2.5e-3 m
- Parameters:
rayleigh_length – The Rayleigh length [m]
- Returns:
This
KeyholeModelobject
- class tc_python.am.LibraryMaterialProperties(library_name: str)¶
Bases:
MaterialPropertiesMaterial properties previously saved on disk using the specified library name.
- class tc_python.am.MaterialProperties¶
Bases:
objectThe material properties used in the AM calculation, can be either from a Scheil calculation or from a previously stored library.
- delete_library()¶
Deletes the material library from disk.
- classmethod from_library(library_name: str)¶
Uses material properties previously saved on disk using a library name.
- Parameters:
library_name – The library name
- Returns:
A new
LibraryMaterialPropertiesobject
- classmethod from_scheil_result(result: ScheilCalculationResult, interface_scattering_constant: float = 4e-08)¶
Creates material properties from the result of a Scheil calculation.
- Parameters:
result – The Scheil result to create material properties from
interface_scattering_constant – Greater than zero to use the interface scattering
- Returns:
A new
ScheilMaterialPropertiesobject
- classmethod get_all_library_names() List[str]¶
Returns a list with the names of all material libraries available on disk.
- Returns:
A list with the names of all material libraries
- get_average_material_property_in_range(material_property_enum: MaterialProperty, from_zone: Zone, to_zone: Zone) float¶
Returns average values for the specified material property in the specified zone interval.
- Parameters:
material_property_enum – The material property
from_zone – The lower zone boundary
to_zone – The upper zone boundary
- Returns:
The average value for the specified material property in the specified zone interval
- get_evaporation_temperature() float¶
Returns the evaporation temperature for the material.
- Returns:
The evaporation temperature [K]
- get_liquidus_temperature() float¶
Returns the liquidus temperature for the material.
- Returns:
The liquidus temperature [K]
- get_name() str¶
Returns the name of the library.
- Returns:
The name of the library
- get_smoothed_values_for_material_property(material_property_enum: MaterialProperty) [List[float], List[float]]¶
Returns smoothed values for the specified material property.
- Parameters:
material_property_enum – The material property
- Returns:
The temperature [K] and the values of the specified material property
- get_smoothing_for(material_property_enum: MaterialProperty) Smoothing¶
Returns the smoothing level for the specified material property.
- Parameters:
material_property_enum – The material property to get smoothing level for
- Returns:
The smoothing level for the specified material property
- get_solidification_temperature() float¶
Returns the solidification temperature for the material.
- Returns:
The solidification temperature [K]
- rename_as_library(name: str)¶
Renames the material library.
- Parameters:
name – The new name of the library
- Returns:
This
MaterialPropertiesobject
- save_as_library(name: str = '')¶
Saves the material library with the specified name to disk.
Default: Re-save the current object with the previously chosen name
- Parameters:
name – The new name of the library
- Returns:
This
MaterialPropertiesobject
- save_library()¶
Saves the material library to disk.
- Returns:
This
MaterialPropertiesobject
- set_smoothing_for_all_properties(smoothing_enum: Smoothing)¶
Sets the smoothing level for all material properties.
- Parameters:
smoothing_enum – The smoothing level
- Returns:
This
MaterialPropertiesobject
- set_smoothing_for_property(material_property_enum: MaterialProperty, smoothing_enum: Smoothing)¶
Sets the smoothing level for the specified material property.
- Parameters:
material_property_enum – The specified material property
smoothing_enum – The smoothing level
- Returns:
This
MaterialPropertiesobject
- class tc_python.am.MaterialProperty(value)¶
Bases:
EnumA single material property used in the class
MaterialProperties.- CP = 0¶
Apparent heat capacity [J/(kg K)]
- DENSITY = 1¶
Density [kg/m3]
- DRIVING_FORCE_EVAPORATION = 8¶
Driving force for evaporation [J/mol]
- DYNAMIC_VISCOSITY = 4¶
Dynamic viscosity [Pa s]
- ELECTRIC_RESISTIVITY = 11¶
Resistivity [Ohm * m]
- ENTHALPY_PER_KG = 10¶
Enthalpy [J/kg]
- ENTHALPY_PER_MOLE = 2¶
Enthalpy [J/mol]
- EVAPORATION_ENTHALPY = 9¶
Evaporation enthalpy [J/mol]
- MOLAR_MASS_OF_GAS = 7¶
Molar mass of Gas [kg/mol]
- MOLAR_VOLUME = 6¶
Molar volume [m3/mol]
- SURFACE_TENSION = 5¶
Surface tension [J/m2]
- THERMAL_CONDUCTIVITY = 3¶
Thermal conductivity [W/(m K)]
- class tc_python.am.MaterialType(value)¶
Bases:
EnumThe material (solid, liquid, powder) to be plotted in a pyvista visualization plot.
- LIQUID = 'Liquid'¶
Onl liquid material
- POWDER = 'Powder'¶
Only powder
- SHOW_ALL = 'All'¶
All material
- SOLID = 'Solid'¶
Only solid material
- SOLID_AND_LIQUID = 'Solid and liquid'¶
Only solid and liquid material
- SOLID_AND_POWDER = 'Solid and powder'¶
Only solid material and powder
- class tc_python.am.MediumMesh¶
Bases:
MeshAn initially medium mesh.
Note
It is adaptive and will be automatically refined as required.
- class tc_python.am.Mesh¶
Bases:
objectThe initial mesh size in the simulation.
Can be coarse, medium, fine, or custom.
Note
It is adaptive and will be automatically refined as required.
- classmethod coarse()¶
Selecting the mesh to be initially coarse.
Note
It is adaptive and will be automatically refined as required.
- Returns:
A new
CoarseMeshobject
- classmethod custom(minimum_element_size: float = 1e-05, maximum_element_size: float = 0.0001)¶
Selecting explicitly the initial mesh.
Default: Minimum element size: 10 um, maximum element size: 100 um
Note
It is adaptive and will be automatically refined as required.
- Parameters:
minimum_element_size – The minimum element size [m]
maximum_element_size – The maximum element size [m]
- Returns:
A new
CustomMeshobject
- classmethod fine()¶
Selecting the mesh to be initially fine.
Note
It is adaptive and will be automatically refined as required.
- Returns:
A new
FineMeshobject
- classmethod medium()¶
Selecting the mesh to be initially medium.
Note
It is adaptive and will be automatically refined as required.
- Returns:
A new
MediumMeshobject
- class tc_python.am.NumericalOptions¶
Bases:
objectThe numerical options for an AM simulation.
- disable_damping()¶
Disable numerical damping.
Default: disabled
- Returns:
This
NumericalOptionsobject
- disable_petrov_galerkin()¶
Disables Streamline upwind Petrov-Galerkin (SUPG) for the numerical solver.
Default: enabled
- Returns:
This
NumericalOptionsobject
- enable_petrov_galerkin()¶
Enables Streamline upwind Petrov-Galerkin (SUPG) for the numerical solver.
Default: enabled
- Returns:
This
NumericalOptionsobject
- get_options()¶
Returns the numerical options for an AM simulation.
- Returns:
The numerical options
- set_damping_factor(damping_factor: float = 0.0)¶
Sets the numerical damping factor.
Default: numerical damping is disabled
- Parameters:
damping_factor – The numerical damping factor
- Returns:
This
NumericalOptionsobject
- set_number_of_cores(num_cores: int)¶
Sets the number of used processor cores.
Default: Half of the available cores on the CPU, 2 cores on a 2-core CPU, and 1 core on a 1-core CPU.
- Parameters:
num_cores – The number of used cores
- Returns:
This
NumericalOptionsobject
- set_smagorinsky_constant(const: float = 0.18)¶
Sets the smagorinsky constant.
- Parameters:
const – The smagorinsky constant.
- Returns:
This
NumericalOptionsobject
- with_file_saving_strategy(file_saving_strategy: FileSavingStrategy)¶
Sets the strategy how result files are saved on disk. Both the number and time point of saving can be controlled.
Default: an automatic file saving strategy
- Parameters:
file_saving_strategy – The file saving strategy
- Returns:
This
NumericalOptionsobject
- class tc_python.am.ProbeCoordinate(x: Optional[float] = None, y: Optional[float] = None, z: Optional[float] = None, position: Optional[List[float]] = None)¶
Bases:
objectThe coordinates of a probe. This is a point in the simulation domain whose properties can be obtained from the result object after the calculation using
TransientResult.get_temperatures_at_probe().
- class tc_python.am.Scalar(value)¶
Bases:
EnumA quantity to be plotted in a pyvista visualization plot.
- MATERIAL_TYPE = 'subdomain_id'¶
Material type
- MOLAR_VOLUME = 'molar_volume'¶
Molar volume
- SURFACE_TENSION = 'gamma'¶
Surface tension
- TEMPERATURE = 'temperature'¶
Temperature
- THERMAL_CONDUCTIVITY = 'k'¶
Thermal conductivity
- VOLUME_FRACTION_LIQUID = 'liquid_vfrac'¶
Volume fraction of liquid
- class tc_python.am.ScanningPath(calc: AdditiveManufacturingCalculation)¶
Bases:
object- get_end_of_scanning_time() float¶
- Returns:
The end of scanning time (s)
- get_heat_source_position(time: float) Tuple[List[float], float]¶
- Parameters:
time – The time (s)
- Returns:
position of the heat source, and its angle. Returns an empty position list, if the heat source is OFF
- get_heat_source_position_nearby(layerID: int, x: float, y: float) Tuple[List[float], float, float, float]¶
- Parameters:
layerID – The layer ID. Zero index
x – x-coordinate of the point.
y – y-coordinate of the point.
- Returns:
position of the nearest point, factor of this position on the line, distance to the line, and time.
- get_heat_source_position_on_path(pathID: int, layerID: int, factor: float) Tuple[List[float], float, float]¶
- Parameters:
pathID – The path ID of the scanning path. Zero index
layerID – The layer ID of the scanning path. Zero index
factor – The factor. 0 - for the beginning position, and 1- for the end position of the line path.
- Returns:
position of the heat source, its angle, and time.
- get_number_of_layers() int¶
- Returns:
Total number of layers
- get_position_between_two_nearest_lines(layerID: int, x: float, y: float) Tuple[float]¶
- Parameters:
layerID – The layer ID. Zero index
x – x-coordinate of the point.
y – y-coordinate of the point.
- Returns:
The nearest position in the middle of two scanning paths. The scanning paths are determined by the two closet to [x, y]
- get_scanning_path_of_layer(layer: int) List[List[float]]¶
- Returns:
List of scanning paths on a layer
- get_time_on_path(pathID: int, layerID: int) Tuple[float, float]¶
- Parameters:
pathID – The path ID of the scanning path. Zero index
layerID – The layer ID of the scanning path. Zero index
- Returns:
Stating time, and ending time of a path, on a layer.
- is_heat_source_on(time: float) bool¶
- Parameters:
time – The time (s)
- Returns:
True if the heat source is ON
- class tc_python.am.ScanningStrategy¶
Bases:
objectThe scanning pattern of the heat source.
Single track, bidirectional (flipping scanning direction of the heat source between alternate tracks), or unidirectional (same scanning direction of the heat source for all tracks) are available.
- classmethod bi_directional()¶
A bidirectional scanning strategy (flipping scanning direction of the heat source between alternate tracks).
- Returns:
A new
BiDirectionalScanningStrategyobject
- set_cooling_time(cooling_time: float)¶
Sets the cooling time.
Default: 0 [s]
- Parameters:
cooling_time – [s]
- Returns:
This
ScanningStrategyobject
- classmethod single_track()¶
A single track scanning strategy.
- Returns:
A new
SingleTrackScanningStrategyobject
- classmethod uni_directional()¶
A unidirectional scanning strategy (same scanning direction of the heat source for all tracks).
- Returns:
A new
UniDirectionalScanningStrategyobject
- class tc_python.am.ScheilMaterialProperties(scheil_result: ScheilCalculationResult, interface_scattering_constant: float = 0.0, note: str = '')¶
Bases:
MaterialPropertiesMaterial properties created from the result of a Scheil calculation.
- class tc_python.am.SingleTrackScanningStrategy¶
Bases:
ScanningStrategyA single track scanning strategy.
- get_type() str¶
Returns the type of scanning strategy.
- Returns:
The type
- set_margin(margin: float = 0.001)¶
Sets the margin.
This is the offset of the scanning path from the sides of the computational domain. In case of single tracks, offset is placed from the sides transverse to the scanning direction.
Default: 1.0e-3 [m]
- Parameters:
margin – The margin [m]
- Returns:
This
SingleTrackScanningStrategyobject
- set_number_of_layers(number_of_layers: int = 1)¶
Sets the number of layers.
Default: 1
- Parameters:
number_of_layers – The number of layers
- Returns:
This
SingleTrackScanningStrategyobject
- set_powder_fill_time(powder_fill_time: float = 0.0)¶
Sets the powder fill time.
Default: 0 [s]
- Parameters:
powder_fill_time – [s]
- Returns:
This
SingleTrackScanningStrategyobject
- class tc_python.am.Smoothing(value)¶
Bases:
EnumThe smoothing level used in the class
MaterialProperties.- CONSTANT = -200¶
Constant smoothing
- LARGE = 600¶
Large smoothing
- LINEAR = -100¶
Linear smoothing
- LITTLE = 60¶
Little smoothing
- MEDIUM = 150¶
Medium smoothing
- NONE = 0¶
No smoothing
- class tc_python.am.SteadyStateCalculation(calculation)¶
Bases:
AdditiveManufacturingCalculationA steady-state Additive Manufacturing calculation.
Note
This computes the temperature distribution in a steady-state environment, either on a bare metal substrate or with a powder layer on the top, with the possibility to add fluid flow inside the melt pool.
- calculate(timeout_in_minutes: float = 0.0) SteadyStateResult¶
Runs the calculation.
- Parameters:
timeout_in_minutes – Used to prevent the calculation from running longer than what is wanted, or from hanging. If the calculation runs longer than timeout_in_minutes, a :class`UnrecoverableCalculationException` will be thrown, the current TCPython-block will be unusable and a new TCPython block must be created for further calculations.
- Returns:
A
SteadyStateResultwhich later can be used to get specific values from the calculated result
- class tc_python.am.SteadyStateResult(result)¶
Bases:
AdditiveManufacturingResultA result for a steady-state calculation.
- get_heat_affected_zone_depth() float¶
Returns the depth of the heat affected zone.
- Returns:
The depth of the heat affected zone [m]
- get_heat_affected_zone_length() float¶
Returns the length of the heat affected zone.
- Returns:
The heat affected zone length [m]
- get_heat_affected_zone_width() float¶
Returns the width of the heat affected zone.
- Returns:
The width of the heat affected zone [m]
- get_keyhole_depth() float¶
The depth of the keyhole.
- Returns:
The depth of the keyhole [m]
- get_keyhole_length() float¶
The length of the keyhole.
- Returns:
The length of the keyhole [m]
- get_keyhole_width() float¶
The width of the keyhole.
- Returns:
The width of the keyhole [m]
- get_meltpool_depth() float¶
Returns the meltpool depth.
- Returns:
The meltpool depth [m]
- get_meltpool_length() float¶
Returns the meltpool length.
- Returns:
The meltpool length [m]
- get_meltpool_width() float¶
Returns the meltpool width.
- Returns:
The meltpool width [m]
- has_keyhole() bool¶
Returns if the result contains a keyhole.
- Returns:
True if the result has a keyhole
- class tc_python.am.TopBoundaryConditions¶
Bases:
objectThe top boundary conditions of the simulation.
- disable_evaporation()¶
Disables the evaporation heat loss due to heating of the powder layer or the metallic surface when being close to the evaporation temperature.
Default: enabled
- Returns:
This
TopBoundaryConditionsobject
- enable_evaporation()¶
Enables the evaporation heat loss due to heating of the powder layer or the metallic surface when being close to the evaporation temperature.
Default: enabled
- Returns:
This
TopBoundaryConditionsobject
- set_convective_heat_coefficient(convective_heat_coefficient: float = 20.0)¶
Sets the convective heat transfer coefficient for the top surface to the surrounding gas.
Enter 0 to disable convective heat transfer.
Default: 20.0 W/m**2
- Parameters:
convective_heat_coefficient – The convective heat transfer coefficient [W/m**2]
- Returns:
This
TopBoundaryConditionsobject
- set_radiation_emissivity(radiation_emissivity: float = 0.8)¶
Sets the radiation from the top surface to the surrounding gas.
Enter 0 to disable radiation.
Default: 0.8
- Parameters:
radiation_emissivity – The radiation emissivity, range: [0 - 1] [-]
- Returns:
This
TopBoundaryConditionsobject
- class tc_python.am.TransientCalculation(calculation)¶
Bases:
AdditiveManufacturingCalculationA transient Additive Manufacturing calculation.
Note
This computes the temperature distribution in a transient case with the given scanning strategy including multiple paths and layers and the possibility to add fluid flow inside the melt pool.
- add_probe(coordinate: ProbeCoordinate)¶
Adds a probe, this a point in the simulation domain whose properties can be obtained from the result after the calculation using
TransientResult.get_temperatures_at_probe().- Parameters:
coordinate – The probe to be added
- Returns:
This
TransientCalculationobject
- calculate(timeout_in_minutes: float = 0.0) TransientResult¶
Runs the calculation.
- Parameters:
timeout_in_minutes – Used to prevent the calculation from running longer than what is wanted, or from hanging. If the calculation runs longer than timeout_in_minutes, a
UnrecoverableCalculationExceptionwill be thrown, the current TCPython-block will be unusable and a new TCPython block must be created for further calculations.- Returns:
A
TransientResultwhich later can be used to get specific values from the calculated result
- get_scanning_path()¶
- Returns:
The calculation’s scanning pattern object
- remove_all_probes()¶
Removes all probes.
- Returns:
This
TransientCalculationobject
- remove_probe(coordinate: ProbeCoordinate)¶
Removes a probe.
- Parameters:
coordinate – The coordinates of the probe to be removed
- Returns:
This
TransientCalculationobject
- set_length(length: float = 0.005)¶
Sets the length of the simulation domain.
Default: 5.0e-3 m :param length: The length [m] :return: This
TransientCalculationobject
- set_width(width: float = 0.004)¶
Sets the width of the simulation domain.
Default: 4.0e-3 m
- Parameters:
width – The width [m]
- Returns:
This
TransientCalculationobject
- with_scanning_strategy(scanning_strategy: ScanningStrategy)¶
Sets the scanning strategy of the heat source, i.e. beam.
- Parameters:
scanning_strategy – The scanning strategy
- Returns:
This
TransientCalculationobject
- class tc_python.am.TransientResult(result)¶
Bases:
AdditiveManufacturingResultA result for transient calculations (also with steady-state heat source).
- get_temperatures_at_probe(coordinate: ProbeCoordinate) Tuple[List[float], List[float]]¶
Obtains the temperature at a probe (i.e., a point in the simulation domain) that had previously been defined for the calculation using
TransientCalculation.add_probe()orTransientWithSteadyStateCalculation.add_probe().- Parameters:
coordinate – The coordinates of the probe - must have been defined in the calculator previously
- Returns:
A tuple (time points [s], temperatures [K])
- get_time_steps() List[float]¶
- Returns:
List of the available time steps
- set_active_time(step: int)¶
Set the step to be active
- class tc_python.am.TransientWithSteadyStateCalculation(transient_with_ss_calculation, ss_calculation)¶
Bases:
AdditiveManufacturingCalculationA transient Additive Manufacturing calculation using a heat source from steady-state.
Note
This computes the temperature distribution in a transient case with the given scanning strategy including multiple paths and layers.
A steady-state simulation runs with the configured heat source and with the possibility to add fluid flow in the melt pool.
A volume heat source (based on the solution of steady-state calculation) is used in the transient simulation.
Tip
This type of calculation is significantly faster than fully transient calculations using
TransientCalculation.- add_probe(coordinate: ProbeCoordinate)¶
Adds a probe, this a point in the simulation domain whose properties can be obtained from the result after the calculation using
TransientResult.get_temperatures_at_probe().- Parameters:
coordinate – The probe to be added
- Returns:
This
TransientWithSteadyStateCalculationobject
- calculate(timeout_in_minutes: float = 0.0) TransientResult¶
Runs the calculation.
- Parameters:
timeout_in_minutes – Used to prevent the calculation from running longer than what is wanted, or from hanging. If the calculation runs longer than timeout_in_minutes, a
UnrecoverableCalculationExceptionwill be thrown, the current TCPython-block will be unusable and a new TCPython block must be created for further calculations.- Returns:
A
TransientResultwhich later can be used to get specific values from the calculated result
- disable_fluid_flow_marangoni()¶
Disables the fluid flow modelling of the Marangoni effect.
Default: Enabled
- Returns:
This
TransientWithSteadyStateCalculationobject
- disable_separate_materials()¶
Disables separate material properties for powder and solid material.
Default: Disabled
- Returns:
This
TransientWithSteadyStateCalculationobject
- enable_fluid_flow_marangoni()¶
Enables the fluid flow modelling of the Marangoni effect.
Default: Enabled
Note
This option is not possible to use in conjunction with the option separate material, which is therefore automatically disabled.
- Returns:
This
TransientWithSteadyStateCalculationobject
- enable_separate_materials()¶
Enables separate material properties for powder and solid material.
Default: Disabled
Note
This option is not possible to use in conjunction with the option Marangoni fluid flow, which is therefore automatically disabled.
- Returns:
This
TransientWithSteadyStateCalculationobject
- remove_all_probes()¶
Removes all probes.
- Returns:
This
TransientWithSteadyStateCalculationobject
- remove_probe(coordinate: ProbeCoordinate)¶
Removes a probe.
- Parameters:
coordinate – The coordinates of the probe to be removed
- Returns:
This
TransientWithSteadyStateCalculationobject
- set_ambient_temperature(temperature: float = 296.15)¶
Sets the ambient temperature.
Default: 23 degree Celsius
- Parameters:
temperature – The ambient temperature [K]
- Returns:
This
TransientWithSteadyStateCalculationobject
- set_base_plate_temperature(temperature: float = 303.15)¶
Sets the baseplate temperature.
Default: 30 degree Celsius
- Parameters:
temperature – The baseplate temperature [K]
- Returns:
This
TransientWithSteadyStateCalculationobject
- set_gas_pressure(pressure: float = 100000.0)¶
Sets the gas pressure.
Default: 1.0e5 Pa
- Parameters:
pressure – The pressure [Pa]
- Returns:
This
TransientWithSteadyStateCalculationobject
- set_height(height: float = 0.002)¶
Sets the height of the simulation domain.
Default: 2.0e-3 m
- Parameters:
height – The height [m]
- Returns:
This
TransientWithSteadyStateCalculationobject
- set_layer_thickness(layer_thickness: float = 4e-05)¶
Sets the layer thickness.
Default: 40.0e-6 m
- Parameters:
layer_thickness – The layer thickness [m]
- Returns:
This
TransientWithSteadyStateCalculationobject
- set_length(length: float = 0.005)¶
Sets the length of the simulation domain.
Default: 5.0e-3 m :param length: The length [m] :return: This
TransientWithSteadyStateCalculationobject
- set_powder_density(powder_density: float = 80.0)¶
Sets the powder density.
Default: 80.0%
- Parameters:
powder_density – The powder density [%]
- Returns:
This
TransientWithSteadyStateCalculationobject
- set_width(width: float = 0.004)¶
Sets the width of the simulation domain.
Default: 4.0e-3 m
- Parameters:
width – The width [m]
- Returns:
This
TransientWithSteadyStateCalculationobject
- with_heat_source(heat_source: HeatSource)¶
Sets the heat source.
- Parameters:
heat_source – The heat source
- Returns:
This
TransientWithSteadyStateCalculationobject
- with_material_properties(material_properties: MaterialProperties)¶
Sets the material properties.
Tip
Material properties can be defined like this:
MaterialProperties.from_library("IN718")orMaterialProperties.from_scheil_result(scheil_result).- Parameters:
material_properties – The material properties
- Returns:
This
TransientWithSteadyStateCalculationobject
- with_mesh(mesh: Mesh)¶
Sets the mesh.
- Parameters:
mesh – The mesh
- Returns:
This
TransientWithSteadyStateCalculationobject
- with_numerical_options(numerical_options: NumericalOptions)¶
Sets the numerical options.
- Parameters:
numerical_options – The numerical options
- Returns:
This
TransientWithSteadyStateCalculationobject
- with_scanning_strategy(scanning_strategy: ScanningStrategy)¶
Sets the scanning strategy of the heat source, i.e. beam.
- Parameters:
scanning_strategy – The scanning strategy
- Returns:
This
TransientWithSteadyStateCalculationobject
- with_top_boundary_conditions(boundary_conditions: TopBoundaryConditions)¶
Sets the boundary conditions.
- Parameters:
boundary_conditions – The boundary conditions
- Returns:
This
TransientWithSteadyStateCalculationobject
- class tc_python.am.UniDirectionalScanningStrategy¶
Bases:
ScanningStrategyA unidirectional scanning strategy (same scanning direction of the heat source for all tracks).
- get_type() str¶
Returns the type of scanning strategy.
- Returns:
The type
- set_angle(angle: float = 0.0)¶
Sets the rotation of the scanning direction between two consecutive layers.
Note
The scanning direction of the first layer is always aligned parallel to the x-axis.
Default: 0 degree
- Parameters:
angle – The angle [degree]
- Returns:
This
UniDirectionalScanningStrategyobject
- set_hatch_spacing(hatch_spacing: float = 0.0)¶
Sets the horizontal separation between two consecutive tracks.
Default: 0 m
- Parameters:
hatch_spacing – The hatch spacing [m]
- Returns:
This
UniDirectionalScanningStrategyobject
- set_lift_time(lift_time: float = 0.0)¶
Sets the lift time, i.e. the time between two tracks where the heat source is inactive.
Default: 0 s
- Parameters:
lift_time – The lift time [s]
- Returns:
This
UniDirectionalScanningStrategyobject
- set_margin(margin: float = 0.001)¶
Sets the margin.
This is the offset of the scanning path from the sides of the computational domain.
Default: 1.0e-3 [m]
- Parameters:
margin – The margin [m]
- Returns:
This
UniDirectionalScanningStrategyobject
- set_number_of_layers(number_of_layers: int = 1)¶
Sets the number of layers.
Default: 1
- Parameters:
number_of_layers – The number of layers
- Returns:
This
UniDirectionalScanningStrategyobject
- set_powder_fill_time(powder_fill_time: float = 0.0)¶
Sets the powder fill time.
Default: 0 s
- Parameters:
powder_fill_time – The powder fill time [s]
- Returns:
This
UniDirectionalScanningStrategyobject
- class tc_python.am.UserDefinedGaussianHeatSource(function: str = '60.0')¶
Bases:
objectA Gaussian heat source (with user defined absorptivity)
- disable_keyhole_model()¶
Disables using a keyhole model in the simulation.
- Returns:
This
GaussianHeatSourceobject
- static get_type() str¶
Returns the type of heat source.
- Returns:
The type
- set_absorptivity_function(function: str = '60')¶
- Parameters:
function – The absorptivity user defined function value to set for the heat source, provided as a string.
- Returns:
This
GaussianHeatSourceobject
- set_beam_radius(beam_radius: float = 0.00011)¶
Sets the beam radius.
Default: 110.0e-6 m
- Parameters:
beam_radius – The beam radius [m]
- Returns:
This
GaussianHeatSourceobject
- set_power(power: float = 120.0)¶
Sets the power of the heat source.
Default: 120 W
- Parameters:
power – The power [W]
- Returns:
This
GaussianHeatSourceobject
- set_scanning_speed(beam_speed: float = 0.5)¶
Sets the moving velocity of the heat source.
Default: 500.0e-3 m/s
- Parameters:
beam_speed – The beam speed [m/s]
- Returns:
This
GaussianHeatSourceobject
- with_keyhole_model(config: KeyholeModel)¶
Sets the keyhole model applied in the simulation.
Default: None
- Parameters:
config – The keyhole model
- Returns:
This
GaussianHeatSourceobject