.. _JSON file: JSON file ======================================== Overview -------- The simulation of powder bed/substrate fusion is a typical simulation setup, and such simulation preset is available. All parameters of the simulation can be specified by the user in the input JSON file. If a parameter is not listed in the JSON file, default values from the :file:`default.json` are used. JSON data is written as a comma-separated list of key/value pairs. The list is enclosed in curly brackets. The key and value are separated by a colon(:) in the middle with the key on the left and the value on the right. The key is a string surrounded by double quotation marks. The value can be (1) a number, (2) a string, (3) or JSON data object. With the third option, the JSON data is nested. .. note:: The nested field can be referred in the description with dot syntax, i.e. the ``{ScanStrategy: {Beam: ... }}`` field is referred to as ``ScanStrategy.Beam``. Here are zero level data description. The values of 'JSON' data files are detailed in the further sections. .. include:: ../json_desc/descJSON.rst For convenience, the provided JSON file is annotated. Some fields are added as comments for the user and are not used in the code. For example, the fields ``units`` and ``comment`` that can be found in different sections of the default JSON file are only reference. .. _config-label: Computation Parameters ---------------------- Here the simulation configuration can be controlled with the parameters in the ``config`` section. Set the maximal number of steps ``MaxTimesteps`` or turn on ``AutoTermination`` to set upper limit on the simulation time. If the simulation takes too much disc space, you can increase ``DumpDataRate``, ``IterationSubstepsRate``, turn off ``DumpVTK``, ``DumpVDB``, ``DumpARR``. If more frames per second are required in the rendered images animation, decrease ``IterationSubstepsRate``. Other options are for advanced use of the software. .. include:: ../json_desc/descconfig.rst Simulation domain and Substrate Sizes ------------------------------------- The ``sizes`` section defines full simulation domain size. The fluid dynamics simulation takes place only around the meltpool area. The meltpool area is allowed to move inside the bounds that are specified here. .. _sizes-label: .. include:: ../json_desc/descsizes.rst .. _NumericalParams-label: Numerical Parameters -------------------- The ``NumericalParams`` section defines the mesh cell size and units for nondimensionalization of time, mass and temperature. .. include:: ../json_desc/descNumericalParams.rst .. _Powder-label: Powder ------ In the KiSSAM simulation, the geometry of the powder particles is input through a VDB file. If the powder is defined with sphere coordinates and radii, it should be rasterized with the provided script. In the ``Powder`` section of the JSON file, the input VDB file is specified, and the wetting angle of powder particles, which is, in general, different from the wetting angle of the substrate. .. include:: ../json_desc/descPowder.rst .. _Substrate-label: Substrate --------- The substrate settings are in the ``Substrate`` section. All other properties of the substrate material are defined through the :ref:`Material ` setting. .. include:: ../json_desc/descSubstrate.rst .. _Chamber-label: Camera ------ The surrounding gas parameters in the chamber are defined in the ``Camera`` section. .. include:: ../json_desc/descCamera.rst .. _ScanStrategy-label: Scanning Strategy ----------------- The scanning strategy is defined in the ``ScanStrategy``. section of the JSON file. There are three presets: single track and square layer, and a manual input for the scan path. .. include:: ../json_desc/descScanStrategy.rst Single Track ^^^^^^^^^^^^ In this preset, laser beam turns on in the ``startPosX``, ``startPosY`` position, travels parallel to the :math:`x`-axis with the speed defined in the ``Beam`` section, and turns off when the travel distance is over the defined ``length``. .. figure:: ../images/track-fullXaprox.png :width: 400px Single Track Scan Path .. include:: ../json_desc/descSingleTrack.rst Square Layer ^^^^^^^^^^^^ The settings of a square layer simulation. In this preset, laser beam turns on in the ``startPosX``, ``startPosY`` position. If ``hatchX`` (``hatchY``) is zero, the beam travels parallel to the :math:`x`-axis (:math:`y`-axis) until the travel distance is over ``dimX`` (``dimY``), then waits for ``delayBetweenTracks`` seconds, then it shifts by hatch distance and travels for the same distance in the opposite direction. The scanning speed is defined in the ``Beam`` section. .. figure:: ../images/scan_path.png :width: 400px .. include:: ../json_desc/descSquareLayer.rst .. _xypositions-label: Manual Scan Path ^^^^^^^^^^^^^^^^ If ``XYpositions`` is set as scanning strategy, a set of points is read either from a source file, or from a set of points. Here is an example of an input file. The first column is time (s), the second and third columns are :math:`x` and :math:`y` positions of the laser at that time. The fourth and fifth columns are optional. They contail laser power (W) and laser spot width (m) at that point correspondingly. .. code:: 0.00 1e-3 1e-3 300 100e-6 2.e-3 3e-3 1e-3 300 200e-6 3.e-3 3e-3 2e-3 300 200e-6 4.e-3 2e-3 2e-3 300 100e-6 5.e-3 2e-3 1e-3 300 100e-6 6.e-3 1e-3 1e-3 300 100e-6 If the strategy is set with a ``pointsArray`` instead of the input file, the array contains the rows of this file. .. include:: ../json_desc/descXYpositions.rst The source file can be generated from g-code with the builtin :ref:`G-code converter`. The script uses the same json for the input. The following fields are used in the script. All of the fields are in the ``G-code-converter`` section of the JSON. =============== ============================== ================================================================================== Key Value type Default value =============== ============================== ================================================================================== ``idleSpeed`` value 7000 Scan speed to the coordinate of G0 code in mm/sec --------------------------------------------------------------------------------------------------------------------------------- ``workSpeed`` value 850 Scan speed to the coordinate of G1 code in mm/sec --------------------------------------------------------------------------------------------------------------------------------- ``offset`` list of 2 numbers [25,25] offset in mm --------------------------------------------------------------------------------------------------------------------------------- =============== ============================== ================================================================================== .. _beam-label: Beam Setting ^^^^^^^^^^^^ The energy source parameters are set in the ``ScanStrategy.Beam`` section. .. include:: ../json_desc/descBeam.rst The shape file format is as follows: .. code:: #Xcoordinate,m Ycoordinate,m Power -0.0002 -0.0002 0 -0.0002 -0.000199 0 -0.0002 -0.000198 0 -0.0002 -0.000197 0 -0.0002 -0.000196 0 -0.0002 -0.000195 0 -0.0002 -0.000194 0 -0.0002 -0.000193 0 -0.0002 -0.000192 0 ... .. _jsonSensors: Sensors ------- Settings for the sensors of backscattered electrons and radiation sensors. See more in :ref:`Sensors `. The ``Sensors`` section can contain the two fields: ``Default`` and ``Array``. ``Default`` is a default setting for every sensor that is added to the simulation. ``Array`` is an array. For every element of an array, a sensor is added to the simulation. Every element should be represented by JSON data with the same fields that are present in the default sensor. If any field is not specified, the default value is taken. .. include:: ../json_desc/descDefault.rst .. _jsonVisual: Visualization ------------- The image output parameters are set in the ``Visual`` section. .. include:: ../json_desc/descVisual.rst .. _PhysicalWorld-label: Physical World -------------- The section includes the gravity parameter and the choice of the evaporation model .. include:: ../json_desc/descPhysicalWorld.rst