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

46 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include "fluid_t.hpp"
namespace sim::coolant
{
class fluid_holder
{
protected:
double level = 0; // litres
double steam = 0; // grams
double heat = 0; // celsius
public:
2024-02-05 18:33:31 +11:00
fluid_holder(fluid_t fluid, double volume, double extra_mass);
const fluid_t fluid;
const double volume; // litres
const double extra_mass; // grams
virtual double add_heat(double m, double t);
virtual double extract_fluid(double amount);
virtual double add_fluid(double amount, double heat);
2024-02-04 23:22:15 +11:00
virtual void add_steam(double amount, double t);
2024-02-05 18:33:31 +11:00
virtual double get_volume() const { return volume; } // litres
virtual double get_level() const { return level; } // litres
virtual double get_heat() const { return heat; } // celsius
virtual double get_steam() const { return steam; } // grams
virtual double get_steam_volume() const { return get_volume() - get_level(); } // litres
virtual double get_mass() const { return fluid.l_to_g(get_level()) + get_steam(); } // grams
virtual double get_thermal_mass() const { return get_mass() + extra_mass; } // grams
virtual double get_pressure() const; // pascals
virtual double get_steam_density() const; // g/L
void update(double dt);
};
};