Types
HSSSimulations.Types
— ModuleContains the main types used in the simulation, along with the abstract types used to extend the simulation's functionality.
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.Geometry
— Typestruct 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 metersy::Float64
: The size of the y axis of the model in metersz::Float64
: The size of the z axis of the model in metersX::Int64
: The size of the x axis of the model in nodesY::Int64
: The size of the y axis of the model in nodesZ::Int64
: The size of the z axis of the model in nodessize::Tuple{Int64, Int64, Int64}
: Tuple of the XYZ sizesxoffset::Float64
: The x axis offset of the model from the machines datum in metersyoffset::Float64
: The y axis offset of the model from the machines datum in metersX_OFFSET::Int64
: The x axis offset of the model from the machines datum in nodesY_OFFSET::Int64
: The y axis offset of the model from the machines datum in nodesxbuild::Float64
: The total x axis size of the machine from which the subset is taken in metersybuild::Float64
: The total y axis size of the machine from which the subset is taken in metersX_BUILD::Int64
: The total x axis size of the machine from which the subset is taken in nodesY_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 secondsNₗ::Int64
: The number of layers in the modelΔh::Float64
: The layer height in nodesΔH::Int64
: The layer height in metersname::String
: Just used for future reference of results
HSSSimulations.Types.Problem
— Typestruct 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 thickink::Ink
: Matrix of final emissivities.Ink
eᵗ::AbstractArray
: Matrix of current emissivitiesFx::AbstractArray
: Matrix of x axis Fourier numbersFy::AbstractArray
: Matrix of y axis Fourier numbersFz::AbstractArray
: Matrix of z axis Fourier numbersκ::AbstractArray
: Matrix of thermal conductivitiesTᵗ⁻¹::AbstractArray
: Ghost node padded matrix of previous time stepresultsIndex::Vector{String}
: index of results filefile::String
: File namedescription::String
: A short description of what is being simulated. To help remember what the simulation results are aboutoptions::Options
: Simulation options
HSSSimulations.Types.LoadStep
— Typestruct LoadStep{R<:AbstractResult}
An internal struct for the propeties that are constant within a load step.
Fields
time::HSSSimulations.Types.LoadTime
: SeeLoadTime
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 theProblem.geometry
variable)ind::HSSSimulations.Types.Indices
: SeeIndices
load::Load
: SeeLoad
init::AbstractResult
: The initial results for the load. SeeAbstractResult
name::String
: Used for the progress meterlayerNum::Int64
: Used for anyLoad
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.
HSSSimulations.Types.LoadTime
— Typestruct LoadTime
Contains all of the time information for a LoadStep.
Fields
Δt::Float64
: Time between time stepstimes::Vector{Float64}
: Array of all of the times in the load stepunskipTimes::Vector{Float64}
: Array of all none skipped times in the load steptₚ::Vector{Float64}
: Array of percentage through timestep, same index as timesutₚ::Vector{Float64}
: Array of percentage through timestep, same index as unskipTimestₛ::Float64
: The time at the start of the load steptₑ::Float64
: Time step end time
HSSSimulations.Types.Indices
— Typemutable 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 nodesiᵢ::Vector{CartesianIndex{3}}
: List of currently imaginary nodesx₁::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 inGeometry
, it is just copied over for convenience.
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.AbstractSimProperty
— Typeabstract 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.
HSSSimulations.Types.LoadTime
— MethodLoadTime(tₛ, tₗ, Δt, skip) -> HSSSimulations.Types.LoadTime
Default Constructor for LoadTime
.
Arguments
tₛ::Float64
: The time at the start of the load steptₗ
: The lenght of the load stepΔt::Float64
: Time between time stepsskip
: How often to save results. See Why We Skip Some Results