Types

HSSSimulations.TypesModule

Contains the main types used in the simulation, along with the abstract types used to extend the simulation's functionality.

source

External

Most of the types that are intended for external use (other than those in the main API) have instead been included with the modules that they are used in. The types listed here under external are often passed into functions on the public interface, so it is useful to understand their fields to know what can be accessed when making new functions for these interfaces.

HSSSimulations.Types.GeometryType
struct Geometry <: HSSSimulations.Types.AbstractSimProperty

Defines the geometry of the build volume (and the simulation volume within that (if only a subset of a build is being simulated).

Fields

  • x::Float64: The size of the x axis of the model in meters

  • y::Float64: The size of the y axis of the model in meters

  • z::Float64: The size of the z axis of the model in meters

  • X::Int64: The size of the x axis of the model in nodes

  • Y::Int64: The size of the y axis of the model in nodes

  • Z::Int64: The size of the z axis of the model in nodes

  • size::Tuple{Int64, Int64, Int64}: Tuple of the XYZ sizes

  • xoffset::Float64: The x axis offset of the model from the machines datum in meters

  • yoffset::Float64: The y axis offset of the model from the machines datum in meters

  • X_OFFSET::Int64: The x axis offset of the model from the machines datum in nodes

  • Y_OFFSET::Int64: The y axis offset of the model from the machines datum in nodes

  • xbuild::Float64: The total x axis size of the machine from which the subset is taken in meters

  • ybuild::Float64: The total y axis size of the machine from which the subset is taken in meters

  • X_BUILD::Int64: The total x axis size of the machine from which the subset is taken in nodes

  • Y_BUILD::Int64: The total y axis size of the machine from which the subset is taken in nodes

  • Δx::Float64: The spacing of the nodes in meters in the x axis

  • Δy::Float64: The spacing of the nodes in meters in the y axis

  • Δz::Float64: The spacing of the nodes in meters in the z axis

  • Δt::Float64: The spacing of timesteps in seconds

  • Nₗ::Int64: The number of layers in the model

  • Δh::Float64: The layer height in nodes

  • ΔH::Int64: The layer height in meters

  • name::String: Just used for future reference of results

source
HSSSimulations.Types.ProblemType
struct Problem{T<:AbstractArray, Gh<:AbstractArray, M<:AbstractMatProp, R<:AbstractResult, OR<:AbstractOtherResults, P<:AbstractProblemParams}

An internal struct used for passing the many variables around the different function, it is built from a given problem struct, using a constructor in the problem module. There is probably a better way of doing this, but it works.

Fields

  • geometry::Geometry: Simulation geometry. Geometry

  • matProp::AbstractMatProp: Simulation material properties. AbstractMatProp

  • params::AbstractProblemParams: Parameters used for boundary conditions. AbstractProblemParams

  • loadSets::Vector{AbstractLoadSet}: List of all load sets to run. AbstractLoadSet

  • otherResults::AbstractOtherResults: Results struct used to save data only once at the end. AbstractOtherResults

  • init::AbstractResult: Initial results. AbstractResult

  • initLay::Int64: The thickness of powder to use for preheat loads, given in number of layers thick

  • ink::Ink: Matrix of final emissivities. Ink

  • eᵗ::AbstractArray: Matrix of current emissivities

  • Fx::AbstractArray: Matrix of x axis Fourier numbers

  • Fy::AbstractArray: Matrix of y axis Fourier numbers

  • Fz::AbstractArray: Matrix of z axis Fourier numbers

  • κ::AbstractArray: Matrix of thermal conductivities

  • Tᵗ⁻¹::AbstractArray: Ghost node padded matrix of previous time step

  • resultsIndex::Vector{String}: index of results file

  • file::String: File name

  • description::String: A short description of what is being simulated. To help remember what the simulation results are about

  • options::Options: Simulation options

source
HSSSimulations.Types.LoadStepType
struct LoadStep{R<:AbstractResult}

An internal struct for the propeties that are constant within a load step.

Fields

  • time::HSSSimulations.Types.LoadTime: See LoadTime

  • size::Tuple{Int64, Int64, Int64}: The x, y and z size in number of nodes (mostly just used for the z, which may have changed from the same value in the Problem.geometry variable)

  • ind::HSSSimulations.Types.Indices: See Indices

  • load::Load: See Load

  • init::AbstractResult: The initial results for the load. See AbstractResult

  • name::String: Used for the progress meter

  • layerNum::Int64: Used for any Load functions that need the layer number. For preheat and cooldown load sets this will be the initial thickness or the finial thickness in layers respectively.

source
HSSSimulations.Types.LoadTimeType
struct LoadTime

Contains all of the time information for a LoadStep.

Fields

  • Δt::Float64: Time between time steps

  • times::Vector{Float64}: Array of all of the times in the load step

  • unskipTimes::Vector{Float64}: Array of all none skipped times in the load step

  • tₚ::Vector{Float64}: Array of percentage through timestep, same index as times

  • utₚ::Vector{Float64}: Array of percentage through timestep, same index as unskipTimes

  • tₛ::Float64: The time at the start of the load step

  • tₑ::Float64: Time step end time

source
HSSSimulations.Types.IndicesType
mutable struct Indices

Stores the indices of the nodes, taking into account if the node represents a volume that contains powder or not. And also stores the node pais for the boundaries.

iᵣ are indices of real nodes, this is all nodes that represent space where there is currently powder. This will normally include every node, however before and during the recoat load it will not include all of the top layer, as powder has not been deposited there yet. iᵢ are the indices of 'imaginary' nodes, these are nodes that represent locations that do not currently contain powder. These is the same as the indices of all of the nodes minus the indicies of the real nodes (iᵣ).

Fields with a subscript 1 () denote the boundary at the start of that axis, and subscript 2 () dentoes the end of that boundary. eg. x₂ is the boundary [end,:,:] and y₁ is [:,1,:]. z₂ is a special case where it always represents the top surface of the build, even if a layer has not been compleatly deposited yet. y₂ is another special case, where it represents its normal face, but also represents the leading edge of deposited powder.

The first element of the tuple in the boundary indices is the cartiesian index (of the array without the ghost cells) for the real node, the second is the linear index of the same point and the third element is the linear index (of the array with the ghost cells) of the matching ghost node.

Fields

  • iᵣ::Vector{CartesianIndex{3}}: List of currently real nodes

  • iᵢ::Vector{CartesianIndex{3}}: List of currently imaginary nodes

  • x₁::Matrix{Tuple{CartesianIndex{3}, Int64, Int64}}

  • x₂::Matrix{Tuple{CartesianIndex{3}, Int64, Int64}}

  • y₁::Matrix{Tuple{CartesianIndex{3}, Int64, Int64}}

  • y₂::Matrix{Tuple{CartesianIndex{3}, Int64, Int64}}: List of real/ghost node pairs for `[:,end,:]

  • z₁::Matrix{Tuple{CartesianIndex{3}, Int64, Int64}}

  • z₂::Matrix{Tuple{CartesianIndex{3}, Int64, Int64}}: List of real/ghost node pairs for `[:,:,end]

  • iₘ::CartesianIndex{3}: The middle point of z₂, and it is currently only used for debugging/logging.

  • ΔH::Int64: The same as it is in Geometry, it is just copied over for convenience.

source

Internal

The methods and types listed below are only used within the simulation and should not be needed when using any of the public API, basic or advanced.

HSSSimulations.Types.AbstractSimPropertyType
abstract type AbstractSimProperty

This is the parent type of all of the simulation property types. It exists mostly to define a show method for all of it's subtype. This just makes things nicer to look at the.

source
HSSSimulations.Types.LoadTimeMethod
LoadTime(tₛ, tₗ, Δt, skip) -> HSSSimulations.Types.LoadTime

Default Constructor for LoadTime.

Arguments

  • tₛ::Float64: The time at the start of the load step
  • tₗ: The lenght of the load step
  • Δt::Float64: Time between time steps
  • skip: How often to save results. See Why We Skip Some Results
source