Improve physical geometry, fluid solvers, audio, and profiling
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#pragma once
|
||||
#include "FluidSim/MeshResolution.hpp"
|
||||
#include "FluidSim/Engine.hpp"
|
||||
#include "FluidSim/Ecu.hpp"
|
||||
#include "FluidSim/Vehicle.hpp"
|
||||
#include "FluidSim/Carburetor.hpp"
|
||||
#include "FluidSim/PhysicalGeometry.hpp"
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
namespace fluidsim::port {
|
||||
@@ -17,11 +20,14 @@ struct PipeConfig {
|
||||
float diameter{}, length{}; // metres
|
||||
int cells{}, count{1};
|
||||
bool silenced{};
|
||||
bool operator==(const PipeConfig&) const = default;
|
||||
};
|
||||
|
||||
// Parsed calibration only. Runtime state belongs to the scenario components.
|
||||
// Dimensional fields use SI units after loading.
|
||||
struct EngineConfig {
|
||||
PhysicalGeometry geometry;
|
||||
float cells_per_meter{}; // Zero retains legacy programmatic meshes. TOML scenarios specify a density.
|
||||
int cylinders{};
|
||||
EngineLayout layout{EngineLayout::Inline};
|
||||
ExhaustTopology topology{ExhaustTopology::Collector};
|
||||
@@ -31,6 +37,9 @@ struct EngineConfig {
|
||||
EcuConfig ecu;
|
||||
VehicleConfig vehicle;
|
||||
CarburetorConfig fuel;
|
||||
FourStrokeCylinder::CamProfile intake_cam,exhaust_cam;
|
||||
FourStrokeCylinder::ValveDynamics intake_valve,exhaust_valve;
|
||||
struct ValveSound { float mode_hz{3600}, effective_mass_kg{0.18f}, radiation_area{0.001f}, damping_ratio{0.9f}; } valve_sound;
|
||||
bool carbureted{}, initialize_phased_charge{true};
|
||||
float initial_rpm{}, starter_torque{}, maximum_load_torque{};
|
||||
float plenum_volume{}, collector_volume{}, throttle_diameter{}, pipe_damping{};
|
||||
@@ -45,7 +54,14 @@ struct EngineConfig {
|
||||
int header_groups() const { return cylinders==3?1:2; }
|
||||
};
|
||||
|
||||
struct JunctionBranchConfig {
|
||||
int pipe{}; bool left{};
|
||||
std::array<float,3> direction{};
|
||||
};
|
||||
struct JunctionConfig {
|
||||
std::string model{"volume"}; // volume, characteristic, or legacy
|
||||
float turning_loss{0};
|
||||
std::vector<JunctionBranchConfig> branches;
|
||||
bool h_pipe{true};
|
||||
float junction_volume{50e-6f};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user