2024-01-18 19:41:13 +11:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-02-02 22:03:47 +11:00
|
|
|
#include "fluid_holder.hpp"
|
2024-01-18 19:41:13 +11:00
|
|
|
|
|
|
|
namespace sim::coolant
|
|
|
|
{
|
|
|
|
|
|
|
|
class pump
|
|
|
|
{
|
2024-02-02 22:03:47 +11:00
|
|
|
fluid_holder* const src;
|
|
|
|
fluid_holder* const dst;
|
2024-01-18 19:41:13 +11:00
|
|
|
|
2024-02-02 22:03:47 +11:00
|
|
|
const double mass; // grams
|
|
|
|
const double radius; // meters
|
|
|
|
const double l_per_rev; // litres
|
|
|
|
const double friction; // J/rev
|
2024-01-18 19:41:13 +11:00
|
|
|
|
2024-02-02 22:03:47 +11:00
|
|
|
double velocity = 0; // m/s
|
2024-02-05 18:33:31 +11:00
|
|
|
double power = 0; // W
|
2024-01-18 19:41:13 +11:00
|
|
|
|
2024-02-02 22:03:47 +11:00
|
|
|
public:
|
2024-01-18 19:41:13 +11:00
|
|
|
|
2024-02-05 18:33:31 +11:00
|
|
|
bool powered = true;
|
|
|
|
bool idling = false;
|
2024-01-18 19:41:13 +11:00
|
|
|
|
2024-02-03 18:12:18 +11:00
|
|
|
pump(fluid_holder* src, fluid_holder* dst, double mass, double radius, double l_per_rev, double friction);
|
2024-01-18 19:41:13 +11:00
|
|
|
|
2024-02-05 18:33:31 +11:00
|
|
|
double get_flow() const; // g/s
|
2024-02-02 22:03:47 +11:00
|
|
|
double get_rpm() const; // rev/min
|
2024-01-18 19:41:13 +11:00
|
|
|
|
2024-02-05 18:33:31 +11:00
|
|
|
const char* get_state_string();
|
2024-02-02 22:03:47 +11:00
|
|
|
void update(double dt);
|
2024-01-18 19:41:13 +11:00
|
|
|
};
|
2024-02-02 22:03:47 +11:00
|
|
|
|
2024-01-18 19:41:13 +11:00
|
|
|
};
|
|
|
|
|