adamantine-sim / adamantine

Software to simulate heat transfer for additive manufacturing
https://adamantine-sim.github.io/adamantine/
Other
40 stars 11 forks source link
3d-printing heat-transfer simulation

image

adamantine is a thermomechanical code for additive manufacturing. It is based on deal.II, ArborX, Trilinos, and Kokkos. adamantine can simulate the thermomechanical evolution an object undergoes during the manufacturing process. It can handle materials in three distinct phases (solid, liquid, and powder) to accurately reflect the physical state during manufacturing. Experimental data can be used to improve the simulation through the use of Ensemble Kalman filter.

Installation

Installing adamantine requires:

An example on how to install all the dependencies can be found in ci/Dockerfile.

To configure adamantine use:

cmake \
  -D CMAKE_BUILD_TYPE=Release \
  -D DEAL_II_DIR=/path/to/dealii \
  -DBOOST_DIR=/path/to/boost \
/path/to/source/dir

Then simply use make. This will compile adamantine and create an executable in a newly created bin subdirectory. You will find in this subdirectory the executable and an example of input files.

The list of configuration options is:

Docker

The Docker image containing the latest version of adamantine can be pulled using

docker pull rombur/adamantine:latest

The 1.0 release version is available using

docker pull rombur/adamantine:1.0

To start an interactive container use

docker run --rm -it rombur/adamantine:1.0 bash

You will find adamantine in /home/adamantine/bin. You can mount a folder into a Docker image using

docker run --rm -it -v /path/to/compute/folder:/path/to/image/folder rombur/adamantine:1.0 bash

NIX

The instructions to install adamantine using NIX can be found here.

Run

After compiling adamantine, you can run a simulation using

mpirun -n 2 ./adamantine --input-file=input.info

Note that the name of the input file is totally arbitrary, my_input_file is as valid as input.info.

There is a known bug when using multithreading. To deactivate multithreading use

export DEAL_II_NUM_THREADS=1

If you use our Docker image, the variable is already set.

Input file

adamantine supports Boost INFO format and json. The input file is assumed to use the INFO format unless the file extension is .json. An example of an input file can be found here.

The following options are available:

Scan path

adamantine supports two kinds of scan path input: the segment format and the event format.

Segment format

After the self-explainatory tree-line header, the column descriptions are:

The first entry must be a spot. If it was a line, there would be no way to know where the line starts (since the coordinates are the ending coordinates). By convention, we avoid using a zero second dwell time for the first spot and instead choose some small positive number.

A scan file example can be found here.

Event format

For an event series the first segment is a point, then the rest are lines. The column descriptions are:

A scan file example can be found here.

Material deposition

adamantine supports two ways to deposit material: based on the scan path and based on a separate material deposition file.

Scan-path-based deposition

If the material deposition is based on the scan path, then material is added according to the deposition_length, deposition_width, deposition_height, deposition_lead_time, and deposition_time input parameters in the geometry input block. Cells are activated if they are crossed by a rectangular prism (rectangle in 2D) traveling along the scan path. In 3D the rectangular prism is centered with the (x,y) values of the scan path and the top of the rectangular prism is at the z value of the scan path (i.e. the scan path height gives the new height of the material after deposition). Near the end of segments, the length of the rectangular prism is truncated so as to not deposit material past the edge of the segment. Material can be deposited with a lead time ahead of the heat source (controlled by deposition_lead_time). Depositing material requires modifying the simulation mesh, which can be computationally intensive. To reduce the cost, material can be added in "lumps", with the time between lumps set by deposition_time.

File-based deposition

The material deposition can also be set by boxes defined in a separate file. The format of this file is as follows.

The first entry of the file is the dimension the problem: 2 or 3.

An example of material deposition file can be found here.

Examples

Examples that showcase adamantine capabilities can be found here.

License

adamantine is distributed under the 3-Clause BSD License.

Questions

If you have any question, find a bug, or have feature request please open an issue.

Contributing

We encourage you to contribute to adamantine! Please check out the guidelines about how to proceed.