1 #ifndef ABLATELIBRARY_TRANSPORTMODEL_HPP
2 #define ABLATELIBRARY_TRANSPORTMODEL_HPP
4 #include <petscsystypes.h>
6 namespace ablate::eos::transport {
8 enum class TransportProperty { Conductivity, Viscosity, Diffusivity };
36 constexpr std::string_view to_string(
const TransportProperty& prop) {
38 case TransportProperty::Conductivity:
39 return "conductivity";
40 case TransportProperty::Viscosity:
42 case TransportProperty::Diffusivity:
53 constexpr TransportProperty from_string(
const std::string_view& prop) {
54 if (prop ==
"conductivity")
return TransportProperty::Conductivity;
55 if (prop ==
"viscosity")
return TransportProperty::Viscosity;
56 if (prop ==
"diffusivity")
return TransportProperty::Diffusivity;
57 throw std::invalid_argument(
"No known TransportProperty for " + std::string(prop));
66 inline std::ostream& operator<<(std::ostream& out,
const TransportProperty& prop) {
67 auto string = to_string(prop);
78 inline std::istream& operator>>(std::istream& in, TransportProperty& prop) {
79 std::string propString;
81 prop = from_string(propString);
Definition: transportModel.hpp:10
virtual ThermodynamicFunction GetTransportFunction(TransportProperty property, const std::vector< domain::Field > &fields) const =0
virtual ThermodynamicTemperatureFunction GetTransportTemperatureFunction(TransportProperty property, const std::vector< domain::Field > &fields) const =0