.. _ucLaserLayerPowder: Laser Hatched Layer with Powder Layer ===================================== Goal ---- A powder bed over a plate of SS316L is taken as an initial geometry. The Gaussian laser pulse with normal incidence melts the metal, and hatches a layer. Powder generation is possible in KiSSAM, but it takes simulation time. When powder is set on a flat substrate, the same powder can be reused in different simulations. In this sample simulation, we use powder layer that was generated before. It should be in a vdb format, with mesh size that corresponds to the simulation setting. Run --- Copy the :download:`JSON file provided with the usercase <../jsonfiles/Laser_layer_powder.json>` into the simulation folder, and the :download:`powder layer file <../jsonfiles/init_spheres.vdb>`, into the simulation folder. .. code:: bash > cp /Laser_layer_powder.json . > cp /init_spheres.vdb . Run the code from terminal with the provided JSON file. You may need to edit the information on the license file in it. .. code:: bash > INPUT_JSON_FILE=Laser_layer_powder.json /opt/KiSSAM/start_calc.sh Make sure that simulation is started by making sure there are no fatal errors in the :file:`.log` file that has appeared. It might be necessary to insert the correct license filepath. Input Configuration ------------------- The simulation parameters can be adjusted by editing the JSON file. .. literalinclude:: ../jsonfiles/Laser_layer_powder.json :language: json :linenos: The parameters that are not specified here are taken from the :file:`/opt/KiSSAM/default.json` file. Simulation Results ------------------ The simulation runs for ~18 hours. The default name for the simulation output directory is `output`. 3D view ^^^^^^^ The track geometry is stored in the openVDB format :file:`output/geometry.vdb`. It is updated during the simulation process and stores the latest state. View it with Blender or VDB view. .. figure:: ucdata/LLpowder/blender-view.png openVDB file loaded and rendered in Blender Images and animation output ^^^^^^^^^^^^^^^^^^^^^^^^^^^ The meltpool states are rendered as images and stored in :file:`output/rendered3D`. The images of cross-sections are found in :file:`output/cross-sections`. .. figure:: ucdata/LLpowder/rendered-pic494000.png Example of the combined image :file:`combinedIMG/pic-250000.png` Surface analysis ^^^^^^^^^^^^^^^^ In the simulation folder, run the script generating file geometry data in text format: .. code:: bash > /opt/KiSSAM/scripts/surfaceAnalyzer.x output/geometry.vdb > heights.dat The output is the text file :file:`heights.dat`. .. code:: #units: millimeters #Xcoord Ycoord SurfaceHeight MeltpoolDepthPosition 0 0 4.56 4.56 0.003 0 4.56 4.56 0.006 0 4.56 4.56 0.009 0 4.56 4.56 0.012 0 4.56 4.56 0.015 0 4.56 4.56 0.018 0 4.56 4.56 0.021 0 4.56 4.56 ... Here we plot the third and the fourths columns as a colormap .. figure:: ucdata/LLpowder/heights.png Surface information plotted in the xy plane Cross Section Image ^^^^^^^^^^^^^^^^^^^ Let us run this script to extract cross-section at :math:`x=1.5` mm from the track start `startPosX` (:math:`1` mm): .. code:: bash > /opt/KiSSAM/scripts/drawCrossSection.x output/geometry.vdb trackXcrossSection.png --box 2.5,1.91,4.4867 2.5,2.09,4.6 --background E8F0F200 --substrate 295569FF --remelted CD86F2FF One pixel of the image is one mesh step: `NumericalParams.dr` (3 μm) in the input file. .. figure:: ucdata/LTplate/trackXcrossSection.* Cross section in simulation