fast-nuclear-sim/src/coolant/pump.hpp

38 lines
619 B
C++
Raw Normal View History

2024-01-18 19:41:13 +11:00
#pragma once
#include "fluid_holder.hpp"
2024-01-18 19:41:13 +11:00
namespace sim::coolant
{
class pump
{
fluid_holder* const src;
fluid_holder* const dst;
2024-01-18 19:41:13 +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
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
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
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
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();
void update(double dt);
2024-01-18 19:41:13 +11:00
};
2024-01-18 19:41:13 +11:00
};