Load engines from TOML and improve scenario audio and carb tuning

Migrate 32 engine definitions into validated startup-loaded TOML files and separate configuration and snapshots from scenario assembly. Add camera-based stereo propagation from shared pipe geometry, preserve exhaust character, tune carburetor mixtures and idle, use ignition cuts for carb engines, and support returning to the scenario menu.

Validation: full Windows build and all 14 CTest checks passed.
This commit is contained in:
max
2026-10-24 03:24:35 +02:00
parent 5607dcf2b5
commit bf8621ad39
82 changed files with 24084 additions and 648 deletions

152
engines/saab-expansion.toml Normal file
View File

@@ -0,0 +1,152 @@
# Engine definition. Dimensional keys state their units.
schema_version = 1
id = "saab-expansion"
name = "Saab B205 / expansion silencers"
category = "Inline four / Saab"
description = "Two single expansion chambers, same body volumes"
order = 5
cycle = "four_stroke"
[engine]
bank_angle_deg = 56.0
collector_volume_litres = 0.6
cylinders = 4
initial_rpm = 1200.0
initialize_phased_charge = true
layout = "inline"
maximum_load_torque_nm = 200.0
minimum_substeps = 2
phase_degrees = [0.0, 180.0, 540.0, 360.0]
pipe_damping = 0.0
plenum_volume_litres = 3.0
starter_torque_nm = 65.0
throttle_diameter_mm = 52.0
topology = "collector"
[cylinder]
afr = 14.7
ambient_temperature_k = 300.0
bore_mm = 90.0
burn_duration_deg = 60.0
burn_start_deg = 5.0
compression = 8.8
energy_variation = 0.05
exhaust_close_deg = 390.0
exhaust_open_deg = 130.0
exhaust_valve_count = 2
exhaust_valve_diameter_mm = 28.0
exhaust_valve_lift_mm = 8.0
fuel_lhv_j_per_kg = 4.4e+07
heat_transfer = 100.0
intake_close_deg = 590.0
intake_open_deg = 340.0
intake_valve_count = 2
intake_valve_diameter_mm = 32.0
intake_valve_lift_mm = 8.5
misfire_probability = 0.0
rod_mm = 153.0
stroke_mm = 78.0
wall_area = 0.02
wiebe_a = 5.0
wiebe_m = 2.0
[crankshaft]
friction_constant_nm = 12.0
friction_quadratic_nm_s2 = 0.0
friction_viscous_nm_s = 0.012
inertia_kg_m2 = 0.18
[ecu]
idle_base_opening = 0.08
idle_control = "feedback"
idle_ki = 4e-05
idle_kp = 0.0001
idle_max_opening = 0.25
idle_minimum_advance_deg = -10.0
idle_rpm = 850.0
idle_spark_gain = 0.025
ignition_map = [[0.0, 10.0], [15000.0, 40.0]]
overrun_cut_rpm = 2000.0
overrun_fuel_cut_enabled = true
overrun_ignition_cut_enabled = false
overrun_resume_rpm = 1300.0
power_afr = 12.8
rev_limit_enabled = true
rev_limit_fuel_cut_enabled = true
rev_limit_rpm = 6500.0
rev_resume_rpm = 6250.0
stoichiometric_afr = 14.7
throttle_closing_rate = 0.0
throttle_closing_time_constant_s = 0.0
throttle_rate = 1000.0
throttle_time_constant_s = 0.001
[vehicle]
air_density = 1.225
clutch_capacity = 300.0
clutch_engagement_rate = 8.0
drag_coefficient = 0.32
final_drive_ratio = 4.05
frontal_area = 2.2
gear_ratios = [3.382716, 1.758025, 1.177778, 0.8938271, 0.6592593]
gravity = 9.80665
mass_kg = 1675.0
primary_reduction = 1.0
rolling_resistance = 0.015
rotational_inertia_kg_m2 = 3.6
wheel_radius_mm = 317.0
[fuel]
system = "injection"
[silencers]
cell_length_mm = 35.0
connecting_length_mm = 800.0
diameter_mm = 60.0
enabled = true
inlet_length_mm = 1400.0
outlet_length_mm = 350.0
[silencers.resonator]
chambers = 1
core_diameter_mm = 60.0
length_mm = 400.0
loss_coefficient = 0.1
passage_diameter_mm = 60.0
resistance = 2.0
type = "expansion"
volume_litres = 6.0
[silencers.muffler]
chambers = 1
core_diameter_mm = 60.0
length_mm = 650.0
loss_coefficient = 0.35
passage_diameter_mm = 60.0
resistance = 4.0
type = "expansion"
volume_litres = 18.0
[[pipes]]
id = "intake"
cells = 8
diameter_mm = 60.0
length_mm = 150.0
[[pipes]]
id = "runners"
count = 4
cells = 10
diameter_mm = 32.0
length_mm = 250.0
[[pipes]]
id = "primaries"
count = 4
cells = 10
diameter_mm = 34.0
length_mm = 280.0
[[pipes]]
id = "tailpipe"
profile = "silenced"