All conversion between different materials have to be defined as reactions. Consequently, all the reactions defined do not necessarily require to be actual chemical processes in the system and can be used for many different purposes. The XML tag for defining a reaction is <reaction>.
Reactions have to be assigned a unique case-sensitive name. In the GUI, defining a new reaction with the same name replaces the earlier reaction. This property can be defined using the attribute “name” in the tag <reaction>.
The reactions can be arranged in the order they are required to be implemented. This order is important as it might affect the results. In the GUI, the reactions can be moved up or down to set the order. This property can be defined using the XML tag <order>.
Materials, along with the volumetric ratios of the materials being formed or used, can be defined as reactants and products. The volumetric ratios are read as doubles. The main reactant should be assigned a ratio of 1.0, and the other reactants are assigned ratios that can be calculated from the stoichiometry and the base density of the material. These properties are defined using the tags <reactant> or <product> and <materialName> and <ratio>.
If a reaction is set as discrete, the reaction rate is calculated individually for each particle. Also, any change in amount in the materials present in this particle, due to the reaction of this particle, is carried out from the came particle. In order for a reaction to be discrete, it should contain at least one non-universal reactant.
If this parameter is set to false, the rate of calculation is calculated for the entire system and then the reactant and the product materials are distributed between particles according to the plugins defined. This property can be defined using the XML tag <discrete>.
Other reactions can be added as successors to this reaction. When a reaction is deactivated by a trigger, its successor reaction is activated. The triggers of the successor reactions still have to keep them activated.
The following XML block shows the setup of a reaction the XML input file.
<reaction name="myReaction">
<order>0</order>
<reactant>
<materialName>myMainReactantMaterial</materialName>
<ratio>1.0</ratio>
</reactant>
<reactant>
<materialName>mySecondReactantMaterial</materialName>
<ratio>0.5677</ratio>
</reactant>
<product>
<materialName>myMainProductMaterial</materialName>
<ratio>0.596</ratio>
</product>
<product>
<materialName>mySecondProductMaterial</materialName>
<ratio>1.57</ratio>
</product>
<discrete>true</discrete>
</reaction>
The name of the reaction can be given with the attribute name. The order defines the position of this reaction in the list of all reactions. All the reactants and products can be listed using the tags reactant and product respectively. The name of the material for the reactant of the product can be given between the tag materialName and the volumetric ratio of the reactant or the product can be given between the tag ratio. The value of the ratio is read as a double.