Combustion Engine Thermals
Advanced thermal simulation for combustion engines. Models coolant, oil, cylinder wall, and exhaust temperatures with realistic heat transfer, overheat damage, and component failure mechanics.
Advanced thermal simulation for combustion engines. Models coolant, oil, cylinder wall, engine block, and exhaust temperatures with realistic heat transfer between components. Simulates overheat damage progression including head gasket failure, piston ring damage, connecting rod bearing wear, and catastrophic engine block melting.
State Fields
M.engineBlockTemperature -- Engine block temperature (°C)
M.cylinderWallTemperature -- Cylinder wall temperature (°C)
M.coolantTemperature -- Coolant temperature (°C)
M.oilTemperature -- Oil temperature (°C)
M.exhaustTemperature -- Exhaust gas temperature (°C)
M.radiatorFanSpin -- Radiator fan spin speed (for audio/visual)
M.exhaustEndNodes -- Exhaust pipe endpoint node IDs (for visual effects)
-- Damage state
M.engineBlockOverheatDamage -- Cumulative engine block overheat damage (0.0+)
M.oilOverheatDamage -- Cumulative oil overheat damage (0.0+)
M.cylinderWallOverheatDamage -- Cumulative cylinder wall overheat damage (0.0+)
M.headGasketBlown -- Boolean: head gasket failure state
M.pistonRingsDamaged -- Boolean: piston ring damage state
M.connectingRodBearingsDamaged -- Boolean: connecting rod bearing damage state
M.engineBlockMelted -- Boolean: catastrophic engine block failure
M.cylinderWallsMelted -- Boolean: catastrophic cylinder wall failure
M.debugData -- Table of debug values for thermal visualizationImplementation Recipes
Manual Cooling / Heating
Subtract from or add to temperature values in updateFixedStep to simulate external thermal effects (like methanol injection or extreme weather).
local engine = powertrain.getDevice("mainEngine")
if engine and engine.thermals then
-- Cool the engine by 5 degrees per second
engine.thermals.coolantTemperature = engine.thermals.coolantTemperature - (5 * dt)
endMonitoring Overheat
Check damage values to trigger "Check Engine" lights or limp modes.
if (engine.thermals.engineBlockOverheatDamage or 0) > 0 then
electrics.values.checkengine = 1
endSee Also
- Combustion Engine — Parent engine device
- Turbocharger — Exhaust-driven compressor (heat source)
- Supercharger — Engine-driven compressor
Combustion Engine
Internal combustion engine device with torque curves, starter motor, ignition control, and rev limiters. The primary power source for most vehicles in BeamNG.
Compressor
Generic air compressor powertrain device. Provides compressed air for pneumatic systems such as air brakes, air suspension, and horn systems.