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

34 lines
504 B
C++
Raw Normal View History

2024-01-18 18:00:39 +11:00
#pragma once
#include "fluid_holder.hpp"
2024-01-18 18:00:39 +11:00
namespace sim::coolant
{
class valve
{
const double max;
fluid_holder* const src;
fluid_holder* const dst;
2024-01-18 18:00:39 +11:00
2024-02-04 23:22:15 +11:00
double speed = 0;
2024-01-18 18:00:39 +11:00
double state = 0;
2024-02-04 23:22:15 +11:00
double flow = 0; // L/s
2024-01-18 18:00:39 +11:00
public:
2024-02-05 18:33:31 +11:00
valve(fluid_holder* src, fluid_holder* dst, double state, double max);
void update(double secs);
void add_open_speed(double v);
void clear_open_speed();
constexpr double get_state() const { return state; }
2024-02-04 23:22:15 +11:00
constexpr double get_flow() const { return flow; }
2024-01-18 18:00:39 +11:00
};
};