Fire Simulation

Fire Simulation

From BeamNG

Revision as of 00:34, 4 November 2019 by Toron Beldevar (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

As of version, supports the use of jbeam variables to drive a particle-based fire simulation. These variables can be combined to approximate the kind of fire behavior found in real vehicles. Fire can spread between nodes within a vehicle. Due to the way BeamNG handles vehicles on individually processed threads, spread of fire between vehicles is not currently supported.

Fire behavior

Nodes store both chemical and heat energy. Chemical energy can only be depleted as a node burns, and is converted into heat energy. Nodes lose heat to their surroundings over time, and this heat loss occurs more quickly at high airspeeds or when underwater. When a node burns, it gains heat energy and also radiates heat energy to nearby nodes, increasing their temperature. Nodes with high mass or high specific heat can absorb more heat energy per unit of temperature increase. This dynamic transfer of energy is what sustains a vehicle fire and allows it to spread or die down. The node variables controlling all of this are listed below.

Jbeam Variables



Name Type Optional for Fire Default Value Typical Range Description
chemEnergy float NOk false 50 - 2000 This variable specifies the amount of chemical energy, or fuel, in a node. For any given burn rate, this controls how long the node will burn for. Typically ranges from 50 (a few seconds) to 2000 (several minutes) at high burn rates.
burnRate float NOk false 0.1 - 10 Controls the intensity with which a node burns. In physical terms, this refers to how quickly the node's chemical energy is converted into heat energy. Typically ranges from 0.1 (feeble flame) to 10 (intense fireball).
flashPoint float NOk false 200 - 1000 A node with a temperature in degrees C greater than its flash point will begin to burn, radiating heat according to its burnRate. Typically ranges from around 200 degrees for gasoline, up to more than 1000 degrees for fire-resistant materials.
smokePoint float NOk false 150 - 1000 A node with a temperature greater than its smoke point will begin to emit smoke particles.
specHeat float Ok 1 0.01 - 100 Specific heat - controls the amount of heat each unit of mass can hold. Nodes with a high specific heat can absorb more heat energy with little temperature increase, while nodes with low specific heat will quickly rise in temperature after absorbing only a little heat energy.
selfIgnitionCoef float Ok false 0 - 1 Self-ignition coefficient - controls the amount of heat energy added to a node through impacts with surfaces. It is driven by the same physics that controls the emission of spark particles, so is a good choice for substances likely to be ignited by sparks (such as fuel). Since self-ignition merely adds heat to a node, whether that node actually ignites also depends on other factors such as specHeat and flashPoint.
containerBeam string Ok false "fuelTank1", "fuelTank2", etc This variable can be assigned to both nodes and beams. Any node with a containerBeam value cannot be heated until a beam with the same containerBeam value is broken. This is useful for fuel tanks, preventing the volatile nodes inside from igniting unless the fuel tank is damaged.
baseTemp float Ok false 200 - 1000 This variable sets a constant base temperature for a node, measured in degrees C. It is useful for hot elements such as exhaust manifolds, which may ignite other flammable nodes through direct contact.
conductionRadius float Ok false 0.05 - 1 For nodes with a base temperature, the conduction radius is the range at which that node is able to conduct heat to other nodes. It is measured in meters.


Diagram of flammable node locations in a typical car

To conserve CPU time and improve accuracy, the number of flammable nodes is usually kept to a minimum. Flammable nodes are generally found in the fuel tank area, along the length of the chassis or body, in the engine bay, and in the engine block. Spacing of flammable nodes should be considered when setting up node fire variables, as heat transfer between nodes falls off rapidly with distance.


In-line example:

        ["e1r", 0.12, -1.62, 0.30,{"chemEnergy":500,"burnRate":0.39,"flashPoint":600,"smokePoint":550,"specHeat": 0.1,"selfIgnitionCoef":false,"containerBeam":false,"baseTemp":500,"conductionRadius":0.09}],

Persistent variables example:

        {"chemEnergy":500,"burnRate":0.39,"flashPoint":600,"smokePoint":550,"specHeat": 0.1,"selfIgnitionCoef":false,"containerBeam":false,"baseTemp":500,"conductionRadius":0.09}
        ["e1r", 0.12, -1.62, 0.30],
        ["e1l", 0.12, -1.31, 0.30],
        {"chemEnergy":false,"burnRate":false,"flashPoint":false,"smokePoint":false,"specHeat": false,"selfIgnitionCoef":false,"containerBeam":false,"baseTemp":false,"conductionRadius":false}

Unless using in-line formatting, all variables should be reset to false when no-longer needed. Applying fire variables to more nodes than needed can reduce the accuracy of the simulation.

Vehicle Creation
Get started: Introduction to Vehicle Creation
See also: JBeam ExamplesJBeam Physics Theory