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 {
throw std::runtime_error(
"Not implemented: acentricFactor of the component"); }
246 {
throw std::runtime_error(
"Not implemented: criticalVolume of the compoenent"); }
252 {
return RawComponent::tripleTemperature(); }
258 {
return RawComponent::triplePressure(); }
266 template <
class Evaluation>
269 const Evaluation& result = interpolateT_(vaporPressure_, temperature);
270 if (std::isnan(scalarValue(result)))
271 return RawComponent::vaporPressure(temperature);
281 template <
class Evaluation>
282 static Evaluation
gasEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
284 const Evaluation& result = interpolateGasTP_(gasEnthalpy_,
287 if (std::isnan(scalarValue(result)))
288 return RawComponent::gasEnthalpy(temperature, pressure);
298 template <
class Evaluation>
299 static Evaluation
liquidEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
301 const Evaluation& result = interpolateLiquidTP_(liquidEnthalpy_,
304 if (std::isnan(scalarValue(result)))
305 return RawComponent::liquidEnthalpy(temperature, pressure);
315 template <
class Evaluation>
316 static Evaluation
gasHeatCapacity(
const Evaluation& temperature,
const Evaluation& pressure)
318 const Evaluation& result = interpolateGasTP_(gasHeatCapacity_,
321 if (std::isnan(scalarValue(result)))
322 return RawComponent::gasHeatCapacity(temperature, pressure);
332 template <
class Evaluation>
335 const Evaluation& result = interpolateLiquidTP_(liquidHeatCapacity_,
338 if (std::isnan(scalarValue(result)))
339 return RawComponent::liquidHeatCapacity(temperature, pressure);
349 template <
class Evaluation>
359 template <
class Evaluation>
369 template <
class Evaluation>
370 static Evaluation
gasPressure(
const Evaluation& temperature, Scalar density)
372 const Evaluation& result = interpolateGasTRho_(gasPressure_,
375 if (std::isnan(scalarValue(result)))
376 return RawComponent::gasPressure(temperature,
387 template <
class Evaluation>
390 const Evaluation& result = interpolateLiquidTRho_(liquidPressure_,
393 if (std::isnan(scalarValue(result)))
394 return RawComponent::liquidPressure(temperature,
403 {
return RawComponent::gasIsCompressible(); }
409 {
return RawComponent::liquidIsCompressible(); }
415 {
return RawComponent::gasIsIdeal(); }
425 template <
class Evaluation>
426 static Evaluation
gasDensity(
const Evaluation& temperature,
const Evaluation& pressure)
428 const Evaluation& result = interpolateGasTP_(gasDensity_,
431 if (std::isnan(scalarValue(result)))
432 return RawComponent::gasDensity(temperature, pressure);
443 template <
class Evaluation>
444 static Evaluation
liquidDensity(
const Evaluation& temperature,
const Evaluation& pressure)
446 const Evaluation& result = interpolateLiquidTP_(liquidDensity_,
449 if (std::isnan(scalarValue(result)))
450 return RawComponent::liquidDensity(temperature, pressure);
460 template <
class Evaluation>
461 static Evaluation
gasViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
463 const Evaluation& result = interpolateGasTP_(gasViscosity_,
466 if (std::isnan(scalarValue(result)))
467 return RawComponent::gasViscosity(temperature, pressure);
477 template <
class Evaluation>
478 static Evaluation
liquidViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
480 const Evaluation& result = interpolateLiquidTP_(liquidViscosity_,
483 if (std::isnan(scalarValue(result)))
484 return RawComponent::liquidViscosity(temperature, pressure);
494 template <
class Evaluation>
497 const Evaluation& result = interpolateGasTP_(gasThermalConductivity_,
500 if (std::isnan(scalarValue(result)))
501 return RawComponent::gasThermalConductivity(temperature, pressure);
511 template <
class Evaluation>
514 const Evaluation& result = interpolateLiquidTP_(liquidThermalConductivity_,
517 if (std::isnan(scalarValue(result)))
518 return RawComponent::liquidThermalConductivity(temperature, pressure);
524 template <
class Evaluation>
525 static Evaluation interpolateT_(
const Scalar* values,
const Evaluation& T)
527 Evaluation alphaT = tempIdx_(T);
528 if (alphaT < 0 || alphaT >= nTemp_ - 1)
529 return std::numeric_limits<Scalar>::quiet_NaN();
531 size_t iT =
static_cast<size_t>(scalarValue(alphaT));
535 values[iT ]*(1 - alphaT) +
536 values[iT + 1]*( alphaT);
541 template <
class Evaluation>
542 static Evaluation interpolateLiquidTP_(
const Scalar* values,
const Evaluation& T,
const Evaluation& p)
544 Evaluation alphaT = tempIdx_(T);
545 if (alphaT < 0 || alphaT >= nTemp_ - 1)
546 return std::numeric_limits<Scalar>::quiet_NaN();
548 size_t iT =
static_cast<size_t>(scalarValue(alphaT));
551 Evaluation alphaP1 = pressLiquidIdx_(p, iT);
552 Evaluation alphaP2 = pressLiquidIdx_(p, iT + 1);
556 std::max<int>(0, std::min(
static_cast<int>(nPress_) - 2,
557 static_cast<int>(scalarValue(alphaP1)))));
560 std::max(0, std::min(
static_cast<int>(nPress_) - 2,
561 static_cast<int>(scalarValue(alphaP2)))));
566 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
567 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
568 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
569 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
574 template <
class Evaluation>
575 static Evaluation interpolateGasTP_(
const Scalar* values,
const Evaluation& T,
const Evaluation& p)
577 Evaluation alphaT = tempIdx_(T);
578 if (alphaT < 0 || alphaT >= nTemp_ - 1)
579 return std::numeric_limits<Scalar>::quiet_NaN();
583 std::max(0, std::min(
static_cast<int>(nTemp_) - 2,
584 static_cast<int>(scalarValue(alphaT)))));
587 Evaluation alphaP1 = pressGasIdx_(p, iT);
588 Evaluation alphaP2 = pressGasIdx_(p, iT + 1);
591 std::max(0, std::min(
static_cast<int>(nPress_) - 2,
592 static_cast<int>(scalarValue(alphaP1)))));
595 std::max(0, std::min(
static_cast<int>(nPress_) - 2,
596 static_cast<int>(scalarValue(alphaP2)))));
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 interpolateGasTRho_(
const Scalar* values,
const Evaluation& T,
const Evaluation& rho)
612 Evaluation alphaT = tempIdx_(T);
613 unsigned iT = std::max(0,
614 std::min(
static_cast<int>(nTemp_ - 2),
615 static_cast<int>(alphaT)));
618 Evaluation alphaP1 = densityGasIdx_(rho, iT);
619 Evaluation alphaP2 = densityGasIdx_(rho, iT + 1);
622 std::min(
static_cast<int>(nDensity_ - 2),
623 static_cast<int>(alphaP1)));
626 std::min(
static_cast<int>(nDensity_ - 2),
627 static_cast<int>(alphaP2)));
632 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
633 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
634 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
635 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
640 template <
class Evaluation>
641 static Evaluation interpolateLiquidTRho_(
const Scalar* values,
const Evaluation& T,
const Evaluation& rho)
643 Evaluation alphaT = tempIdx_(T);
644 unsigned iT = std::max<int>(0, std::min<int>(nTemp_ - 2,
static_cast<int>(alphaT)));
647 Evaluation alphaP1 = densityLiquidIdx_(rho, iT);
648 Evaluation alphaP2 = densityLiquidIdx_(rho, iT + 1);
649 unsigned iP1 = std::max<int>(0, std::min<int>(nDensity_ - 2,
static_cast<int>(alphaP1)));
650 unsigned iP2 = std::max<int>(0, std::min<int>(nDensity_ - 2,
static_cast<int>(alphaP2)));
655 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
656 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
657 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
658 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
663 template <
class Evaluation>
664 static Evaluation tempIdx_(
const Evaluation& temperature)
666 return (nTemp_ - 1)*(temperature - tempMin_)/(tempMax_ - tempMin_);
670 template <
class Evaluation>
671 static Evaluation pressLiquidIdx_(
const Evaluation& pressure,
size_t tempIdx)
673 Scalar plMin = minLiquidPressure_(tempIdx);
674 Scalar plMax = maxLiquidPressure_(tempIdx);
676 return (nPress_ - 1)*(pressure - plMin)/(plMax - plMin);
680 template <
class Evaluation>
681 static Evaluation pressGasIdx_(
const Evaluation& pressure,
size_t tempIdx)
683 Scalar pgMin = minGasPressure_(tempIdx);
684 Scalar pgMax = maxGasPressure_(tempIdx);
686 return (nPress_ - 1)*(pressure - pgMin)/(pgMax - pgMin);
690 template <
class Evaluation>
691 static Evaluation densityLiquidIdx_(
const Evaluation& density,
size_t tempIdx)
693 Scalar densityMin = minLiquidDensity_(tempIdx);
694 Scalar densityMax = maxLiquidDensity_(tempIdx);
695 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
699 template <
class Evaluation>
700 static Evaluation densityGasIdx_(
const Evaluation& density,
size_t tempIdx)
702 Scalar densityMin = minGasDensity_(tempIdx);
703 Scalar densityMax = maxGasDensity_(tempIdx);
704 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
709 static Scalar minLiquidPressure_(
size_t tempIdx)
711 if (!useVaporPressure)
714 return std::max<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1);
719 static Scalar maxLiquidPressure_(
size_t tempIdx)
721 if (!useVaporPressure)
724 return std::max<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
729 static Scalar minGasPressure_(
size_t tempIdx)
731 if (!useVaporPressure)
734 return std::min<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1 );
739 static Scalar maxGasPressure_(
size_t tempIdx)
741 if (!useVaporPressure)
744 return std::min<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
750 static Scalar minLiquidDensity_(
size_t tempIdx)
751 {
return minLiquidDensity__[tempIdx]; }
755 static Scalar maxLiquidDensity_(
size_t tempIdx)
756 {
return maxLiquidDensity__[tempIdx]; }
760 static Scalar minGasDensity_(
size_t tempIdx)
761 {
return minGasDensity__[tempIdx]; }
765 static Scalar maxGasDensity_(
size_t tempIdx)
766 {
return maxGasDensity__[tempIdx]; }
769 static Scalar* vaporPressure_;
771 static Scalar* minLiquidDensity__;
772 static Scalar* maxLiquidDensity__;
774 static Scalar* minGasDensity__;
775 static Scalar* maxGasDensity__;
779 static Scalar* gasEnthalpy_;
780 static Scalar* liquidEnthalpy_;
782 static Scalar* gasHeatCapacity_;
783 static Scalar* liquidHeatCapacity_;
785 static Scalar* gasDensity_;
786 static Scalar* liquidDensity_;
788 static Scalar* gasViscosity_;
789 static Scalar* liquidViscosity_;
791 static Scalar* gasThermalConductivity_;
792 static Scalar* liquidThermalConductivity_;
796 static Scalar* gasPressure_;
797 static Scalar* liquidPressure_;
800 static Scalar tempMin_;
801 static Scalar tempMax_;
802 static unsigned nTemp_;
804 static Scalar pressMin_;
805 static Scalar pressMax_;
806 static unsigned nPress_;
808 static Scalar densityMin_;
809 static Scalar densityMax_;
810 static unsigned nDensity_;
813 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
814 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::vaporPressure_;
815 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
816 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minLiquidDensity__;
817 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
818 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxLiquidDensity__;
819 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
820 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minGasDensity__;
821 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
822 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxGasDensity__;
823 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
824 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasEnthalpy_;
825 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
826 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidEnthalpy_;
827 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
828 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasHeatCapacity_;
829 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
830 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidHeatCapacity_;
831 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
832 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasDensity_;
833 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
834 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidDensity_;
835 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
836 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasViscosity_;
837 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
838 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidViscosity_;
839 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
840 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasThermalConductivity_;
841 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
842 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidThermalConductivity_;
843 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
844 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasPressure_;
845 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
846 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidPressure_;
847 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
848 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMin_;
849 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
850 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMax_;
851 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
852 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nTemp_;
853 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
854 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMin_;
855 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
856 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMax_;
857 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
858 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nPress_;
859 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
860 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMin_;
861 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
862 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMax_;
863 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
864 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:495
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:402
static Evaluation liquidPressure(const Evaluation &temperature, Scalar density)
The pressure of liquid in at a given density and temperature.
Definition: TabulatedComponent.hpp:388
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the gas .
Definition: TabulatedComponent.hpp:282
static Evaluation liquidHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the liquid .
Definition: TabulatedComponent.hpp:333
static Evaluation liquidInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the liquid .
Definition: TabulatedComponent.hpp:360
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:408
static Evaluation gasPressure(const Evaluation &temperature, Scalar density)
The pressure of gas in at a given density and temperature.
Definition: TabulatedComponent.hpp:370
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of liquid.
Definition: TabulatedComponent.hpp:478
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: TabulatedComponent.hpp:257
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature .
Definition: TabulatedComponent.hpp:426
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the gas .
Definition: TabulatedComponent.hpp:350
static Scalar criticalVolume()
Returns the critical volume in of the component.
Definition: TabulatedComponent.hpp:245
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the gas .
Definition: TabulatedComponent.hpp:316
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: TabulatedComponent.hpp:414
static const char * name()
A human readable name for the component.
Definition: TabulatedComponent.hpp:215
static Scalar acentricFactor()
Returns the acentric factor of the component.
Definition: TabulatedComponent.hpp:239
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of liquid at a given pressure and temperature .
Definition: TabulatedComponent.hpp:444
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of the component at a given temperature.
Definition: TabulatedComponent.hpp:267
static Evaluation liquidThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of liquid water .
Definition: TabulatedComponent.hpp:512
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of gas.
Definition: TabulatedComponent.hpp:461
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the liquid .
Definition: TabulatedComponent.hpp:299
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: TabulatedComponent.hpp:251