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

40 lines
1.1 KiB
C++
Raw Normal View History

2024-01-16 20:30:22 +11:00
#pragma once
#include "vapor_pressure.hpp"
namespace sim::coolant
{
struct fluid_t
{
const double gPl; // g/L
const double gPmol; // g/mol
2024-01-18 00:23:55 +11:00
const double jPg; // J/g latent heat of vaporisation
const double jPgk; // J/g/K heat capacity
2024-01-21 19:07:38 +11:00
const double bubble_speed; // m/s
2024-01-16 20:30:22 +11:00
const coolant::vapor_pressure vapor_pressure;
2024-01-21 19:07:38 +11:00
constexpr fluid_t(double gPl, double gPmol, double jPg, double jPgk, double bubble_speed, coolant::vapor_pressure vapor_pressure) :
gPl(gPl), gPmol(gPmol),
jPg(jPg), jPgk(jPgk),
vapor_pressure(vapor_pressure),
bubble_speed(bubble_speed)
{
}
2024-01-16 20:30:22 +11:00
constexpr double g_to_mol(double g) const { return g / gPmol; }
constexpr double mol_to_g(double mol) const { return mol * gPmol; }
constexpr double g_to_l(double g) const { return g / gPl; }
constexpr double l_to_g(double l) const { return l * gPl; }
constexpr double mol_to_l(double mol) const { return g_to_l(mol_to_g(mol)); }
constexpr double l_to_mol(double l) const { return g_to_mol(l_to_g(l)); }
};
2024-01-21 19:07:38 +11:00
constexpr const fluid_t WATER = fluid_t(1000, 18, 2257, 4.1816, 0.3, {8.07131, 1730.63, 233.426});
2024-01-16 20:30:22 +11:00
}