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_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
- 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.CoarseMesh¶
Bases:
MeshAn initially coarse mesh.
Note
It is adaptive and will be automatically refined as required.
- class tc_python.am.ConicalHeatSource¶
Bases:
HeatSourceA 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 = {'focal_point': [0.0, 0.0, 0.0], 'position': [-2, -2, 1], 'viewup': [0, 0, 1]}¶
The default pyvista camera view.
- class tc_python.am.DoubleEllipsoidalHeatSource¶
Bases:
HeatSourceA 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¶
Bases:
HeatSourceA 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.
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 double_ellipsoidal()¶
A double ellipsoidal heat source.
The default is a Gaussian heat source.
- Returns:
A new
DoubleEllipsoidalHeatSourceobject
- classmethod gaussian()¶
A Gaussian heat source.
This is the default.
- Returns:
A new
GaussianHeatSourceobject
- 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.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)¶
Creates material properties from the result of a Scheil calculation.
- Parameters:
result – The Scheil result to create material properties from
- 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]
- 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
- 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
- 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: float, y: float, z: float)¶
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.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
- 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)¶
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
- 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])
- 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