28 #ifndef OPM_TABULATED_COMPONENT_HPP 29 #define OPM_TABULATED_COMPONENT_HPP 36 #include <opm/common/Exceptions.hpp> 37 #include <opm/common/ErrorMacros.hpp> 57 template <
class ScalarT,
class RawComponent,
bool useVaporPressure=true>
61 typedef ScalarT Scalar;
63 static const bool isTabulated =
true;
75 static void init(Scalar tempMin, Scalar tempMax,
unsigned nTemp,
76 Scalar pressMin, Scalar pressMax,
unsigned nPress)
87 vaporPressure_ =
new Scalar[nTemp_];
88 minGasDensity__ =
new Scalar[nTemp_];
89 maxGasDensity__ =
new Scalar[nTemp_];
90 minLiquidDensity__ =
new Scalar[nTemp_];
91 maxLiquidDensity__ =
new Scalar[nTemp_];
93 gasEnthalpy_ =
new Scalar[nTemp_*nPress_];
94 liquidEnthalpy_ =
new Scalar[nTemp_*nPress_];
95 gasHeatCapacity_ =
new Scalar[nTemp_*nPress_];
96 liquidHeatCapacity_ =
new Scalar[nTemp_*nPress_];
97 gasDensity_ =
new Scalar[nTemp_*nPress_];
98 liquidDensity_ =
new Scalar[nTemp_*nPress_];
99 gasViscosity_ =
new Scalar[nTemp_*nPress_];
100 liquidViscosity_ =
new Scalar[nTemp_*nPress_];
101 gasThermalConductivity_ =
new Scalar[nTemp_*nPress_];
102 liquidThermalConductivity_ =
new Scalar[nTemp_*nPress_];
103 gasPressure_ =
new Scalar[nTemp_*nDensity_];
104 liquidPressure_ =
new Scalar[nTemp_*nDensity_];
106 assert(std::numeric_limits<Scalar>::has_quiet_NaN);
107 Scalar NaN = std::numeric_limits<Scalar>::quiet_NaN();
110 for (
unsigned iT = 0; iT < nTemp_; ++ iT) {
111 Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
113 try { vaporPressure_[iT] = RawComponent::vaporPressure(temperature); }
114 catch (
const std::exception&) { vaporPressure_[iT] = NaN; }
116 Scalar pgMax = maxGasPressure_(iT);
117 Scalar pgMin = minGasPressure_(iT);
120 for (
unsigned iP = 0; iP < nPress_; ++ iP) {
121 Scalar pressure = iP * (pgMax - pgMin)/(nPress_ - 1) + pgMin;
123 unsigned i = iT + iP*nTemp_;
125 try { gasEnthalpy_[i] = RawComponent::gasEnthalpy(temperature, pressure); }
126 catch (
const std::exception&) { gasEnthalpy_[i] = NaN; }
128 try { gasHeatCapacity_[i] = RawComponent::gasHeatCapacity(temperature, pressure); }
129 catch (
const std::exception&) { gasHeatCapacity_[i] = NaN; }
131 try { gasDensity_[i] = RawComponent::gasDensity(temperature, pressure); }
132 catch (
const std::exception&) { gasDensity_[i] = NaN; }
134 try { gasViscosity_[i] = RawComponent::gasViscosity(temperature, pressure); }
135 catch (
const std::exception&) { gasViscosity_[i] = NaN; }
137 try { gasThermalConductivity_[i] = RawComponent::gasThermalConductivity(temperature, pressure); }
138 catch (
const std::exception&) { gasThermalConductivity_[i] = NaN; }
141 Scalar plMin = minLiquidPressure_(iT);
142 Scalar plMax = maxLiquidPressure_(iT);
143 for (
unsigned iP = 0; iP < nPress_; ++ iP) {
144 Scalar pressure = iP * (plMax - plMin)/(nPress_ - 1) + plMin;
146 unsigned i = iT + iP*nTemp_;
148 try { liquidEnthalpy_[i] = RawComponent::liquidEnthalpy(temperature, pressure); }
149 catch (
const std::exception&) { liquidEnthalpy_[i] = NaN; }
151 try { liquidHeatCapacity_[i] = RawComponent::liquidHeatCapacity(temperature, pressure); }
152 catch (
const std::exception&) { liquidHeatCapacity_[i] = NaN; }
154 try { liquidDensity_[i] = RawComponent::liquidDensity(temperature, pressure); }
155 catch (
const std::exception&) { liquidDensity_[i] = NaN; }
157 try { liquidViscosity_[i] = RawComponent::liquidViscosity(temperature, pressure); }
158 catch (
const std::exception&) { liquidViscosity_[i] = NaN; }
160 try { liquidThermalConductivity_[i] = RawComponent::liquidThermalConductivity(temperature, pressure); }
161 catch (
const std::exception&) { liquidThermalConductivity_[i] = NaN; }
166 for (
unsigned iT = 0; iT < nTemp_; ++ iT) {
167 Scalar temperature = iT * (tempMax_ - tempMin_)/(nTemp_ - 1) + tempMin_;
171 minGasDensity__[iT] = RawComponent::gasDensity(temperature, minGasPressure_(iT));
173 maxGasDensity__[iT] = RawComponent::gasDensity(temperature, maxGasPressure_(iT + 1));
175 maxGasDensity__[iT] = RawComponent::gasDensity(temperature, maxGasPressure_(iT));
178 for (
unsigned iRho = 0; iRho < nDensity_; ++ iRho) {
180 Scalar(iRho)/(nDensity_ - 1) *
181 (maxGasDensity__[iT] - minGasDensity__[iT])
185 unsigned i = iT + iRho*nTemp_;
187 try { gasPressure_[i] = RawComponent::gasPressure(temperature, density); }
188 catch (
const std::exception&) { gasPressure_[i] = NaN; };
193 minLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, minLiquidPressure_(iT));
195 maxLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, maxLiquidPressure_(iT + 1));
197 maxLiquidDensity__[iT] = RawComponent::liquidDensity(temperature, maxLiquidPressure_(iT));
200 for (
unsigned iRho = 0; iRho < nDensity_; ++ iRho) {
202 Scalar(iRho)/(nDensity_ - 1) *
203 (maxLiquidDensity__[iT] - minLiquidDensity__[iT])
205 minLiquidDensity__[iT];
207 unsigned i = iT + iRho*nTemp_;
209 try { liquidPressure_[i] = RawComponent::liquidPressure(temperature, density); }
210 catch (
const std::exception&) { liquidPressure_[i] = NaN; };
219 {
return RawComponent::name(); }
225 {
return RawComponent::molarMass(); }
231 {
return RawComponent::criticalTemperature(); }
237 {
return RawComponent::criticalPressure(); }
243 {
return RawComponent::tripleTemperature(); }
249 {
return RawComponent::triplePressure(); }
257 template <
class Evaluation>
260 const Evaluation& result = interpolateT_(vaporPressure_, temperature);
261 if (std::isnan(Opm::scalarValue(result)))
262 return RawComponent::vaporPressure(temperature);
272 template <
class Evaluation>
273 static Evaluation
gasEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
275 const Evaluation& result = interpolateGasTP_(gasEnthalpy_,
278 if (std::isnan(Opm::scalarValue(result)))
279 return RawComponent::gasEnthalpy(temperature, pressure);
289 template <
class Evaluation>
290 static Evaluation
liquidEnthalpy(
const Evaluation& temperature,
const Evaluation& pressure)
292 const Evaluation& result = interpolateLiquidTP_(liquidEnthalpy_,
295 if (std::isnan(Opm::scalarValue(result)))
296 return RawComponent::liquidEnthalpy(temperature, pressure);
306 template <
class Evaluation>
307 static Evaluation
gasHeatCapacity(
const Evaluation& temperature,
const Evaluation& pressure)
309 const Evaluation& result = interpolateGasTP_(gasHeatCapacity_,
312 if (std::isnan(Opm::scalarValue(result)))
313 return RawComponent::gasHeatCapacity(temperature, pressure);
323 template <
class Evaluation>
326 const Evaluation& result = interpolateLiquidTP_(liquidHeatCapacity_,
329 if (std::isnan(Opm::scalarValue(result)))
330 return RawComponent::liquidHeatCapacity(temperature, pressure);
340 template <
class Evaluation>
350 template <
class Evaluation>
360 template <
class Evaluation>
361 static Evaluation
gasPressure(
const Evaluation& temperature, Scalar density)
363 const Evaluation& result = interpolateGasTRho_(gasPressure_,
366 if (std::isnan(Opm::scalarValue(result)))
367 return RawComponent::gasPressure(temperature,
378 template <
class Evaluation>
381 const Evaluation& result = interpolateLiquidTRho_(liquidPressure_,
384 if (std::isnan(Opm::scalarValue(result)))
385 return RawComponent::liquidPressure(temperature,
394 {
return RawComponent::gasIsCompressible(); }
400 {
return RawComponent::liquidIsCompressible(); }
406 {
return RawComponent::gasIsIdeal(); }
416 template <
class Evaluation>
417 static Evaluation
gasDensity(
const Evaluation& temperature,
const Evaluation& pressure)
419 const Evaluation& result = interpolateGasTP_(gasDensity_,
422 if (std::isnan(Opm::scalarValue(result)))
423 return RawComponent::gasDensity(temperature, pressure);
434 template <
class Evaluation>
435 static Evaluation
liquidDensity(
const Evaluation& temperature,
const Evaluation& pressure)
437 const Evaluation& result = interpolateLiquidTP_(liquidDensity_,
440 if (std::isnan(Opm::scalarValue(result)))
441 return RawComponent::liquidDensity(temperature, pressure);
451 template <
class Evaluation>
452 static Evaluation
gasViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
454 const Evaluation& result = interpolateGasTP_(gasViscosity_,
457 if (std::isnan(Opm::scalarValue(result)))
458 return RawComponent::gasViscosity(temperature, pressure);
468 template <
class Evaluation>
469 static Evaluation
liquidViscosity(
const Evaluation& temperature,
const Evaluation& pressure)
471 const Evaluation& result = interpolateLiquidTP_(liquidViscosity_,
474 if (std::isnan(Opm::scalarValue(result)))
475 return RawComponent::liquidViscosity(temperature, pressure);
485 template <
class Evaluation>
488 const Evaluation& result = interpolateGasTP_(gasThermalConductivity_,
491 if (std::isnan(Opm::scalarValue(result)))
492 return RawComponent::gasThermalConductivity(temperature, pressure);
502 template <
class Evaluation>
505 const Evaluation& result = interpolateLiquidTP_(liquidThermalConductivity_,
508 if (std::isnan(Opm::scalarValue(result)))
509 return RawComponent::liquidThermalConductivity(temperature, pressure);
515 template <
class Evaluation>
516 static Evaluation interpolateT_(
const Scalar* values,
const Evaluation& T)
518 Evaluation alphaT = tempIdx_(T);
519 if (alphaT < 0 || alphaT >= nTemp_ - 1)
520 return std::numeric_limits<Scalar>::quiet_NaN();
522 size_t iT =
static_cast<size_t>(Opm::scalarValue(alphaT));
526 values[iT ]*(1 - alphaT) +
527 values[iT + 1]*( alphaT);
532 template <
class Evaluation>
533 static Evaluation interpolateLiquidTP_(
const Scalar* values,
const Evaluation& T,
const Evaluation& p)
535 Evaluation alphaT = tempIdx_(T);
536 if (alphaT < 0 || alphaT >= nTemp_ - 1)
537 return std::numeric_limits<Scalar>::quiet_NaN();
539 size_t iT =
static_cast<size_t>(Opm::scalarValue(alphaT));
542 Evaluation alphaP1 = pressLiquidIdx_(p, iT);
543 Evaluation alphaP2 = pressLiquidIdx_(p, iT + 1);
547 std::max<int>(0, std::min(static_cast<int>(nPress_) - 2,
548 static_cast<int>(Opm::scalarValue(alphaP1)))));
551 std::max(0, std::min(static_cast<int>(nPress_) - 2,
552 static_cast<int>(Opm::scalarValue(alphaP2)))));
557 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
558 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
559 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
560 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
565 template <
class Evaluation>
566 static Evaluation interpolateGasTP_(
const Scalar* values,
const Evaluation& T,
const Evaluation& p)
568 Evaluation alphaT = tempIdx_(T);
569 if (alphaT < 0 || alphaT >= nTemp_ - 1)
570 return std::numeric_limits<Scalar>::quiet_NaN();
574 std::max(0, std::min(static_cast<int>(nTemp_) - 2,
575 static_cast<int>(Opm::scalarValue(alphaT)))));
578 Evaluation alphaP1 = pressGasIdx_(p, iT);
579 Evaluation alphaP2 = pressGasIdx_(p, iT + 1);
582 std::max(0, std::min(static_cast<int>(nPress_) - 2,
583 static_cast<int>(Opm::scalarValue(alphaP1)))));
586 std::max(0, std::min(static_cast<int>(nPress_) - 2,
587 static_cast<int>(Opm::scalarValue(alphaP2)))));
592 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
593 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
594 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
595 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
600 template <
class Evaluation>
601 static Evaluation interpolateGasTRho_(
const Scalar* values,
const Evaluation& T,
const Evaluation& rho)
603 Evaluation alphaT = tempIdx_(T);
604 unsigned iT = std::max(0,
605 std::min(static_cast<int>(nTemp_ - 2),
606 static_cast<int>(alphaT)));
609 Evaluation alphaP1 = densityGasIdx_(rho, iT);
610 Evaluation alphaP2 = densityGasIdx_(rho, iT + 1);
613 std::min(static_cast<int>(nDensity_ - 2),
614 static_cast<int>(alphaP1)));
617 std::min(static_cast<int>(nDensity_ - 2),
618 static_cast<int>(alphaP2)));
623 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
624 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
625 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
626 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
631 template <
class Evaluation>
632 static Evaluation interpolateLiquidTRho_(
const Scalar* values,
const Evaluation& T,
const Evaluation& rho)
634 Evaluation alphaT = tempIdx_(T);
635 unsigned iT = std::max<int>(0, std::min<int>(nTemp_ - 2,
static_cast<int>(alphaT)));
638 Evaluation alphaP1 = densityLiquidIdx_(rho, iT);
639 Evaluation alphaP2 = densityLiquidIdx_(rho, iT + 1);
640 unsigned iP1 = std::max<int>(0, std::min<int>(nDensity_ - 2,
static_cast<int>(alphaP1)));
641 unsigned iP2 = std::max<int>(0, std::min<int>(nDensity_ - 2,
static_cast<int>(alphaP2)));
646 values[(iT ) + (iP1 )*nTemp_]*(1 - alphaT)*(1 - alphaP1) +
647 values[(iT ) + (iP1 + 1)*nTemp_]*(1 - alphaT)*( alphaP1) +
648 values[(iT + 1) + (iP2 )*nTemp_]*( alphaT)*(1 - alphaP2) +
649 values[(iT + 1) + (iP2 + 1)*nTemp_]*( alphaT)*( alphaP2);
654 template <
class Evaluation>
655 static Evaluation tempIdx_(
const Evaluation& temperature)
657 return (nTemp_ - 1)*(temperature - tempMin_)/(tempMax_ - tempMin_);
661 template <
class Evaluation>
662 static Evaluation pressLiquidIdx_(
const Evaluation& pressure,
size_t tempIdx)
664 Scalar plMin = minLiquidPressure_(tempIdx);
665 Scalar plMax = maxLiquidPressure_(tempIdx);
667 return (nPress_ - 1)*(pressure - plMin)/(plMax - plMin);
671 template <
class Evaluation>
672 static Evaluation pressGasIdx_(
const Evaluation& pressure,
size_t tempIdx)
674 Scalar pgMin = minGasPressure_(tempIdx);
675 Scalar pgMax = maxGasPressure_(tempIdx);
677 return (nPress_ - 1)*(pressure - pgMin)/(pgMax - pgMin);
681 template <
class Evaluation>
682 static Evaluation densityLiquidIdx_(
const Evaluation& density,
size_t tempIdx)
684 Scalar densityMin = minLiquidDensity_(tempIdx);
685 Scalar densityMax = maxLiquidDensity_(tempIdx);
686 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
690 template <
class Evaluation>
691 static Evaluation densityGasIdx_(
const Evaluation& density,
size_t tempIdx)
693 Scalar densityMin = minGasDensity_(tempIdx);
694 Scalar densityMax = maxGasDensity_(tempIdx);
695 return (nDensity_ - 1) * (density - densityMin)/(densityMax - densityMin);
700 static Scalar minLiquidPressure_(
size_t tempIdx)
702 if (!useVaporPressure)
705 return std::max<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1);
710 static Scalar maxLiquidPressure_(
size_t tempIdx)
712 if (!useVaporPressure)
715 return std::max<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
720 static Scalar minGasPressure_(
size_t tempIdx)
722 if (!useVaporPressure)
725 return std::min<Scalar>(pressMin_, vaporPressure_[tempIdx] / 1.1 );
730 static Scalar maxGasPressure_(
size_t tempIdx)
732 if (!useVaporPressure)
735 return std::min<Scalar>(pressMax_, vaporPressure_[tempIdx] * 1.1);
741 static Scalar minLiquidDensity_(
size_t tempIdx)
742 {
return minLiquidDensity__[tempIdx]; }
746 static Scalar maxLiquidDensity_(
size_t tempIdx)
747 {
return maxLiquidDensity__[tempIdx]; }
751 static Scalar minGasDensity_(
size_t tempIdx)
752 {
return minGasDensity__[tempIdx]; }
756 static Scalar maxGasDensity_(
size_t tempIdx)
757 {
return maxGasDensity__[tempIdx]; }
760 static Scalar* vaporPressure_;
762 static Scalar* minLiquidDensity__;
763 static Scalar* maxLiquidDensity__;
765 static Scalar* minGasDensity__;
766 static Scalar* maxGasDensity__;
770 static Scalar* gasEnthalpy_;
771 static Scalar* liquidEnthalpy_;
773 static Scalar* gasHeatCapacity_;
774 static Scalar* liquidHeatCapacity_;
776 static Scalar* gasDensity_;
777 static Scalar* liquidDensity_;
779 static Scalar* gasViscosity_;
780 static Scalar* liquidViscosity_;
782 static Scalar* gasThermalConductivity_;
783 static Scalar* liquidThermalConductivity_;
787 static Scalar* gasPressure_;
788 static Scalar* liquidPressure_;
791 static Scalar tempMin_;
792 static Scalar tempMax_;
793 static unsigned nTemp_;
795 static Scalar pressMin_;
796 static Scalar pressMax_;
797 static unsigned nPress_;
799 static Scalar densityMin_;
800 static Scalar densityMax_;
801 static unsigned nDensity_;
804 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
805 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::vaporPressure_;
806 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
807 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minLiquidDensity__;
808 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
809 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxLiquidDensity__;
810 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
811 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::minGasDensity__;
812 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
813 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::maxGasDensity__;
814 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
815 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasEnthalpy_;
816 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
817 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidEnthalpy_;
818 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
819 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasHeatCapacity_;
820 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
821 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidHeatCapacity_;
822 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
823 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasDensity_;
824 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
825 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidDensity_;
826 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
827 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasViscosity_;
828 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
829 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidViscosity_;
830 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
831 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasThermalConductivity_;
832 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
833 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidThermalConductivity_;
834 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
835 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::gasPressure_;
836 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
837 Scalar* TabulatedComponent<Scalar, RawComponent, useVaporPressure>::liquidPressure_;
838 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
839 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMin_;
840 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
841 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::tempMax_;
842 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
843 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nTemp_;
844 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
845 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMin_;
846 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
847 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::pressMax_;
848 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
849 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nPress_;
850 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
851 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMin_;
852 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
853 Scalar TabulatedComponent<Scalar, RawComponent, useVaporPressure>::densityMax_;
854 template <
class Scalar,
class RawComponent,
bool useVaporPressure>
855 unsigned TabulatedComponent<Scalar, RawComponent, useVaporPressure>::nDensity_;
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of liquid at a given pressure and temperature .
Definition: TabulatedComponent.hpp:435
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the liquid .
Definition: TabulatedComponent.hpp:290
static Evaluation liquidHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the liquid .
Definition: TabulatedComponent.hpp:324
static Scalar molarMass()
The molar mass in of the component.
Definition: TabulatedComponent.hpp:224
static Scalar triplePressure()
Returns the pressure in at the component's triple point.
Definition: TabulatedComponent.hpp:248
Definition: Air_Mesitylene.hpp:33
static Evaluation liquidInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the liquid .
Definition: TabulatedComponent.hpp:351
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of gas.
Definition: TabulatedComponent.hpp:452
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature .
Definition: TabulatedComponent.hpp:417
static Evaluation liquidThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of liquid water .
Definition: TabulatedComponent.hpp:503
static const char * name()
A human readable name for the component.
Definition: TabulatedComponent.hpp:218
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of the component at a given temperature.
Definition: TabulatedComponent.hpp:258
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure)
Specific internal energy of the gas .
Definition: TabulatedComponent.hpp:341
static Scalar criticalPressure()
Returns the critical pressure in of the component.
Definition: TabulatedComponent.hpp:236
static Evaluation gasHeatCapacity(const Evaluation &temperature, const Evaluation &pressure)
Specific isobaric heat capacity of the gas .
Definition: TabulatedComponent.hpp:307
static Scalar criticalTemperature()
Returns the critical temperature in of the component.
Definition: TabulatedComponent.hpp:230
static Evaluation liquidPressure(const Evaluation &temperature, Scalar density)
The pressure of liquid in at a given density and temperature.
Definition: TabulatedComponent.hpp:379
A generic class which tabulates all thermodynamic properties of a given component.
Definition: TabulatedComponent.hpp:58
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the tables.
Definition: TabulatedComponent.hpp:75
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the gas .
Definition: TabulatedComponent.hpp:273
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: TabulatedComponent.hpp:405
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of liquid.
Definition: TabulatedComponent.hpp:469
static Evaluation gasThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of gaseous water .
Definition: TabulatedComponent.hpp:486
static bool gasIsCompressible()
Returns true iff the gas phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:393
static Evaluation gasPressure(const Evaluation &temperature, Scalar density)
The pressure of gas in at a given density and temperature.
Definition: TabulatedComponent.hpp:361
static Scalar tripleTemperature()
Returns the temperature in at the component's triple point.
Definition: TabulatedComponent.hpp:242
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:399