Port FluidSim core and scenarios to C++20

This commit is contained in:
maxwes08
2026-10-22 23:52:20 +02:00
commit a859740a95
47 changed files with 3851 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
#pragma once
#include "FluidSim/Engine.hpp"
namespace fluidsim::port {
// Fixed thermodynamic boundary matching the C# Atmosphere component.
class Atmosphere final : public Component {
public:
float pressure{101325.0f};
float temperature{300.0f};
float gas_constant_value{gas_constant};
float gamma_value{gamma};
Port port{};
Atmosphere() { update_port(); }
float density() const { return pressure / (gas_constant_value * temperature); }
float specific_enthalpy() const {
return gamma_value / (gamma_value - 1.0f) * pressure / density();
}
std::vector<Port*> ports() override { return {&port}; }
void update_state(float /*dt*/) override { update_port(); }
private:
void update_port() {
port.pressure = pressure;
port.density = density();
port.temperature = temperature;
port.enthalpy = specific_enthalpy();
port.air_fraction = 1.0f;
}
};
} // namespace fluidsim::port