28 #ifndef OPM_TABULATED_COMPONENT_HPP
29 #define OPM_TABULATED_COMPONENT_HPP
54 template <
class ScalarT,
class RawComponent,
bool useVaporPressure=true>
58 typedef ScalarT Scalar;
60 static const bool isTabulated =
true;
72 static void init(Scalar tempMin, Scalar tempMax,
unsigned nTemp,
73 Scalar pressMin, Scalar pressMax,
unsigned nPress)
84 vaporPressure_ =
new Scalar[nTemp_];
85 minGasDensity__ =
new Scalar[nTemp_];
86 maxGasDensity__ =
new Scalar[nTemp_];
87 minLiquidDensity__ =
new Scalar[nTemp_];
88 maxLiquidDensity__ =
new Scalar[nTemp_];
90 gasEnthalpy_ =
new Scalar[nTemp_*nPress_];
91 liquidEnthalpy_ =
new Scalar[nTemp_*nPress_];
92 gasHeatCapacity_ =
new Scalar[nTemp_*nPress_];
93 liquidHeatCapacity_ =
new Scalar[nTemp_*nPress_];
94 gasDensity_ =
new Scalar[nTemp_*nPress_];
95 liquidDensity_ =
new Scalar[nTemp_*nPress_];
96 gasViscosity_ =
new Scalar[nTemp_*nPress_];
97 liquidViscosity_ =
new Scalar[nTemp_*nPress_];
98 gasThermalConductivity_ =
new Scalar[nTemp_*nPress_];
99 liquidThermalConductivity_ =
new Scalar[nTemp_*nPress_];
100 gasPressure_ =
new Scalar[nTemp_*nDensity_];
101 liquidPressure_ =
new Scalar[nTemp_*nDensity_];
103 assert(std::numeric_limits<Scalar>::has_quiet_NaN);
104 Scalar NaN = std::numeric_limits<Scalar>::quiet_NaN();
107 for (
unsigned iT = 0; iT < nTemp_; ++ iT) {
108 Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
110 try { vaporPressure_[iT] = RawComponent::vaporPressure(temperature); }
111 catch (
const std::exception&) { vaporPressure_[iT] = NaN; }
113 Scalar pgMax = maxGasPressure_(iT);
114 Scalar pgMin = minGasPressure_(iT);
117 for (
unsigned iP = 0; iP < nPress_; ++ iP) {
118 Scalar pressure = iP * (pgMax - pgMin)/(nPress_ - 1) + pgMin;
120 unsigned i = iT + iP*nTemp_;
122 try { gasEnthalpy_[i] = RawComponent::gasEnthalpy(temperature, pressure); }
123 catch (
const std::exception&) { gasEnthalpy_[i] = NaN; }
125 try { gasHeatCapacity_[i] = RawComponent::gasHeatCapacity(temperature, pressure); }
126 catch (
const std::exception&) { gasHeatCapacity_[i] = NaN; }
128 try { gasDensity_[i] = RawComponent::gasDensity(temperature, pressure); }
129 catch (
const std::exception&) { gasDensity_[i] = NaN; }
131 try { gasViscosity_[i] = RawComponent::gasViscosity(temperature, pressure); }
132 catch (
const std::exception&) { gasViscosity_[i] = NaN; }
134 try { gasThermalConductivity_[i] = RawComponent::gasThermalConductivity(temperature, pressure); }
135 catch (
const std::exception&) { gasThermalConductivity_[i] = NaN; }
138 Scalar plMin = minLiquidPressure_(iT);
139 Scalar plMax = maxLiquidPressure_(iT);
140 for (
unsigned iP = 0; iP < nPress_; ++ iP) {
141 Scalar pressure = iP * (plMax - plMin)/(nPress_ - 1) + plMin;
143 unsigned i = iT + iP*nTemp_;
145 try { liquidEnthalpy_[i] = RawComponent::liquidEnthalpy(temperature, pressure); }
146 catch (
const std::exception&) { liquidEnthalpy_[i] = NaN; }
148 try { liquidHeatCapacity_[i] = RawComponent::liquidHeatCapacity(temperature, pressure); }
149 catch (
const std::exception&) { liquidHeatCapacity_[i] = NaN; }
151 try { liquidDensity_[i] = RawComponent::liquidDensity(temperature, pressure); }
152 catch (
const std::exception&) { liquidDensity_[i] = NaN; }
154 try { liquidViscosity_[i] = RawComponent::liquidViscosity(temperature, pressure); }
155 catch (
const std::exception&) { liquidViscosity_[i] = NaN; }
157 try { liquidThermalConductivity_[i] = RawComponent::liquidThermalConductivity(temperature, pressure); }
158 catch (
const std::exception&) { liquidThermalConductivity_[i] = NaN; }
163 for (
unsigned iT = 0; iT < nTemp_; ++ iT) {
164 Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
168 minGasDensity__[iT] = RawComponent::gasDensity(temperature, minGasPressure_(iT));
170 maxGasDensity__[iT] = RawComponent::gasDensity(temperature, maxGasPressure_(iT + 1));
172 maxGasDensity__[iT] = RawComponent::gasDensity(temperature, maxGasPressure_(iT));
175 for (
unsigned iRho = 0; iRho < nDensity_; ++ iRho) {
177 Scalar(iRho)/(nDensity_ - 1) *
178 (maxGasDensity__[iT] - minGasDensity__[iT])
182 unsigned i = iT + iRho*nTemp_;
184 try { gasPressure_[i] = RawComponent::gasPressure(temperature, density); }
185 catch (
const std::exception&) { gasPressure_[i] = NaN; };
190 minLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, minLiquidPressure_(iT));
192 maxLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, maxLiquidPressure_(iT + 1));
194 maxLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, maxLiquidPressure_(iT));
197 for (
unsigned iRho = 0; iRho < nDensity_; ++ iRho) {
199 Scalar(iRho)/(nDensity_ - 1) *
200 (maxLiquidDensity__[iT] - minLiquidDensity__[iT])
202 minLiquidDensity__[iT];
204 unsigned i = iT + iRho*nTemp_;
206 try { liquidPressure_[i] = RawComponent::liquidPressure(temperature, density); }
207 catch (
const std::exception&) { liquidPressure_[i] = NaN; };
216 {
return RawComponent::name(); }
222 {
return RawComponent::molarMass(); }
228 {
return RawComponent::criticalTemperature(); }
234 {
return RawComponent::criticalPressure(); }
240 {
return RawComponent::tripleTemperature(); }
246 {
return RawComponent::triplePressure(); }
254 template <
class Evaluation>
257 const Evaluation& result = interpolateT_(vaporPressure_, temperature);
258 if (std::isnan(scalarValue(result)))
259 return RawComponent::vaporPressure(temperature);
269 template <
class Evaluation>
270 static Evaluation
gasEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
272 const Evaluation& result = interpolateGasTP_(gasEnthalpy_,
275 if (std::isnan(scalarValue(result)))
276 return RawComponent::gasEnthalpy(temperature, pressure);
286 template <
class Evaluation>
287 static Evaluation
liquidEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
289 const Evaluation& result = interpolateLiquidTP_(liquidEnthalpy_,
292 if (std::isnan(scalarValue(result)))
293 return RawComponent::liquidEnthalpy(temperature, pressure);
303 template <
class Evaluation>
304 static Evaluation
gasHeatCapacity(
const Evaluation& temperature,
const Evaluation& pressure)
306 const Evaluation& result = interpolateGasTP_(gasHeatCapacity_,
309 if (std::isnan(scalarValue(result)))
310 return RawComponent::gasHeatCapacity(temperature, pressure);
320 template <
class Evaluation>
323 const Evaluation& result = interpolateLiquidTP_(liquidHeatCapacity_,
326 if (std::isnan(scalarValue(result)))
327 return RawComponent::liquidHeatCapacity(temperature, pressure);
337 template <
class Evaluation>
347 template <
class Evaluation>
357 template <
class Evaluation>
358 static Evaluation
gasPressure(
const Evaluation& temperature, Scalar density)
360 const Evaluation& result = interpolateGasTRho_(gasPressure_,
363 if (std::isnan(scalarValue(result)))
364 return RawComponent::gasPressure(temperature,
375 template <
class Evaluation>
378 const Evaluation& result = interpolateLiquidTRho_(liquidPressure_,
381 if (std::isnan(scalarValue(result)))
382 return RawComponent::liquidPressure(temperature,
391 {
return RawComponent::gasIsCompressible(); }
397 {
return RawComponent::liquidIsCompressible(); }
403 {
return RawComponent::gasIsIdeal(); }
413 template <
class Evaluation>
414 static Evaluation
gasDensity(
const Evaluation& temperature,
const Evaluation& pressure)
416 const Evaluation& result = interpolateGasTP_(gasDensity_,
419 if (std::isnan(scalarValue(result)))
420 return RawComponent::gasDensity(temperature, pressure);
431 template <
class Evaluation>
432 static Evaluation
liquidDensity(
const Evaluation& temperature,
const Evaluation& pressure)
434 const Evaluation& result = interpolateLiquidTP_(liquidDensity_,
437 if (std::isnan(scalarValue(result)))
438 return RawComponent::liquidDensity(temperature, pressure);
448 template <
class Evaluation>
449 static Evaluation
gasViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
451 const Evaluation& result = interpolateGasTP_(gasViscosity_,
454 if (std::isnan(scalarValue(result)))
455 return RawComponent::gasViscosity(temperature, pressure);
465 template <
class Evaluation>
466 static Evaluation
liquidViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
468 const Evaluation& result = interpolateLiquidTP_(liquidViscosity_,
471 if (std::isnan(scalarValue(result)))
472 return RawComponent::liquidViscosity(temperature, pressure);
482 template <
class Evaluation>
485 const Evaluation& result = interpolateGasTP_(gasThermalConductivity_,
488 if (std::isnan(scalarValue(result)))
489 return RawComponent::gasThermalConductivity(temperature, pressure);
499 template <
class Evaluation>
502 const Evaluation& result = interpolateLiquidTP_(liquidThermalConductivity_,
505 if (std::isnan(scalarValue(result)))
506 return RawComponent::liquidThermalConductivity(temperature, pressure);
512 template <
class Evaluation>
513 static Evaluation interpolateT_(
const Scalar* values,
const Evaluation& T)
515 Evaluation alphaT = tempIdx_(T);
516 if (alphaT < 0 || alphaT >= nTemp_ - 1)
517 return std::numeric_limits<Scalar>::quiet_NaN();
519 size_t iT =
static_cast<size_t>(scalarValue(alphaT));
523 values[iT ]*(1 - alphaT) +
524 values[iT + 1]*( alphaT);
529 template <
class Evaluation>
530 static Evaluation interpolateLiquidTP_(
const Scalar* values,
const Evaluation& T,
const Evaluation& p)
532 Evaluation alphaT = tempIdx_(T);
533 if (alphaT < 0 || alphaT >= nTemp_ - 1)
534 return std::numeric_limits<Scalar>::quiet_NaN();
536 size_t iT =
static_cast<size_t>(scalarValue(alphaT));
539 Evaluation alphaP1 = pressLiquidIdx_(p, iT);
540 Evaluation alphaP2 = pressLiquidIdx_(p, iT + 1);
544 std::max<int>(0, std::min(
static_cast<int>(nPress_) - 2,
545 static_cast<int>(scalarValue(alphaP1)))));
548 std::max(0, std::min(
static_cast<int>(nPress_) - 2,
549 static_cast<int>(scalarValue(alphaP2)))));
554 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
555 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
556 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
557 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
562 template <
class Evaluation>
563 static Evaluation interpolateGasTP_(
const Scalar* values,
const Evaluation& T,
const Evaluation& p)
565 Evaluation alphaT = tempIdx_(T);
566 if (alphaT < 0 || alphaT >= nTemp_ - 1)
567 return std::numeric_limits<Scalar>::quiet_NaN();
571 std::max(0, std::min(
static_cast<int>(nTemp_) - 2,
572 static_cast<int>(scalarValue(alphaT)))));
575 Evaluation alphaP1 = pressGasIdx_(p, iT);
576 Evaluation alphaP2 = pressGasIdx_(p, iT + 1);
579 std::max(0, std::min(
static_cast<int>(nPress_) - 2,
580 static_cast<int>(scalarValue(alphaP1)))));
583 std::max(0, std::min(
static_cast<int>(nPress_) - 2,
584 static_cast<int>(scalarValue(alphaP2)))));
589 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
590 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
591 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
592 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
597 template <
class Evaluation>
598 static Evaluation interpolateGasTRho_(
const Scalar* values,
const Evaluation& T,
const Evaluation& rho)
600 Evaluation alphaT = tempIdx_(T);
601 unsigned iT = std::max(0,
602 std::min(
static_cast<int>(nTemp_ - 2),
603 static_cast<int>(alphaT)));
606 Evaluation alphaP1 = densityGasIdx_(rho, iT);
607 Evaluation alphaP2 = densityGasIdx_(rho, iT + 1);
610 std::min(
static_cast<int>(nDensity_ - 2),
611 static_cast<int>(alphaP1)));
614 std::min(
static_cast<int>(nDensity_ - 2),
615 static_cast<int>(alphaP2)));
620 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
621 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
622 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
623 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
628 template <
class Evaluation>
629 static Evaluation interpolateLiquidTRho_(
const Scalar* values,
const Evaluation& T,
const Evaluation& rho)
631 Evaluation alphaT = tempIdx_(T);
632 unsigned iT = std::max<int>(0, std::min<int>(nTemp_ - 2,
static_cast<int>(alphaT)));
635 Evaluation alphaP1 = densityLiquidIdx_(rho, iT);
636 Evaluation alphaP2 = densityLiquidIdx_(rho, iT + 1);
637 unsigned iP1 = std::max<int>(0, std::min<int>(nDensity_ - 2,
static_cast<int>(alphaP1)));
638 unsigned iP2 = std::max<int>(0, std::min<int>(nDensity_ - 2,
static_cast<int>(alphaP2)));
643 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
644 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
645 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
646 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
651 template <
class Evaluation>
652 static Evaluation tempIdx_(
const Evaluation& temperature)
654 return (nTemp_ - 1)*(temperature - tempMin_)/(tempMax_ - tempMin_);
658 template <
class Evaluation>
659 static Evaluation pressLiquidIdx_(
const Evaluation& pressure,
size_t tempIdx)
661 Scalar plMin = minLiquidPressure_(tempIdx);
662 Scalar plMax = maxLiquidPressure_(tempIdx);
664 return (nPress_ - 1)*(pressure - plMin)/(plMax - plMin);
668 template <
class Evaluation>
669 static Evaluation pressGasIdx_(
const Evaluation& pressure,
size_t tempIdx)
671 Scalar pgMin = minGasPressure_(tempIdx);
672 Scalar pgMax = maxGasPressure_(tempIdx);
674 return (nPress_ - 1)*(pressure - pgMin)/(pgMax - pgMin);
678 template <
class Evaluation>
679 static Evaluation densityLiquidIdx_(
const Evaluation& density,
size_t tempIdx)
681 Scalar densityMin = minLiquidDensity_(tempIdx);
682 Scalar densityMax = maxLiquidDensity_(tempIdx);
683 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
687 template <
class Evaluation>
688 static Evaluation densityGasIdx_(
const Evaluation& density,
size_t tempIdx)
690 Scalar densityMin = minGasDensity_(tempIdx);
691 Scalar densityMax = maxGasDensity_(tempIdx);
692 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
697 static Scalar minLiquidPressure_(
size_t tempIdx)
699 if (!useVaporPressure)
702 return std::max<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1);
707 static Scalar maxLiquidPressure_(
size_t tempIdx)
709 if (!useVaporPressure)
712 return std::max<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
717 static Scalar minGasPressure_(
size_t tempIdx)
719 if (!useVaporPressure)
722 return std::min<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1 );
727 static Scalar maxGasPressure_(
size_t tempIdx)
729 if (!useVaporPressure)
732 return std::min<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
738 static Scalar minLiquidDensity_(
size_t tempIdx)
739 {
return minLiquidDensity__[tempIdx]; }
743 static Scalar maxLiquidDensity_(
size_t tempIdx)
744 {
return maxLiquidDensity__[tempIdx]; }
748 static Scalar minGasDensity_(
size_t tempIdx)
749 {
return minGasDensity__[tempIdx]; }
753 static Scalar maxGasDensity_(
size_t tempIdx)
754 {
return maxGasDensity__[tempIdx]; }
757 static Scalar* vaporPressure_;
759 static Scalar* minLiquidDensity__;
760 static Scalar* maxLiquidDensity__;
762 static Scalar* minGasDensity__;
763 static Scalar* maxGasDensity__;
767 static Scalar* gasEnthalpy_;
768 static Scalar* liquidEnthalpy_;
770 static Scalar* gasHeatCapacity_;
771 static Scalar* liquidHeatCapacity_;
773 static Scalar* gasDensity_;
774 static Scalar* liquidDensity_;
776 static Scalar* gasViscosity_;
777 static Scalar* liquidViscosity_;
779 static Scalar* gasThermalConductivity_;
780 static Scalar* liquidThermalConductivity_;
784 static Scalar* gasPressure_;
785 static Scalar* liquidPressure_;
788 static Scalar tempMin_;
789 static Scalar tempMax_;
790 static unsigned nTemp_;
792 static Scalar pressMin_;
793 static Scalar pressMax_;
794 static unsigned nPress_;
796 static Scalar densityMin_;
797 static Scalar densityMax_;
798 static unsigned nDensity_;
801 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
802 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::vaporPressure_;
803 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
804 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minLiquidDensity__;
805 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
806 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxLiquidDensity__;
807 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
808 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minGasDensity__;
809 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
810 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxGasDensity__;
811 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
812 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasEnthalpy_;
813 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
814 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidEnthalpy_;
815 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
816 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasHeatCapacity_;
817 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
818 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidHeatCapacity_;
819 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
820 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasDensity_;
821 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
822 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidDensity_;
823 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
824 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasViscosity_;
825 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
826 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidViscosity_;
827 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
828 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasThermalConductivity_;
829 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
830 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidThermalConductivity_;
831 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
832 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasPressure_;
833 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
834 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidPressure_;
835 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
836 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMin_;
837 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
838 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMax_;
839 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
840 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nTemp_;
841 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
842 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMin_;
843 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
844 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMax_;
845 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
846 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nPress_;
847 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
848 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMin_;
849 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
850 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMax_;
851 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
852 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nDensity_;
A generic class which tabulates all thermodynamic properties of a given component.
Definition: TabulatedComponent.hpp:56
static Evaluation gasThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of gaseous water .
Definition: TabulatedComponent.hpp:483
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:390
static Evaluation liquidPressure(const Evaluation &temperature, Scalar density)
The pressure of liquid in at a given density and temperature.
Definition: TabulatedComponent.hpp:376
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the gas .
Definition: TabulatedComponent.hpp:270
static Evaluation liquidHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the liquid .
Definition: TabulatedComponent.hpp:321
static Evaluation liquidInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the liquid .
Definition: TabulatedComponent.hpp:348
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the tables.
Definition: TabulatedComponent.hpp:72
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: TabulatedComponent.hpp:227
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: TabulatedComponent.hpp:233
static Scalar molarMass()
The molar mass in of the component.
Definition: TabulatedComponent.hpp:221
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:396
static Evaluation gasPressure(const Evaluation &temperature, Scalar density)
The pressure of gas in at a given density and temperature.
Definition: TabulatedComponent.hpp:358
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of liquid.
Definition: TabulatedComponent.hpp:466
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: TabulatedComponent.hpp:245
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature .
Definition: TabulatedComponent.hpp:414
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the gas .
Definition: TabulatedComponent.hpp:338
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the gas .
Definition: TabulatedComponent.hpp:304
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: TabulatedComponent.hpp:402
static const char * name()
A human readable name for the component.
Definition: TabulatedComponent.hpp:215
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of liquid at a given pressure and temperature .
Definition: TabulatedComponent.hpp:432
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of the component at a given temperature.
Definition: TabulatedComponent.hpp:255
static Evaluation liquidThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of liquid water .
Definition: TabulatedComponent.hpp:500
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of gas.
Definition: TabulatedComponent.hpp:449
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the liquid .
Definition: TabulatedComponent.hpp:287
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: TabulatedComponent.hpp:239