28#ifndef DUMUX_TABULATED_COMPONENT_HH
29#define DUMUX_TABULATED_COMPONENT_HH
44template<
class RawComponent,
bool useVaporPressure>
49template<
class RawComponent,
bool useVaporPressure>
52 using Scalar =
typename RawComponent::Scalar;
55 static constexpr bool hasSolidState = std::is_base_of<Components::Solid<Scalar, RawComponent>, RawComponent>::value;
58 static constexpr bool hasLiquidState = std::is_base_of<Components::Liquid<Scalar, RawComponent>, RawComponent>::value;
61 static constexpr bool hasGasState = std::is_base_of<Components::Gas<Scalar, RawComponent>, RawComponent>::value;
80template <
class RawComponent,
bool useVaporPressure=true>
85 using Scalar =
typename RawComponent::Scalar;
106 pressMin_ = pressMin;
107 pressMax_ = pressMax;
111 std::cout <<
"-------------------------------------------------------------------------\n"
112 <<
"Initializing tables for the " << RawComponent::name()
113 <<
" fluid properties (" << nTemp*nPress <<
" entries).\n"
114 <<
"Temperature -> min: " << std::scientific << std::setprecision(3)
115 << tempMin <<
", max: " << tempMax <<
", n: " << nTemp <<
'\n'
116 <<
"Pressure -> min: " << std::scientific << std::setprecision(3)
117 << pressMin <<
", max: " << pressMax <<
", n: " << nPress <<
'\n'
118 <<
"-------------------------------------------------------------------------" << std::endl;
121 assert(std::numeric_limits<Scalar>::has_quiet_NaN);
122 const auto NaN = std::numeric_limits<Scalar>::quiet_NaN();
124 vaporPressure_.resize(nTemp_, NaN);
125 minGasDensity_.resize(nTemp_, NaN);
126 maxGasDensity_.resize(nTemp_, NaN);
127 minLiquidDensity_.resize(nTemp_, NaN);
128 maxLiquidDensity_.resize(nTemp_, NaN);
130 const std::size_t numEntriesTp = nTemp_*nPress_;
131 gasEnthalpy_.resize(numEntriesTp, NaN);
132 liquidEnthalpy_.resize(numEntriesTp, NaN);
133 gasHeatCapacity_.resize(numEntriesTp, NaN);
134 liquidHeatCapacity_.resize(numEntriesTp, NaN);
135 gasDensity_.resize(numEntriesTp, NaN);
136 liquidDensity_.resize(numEntriesTp, NaN);
137 gasViscosity_.resize(numEntriesTp, NaN);
138 liquidViscosity_.resize(numEntriesTp, NaN);
139 gasThermalConductivity_.resize(numEntriesTp, NaN);
140 liquidThermalConductivity_.resize(numEntriesTp, NaN);
141 gasPressure_.resize(numEntriesTp, NaN);
142 liquidPressure_.resize(numEntriesTp, NaN);
145 minMaxLiquidDensityInitialized_ =
false;
146 minMaxGasDensityInitialized_ =
false;
147 gasEnthalpyInitialized_ =
false;
148 liquidEnthalpyInitialized_ =
false;
149 gasHeatCapacityInitialized_ =
false;
150 liquidHeatCapacityInitialized_ =
false;
151 gasDensityInitialized_ =
false;
152 liquidDensityInitialized_ =
false;
153 gasViscosityInitialized_ =
false;
154 liquidViscosityInitialized_ =
false;
155 gasThermalConductivityInitialized_ =
false;
156 liquidThermalConductivityInitialized_ =
false;
157 gasPressureInitialized_ =
false;
158 liquidPressureInitialized_ =
false;
161 initVaporPressure_();
165 warningPrinted_ =
false;
173 {
return RawComponent::name(); }
179 {
return RawComponent::molarMass(); }
185 {
return RawComponent::criticalTemperature(); }
191 {
return RawComponent::criticalPressure(); }
197 {
return RawComponent::tripleTemperature(); }
203 {
return RawComponent::triplePressure(); }
214 Scalar result = interpolateT_(vaporPressure_, T);
216 return RawComponent::vaporPressure(T);
229 return RawComponent::vaporTemperature(pressure);
240 Scalar result = interpolateTP_(gasEnthalpy_, temperature, pressure,
241 pressGasIdx_, minGasPressure_, maxGasPressure_,
"gas");
245 if (!gasEnthalpyInitialized_)
247 auto gasEnth = [] (
auto T,
auto p) {
return RawComponent::gasEnthalpy(T, p); };
248 initTPArray_(gasEnth, minGasPressure_, maxGasPressure_, gasEnthalpy_);
249 gasEnthalpyInitialized_ =
true;
253 printWarning_(
"gasEnthalpy", temperature, pressure);
254 return RawComponent::gasEnthalpy(temperature, pressure);
267 Scalar result = interpolateTP_(liquidEnthalpy_, temperature, pressure,
268 pressLiquidIdx_, minLiquidPressure_, maxLiquidPressure_,
"liquid");
272 if (!liquidEnthalpyInitialized_)
274 auto liqEnth = [] (
auto T,
auto p) {
return RawComponent::liquidEnthalpy(T, p); };
275 initTPArray_(liqEnth, minLiquidPressure_, maxLiquidPressure_, liquidEnthalpy_);
276 liquidEnthalpyInitialized_ =
true;
280 printWarning_(
"liquidEnthalpy", temperature, pressure);
281 return RawComponent::liquidEnthalpy(temperature, pressure);
294 Scalar result = interpolateTP_(gasHeatCapacity_, temperature, pressure,
295 pressGasIdx_, minGasPressure_, maxGasPressure_,
"gas");
299 if (!gasHeatCapacityInitialized_)
301 auto gasHC = [] (
auto T,
auto p) {
return RawComponent::gasHeatCapacity(T, p); };
302 initTPArray_(gasHC, minGasPressure_, maxGasPressure_, gasHeatCapacity_);
303 gasHeatCapacityInitialized_ =
true;
307 printWarning_(
"gasHeatCapacity", temperature, pressure);
308 return RawComponent::gasHeatCapacity(temperature, pressure);
321 Scalar result = interpolateTP_(liquidHeatCapacity_, temperature, pressure,
322 pressLiquidIdx_, minLiquidPressure_, maxLiquidPressure_,
"liquid");
326 if (!liquidHeatCapacityInitialized_)
328 auto liqHC = [] (
auto T,
auto p) {
return RawComponent::liquidHeatCapacity(T, p); };
329 initTPArray_(liqHC, minLiquidPressure_, maxLiquidPressure_, liquidHeatCapacity_);
330 liquidHeatCapacityInitialized_ =
true;
334 printWarning_(
"liquidHeatCapacity", temperature, pressure);
335 return RawComponent::liquidHeatCapacity(temperature, pressure);
371 if (!minMaxGasDensityInitialized_)
373 auto gasRho = [] (
auto T,
auto p) {
return RawComponent::gasDensity(T, p); };
374 initMinMaxRhoArray_(gasRho, minGasPressure_, maxGasPressure_, minGasDensity_, maxGasDensity_);
375 minMaxGasDensityInitialized_ =
true;
378 Scalar result = interpolateTRho_(gasPressure_, temperature, density, densityGasIdx_);
382 if (!gasPressureInitialized_)
384 auto gasPFunc = [] (
auto T,
auto rho) {
return RawComponent::gasPressure(T, rho); };
385 initPressureArray_(gasPressure_, gasPFunc, minGasDensity_, maxGasDensity_);
386 gasPressureInitialized_ =
true;
390 printWarning_(
"gasPressure", temperature, density);
391 return RawComponent::gasPressure(temperature, density);
405 if (!minMaxLiquidDensityInitialized_)
407 auto liqRho = [] (
auto T,
auto p) {
return RawComponent::liquidDensity(T, p); };
408 initMinMaxRhoArray_(liqRho, minLiquidPressure_, maxLiquidPressure_, minLiquidDensity_, maxLiquidDensity_);
409 minMaxLiquidDensityInitialized_ =
true;
412 Scalar result = interpolateTRho_(liquidPressure_, temperature, density, densityLiquidIdx_);
416 if (!liquidPressureInitialized_)
418 auto liqPFunc = [] (
auto T,
auto rho) {
return RawComponent::liquidPressure(T, rho); };
419 initPressureArray_(liquidPressure_, liqPFunc, minLiquidDensity_, maxLiquidDensity_);
420 liquidPressureInitialized_ =
true;
424 printWarning_(
"liquidPressure", temperature, density);
425 return RawComponent::liquidPressure(temperature, density);
434 {
return RawComponent::gasIsCompressible(); }
440 {
return RawComponent::liquidIsCompressible(); }
446 {
return RawComponent::gasIsIdeal(); }
458 Scalar result = interpolateTP_(gasDensity_, temperature, pressure,
459 pressGasIdx_, minGasPressure_, maxGasPressure_,
"gas");
463 if (!gasDensityInitialized_)
465 auto gasRho = [] (
auto T,
auto p) {
return RawComponent::gasDensity(T, p); };
466 initTPArray_(gasRho, minGasPressure_, maxGasPressure_, gasDensity_);
467 gasDensityInitialized_ =
true;
471 printWarning_(
"gasDensity", temperature, pressure);
472 return RawComponent::gasDensity(temperature, pressure);
497 Scalar result = interpolateTP_(liquidDensity_, temperature, pressure,
498 pressLiquidIdx_, minLiquidPressure_, maxLiquidPressure_,
"liquid");
502 if (!liquidDensityInitialized_)
508 auto liqRho = [] (
auto T,
auto p) {
return RawComponent::liquidDensity(T, p); };
509 initTPArray_(liqRho, minLiquidPressure_, maxLiquidPressure_, liquidDensity_);
510 liquidDensityInitialized_ =
true;
514 printWarning_(
"liquidDensity", temperature, pressure);
515 return RawComponent::liquidDensity(temperature, pressure);
540 Scalar result = interpolateTP_(gasViscosity_, temperature, pressure,
541 pressGasIdx_, minGasPressure_, maxGasPressure_,
"gas");
545 if (!gasViscosityInitialized_)
547 auto gasVisc = [] (
auto T,
auto p) {
return RawComponent::gasViscosity(T, p); };
548 initTPArray_(gasVisc, minGasPressure_, maxGasPressure_, gasViscosity_);
549 gasViscosityInitialized_ =
true;
553 printWarning_(
"gasViscosity", temperature, pressure);
554 return RawComponent::gasViscosity(temperature, pressure);
567 Scalar result = interpolateTP_(liquidViscosity_, temperature, pressure,
568 pressLiquidIdx_, minLiquidPressure_, maxLiquidPressure_,
"liquid");
572 if (!liquidViscosityInitialized_)
574 auto liqVisc = [] (
auto T,
auto p) {
return RawComponent::liquidViscosity(T, p); };
575 initTPArray_(liqVisc, minLiquidPressure_, maxLiquidPressure_, liquidViscosity_);
576 liquidViscosityInitialized_ =
true;
580 printWarning_(
"liquidViscosity",temperature, pressure);
581 return RawComponent::liquidViscosity(temperature, pressure);
594 Scalar result = interpolateTP_(gasThermalConductivity_, temperature, pressure,
595 pressGasIdx_, minGasPressure_, maxGasPressure_,
"gas");
599 if (!gasThermalConductivityInitialized_)
601 auto gasTC = [] (
auto T,
auto p) {
return RawComponent::gasThermalConductivity(T, p); };
602 initTPArray_(gasTC, minGasPressure_, maxGasPressure_, gasThermalConductivity_);
603 gasThermalConductivityInitialized_ =
true;
607 printWarning_(
"gasThermalConductivity", temperature, pressure);
608 return RawComponent::gasThermalConductivity(temperature, pressure);
621 Scalar result = interpolateTP_(liquidThermalConductivity_, temperature, pressure,
622 pressLiquidIdx_, minLiquidPressure_, maxLiquidPressure_,
"liquid");
626 if (!liquidThermalConductivityInitialized_)
628 auto liqTC = [] (
auto T,
auto p) {
return RawComponent::liquidThermalConductivity(T, p); };
629 initTPArray_(liqTC, minLiquidPressure_, maxLiquidPressure_, liquidThermalConductivity_);
630 liquidThermalConductivityInitialized_ =
true;
634 printWarning_(
"liquidThermalConductivity", temperature, pressure);
635 return RawComponent::liquidThermalConductivity(temperature, pressure);
643 static void printWarning_(
const std::string& quantity,
Scalar arg1,
Scalar arg2)
650 std::cerr <<
"Warning: tabulated component '" <<
name()
651 <<
"' has not been initialized. "
652 <<
"Call FluidSystem::init() to use the tabulation in order to reduce runtime. \n";
654 std::cerr <<
"Warning: "<<quantity<<
"(T="<<arg1<<
", p="<<arg2<<
") of component '"<<
name()
657 <<
"Forwarded to FluidSystem for direct evaluation of "<<quantity<<
". \n";
663 template<
bool useVP = useVaporPressure, std::enable_if_t<useVP,
int> = 0 >
664 static void initVaporPressure_()
667 for (
unsigned iT = 0; iT <
nTemp_; ++ iT)
675 template<
bool useVP = useVaporPressure, std::enable_if_t<!useVP,
int> = 0 >
676 static void initVaporPressure_() {}
692 template<
class PropFunc,
class MinPFunc,
class MaxPFunc>
693 static void initTPArray_(PropFunc&& f, MinPFunc&& minP, MaxPFunc&& maxP, std::vector<typename RawComponent::Scalar>& values)
695 for (
unsigned iT = 0; iT < nTemp_; ++ iT)
701 for (
unsigned iP = 0; iP < nPress_; ++ iP)
704 values[iT + iP*nTemp_] = f(temperature, pressure);
724 template<
class RhoFunc,
class MinPFunc,
class MaxPFunc>
725 static void initMinMaxRhoArray_(RhoFunc&& rho,
728 std::vector<typename RawComponent::Scalar>& rhoMin,
729 std::vector<typename RawComponent::Scalar>& rhoMax)
731 for (
unsigned iT = 0; iT < nTemp_; ++ iT)
735 rhoMin[iT] = rho(temperature, minP(iT));
737 rhoMax[iT] = rho(temperature, maxP(iT + 1));
739 rhoMax[iT] = rho(temperature, maxP(iT));
753 template<
class PFunc>
754 static void initPressureArray_(std::vector<typename RawComponent::Scalar>& pressure, PFunc&& p,
755 const std::vector<typename RawComponent::Scalar>& rhoMin,
756 const std::vector<typename RawComponent::Scalar>& rhoMax)
758 for (
unsigned iT = 0; iT < nTemp_; ++ iT)
762 for (
unsigned iRho = 0; iRho < nDensity_; ++ iRho)
765 * (rhoMax[iT] - rhoMin[iT])
767 pressure[iT + iRho*nTemp_] = p(temperature, density);
773 static Scalar interpolateT_(
const std::vector<typename RawComponent::Scalar>& values,
Scalar T)
775 Scalar alphaT = tempIdx_(T);
776 if (alphaT < 0 || alphaT >= nTemp_ - 1)
777 return std::numeric_limits<Scalar>::quiet_NaN();
779 unsigned iT = (unsigned) alphaT;
782 return values[iT ]*(1 - alphaT) +
783 values[iT + 1]*( alphaT);
787 template<
class GetPIdx,
class MinPFunc,
class MaxPFunc>
788 static Scalar interpolateTP_(
const std::vector<typename RawComponent::Scalar>& values,
Scalar T,
Scalar p,
789 GetPIdx&& getPIdx, MinPFunc&& minP, MaxPFunc&& maxP,
790 const std::string& phaseName)
792 Scalar alphaT = tempIdx_(T);
793 if (alphaT < 0 || alphaT >= nTemp_ - 1) {
794 return std::numeric_limits<Scalar>::quiet_NaN();
798 unsigned iT = max<int>(0, min<int>(nTemp_ - 2, (
int) alphaT));
801 Scalar alphaP1 = getPIdx(p, iT);
802 Scalar alphaP2 = getPIdx(p, iT + 1);
804 unsigned iP1 = max<int>(0, min<int>(nPress_ - 2, (
int) alphaP1));
805 unsigned iP2 = max<int>(0, min<int>(nPress_ - 2, (
int) alphaP2));
809#if 0 && !defined NDEBUG
810 if(!(0 <= alphaT && alphaT <= 1.0))
811 DUNE_THROW(NumericalProblem,
"Temperature out of range: "
812 <<
"T=" << T <<
" range: [" << tempMin_ <<
", " << tempMax_ <<
"]");
813 if(!(0 <= alphaP1 && alphaP1 <= 1.0))
814 DUNE_THROW(NumericalProblem,
"First " << phaseName
" pressure out of range: "
815 <<
"p=" << p <<
" range: [" << minP(tempIdx_(T)) <<
", " << maxP(tempIdx_(T)) <<
"]");
816 if(!(0 <= alphaP2 && alphaP2 <= 1.0))
817 DUNE_THROW(NumericalProblem,
"Second " << phaseName
" pressure out of range: "
818 <<
"p=" << p <<
" range: [" << minP(tempIdx_(T) + 1) <<
", " << maxP(tempIdx_(T) + 1) <<
"]");
821 return values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
822 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
823 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
824 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
828 template<
class GetRhoIdx>
829 static Scalar interpolateTRho_(
const std::vector<typename RawComponent::Scalar>& values,
Scalar T,
Scalar rho, GetRhoIdx&& rhoIdx)
833 Scalar alphaT = tempIdx_(T);
834 unsigned iT = max<int>(0, min<int>(nTemp_ - 2, (
int) alphaT));
837 Scalar alphaP1 = rhoIdx(rho, iT);
838 Scalar alphaP2 = rhoIdx(rho, iT + 1);
839 unsigned iP1 = max<int>(0, min<int>(nDensity_ - 2, (
int) alphaP1));
840 unsigned iP2 = max<int>(0, min<int>(nDensity_ - 2, (
int) alphaP2));
844 return values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
845 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
846 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
847 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
853 return (nTemp_ - 1)*(
temperature - tempMin_)/(tempMax_ - tempMin_);
857 static Scalar pressLiquidIdx_(
Scalar pressure,
unsigned tempIdx)
859 Scalar plMin = minLiquidPressure_(tempIdx);
860 Scalar plMax = maxLiquidPressure_(tempIdx);
862 return (nPress_ - 1)*(
pressure - plMin)/(plMax - plMin);
866 static Scalar pressGasIdx_(
Scalar pressure,
unsigned tempIdx)
868 Scalar pgMin = minGasPressure_(tempIdx);
869 Scalar pgMax = maxGasPressure_(tempIdx);
871 return (nPress_ - 1)*(
pressure - pgMin)/(pgMax - pgMin);
875 static Scalar densityLiquidIdx_(
Scalar density,
unsigned tempIdx)
877 Scalar densityMin = minLiquidDensity_[tempIdx];
878 Scalar densityMax = maxLiquidDensity_[tempIdx];
879 return (nDensity_ - 1) * (
density - densityMin)/(densityMax - densityMin);
883 static Scalar densityGasIdx_(
Scalar density,
unsigned tempIdx)
885 Scalar densityMin = minGasDensity_[tempIdx];
886 Scalar densityMax = maxGasDensity_[tempIdx];
887 return (nDensity_ - 1) * (
density - densityMin)/(densityMax - densityMin);
891 static Scalar minLiquidPressure_(
int tempIdx)
894 if (!useVaporPressure)
897 return max(pressMin_, vaporPressure_[tempIdx] / 1.1);
901 static Scalar maxLiquidPressure_(
int tempIdx)
904 if (!useVaporPressure)
907 return max(pressMax_, vaporPressure_[tempIdx] * 1.1);
911 static Scalar minGasPressure_(
int tempIdx)
914 if (!useVaporPressure)
917 return min(pressMin_, vaporPressure_[tempIdx] / 1.1 );
921 static Scalar maxGasPressure_(
int tempIdx)
924 if (!useVaporPressure)
927 return min(pressMax_, vaporPressure_[tempIdx] * 1.1);
932 static bool initialized_;
934 static bool warningPrinted_;
938 static std::vector<typename RawComponent::Scalar> vaporPressure_;
940 static std::vector<typename RawComponent::Scalar> minLiquidDensity_;
941 static std::vector<typename RawComponent::Scalar> maxLiquidDensity_;
942 static bool minMaxLiquidDensityInitialized_;
944 static std::vector<typename RawComponent::Scalar> minGasDensity_;
945 static std::vector<typename RawComponent::Scalar> maxGasDensity_;
946 static bool minMaxGasDensityInitialized_;
949 static std::vector<typename RawComponent::Scalar> gasEnthalpy_;
950 static std::vector<typename RawComponent::Scalar> liquidEnthalpy_;
951 static bool gasEnthalpyInitialized_;
952 static bool liquidEnthalpyInitialized_;
954 static std::vector<typename RawComponent::Scalar> gasHeatCapacity_;
955 static std::vector<typename RawComponent::Scalar> liquidHeatCapacity_;
956 static bool gasHeatCapacityInitialized_;
957 static bool liquidHeatCapacityInitialized_;
959 static std::vector<typename RawComponent::Scalar> gasDensity_;
960 static std::vector<typename RawComponent::Scalar> liquidDensity_;
961 static bool gasDensityInitialized_;
962 static bool liquidDensityInitialized_;
964 static std::vector<typename RawComponent::Scalar> gasViscosity_;
965 static std::vector<typename RawComponent::Scalar> liquidViscosity_;
966 static bool gasViscosityInitialized_;
967 static bool liquidViscosityInitialized_;
969 static std::vector<typename RawComponent::Scalar> gasThermalConductivity_;
970 static std::vector<typename RawComponent::Scalar> liquidThermalConductivity_;
971 static bool gasThermalConductivityInitialized_;
972 static bool liquidThermalConductivityInitialized_;
975 static std::vector<typename RawComponent::Scalar> gasPressure_;
976 static std::vector<typename RawComponent::Scalar> liquidPressure_;
977 static bool gasPressureInitialized_;
978 static bool liquidPressureInitialized_;
983 static unsigned nTemp_;
987 static unsigned nPress_;
989 static Scalar densityMin_;
990 static Scalar densityMax_;
991 static unsigned nDensity_;
995template <
class RawComponent,
bool useVaporPressure>
996bool TabulatedComponent<RawComponent, useVaporPressure>::initialized_ =
false;
998template <
class RawComponent,
bool useVaporPressure>
999bool TabulatedComponent<RawComponent, useVaporPressure>::warningPrinted_ =
false;
1002template <
class RawComponent,
bool useVaporPressure>
1003bool TabulatedComponent<RawComponent, useVaporPressure>::minMaxLiquidDensityInitialized_ =
false;
1004template <
class RawComponent,
bool useVaporPressure>
1005bool TabulatedComponent<RawComponent, useVaporPressure>::minMaxGasDensityInitialized_ =
false;
1006template <
class RawComponent,
bool useVaporPressure>
1007bool TabulatedComponent<RawComponent, useVaporPressure>::gasEnthalpyInitialized_ =
false;
1008template <
class RawComponent,
bool useVaporPressure>
1009bool TabulatedComponent<RawComponent, useVaporPressure>::liquidEnthalpyInitialized_ =
false;
1010template <
class RawComponent,
bool useVaporPressure>
1011bool TabulatedComponent<RawComponent, useVaporPressure>::gasHeatCapacityInitialized_ =
false;
1012template <
class RawComponent,
bool useVaporPressure>
1013bool TabulatedComponent<RawComponent, useVaporPressure>::liquidHeatCapacityInitialized_ =
false;
1014template <
class RawComponent,
bool useVaporPressure>
1015bool TabulatedComponent<RawComponent, useVaporPressure>::gasDensityInitialized_ =
false;
1016template <
class RawComponent,
bool useVaporPressure>
1017bool TabulatedComponent<RawComponent, useVaporPressure>::liquidDensityInitialized_ =
false;
1018template <
class RawComponent,
bool useVaporPressure>
1019bool TabulatedComponent<RawComponent, useVaporPressure>::gasViscosityInitialized_ =
false;
1020template <
class RawComponent,
bool useVaporPressure>
1021bool TabulatedComponent<RawComponent, useVaporPressure>::liquidViscosityInitialized_ =
false;
1022template <
class RawComponent,
bool useVaporPressure>
1023bool TabulatedComponent<RawComponent, useVaporPressure>::gasThermalConductivityInitialized_ =
false;
1024template <
class RawComponent,
bool useVaporPressure>
1025bool TabulatedComponent<RawComponent, useVaporPressure>::liquidThermalConductivityInitialized_ =
false;
1026template <
class RawComponent,
bool useVaporPressure>
1027bool TabulatedComponent<RawComponent, useVaporPressure>::gasPressureInitialized_ =
false;
1028template <
class RawComponent,
bool useVaporPressure>
1029bool TabulatedComponent<RawComponent, useVaporPressure>::liquidPressureInitialized_ =
false;
1031template <
class RawComponent,
bool useVaporPressure>
1032std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::vaporPressure_;
1033template <
class RawComponent,
bool useVaporPressure>
1034std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::minLiquidDensity_;
1035template <
class RawComponent,
bool useVaporPressure>
1036std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::maxLiquidDensity_;
1037template <
class RawComponent,
bool useVaporPressure>
1038std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::minGasDensity_;
1039template <
class RawComponent,
bool useVaporPressure>
1040std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::maxGasDensity_;
1041template <
class RawComponent,
bool useVaporPressure>
1042std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::gasEnthalpy_;
1043template <
class RawComponent,
bool useVaporPressure>
1044std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::liquidEnthalpy_;
1045template <
class RawComponent,
bool useVaporPressure>
1046std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::gasHeatCapacity_;
1047template <
class RawComponent,
bool useVaporPressure>
1048std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::liquidHeatCapacity_;
1049template <
class RawComponent,
bool useVaporPressure>
1050std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::gasDensity_;
1051template <
class RawComponent,
bool useVaporPressure>
1052std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::liquidDensity_;
1053template <
class RawComponent,
bool useVaporPressure>
1054std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::gasViscosity_;
1055template <
class RawComponent,
bool useVaporPressure>
1056std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::liquidViscosity_;
1057template <
class RawComponent,
bool useVaporPressure>
1058std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::gasThermalConductivity_;
1059template <
class RawComponent,
bool useVaporPressure>
1060std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::liquidThermalConductivity_;
1061template <
class RawComponent,
bool useVaporPressure>
1062std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::gasPressure_;
1063template <
class RawComponent,
bool useVaporPressure>
1064std::vector<typename RawComponent::Scalar> TabulatedComponent<RawComponent, useVaporPressure>::liquidPressure_;
1065template <
class RawComponent,
bool useVaporPressure>
1066typename RawComponent::Scalar TabulatedComponent<RawComponent, useVaporPressure>::tempMin_;
1067template <
class RawComponent,
bool useVaporPressure>
1068typename RawComponent::Scalar TabulatedComponent<RawComponent, useVaporPressure>::tempMax_;
1069template <
class RawComponent,
bool useVaporPressure>
1070unsigned TabulatedComponent<RawComponent, useVaporPressure>::nTemp_;
1071template <
class RawComponent,
bool useVaporPressure>
1072typename RawComponent::Scalar TabulatedComponent<RawComponent, useVaporPressure>::pressMin_;
1073template <
class RawComponent,
bool useVaporPressure>
1074typename RawComponent::Scalar TabulatedComponent<RawComponent, useVaporPressure>::pressMax_;
1075template <
class RawComponent,
bool useVaporPressure>
1076unsigned TabulatedComponent<RawComponent, useVaporPressure>::nPress_;
1077template <
class RawComponent,
bool useVaporPressure>
1078typename RawComponent::Scalar TabulatedComponent<RawComponent, useVaporPressure>::densityMin_;
1079template <
class RawComponent,
bool useVaporPressure>
1080typename RawComponent::Scalar TabulatedComponent<RawComponent, useVaporPressure>::densityMax_;
1081template <
class RawComponent,
bool useVaporPressure>
1082unsigned TabulatedComponent<RawComponent, useVaporPressure>::nDensity_;
1085template <
class Component>
1089template <
class RawComponent,
bool useVaporPressure>
Some exceptions thrown in DuMux.
Component traits, i.e. information extracted from components.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition name.hh:51
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition name.hh:34
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition name.hh:65
RawComponent::Scalar TabulatedComponent< RawComponent, useVaporPressure >::pressMin_
Definition tabulatedcomponent.hh:1072
unsigned TabulatedComponent< RawComponent, useVaporPressure >::nTemp_
Definition tabulatedcomponent.hh:1070
bool TabulatedComponent< RawComponent, useVaporPressure >::warningPrinted_
Definition tabulatedcomponent.hh:999
RawComponent::Scalar TabulatedComponent< RawComponent, useVaporPressure >::tempMax_
Definition tabulatedcomponent.hh:1068
std::vector< typename RawComponent::Scalar > TabulatedComponent< RawComponent, useVaporPressure >::vaporPressure_
Definition tabulatedcomponent.hh:1032
bool TabulatedComponent< RawComponent, useVaporPressure >::initialized_
Definition tabulatedcomponent.hh:996
RawComponent::Scalar TabulatedComponent< RawComponent, useVaporPressure >::tempMin_
Definition tabulatedcomponent.hh:1066
RawComponent::Scalar TabulatedComponent< RawComponent, useVaporPressure >::pressMax_
Definition tabulatedcomponent.hh:1074
IsAqueous struct.
Definition components/base.hh:47
Component traits, i.e. information extracted from components.
Definition componenttraits.hh:43
Tabulates all thermodynamic properties of a given untabulated chemical species.
Definition tabulatedcomponent.hh:82
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the gas .
Definition tabulatedcomponent.hh:238
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of gas in at a given density and temperature.
Definition tabulatedcomponent.hh:368
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition tabulatedcomponent.hh:184
static Scalar liquidPressure(Scalar temperature, Scalar density)
The pressure of liquid in at a given density and temperature.
Definition tabulatedcomponent.hh:402
static const Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the gas .
Definition tabulatedcomponent.hh:292
static std::string name()
A human readable name for the component.
Definition tabulatedcomponent.hh:172
static Scalar vaporTemperature(Scalar pressure)
The vapor pressure in of the component at a given temperature.
Definition tabulatedcomponent.hh:227
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
The thermal conductivity of liquid water .
Definition tabulatedcomponent.hh:619
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of gas at a given pressure and temperature .
Definition tabulatedcomponent.hh:456
static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the liquid .
Definition tabulatedcomponent.hh:265
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition tabulatedcomponent.hh:202
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition tabulatedcomponent.hh:190
static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of the gas .
Definition tabulatedcomponent.hh:346
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of liquid in at a given pressure and temperature.
Definition tabulatedcomponent.hh:529
static constexpr Scalar molarMass()
The molar mass in of the component.
Definition tabulatedcomponent.hh:178
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of liquid.
Definition tabulatedcomponent.hh:565
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of gas.
Definition tabulatedcomponent.hh:538
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition tabulatedcomponent.hh:196
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition tabulatedcomponent.hh:439
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of liquid at a given pressure and temperature .
Definition tabulatedcomponent.hh:495
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
The thermal conductivity of gaseous water .
Definition tabulatedcomponent.hh:592
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of gas in at a given pressure and temperature.
Definition tabulatedcomponent.hh:485
static constexpr bool isTabulated
Definition tabulatedcomponent.hh:88
static const Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of the liquid .
Definition tabulatedcomponent.hh:357
static Scalar vaporPressure(Scalar T)
The vapor pressure in of the component at a given temperature.
Definition tabulatedcomponent.hh:211
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition tabulatedcomponent.hh:433
static void init(Scalar tempMin, Scalar tempMax, std::size_t nTemp, Scalar pressMin, Scalar pressMax, std::size_t nPress)
Initialize the tables.
Definition tabulatedcomponent.hh:100
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition tabulatedcomponent.hh:445
static const Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the liquid .
Definition tabulatedcomponent.hh:319
typename Dumux::Components::H2O< Scalar >::Scalar Scalar
Definition tabulatedcomponent.hh:85
typename RawComponent::Scalar Scalar
Definition tabulatedcomponent.hh:52
static constexpr bool hasGasState
if the component implements a gaseous state
Definition tabulatedcomponent.hh:61
static constexpr bool hasLiquidState
if the component implements a liquid state
Definition tabulatedcomponent.hh:58
static constexpr bool hasSolidState
if the component implements a solid state
Definition tabulatedcomponent.hh:55