26 #ifndef OPM_TABULATED_COMPONENT_HPP
27 #define OPM_TABULATED_COMPONENT_HPP
34 #include <opm/common/Exceptions.hpp>
35 #include <opm/common/ErrorMacros.hpp>
55 template <
class ScalarT,
class RawComponent,
bool useVaporPressure=true>
73 static void init(Scalar tempMin, Scalar tempMax,
unsigned nTemp,
74 Scalar pressMin, Scalar pressMax,
unsigned nPress)
85 vaporPressure_ =
new Scalar[nTemp_];
86 minGasDensity__ =
new Scalar[nTemp_];
87 maxGasDensity__ =
new Scalar[nTemp_];
88 minLiquidDensity__ =
new Scalar[nTemp_];
89 maxLiquidDensity__ =
new Scalar[nTemp_];
91 gasEnthalpy_ =
new Scalar[nTemp_*nPress_];
92 liquidEnthalpy_ =
new Scalar[nTemp_*nPress_];
93 gasHeatCapacity_ =
new Scalar[nTemp_*nPress_];
94 liquidHeatCapacity_ =
new Scalar[nTemp_*nPress_];
95 gasDensity_ =
new Scalar[nTemp_*nPress_];
96 liquidDensity_ =
new Scalar[nTemp_*nPress_];
97 gasViscosity_ =
new Scalar[nTemp_*nPress_];
98 liquidViscosity_ =
new Scalar[nTemp_*nPress_];
99 gasThermalConductivity_ =
new Scalar[nTemp_*nPress_];
100 liquidThermalConductivity_ =
new Scalar[nTemp_*nPress_];
101 gasPressure_ =
new Scalar[nTemp_*nDensity_];
102 liquidPressure_ =
new Scalar[nTemp_*nDensity_];
104 assert(std::numeric_limits<Scalar>::has_quiet_NaN);
105 Scalar NaN = std::numeric_limits<Scalar>::quiet_NaN();
108 for (
unsigned iT = 0; iT < nTemp_; ++ iT) {
109 Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
111 try { vaporPressure_[iT] = RawComponent::vaporPressure(temperature); }
112 catch (std::exception) { vaporPressure_[iT] = NaN; }
114 Scalar pgMax = maxGasPressure_(iT);
115 Scalar pgMin = minGasPressure_(iT);
118 for (
unsigned iP = 0; iP < nPress_; ++ iP) {
119 Scalar pressure = iP * (pgMax - pgMin)/(nPress_ - 1) + pgMin;
121 unsigned i = iT + iP*nTemp_;
123 try { gasEnthalpy_[i] = RawComponent::gasEnthalpy(temperature, pressure); }
124 catch (std::exception) { gasEnthalpy_[i] = NaN; }
126 try { gasHeatCapacity_[i] = RawComponent::gasHeatCapacity(temperature, pressure); }
127 catch (std::exception) { gasHeatCapacity_[i] = NaN; }
129 try { gasDensity_[i] = RawComponent::gasDensity(temperature, pressure); }
130 catch (std::exception) { gasDensity_[i] = NaN; }
132 try { gasViscosity_[i] = RawComponent::gasViscosity(temperature, pressure); }
133 catch (std::exception) { gasViscosity_[i] = NaN; }
135 try { gasThermalConductivity_[i] = RawComponent::gasThermalConductivity(temperature, pressure); }
136 catch (std::exception) { gasThermalConductivity_[i] = NaN; }
139 Scalar plMin = minLiquidPressure_(iT);
140 Scalar plMax = maxLiquidPressure_(iT);
141 for (
unsigned iP = 0; iP < nPress_; ++ iP) {
142 Scalar pressure = iP * (plMax - plMin)/(nPress_ - 1) + plMin;
144 unsigned i = iT + iP*nTemp_;
146 try { liquidEnthalpy_[i] = RawComponent::liquidEnthalpy(temperature, pressure); }
147 catch (std::exception) { liquidEnthalpy_[i] = NaN; }
149 try { liquidHeatCapacity_[i] = RawComponent::liquidHeatCapacity(temperature, pressure); }
150 catch (std::exception) { liquidHeatCapacity_[i] = NaN; }
152 try { liquidDensity_[i] = RawComponent::liquidDensity(temperature, pressure); }
153 catch (std::exception) { liquidDensity_[i] = NaN; }
155 try { liquidViscosity_[i] = RawComponent::liquidViscosity(temperature, pressure); }
156 catch (std::exception) { liquidViscosity_[i] = NaN; }
158 try { liquidThermalConductivity_[i] = RawComponent::liquidThermalConductivity(temperature, pressure); }
159 catch (std::exception) { liquidThermalConductivity_[i] = NaN; }
164 for (
unsigned iT = 0; iT < nTemp_; ++ iT) {
165 Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
169 minGasDensity__[iT] = RawComponent::gasDensity(temperature, minGasPressure_(iT));
171 maxGasDensity__[iT] = RawComponent::gasDensity(temperature, maxGasPressure_(iT + 1));
173 maxGasDensity__[iT] = RawComponent::gasDensity(temperature, maxGasPressure_(iT));
176 for (
unsigned iRho = 0; iRho < nDensity_; ++ iRho) {
178 Scalar(iRho)/(nDensity_ - 1) *
179 (maxGasDensity__[iT] - minGasDensity__[iT])
183 unsigned i = iT + iRho*nTemp_;
185 try { gasPressure_[i] = RawComponent::gasPressure(temperature, density); }
186 catch (std::exception) { gasPressure_[i] = NaN; };
191 minLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, minLiquidPressure_(iT));
193 maxLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, maxLiquidPressure_(iT + 1));
195 maxLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, maxLiquidPressure_(iT));
198 for (
unsigned iRho = 0; iRho < nDensity_; ++ iRho) {
200 Scalar(iRho)/(nDensity_ - 1) *
201 (maxLiquidDensity__[iT] - minLiquidDensity__[iT])
203 minLiquidDensity__[iT];
205 unsigned i = iT + iRho*nTemp_;
207 try { liquidPressure_[i] = RawComponent::liquidPressure(temperature, density); }
208 catch (std::exception) { liquidPressure_[i] = NaN; };
217 {
return RawComponent::name(); }
223 {
return RawComponent::molarMass(); }
229 {
return RawComponent::criticalTemperature(); }
235 {
return RawComponent::criticalPressure(); }
241 {
return RawComponent::tripleTemperature(); }
247 {
return RawComponent::triplePressure(); }
255 template <
class Evaluation>
260 const Evaluation& result = interpolateT_(vaporPressure_, temperature);
261 if (std::isnan(Toolbox::value(result)))
262 return RawComponent::vaporPressure(temperature);
272 template <
class Evaluation>
273 static Evaluation
gasEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
277 const Evaluation& result = interpolateGasTP_(gasEnthalpy_,
280 if (std::isnan(Toolbox::value(result)))
281 return RawComponent::gasEnthalpy(temperature, pressure);
291 template <
class Evaluation>
292 static Evaluation
liquidEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
296 const Evaluation& result = interpolateLiquidTP_(liquidEnthalpy_,
299 if (std::isnan(Toolbox::value(result)))
300 return RawComponent::liquidEnthalpy(temperature, pressure);
310 template <
class Evaluation>
311 static Evaluation
gasHeatCapacity(
const Evaluation& temperature,
const Evaluation& pressure)
315 const Evaluation& result = interpolateGasTP_(gasHeatCapacity_,
318 if (std::isnan(Toolbox::value(result)))
319 return RawComponent::gasHeatCapacity(temperature, pressure);
329 template <
class Evaluation>
334 const Evaluation& result = interpolateLiquidTP_(liquidHeatCapacity_,
337 if (std::isnan(Toolbox::value(result)))
338 return RawComponent::liquidHeatCapacity(temperature, pressure);
348 template <
class Evaluation>
358 template <
class Evaluation>
368 template <
class Evaluation>
369 static Evaluation
gasPressure(
const Evaluation& temperature, Scalar density)
373 const Evaluation& result = interpolateGasTRho_(gasPressure_,
376 if (std::isnan(Toolbox::value(result)))
377 return RawComponent::gasPressure(temperature,
388 template <
class Evaluation>
393 const Evaluation& result = interpolateLiquidTRho_(liquidPressure_,
396 if (std::isnan(Toolbox::value(result)))
397 return RawComponent::liquidPressure(temperature,
406 {
return RawComponent::gasIsCompressible(); }
412 {
return RawComponent::liquidIsCompressible(); }
418 {
return RawComponent::gasIsIdeal(); }
428 template <
class Evaluation>
429 static Evaluation
gasDensity(
const Evaluation& temperature,
const Evaluation& pressure)
433 const Evaluation& result = interpolateGasTP_(gasDensity_,
436 if (std::isnan(Toolbox::value(result)))
437 return RawComponent::gasDensity(temperature, pressure);
448 template <
class Evaluation>
449 static Evaluation
liquidDensity(
const Evaluation& temperature,
const Evaluation& pressure)
453 const Evaluation& result = interpolateLiquidTP_(liquidDensity_,
456 if (std::isnan(Toolbox::value(result)))
457 return RawComponent::liquidDensity(temperature, pressure);
467 template <
class Evaluation>
468 static Evaluation
gasViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
472 const Evaluation& result = interpolateGasTP_(gasViscosity_,
475 if (std::isnan(Toolbox::value(result)))
476 return RawComponent::gasViscosity(temperature, pressure);
486 template <
class Evaluation>
487 static Evaluation
liquidViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
491 const Evaluation& result = interpolateLiquidTP_(liquidViscosity_,
494 if (std::isnan(Toolbox::value(result)))
495 return RawComponent::liquidViscosity(temperature, pressure);
505 template <
class Evaluation>
510 const Evaluation& result = interpolateGasTP_(gasThermalConductivity_,
513 if (std::isnan(Toolbox::value(result)))
514 return RawComponent::gasThermalConductivity(temperature, pressure);
524 template <
class Evaluation>
529 const Evaluation& result = interpolateLiquidTP_(liquidThermalConductivity_,
532 if (std::isnan(Toolbox::value(result)))
533 return RawComponent::liquidThermalConductivity(temperature, pressure);
539 template <
class Evaluation>
540 static Evaluation interpolateT_(
const Scalar *values,
const Evaluation& T)
544 Evaluation alphaT = tempIdx_(T);
545 if (alphaT < 0 || alphaT >= nTemp_ - 1)
546 return std::numeric_limits<Scalar>::quiet_NaN();
548 unsigned iT = (unsigned) Toolbox::value(alphaT);
552 values[iT ]*(1 - alphaT) +
553 values[iT + 1]*( alphaT);
558 template <
class Evaluation>
559 static Evaluation interpolateLiquidTP_(
const Scalar *values,
const Evaluation& T,
const Evaluation& p)
561 typedef MathToolbox<Evaluation> Toolbox;
563 Evaluation alphaT = tempIdx_(T);
564 if (alphaT < 0 || alphaT >= nTemp_ - 1) {
565 return Toolbox::createConstant(std::numeric_limits<Scalar>::quiet_NaN());
570 std::min<size_t>(nTemp_ - 2,
571 static_cast<size_t>(Toolbox::value(alphaT))));
574 Evaluation alphaP1 = pressLiquidIdx_(p, iT);
575 Evaluation alphaP2 = pressLiquidIdx_(p, iT + 1);
579 std::min<size_t>(nPress_ - 2,
580 static_cast<size_t>(Toolbox::value(alphaP1))));
583 std::min<size_t>(nPress_ - 2,
584 static_cast<size_t>(Toolbox::value(alphaP2))));
588 #if 0 && !defined NDEBUG
589 if(!(0 <= alphaT && alphaT <= 1.0))
590 OPM_THROW(NumericalProblem,
"Temperature out of range: "
591 <<
"T=" << T <<
" range: [" << tempMin_ <<
", " << tempMax_ <<
"]");
592 if(!(0 <= alphaP1 && alphaP1 <= 1.0))
593 OPM_THROW(NumericalProblem,
"First liquid pressure out of range: "
594 <<
"p=" << p <<
" range: [" << minLiquidPressure_(tempIdx_(T)) <<
", " << maxLiquidPressure_(tempIdx_(T)) <<
"]");
595 if(!(0 <= alphaP2 && alphaP2 <= 1.0))
596 OPM_THROW(NumericalProblem,
"Second liquid pressure out of range: "
597 <<
"p=" << p <<
" range: [" << minLiquidPressure_(tempIdx_(T) + 1) <<
", " << maxLiquidPressure_(tempIdx_(T) + 1) <<
"]");
601 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
602 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
603 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
604 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
609 template <
class Evaluation>
610 static Evaluation interpolateGasTP_(
const Scalar *values,
const Evaluation& T,
const Evaluation& p)
612 typedef MathToolbox<Evaluation> Toolbox;
614 Evaluation alphaT = tempIdx_(T);
615 if (alphaT < 0 || alphaT >= nTemp_ - 1) {
616 return Toolbox::createConstant(std::numeric_limits<Scalar>::quiet_NaN());
621 std::min<size_t>(nTemp_ - 2,
622 static_cast<size_t>(Toolbox::value(alphaT))));
625 Evaluation alphaP1 = pressGasIdx_(p, iT);
626 Evaluation alphaP2 = pressGasIdx_(p, iT + 1);
628 std::max<size_t>(0, std::min<size_t>(nPress_ - 2,
629 static_cast<size_t>(Toolbox::value(alphaP1))));
632 std::min<size_t>(nPress_ - 2,
633 static_cast<size_t>(Toolbox::value(alphaP2))));
637 #if 0 && !defined NDEBUG
638 if(!(0 <= alphaT && alphaT <= 1.0))
639 OPM_THROW(NumericalProblem,
"Temperature out of range: "
640 <<
"T=" << T <<
" range: [" << tempMin_ <<
", " << tempMax_ <<
"]");
641 if(!(0 <= alphaP1 && alphaP1 <= 1.0))
642 OPM_THROW(NumericalProblem,
"First gas pressure out of range: "
643 <<
"p=" << p <<
" range: [" << minGasPressure_(tempIdx_(T)) <<
", " << maxGasPressure_(tempIdx_(T)) <<
"]");
644 if(!(0 <= alphaP2 && alphaP2 <= 1.0))
645 OPM_THROW(NumericalProblem,
"Second gas pressure out of range: "
646 <<
"p=" << p <<
" range: [" << minGasPressure_(tempIdx_(T) + 1) <<
", " << maxGasPressure_(tempIdx_(T) + 1) <<
"]");
650 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
651 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
652 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
653 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
658 template <
class Evaluation>
659 static Evaluation interpolateGasTRho_(
const Scalar *values,
const Evaluation& T,
const Evaluation& rho)
661 Evaluation alphaT = tempIdx_(T);
662 unsigned iT = std::max<int>(0, std::min<int>(nTemp_ - 2, (int) alphaT));
665 Evaluation alphaP1 = densityGasIdx_(rho, iT);
666 Evaluation alphaP2 = densityGasIdx_(rho, iT + 1);
667 unsigned iP1 = std::max<int>(0, std::min<int>(nDensity_ - 2, (int) alphaP1));
668 unsigned iP2 = std::max<int>(0, std::min<int>(nDensity_ - 2, (int) alphaP2));
673 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
674 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
675 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
676 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
681 template <
class Evaluation>
682 static Evaluation interpolateLiquidTRho_(
const Scalar *values,
const Evaluation& T,
const Evaluation& rho)
684 Evaluation alphaT = tempIdx_(T);
685 unsigned iT = std::max<int>(0, std::min<int>(nTemp_ - 2, (int) alphaT));
688 Evaluation alphaP1 = densityLiquidIdx_(rho, iT);
689 Evaluation alphaP2 = densityLiquidIdx_(rho, iT + 1);
690 unsigned iP1 = std::max<int>(0, std::min<int>(nDensity_ - 2, (int) alphaP1));
691 unsigned iP2 = std::max<int>(0, std::min<int>(nDensity_ - 2, (int) alphaP2));
696 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
697 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
698 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
699 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
704 template <
class Evaluation>
705 static Evaluation tempIdx_(
const Evaluation& temperature)
707 return (nTemp_ - 1)*(temperature - tempMin_)/(tempMax_ - tempMin_);
711 template <
class Evaluation>
712 static Evaluation pressLiquidIdx_(
const Evaluation& pressure,
size_t tempIdx)
714 Scalar plMin = minLiquidPressure_(tempIdx);
715 Scalar plMax = maxLiquidPressure_(tempIdx);
717 return (nPress_ - 1)*(pressure - plMin)/(plMax - plMin);
721 template <
class Evaluation>
722 static Evaluation pressGasIdx_(
const Evaluation& pressure,
size_t tempIdx)
724 Scalar pgMin = minGasPressure_(tempIdx);
725 Scalar pgMax = maxGasPressure_(tempIdx);
727 return (nPress_ - 1)*(pressure - pgMin)/(pgMax - pgMin);
731 template <
class Evaluation>
732 static Evaluation densityLiquidIdx_(
const Evaluation& density,
size_t tempIdx)
734 Scalar densityMin = minLiquidDensity_(tempIdx);
735 Scalar densityMax = maxLiquidDensity_(tempIdx);
736 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
740 template <
class Evaluation>
741 static Evaluation densityGasIdx_(
const Evaluation& density,
size_t tempIdx)
743 Scalar densityMin = minGasDensity_(tempIdx);
744 Scalar densityMax = maxGasDensity_(tempIdx);
745 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
750 static Scalar minLiquidPressure_(
size_t tempIdx)
752 if (!useVaporPressure)
755 return std::max<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1);
760 static Scalar maxLiquidPressure_(
size_t tempIdx)
762 if (!useVaporPressure)
765 return std::max<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
770 static Scalar minGasPressure_(
size_t tempIdx)
772 if (!useVaporPressure)
775 return std::min<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1 );
780 static Scalar maxGasPressure_(
size_t tempIdx)
782 if (!useVaporPressure)
785 return std::min<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
791 static Scalar minLiquidDensity_(
size_t tempIdx)
792 {
return minLiquidDensity__[tempIdx]; }
796 static Scalar maxLiquidDensity_(
size_t tempIdx)
797 {
return maxLiquidDensity__[tempIdx]; }
801 static Scalar minGasDensity_(
size_t tempIdx)
802 {
return minGasDensity__[tempIdx]; }
806 static Scalar maxGasDensity_(
size_t tempIdx)
807 {
return maxGasDensity__[tempIdx]; }
810 static Scalar *vaporPressure_;
812 static Scalar *minLiquidDensity__;
813 static Scalar *maxLiquidDensity__;
815 static Scalar *minGasDensity__;
816 static Scalar *maxGasDensity__;
820 static Scalar *gasEnthalpy_;
821 static Scalar *liquidEnthalpy_;
823 static Scalar *gasHeatCapacity_;
824 static Scalar *liquidHeatCapacity_;
826 static Scalar *gasDensity_;
827 static Scalar *liquidDensity_;
829 static Scalar *gasViscosity_;
830 static Scalar *liquidViscosity_;
832 static Scalar *gasThermalConductivity_;
833 static Scalar *liquidThermalConductivity_;
837 static Scalar *gasPressure_;
838 static Scalar *liquidPressure_;
841 static Scalar tempMin_;
842 static Scalar tempMax_;
843 static unsigned nTemp_;
845 static Scalar pressMin_;
846 static Scalar pressMax_;
847 static unsigned nPress_;
849 static Scalar densityMin_;
850 static Scalar densityMax_;
851 static unsigned nDensity_;
854 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
855 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::vaporPressure_;
856 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
857 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minLiquidDensity__;
858 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
859 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxLiquidDensity__;
860 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
861 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minGasDensity__;
862 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
863 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxGasDensity__;
864 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
865 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasEnthalpy_;
866 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
867 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidEnthalpy_;
868 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
869 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasHeatCapacity_;
870 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
871 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidHeatCapacity_;
872 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
873 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasDensity_;
874 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
875 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidDensity_;
876 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
877 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasViscosity_;
878 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
879 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidViscosity_;
880 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
881 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasThermalConductivity_;
882 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
883 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidThermalConductivity_;
884 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
885 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasPressure_;
886 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
887 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidPressure_;
888 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
889 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMin_;
890 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
891 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMax_;
892 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
893 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nTemp_;
894 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
895 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMin_;
896 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
897 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMax_;
898 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
899 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nPress_;
900 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
901 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMin_;
902 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
903 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMax_;
904 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
905 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nDensity_;
static const char * name()
A human readable name for the component.
Definition: TabulatedComponent.hpp:216
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the tables.
Definition: TabulatedComponent.hpp:73
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:405
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of the component at a given temperature.
Definition: TabulatedComponent.hpp:256
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the gas .
Definition: TabulatedComponent.hpp:311
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: TabulatedComponent.hpp:240
Definition: Air_Mesitylene.hpp:31
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of liquid at a given pressure and temperature .
Definition: TabulatedComponent.hpp:449
static Evaluation gasThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of gaseous water .
Definition: TabulatedComponent.hpp:506
static Evaluation liquidHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the liquid .
Definition: TabulatedComponent.hpp:330
static Scalar molarMass()
The molar mass in of the component.
Definition: TabulatedComponent.hpp:222
static Evaluation gasPressure(const Evaluation &temperature, Scalar density)
The pressure of gas in at a given density and temperature.
Definition: TabulatedComponent.hpp:369
static Evaluation liquidInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the liquid .
Definition: TabulatedComponent.hpp:359
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: TabulatedComponent.hpp:246
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: TabulatedComponent.hpp:234
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: TabulatedComponent.hpp:228
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: TabulatedComponent.hpp:417
A generic class which tabulates all thermodynamic properties of a given component.
Definition: TabulatedComponent.hpp:56
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the liquid .
Definition: TabulatedComponent.hpp:292
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the gas .
Definition: TabulatedComponent.hpp:349
static const bool isTabulated
Definition: TabulatedComponent.hpp:61
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:411
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the gas .
Definition: TabulatedComponent.hpp:273
static Evaluation liquidPressure(const Evaluation &temperature, Scalar density)
The pressure of liquid in at a given density and temperature.
Definition: TabulatedComponent.hpp:389
ScalarT Scalar
Definition: TabulatedComponent.hpp:59
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature .
Definition: TabulatedComponent.hpp:429
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of gas.
Definition: TabulatedComponent.hpp:468
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of liquid.
Definition: TabulatedComponent.hpp:487
static Evaluation liquidThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of liquid water .
Definition: TabulatedComponent.hpp:525