www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TabulatedFluidProperties Class Reference

Class for fluid properties read from a file. More...

#include <TabulatedFluidProperties.h>

Inheritance diagram for TabulatedFluidProperties:
[legend]

Public Member Functions

 TabulatedFluidProperties (const InputParameters &parameters)
 
virtual ~TabulatedFluidProperties ()
 
virtual void initialSetup () override
 
virtual std::string fluidName () const override
 Fluid name. More...
 
virtual Real molarMass () const override
 Molar mass. More...
 
virtual Real rho (Real pressure, Real temperature) const override
 Density. More...
 
virtual void rho_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
 Density and its derivatives wrt pressure and temperature. More...
 
virtual Real e (Real pressure, Real temperature) const override
 Internal energy. More...
 
virtual void e_dpT (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
 Internal energy and its derivatives wrt pressure and temperature. More...
 
virtual void rho_e_dpT (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const override
 Density and internal energy and their derivatives wrt pressure and temperature. More...
 
virtual Real h (Real p, Real T) const override
 Specific enthalpy. More...
 
virtual void h_dpT (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
 Enthalpy and its derivatives wrt pressure and temperature. More...
 
virtual Real mu (Real pressure, Real temperature) const override
 
virtual void mu_dpT (Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
 
virtual Real mu_from_rho_T (Real density, Real temperature) const override
 
virtual void mu_drhoT_from_rho_T (Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const override
 Dynamic viscosity and its derivatives wrt density and temperature. More...
 
virtual Real cp (Real pressure, Real temperature) const override
 Isobaric specific heat capacity. More...
 
virtual Real cv (Real pressure, Real temperature) const override
 Isochoric specific heat. More...
 
virtual Real c (Real pressure, Real temperature) const override
 Speed of sound. More...
 
virtual Real k (Real pressure, Real temperature) const override
 Thermal conductivity. More...
 
virtual void k_dpT (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const override
 Thermal conductivity and its derivatives wrt pressure and temperature. More...
 
virtual Real k_from_rho_T (Real density, Real temperature) const override
 Thermal conductivity as a function of density and temperature. More...
 
virtual Real s (Real pressure, Real temperature) const override
 Specific entropy. More...
 
virtual Real beta (Real pressure, Real temperature) const override
 Thermal expansion coefficient. More...
 
virtual Real henryConstant (Real temperature) const override
 Henry's law constant for dissolution in water. More...
 
virtual void henryConstant_dT (Real temperature, Real &Kh, Real &dKh_dT) const override
 Henry's law constant for dissolution in water and derivative wrt temperature. More...
 
virtual Real gamma (Real pressure, Real temperature) const
 Adiabatic index - ratio of specific heats. More...
 
virtual void execute () final
 
virtual void initialize () final
 
virtual void finalize () final
 

Protected Member Functions

void writeTabulatedData (std::string file_name)
 Writes tabulated data to a file. More...
 
void checkInputVariables (Real pressure, Real temperature) const
 Checks that the inputs are within the range of the tabulated data, and throws an error if they are not. More...
 
virtual void generateTabulatedData ()
 Generates a table of fluid properties by looping over pressure and temperature and calculating properties using the FluidProperties UserObject _fp. More...
 
void reshapeData2D (unsigned int nrow, unsigned int ncol, const std::vector< Real > &vec, std::vector< std::vector< Real >> &mat)
 Forms a 2D matrix from a single std::vector. More...
 
virtual Real henryConstantIAPWS (Real temperature, Real A, Real B, Real C) const
 IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004) More...
 
virtual void henryConstantIAPWS_dT (Real temperature, Real &Kh, Real &dKh_dT, Real A, Real B, Real C) const
 IAPWS formulation of Henry's law constant for dissolution in water and derivative wrt temperature. More...
 

Protected Attributes

FileName _file_name
 File name of tabulated data file. More...
 
std::vector< Real > _pressure
 Pressure vector. More...
 
std::vector< Real > _temperature
 Temperature vector. More...
 
std::vector< std::vector< Real > > _density
 Tabulated density. More...
 
std::vector< std::vector< Real > > _internal_energy
 Tabulated internal energy. More...
 
std::vector< std::vector< Real > > _enthalpy
 Tabulated enthalpy. More...
 
std::unique_ptr< BicubicSplineInterpolation > _density_ipol
 Interpoled density. More...
 
std::unique_ptr< BicubicSplineInterpolation > _internal_energy_ipol
 Interpoled internal energy. More...
 
std::unique_ptr< BicubicSplineInterpolation > _enthalpy_ipol
 Interpoled enthalpy. More...
 
std::vector< Real > _drho_dp_0
 Derivatives along the boundary. More...
 
std::vector< Real > _drho_dp_n
 
std::vector< Real > _drho_dT_0
 
std::vector< Real > _drho_dT_n
 
std::vector< Real > _de_dp_0
 
std::vector< Real > _de_dp_n
 
std::vector< Real > _de_dT_0
 
std::vector< Real > _de_dT_n
 
std::vector< Real > _dh_dp_0
 
std::vector< Real > _dh_dp_n
 
std::vector< Real > _dh_dT_0
 
std::vector< Real > _dh_dT_n
 
Real _temperature_min
 Minimum temperature in tabulated data. More...
 
Real _temperature_max
 Maximum temperature in tabulated data. More...
 
Real _pressure_min
 Minimum pressure in tabulated data. More...
 
Real _pressure_max
 Maximum pressure in tabulated data. More...
 
unsigned int _num_T
 Number of temperature points in the tabulated data. More...
 
unsigned int _num_p
 Number of pressure points in the tabulated data. More...
 
const unsigned int _wrt_p = 1
 Index for derivatives wrt pressure. More...
 
const unsigned int _wrt_T = 2
 Index for derivatives wrt temperature. More...
 
const SinglePhaseFluidPropertiesPT_fp
 SinglePhaseFluidPropertiesPT UserObject. More...
 
const std::vector< std::string > _required_columns
 List of required column names to be read. More...
 
MooseUtils::DelimitedFileReader _csv_reader
 The MOOSE delimited file reader. More...
 
const Real _R
 Universal gas constant (J/mol/K) More...
 
const Real _T_c2k
 Conversion of temperature from Celcius to Kelvin. More...
 

Detailed Description

Class for fluid properties read from a file.

Property values are read from a CSV file containing property data. Monotonically increasing values of pressure and temperature must be included in the data file, specifying the phase space where tabulated fluid properties will be defined. An error is thrown if either temperature or pressure data is not included or not monotonic, and an error is also thrown if this UserObject is requested to provide a fluid property outside this phase space.

This class is intended to be used when complicated formulations for density, internal energy or enthalpy are required, which can be computationally expensive. This is particularly the case where the fluid equation of state is based on a Helmholtz free energy that is a function of density and temperature, like that used in CO2FluidProperties. In this case, density must be solved iteratively using pressure and temperature, which increases the computational burden.

In these cases, using an interpolation of the tabulated fluid properties can significantly reduce the computational time for computing density, internal energy, and enthalpy.

The expected file format for the tabulated fluid properties is now described. The first line must be the header containing the required column names "pressure", "temperature", "density", "enthalpy", "internal_energy" (note: the order is not important, although having pressure and temperature first makes the data easier for a human to read).

The data in the pressure and temperature columns must be monotonically increasing. This file format does require duplication of the pressure and temperature data - each pressure value must be included num_T times, while each temperature value is repeated num_p times, where num_T and num_p are the number of temperature and pressure points, respectively. This class will check that the required number of data points have been entered (num_T * num_p).

An example of a valid fluid properties file is provided below:

pressure, temperature, density, enthalpy, internal_energy 200000, 275, 3.90056, -21487, -72761.7 200000, 277, 3.86573, -19495.4, -71232.0 200000, 280, 3.83155, -17499.1, -69697.3 300000, 275, 6.07273, -22728.3, -73626.5 300000, 277, 6.01721, -20711.5, -72079.3 300000, 280, 5.96277, -18691.0, -70527.7

and so on.

If no tabulated fluid property data file exists, then data for density, internal energy and enthalpy will be generated using the pressure and temperature ranges specified in the input file at the beginning of the simulation.

This tabulated data will be written to file in the correct format, enabling suitable data files to be created for future use. There is an upfront computational expense required for this initial data generation, depending on the required number of pressure and temperature points. However, provided that the number of data points required to generate the tabulated data is smaller than the number of times the property members in the FluidProperties UserObject are used, the initial time to generate the data and the subsequent interpolation time can be much less than using the original FluidProperties UserObject.

Density, internal_energy and enthalpy and their derivatives wrt pressure and temperature are always calculated using bicubic spline interpolation, while all remaining fluid properties are calculated using the FluidProperties UserObject _fp.

A function to write generated data to file using the correct format is provided to allow suitable files of fluid property data to be generated using the FluidProperties module UserObjects.

Definition at line 87 of file TabulatedFluidProperties.h.

Constructor & Destructor Documentation

TabulatedFluidProperties::TabulatedFluidProperties ( const InputParameters &  parameters)

Definition at line 46 of file TabulatedFluidProperties.C.

47  : SinglePhaseFluidPropertiesPT(parameters),
48  _file_name(getParam<FileName>("fluid_property_file")),
49  _temperature_min(getParam<Real>("temperature_min")),
50  _temperature_max(getParam<Real>("temperature_max")),
51  _pressure_min(getParam<Real>("pressure_min")),
52  _pressure_max(getParam<Real>("pressure_max")),
53  _num_T(getParam<unsigned int>("num_T")),
54  _num_p(getParam<unsigned int>("num_p")),
55  _fp(getUserObject<SinglePhaseFluidPropertiesPT>("fp")),
56  _csv_reader(_file_name, &_communicator)
57 {
58  // Sanity check on minimum and maximum temperatures and pressures
60  mooseError("temperature_max must be greater than temperature_min in ", name());
62  mooseError("pressure_max must be greater than pressure_min in ", name());
63 
64  // Lines starting with # are treated as comments
65  _csv_reader.setComment("#");
66 }
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
Real _temperature_min
Minimum temperature in tabulated data.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
unsigned int _num_T
Number of temperature points in the tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
unsigned int _num_p
Number of pressure points in the tabulated data.
SinglePhaseFluidPropertiesPT(const InputParameters &parameters)
FileName _file_name
File name of tabulated data file.
TabulatedFluidProperties::~TabulatedFluidProperties ( )
virtual

Definition at line 68 of file TabulatedFluidProperties.C.

68 {}

Member Function Documentation

Real TabulatedFluidProperties::beta ( Real  pressure,
Real  temperature 
) const
overridevirtual

Thermal expansion coefficient.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
beta (1/K)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 355 of file TabulatedFluidProperties.C.

356 {
357  return _fp.beta(pressure, temperature);
358 }
virtual Real beta(Real pressure, Real temperature) const =0
Thermal expansion coefficient.
const std::string temperature
Definition: NS.h:25
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
const std::string pressure
Definition: NS.h:24
Real TabulatedFluidProperties::c ( Real  pressure,
Real  temperature 
) const
overridevirtual

Speed of sound.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
speed of sound (m/s)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 311 of file TabulatedFluidProperties.C.

312 {
313  return _fp.c(pressure, temperature);
314 }
virtual Real c(Real pressure, Real temperature) const =0
Speed of sound.
const std::string temperature
Definition: NS.h:25
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
const std::string pressure
Definition: NS.h:24
void TabulatedFluidProperties::checkInputVariables ( Real  pressure,
Real  temperature 
) const
protected

Checks that the inputs are within the range of the tabulated data, and throws an error if they are not.

Parameters
pressureinput pressure (Pa)
temperatureinput temperature (K)

Definition at line 455 of file TabulatedFluidProperties.C.

Referenced by e(), e_dpT(), h(), h_dpT(), rho(), rho_dpT(), and rho_e_dpT().

456 {
457  if (pressure < _pressure_min || pressure > _pressure_max)
458  mooseError("Pressure ",
459  pressure,
460  " is outside the range of tabulated pressure (",
462  ", ",
463  _pressure_max,
464  ".");
465 
466  if (temperature < _temperature_min || temperature > _temperature_max)
467  mooseError("Temperature ",
468  temperature,
469  " is outside the range of tabulated temperature (",
471  ", ",
472  _temperature_max,
473  ".");
474 }
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
const std::string temperature
Definition: NS.h:25
Real _temperature_min
Minimum temperature in tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
const std::string pressure
Definition: NS.h:24
Real TabulatedFluidProperties::cp ( Real  pressure,
Real  temperature 
) const
overridevirtual

Isobaric specific heat capacity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cp (J/kg/K)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 317 of file TabulatedFluidProperties.C.

318 {
319  return _fp.cp(pressure, temperature);
320 }
virtual Real cp(Real pressure, Real temperature) const =0
Isobaric specific heat capacity.
const std::string temperature
Definition: NS.h:25
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
const std::string pressure
Definition: NS.h:24
Real TabulatedFluidProperties::cv ( Real  pressure,
Real  temperature 
) const
overridevirtual

Isochoric specific heat.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
cv (J/kg/K)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 323 of file TabulatedFluidProperties.C.

324 {
325  return _fp.cv(pressure, temperature);
326 }
const std::string temperature
Definition: NS.h:25
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real cv(Real pressure, Real temperature) const =0
Isochoric specific heat.
const std::string pressure
Definition: NS.h:24
Real TabulatedFluidProperties::e ( Real  pressure,
Real  temperature 
) const
overridevirtual

Internal energy.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
internal energy (J/kg)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 227 of file TabulatedFluidProperties.C.

228 {
230  return _internal_energy_ipol->sample(pressure, temperature);
231 }
std::unique_ptr< BicubicSplineInterpolation > _internal_energy_ipol
Interpoled internal energy.
const std::string temperature
Definition: NS.h:25
void checkInputVariables(Real pressure, Real temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:24
void TabulatedFluidProperties::e_dpT ( Real  pressure,
Real  temperature,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtual

Internal energy and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy wrt pressure
[out]de_dTderivative of internal energy wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 234 of file TabulatedFluidProperties.C.

Referenced by rho_e_dpT().

236 {
239  de_dp = _internal_energy_ipol->sampleDerivative(pressure, temperature, _wrt_p);
240  de_dT = _internal_energy_ipol->sampleDerivative(pressure, temperature, _wrt_T);
241 }
std::unique_ptr< BicubicSplineInterpolation > _internal_energy_ipol
Interpoled internal energy.
const unsigned int _wrt_T
Index for derivatives wrt temperature.
const std::string temperature
Definition: NS.h:25
void checkInputVariables(Real pressure, Real temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const unsigned int _wrt_p
Index for derivatives wrt pressure.
const std::string pressure
Definition: NS.h:24
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 25 of file FluidProperties.h.

25 {}
virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 27 of file FluidProperties.h.

27 {}
std::string TabulatedFluidProperties::fluidName ( ) const
overridevirtual

Fluid name.

Returns
string representing fluid name

Implements SinglePhaseFluidPropertiesPT.

Definition at line 198 of file TabulatedFluidProperties.C.

199 {
200  return _fp.fluidName();
201 }
virtual std::string fluidName() const =0
Fluid name.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
Real SinglePhaseFluidPropertiesPT::gamma ( Real  pressure,
Real  temperature 
) const
virtualinherited

Adiabatic index - ratio of specific heats.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
gamma (-)

Definition at line 27 of file SinglePhaseFluidPropertiesPT.C.

Referenced by MethaneFluidProperties::c().

28 {
30 }
virtual Real cp(Real pressure, Real temperature) const =0
Isobaric specific heat capacity.
const std::string temperature
Definition: NS.h:25
virtual Real cv(Real pressure, Real temperature) const =0
Isochoric specific heat.
const std::string pressure
Definition: NS.h:24
void TabulatedFluidProperties::generateTabulatedData ( )
protectedvirtual

Generates a table of fluid properties by looping over pressure and temperature and calculating properties using the FluidProperties UserObject _fp.

Definition at line 400 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

401 {
402  _pressure.resize(_num_p);
403  _temperature.resize(_num_T);
404 
405  _density.resize(_num_p);
406  _internal_energy.resize(_num_p);
407  _enthalpy.resize(_num_p);
408 
409  for (unsigned int i = 0; i < _num_p; ++i)
410  {
411  _density[i].resize(_num_T);
412  _internal_energy[i].resize(_num_T);
413  _enthalpy[i].resize(_num_T);
414  }
415 
416  // Temperature is divided equally into _num_T segments
417  Real delta_T = (_temperature_max - _temperature_min) / static_cast<Real>(_num_T - 1);
418 
419  for (unsigned int j = 0; j < _num_T; ++j)
420  _temperature[j] = _temperature_min + j * delta_T;
421 
422  // Divide the pressure into _num_p equal segments
423  Real delta_p = (_pressure_max - _pressure_min) / static_cast<Real>(_num_p - 1);
424 
425  for (unsigned int i = 0; i < _num_p; ++i)
426  _pressure[i] = _pressure_min + i * delta_p;
427 
428  // Generate the tabulated data at the pressure and temperature points
429  for (unsigned int i = 0; i < _num_p; ++i)
430  for (unsigned int j = 0; j < _num_T; ++j)
431  {
432  _density[i][j] = _fp.rho(_pressure[i], _temperature[j]);
433  _internal_energy[i][j] = _fp.e(_pressure[i], _temperature[j]);
434  _enthalpy[i][j] = _fp.h(_pressure[i], _temperature[j]);
435  }
436 }
std::vector< std::vector< Real > > _internal_energy
Tabulated internal energy.
Real _temperature_max
Maximum temperature in tabulated data.
Real _pressure_max
Maximum pressure in tabulated data.
std::vector< std::vector< Real > > _density
Tabulated density.
Real _temperature_min
Minimum temperature in tabulated data.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
std::vector< std::vector< Real > > _enthalpy
Tabulated enthalpy.
virtual Real e(Real pressure, Real temperature) const =0
Internal energy.
std::vector< Real > _pressure
Pressure vector.
std::vector< Real > _temperature
Temperature vector.
unsigned int _num_T
Number of temperature points in the tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
unsigned int _num_p
Number of pressure points in the tabulated data.
virtual Real h(Real p, Real T) const =0
Specific enthalpy.
virtual Real rho(Real pressure, Real temperature) const =0
Density.
Real TabulatedFluidProperties::h ( Real  p,
Real  T 
) const
overridevirtual

Specific enthalpy.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
h (J/kg)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 259 of file TabulatedFluidProperties.C.

260 {
262  return _enthalpy_ipol->sample(pressure, temperature);
263 }
std::unique_ptr< BicubicSplineInterpolation > _enthalpy_ipol
Interpoled enthalpy.
const std::string temperature
Definition: NS.h:25
void checkInputVariables(Real pressure, Real temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const std::string pressure
Definition: NS.h:24
void TabulatedFluidProperties::h_dpT ( Real  pressure,
Real  temperature,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
overridevirtual

Enthalpy and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]h(J/kg)
[out]dh_dpderivative of enthalpy wrt pressure
[out]dh_dTderivative of enthalpy wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 266 of file TabulatedFluidProperties.C.

268 {
270  h = _enthalpy_ipol->sample(pressure, temperature);
271  dh_dp = _enthalpy_ipol->sampleDerivative(pressure, temperature, _wrt_p);
272  dh_dT = _enthalpy_ipol->sampleDerivative(pressure, temperature, _wrt_T);
273 }
std::unique_ptr< BicubicSplineInterpolation > _enthalpy_ipol
Interpoled enthalpy.
const unsigned int _wrt_T
Index for derivatives wrt temperature.
const std::string temperature
Definition: NS.h:25
void checkInputVariables(Real pressure, Real temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const unsigned int _wrt_p
Index for derivatives wrt pressure.
const std::string pressure
Definition: NS.h:24
virtual Real h(Real p, Real T) const override
Specific enthalpy.
Real TabulatedFluidProperties::henryConstant ( Real  temperature) const
overridevirtual

Henry's law constant for dissolution in water.

Parameters
temperaturefluid temperature (K)
Returns
Henry's constant

Implements SinglePhaseFluidPropertiesPT.

Definition at line 361 of file TabulatedFluidProperties.C.

362 {
363  return _fp.henryConstant(temperature);
364 }
const std::string temperature
Definition: NS.h:25
virtual Real henryConstant(Real temperature) const =0
Henry&#39;s law constant for dissolution in water.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulatedFluidProperties::henryConstant_dT ( Real  temperature,
Real &  Kh,
Real &  dKh_dT 
) const
overridevirtual

Henry's law constant for dissolution in water and derivative wrt temperature.

Parameters
temperaturefluid temperature (K)
[out]KhHenry's constant
[out]dKh_dTderivative of Kh wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 367 of file TabulatedFluidProperties.C.

368 {
369  _fp.henryConstant_dT(temperature, Kh, dKh_dT);
370 }
const std::string temperature
Definition: NS.h:25
virtual void henryConstant_dT(Real temperature, Real &Kh, Real &dKh_dT) const =0
Henry&#39;s law constant for dissolution in water and derivative wrt temperature.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
Real SinglePhaseFluidPropertiesPT::henryConstantIAPWS ( Real  temperature,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

IAPWS formulation of Henry's law constant for dissolution in water From Guidelines on the Henry's constant and vapour liquid distribution constant for gases in H20 and D20 at high temperatures, IAPWS (2004)

Definition at line 33 of file SinglePhaseFluidPropertiesPT.C.

Referenced by MethaneFluidProperties::henryConstant(), and CO2FluidProperties::henryConstant().

34 {
35  Real Tr = temperature / 647.096;
36  Real tau = 1.0 - Tr;
37 
38  Real lnkh = A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
39 
40  // The vapor pressure used in this formulation
41  std::vector<Real> a{-7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
42  std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
43  Real sum = 0.0;
44 
45  for (std::size_t i = 0; i < a.size(); ++i)
46  sum += a[i] * std::pow(tau, b[i]);
47 
48  return 22.064e6 * std::exp(sum / Tr) * std::exp(lnkh);
49 }
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
void SinglePhaseFluidPropertiesPT::henryConstantIAPWS_dT ( Real  temperature,
Real &  Kh,
Real &  dKh_dT,
Real  A,
Real  B,
Real  C 
) const
protectedvirtualinherited

IAPWS formulation of Henry's law constant for dissolution in water and derivative wrt temperature.

Definition at line 52 of file SinglePhaseFluidPropertiesPT.C.

Referenced by MethaneFluidProperties::henryConstant_dT(), and CO2FluidProperties::henryConstant_dT().

54 {
55  Real pc = 22.064e6;
56  Real Tc = 647.096;
57 
58  Real Tr = temperature / Tc;
59  Real tau = 1.0 - Tr;
60 
61  Real lnkh = A / Tr + B * std::pow(tau, 0.355) / Tr + C * std::pow(Tr, -0.41) * std::exp(tau);
62  Real dlnkh_dT =
63  (-A / Tr / Tr - B * std::pow(tau, 0.355) / Tr / Tr - 0.355 * B * std::pow(tau, -0.645) / Tr -
64  0.41 * C * std::pow(Tr, -1.41) * std::exp(tau) - C * std::pow(Tr, -0.41) * std::exp(tau)) /
65  Tc;
66 
67  // The vapor pressure used in this formulation
68  std::vector<Real> a{-7.85951783, 1.84408259, -11.7866497, 22.6807411, -15.9618719, 1.80122502};
69  std::vector<Real> b{1.0, 1.5, 3.0, 3.5, 4.0, 7.5};
70  Real sum = 0.0;
71  Real dsum = 0.0;
72 
73  for (std::size_t i = 0; i < a.size(); ++i)
74  {
75  sum += a[i] * std::pow(tau, b[i]);
76  dsum += a[i] * b[i] * std::pow(tau, b[i] - 1.0);
77  }
78 
79  Real p = pc * std::exp(sum / Tr);
80  Real dp_dT = -p / Tc / Tr * (sum / Tr + dsum);
81 
82  // Henry's constant and its derivative wrt temperature
83  Kh = p * std::exp(lnkh);
84  dKh_dT = (p * dlnkh_dT + dp_dT) * std::exp(lnkh);
85 }
const std::string temperature
Definition: NS.h:25
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 26 of file FluidProperties.h.

26 {}
void TabulatedFluidProperties::initialSetup ( )
overridevirtual

Definition at line 71 of file TabulatedFluidProperties.C.

72 {
73  // Check to see if _file_name supplied exists. If it does, that data
74  // will be used. If it does not exist, data will be generated and then
75  // written to _file_name.
76  std::ifstream file(_file_name.c_str());
77  if (file.good())
78  {
79  _console << "Reading tabulated properties from " << _file_name << "\n";
80  _csv_reader.read();
81 
82  const std::vector<std::string> & column_names = _csv_reader.getNames();
83 
84  // Check that all required columns are present
85  for (std::size_t i = 0; i < _required_columns.size(); ++i)
86  {
87  if (std::find(column_names.begin(), column_names.end(), _required_columns[i]) ==
88  column_names.end())
89  mooseError("No ",
91  " data read in ",
92  _file_name,
93  ". A column named ",
95  " must be present");
96  }
97 
98  std::map<std::string, unsigned int> data_index;
99  for (std::size_t i = 0; i < _required_columns.size(); ++i)
100  {
101  auto it = std::find(column_names.begin(), column_names.end(), _required_columns[i]);
102  data_index[_required_columns[i]] = std::distance(column_names.begin(), it);
103  }
104 
105  const std::vector<std::vector<Real>> & column_data = _csv_reader.getData();
106 
107  // Extract the pressure and temperature data vectors
108  _pressure = column_data[data_index.find("pressure")->second];
109  _temperature = column_data[data_index.find("temperature")->second];
110 
111  // Pressure and temperature data contains duplicates due to the csv format.
112  // First, check that pressure is monotonically increasing
113  if (!std::is_sorted(_pressure.begin(), _pressure.end()))
114  mooseError("The column data for pressure is not monotonically increasing in ", _file_name);
115 
116  // The first pressure value is repeated for each temperature value. Counting the
117  // number of repeats provides the number of temperature values
118  auto num_T = std::count(_pressure.begin(), _pressure.end(), _pressure.front());
119 
120  // Now remove the duplicates in the pressure vector
121  auto last_unique = std::unique(_pressure.begin(), _pressure.end());
122  _pressure.erase(last_unique, _pressure.end());
123  _num_p = _pressure.size();
124 
125  // Check that the number of rows in the csv file is equal to _num_p * _num_T
126  if (column_data[0].size() != _num_p * static_cast<unsigned int>(num_T))
127  mooseError("The number of rows in ",
128  _file_name,
129  " is not equal to the number of unique pressure values ",
130  _num_p,
131  " multiplied by the number of unique temperature values ",
132  num_T);
133 
134  // Need to make sure that the temperature values are provided in ascending order
135  // as well as duplicated for each pressure value
136  std::vector<Real> temp0(_temperature.begin(), _temperature.begin() + num_T);
137  if (!std::is_sorted(temp0.begin(), temp0.end()))
138  mooseError("The column data for temperature is not monotonically increasing in ", _file_name);
139 
140  auto it_temp = _temperature.begin() + num_T;
141  for (std::size_t i = 1; i < _pressure.size(); ++i)
142  {
143  std::vector<Real> temp(it_temp, it_temp + num_T);
144  if (temp != temp0)
145  mooseError("Temperature values for pressure ",
146  _pressure[i],
147  " are not identical to values for ",
148  _pressure[0]);
149 
150  std::advance(it_temp, num_T);
151  }
152 
153  // At this point, all temperature data has been provided in ascending order
154  // identically for each pressure value, so we can just keep the first range
155  _temperature.erase(_temperature.begin() + num_T, _temperature.end());
156  _num_T = _temperature.size();
157 
158  // Minimum and maximum pressure and temperature. Note that _pressure and
159  // _temperature are sorted
160  _pressure_min = _pressure.front();
161  _pressure_max = _pressure.back();
162  _temperature_min = _temperature.front();
164 
165  // Extract the fluid property data and reshape into 2D arrays for interpolation
166  reshapeData2D(_num_p, _num_T, column_data[data_index.find("density")->second], _density);
167  reshapeData2D(_num_p, _num_T, column_data[data_index.find("enthalpy")->second], _enthalpy);
169  _num_p, _num_T, column_data[data_index.find("internal_energy")->second], _internal_energy);
170  }
171  else
172  {
173  _console << "No tabulated properties file named " << _file_name << " exists.\n"
174  << "Generating tabulated data and writing output to " << _file_name << "\n";
175 
177 
178  // Write tabulated data to file
179  writeTabulatedData(_file_name);
180  }
181 
182  // Construct bicubic splines from tabulated data
183  _density_ipol = libmesh_make_unique<BicubicSplineInterpolation>();
184  _internal_energy_ipol = libmesh_make_unique<BicubicSplineInterpolation>();
185  _enthalpy_ipol = libmesh_make_unique<BicubicSplineInterpolation>();
186 
187  _density_ipol->setData(
189 
190  _internal_energy_ipol->setData(
192 
193  _enthalpy_ipol->setData(
195 }
std::unique_ptr< BicubicSplineInterpolation > _enthalpy_ipol
Interpoled enthalpy.
std::vector< std::vector< Real > > _internal_energy
Tabulated internal energy.
Real _temperature_max
Maximum temperature in tabulated data.
const std::vector< std::string > _required_columns
List of required column names to be read.
std::unique_ptr< BicubicSplineInterpolation > _internal_energy_ipol
Interpoled internal energy.
Real _pressure_max
Maximum pressure in tabulated data.
std::vector< std::vector< Real > > _density
Tabulated density.
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
Real _temperature_min
Minimum temperature in tabulated data.
std::unique_ptr< BicubicSplineInterpolation > _density_ipol
Interpoled density.
std::vector< std::vector< Real > > _enthalpy
Tabulated enthalpy.
std::vector< Real > _pressure
Pressure vector.
std::vector< Real > _temperature
Temperature vector.
unsigned int _num_T
Number of temperature points in the tabulated data.
Real _pressure_min
Minimum pressure in tabulated data.
unsigned int _num_p
Number of pressure points in the tabulated data.
void reshapeData2D(unsigned int nrow, unsigned int ncol, const std::vector< Real > &vec, std::vector< std::vector< Real >> &mat)
Forms a 2D matrix from a single std::vector.
std::vector< Real > _drho_dp_0
Derivatives along the boundary.
virtual void generateTabulatedData()
Generates a table of fluid properties by looping over pressure and temperature and calculating proper...
void writeTabulatedData(std::string file_name)
Writes tabulated data to a file.
FileName _file_name
File name of tabulated data file.
Real TabulatedFluidProperties::k ( Real  pressure,
Real  temperature 
) const
overridevirtual

Thermal conductivity.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
thermal conductivity (W/m/K)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 329 of file TabulatedFluidProperties.C.

330 {
331  Real rho = this->rho(pressure, temperature);
332  return this->k_from_rho_T(rho, temperature);
333 }
virtual Real rho(Real pressure, Real temperature) const override
Density.
const std::string temperature
Definition: NS.h:25
const std::string pressure
Definition: NS.h:24
virtual Real k_from_rho_T(Real density, Real temperature) const override
Thermal conductivity as a function of density and temperature.
void TabulatedFluidProperties::k_dpT ( Real  pressure,
Real  temperature,
Real &  k,
Real &  dk_dp,
Real &  dk_dT 
) const
overridevirtual

Thermal conductivity and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]thermalconductivity (W/m/K)
[out]derivativeof thermal conductivity wrt pressure
[out]derivativeof thermal conductivity wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 336 of file TabulatedFluidProperties.C.

338 {
339  mooseError(name(), "k_dpT() is not implemented");
340 }
Real TabulatedFluidProperties::k_from_rho_T ( Real  density,
Real  temperature 
) const
overridevirtual

Thermal conductivity as a function of density and temperature.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
Returns
thermal conductivity (W/m/K)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 343 of file TabulatedFluidProperties.C.

Referenced by k().

344 {
346 }
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real k_from_rho_T(Real density, Real temperature) const =0
Thermal conductivity as a function of density and temperature.
Real TabulatedFluidProperties::molarMass ( ) const
overridevirtual

Molar mass.

Returns
molar mass (kg/mol)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 204 of file TabulatedFluidProperties.C.

205 {
206  return _fp.molarMass();
207 }
virtual Real molarMass() const =0
Molar mass.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
Real TabulatedFluidProperties::mu ( Real  pressure,
Real  temperature 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 276 of file TabulatedFluidProperties.C.

277 {
278  Real rho = this->rho(pressure, temperature);
279  return this->mu_from_rho_T(rho, temperature);
280 }
virtual Real rho(Real pressure, Real temperature) const override
Density.
virtual Real mu_from_rho_T(Real density, Real temperature) const override
const std::string temperature
Definition: NS.h:25
const std::string pressure
Definition: NS.h:24
void TabulatedFluidProperties::mu_dpT ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 283 of file TabulatedFluidProperties.C.

285 {
286  Real rho, drho_dp, drho_dT;
287  this->rho_dpT(pressure, temperature, rho, drho_dp, drho_dT);
288  Real dmu_drho;
289  this->mu_drhoT_from_rho_T(rho, temperature, drho_dT, mu, dmu_drho, dmu_dT);
290  dmu_dp = dmu_drho * drho_dp;
291 }
virtual Real rho(Real pressure, Real temperature) const override
Density.
const std::string temperature
Definition: NS.h:25
virtual void rho_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
Density and its derivatives wrt pressure and temperature.
virtual Real mu(Real pressure, Real temperature) const override
const std::string pressure
Definition: NS.h:24
virtual void mu_drhoT_from_rho_T(Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const override
Dynamic viscosity and its derivatives wrt density and temperature.
void TabulatedFluidProperties::mu_drhoT_from_rho_T ( Real  density,
Real  temperature,
Real  ddensity_dT,
Real &  mu,
Real &  dmu_drho,
Real &  dmu_dT 
) const
overridevirtual

Dynamic viscosity and its derivatives wrt density and temperature.

Parameters
densityfluid density (kg/m^3)
temperaturefluid temperature (K)
ddensity_dTderivative of density wrt temperature
[out]muviscosity (Pa.s)
[out]dmu_drhoderivative of viscosity wrt density
[out]dmu_dTderivative of viscosity wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 300 of file TabulatedFluidProperties.C.

Referenced by mu_dpT().

306 {
307  _fp.mu_drhoT_from_rho_T(density, temperature, ddensity_dT, mu, dmu_drho, dmu_dT);
308 }
const std::string density
Definition: NS.h:15
const std::string temperature
Definition: NS.h:25
virtual void mu_drhoT_from_rho_T(Real density, Real temperature, Real ddensity_dT, Real &mu, Real &dmu_drho, Real &dmu_dT) const =0
Dynamic viscosity and its derivatives wrt density and temperature.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
virtual Real mu(Real pressure, Real temperature) const override
Real TabulatedFluidProperties::mu_from_rho_T ( Real  density,
Real  temperature 
) const
overridevirtual

Implements SinglePhaseFluidPropertiesPT.

Definition at line 294 of file TabulatedFluidProperties.C.

Referenced by mu().

295 {
297 }
const std::string density
Definition: NS.h:15
virtual Real mu_from_rho_T(Real density, Real temperature) const =0
const std::string temperature
Definition: NS.h:25
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
void TabulatedFluidProperties::reshapeData2D ( unsigned int  nrow,
unsigned int  ncol,
const std::vector< Real > &  vec,
std::vector< std::vector< Real >> &  mat 
)
protected

Forms a 2D matrix from a single std::vector.

Parameters
nrownumber of rows in the matrix
ncolnumber of columns in the matrix
vec1D vector to reshape into a 2D matrix
[out]2Dmatrix formed by reshaping vec

Definition at line 439 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

443 {
444  if (!vec.empty())
445  {
446  mat.resize(nrow);
447 
448  for (unsigned int i = 0; i < nrow; ++i)
449  for (unsigned int j = 0; j < ncol; ++j)
450  mat[i].push_back(vec[i * ncol + j]);
451  }
452 }
Real TabulatedFluidProperties::rho ( Real  pressure,
Real  temperature 
) const
overridevirtual

Density.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
density (kg/m^3)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 210 of file TabulatedFluidProperties.C.

Referenced by k(), mu(), and mu_dpT().

211 {
213  return _density_ipol->sample(pressure, temperature);
214 }
const std::string temperature
Definition: NS.h:25
void checkInputVariables(Real pressure, Real temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
std::unique_ptr< BicubicSplineInterpolation > _density_ipol
Interpoled density.
const std::string pressure
Definition: NS.h:24
void TabulatedFluidProperties::rho_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtual

Density and its derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density wrt pressure
[out]drho_dTderivative of density wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 217 of file TabulatedFluidProperties.C.

Referenced by mu_dpT(), and rho_e_dpT().

219 {
222  drho_dp = _density_ipol->sampleDerivative(pressure, temperature, _wrt_p);
223  drho_dT = _density_ipol->sampleDerivative(pressure, temperature, _wrt_T);
224 }
virtual Real rho(Real pressure, Real temperature) const override
Density.
const unsigned int _wrt_T
Index for derivatives wrt temperature.
const std::string temperature
Definition: NS.h:25
void checkInputVariables(Real pressure, Real temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
const unsigned int _wrt_p
Index for derivatives wrt pressure.
std::unique_ptr< BicubicSplineInterpolation > _density_ipol
Interpoled density.
const std::string pressure
Definition: NS.h:24
void TabulatedFluidProperties::rho_e_dpT ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtual

Density and internal energy and their derivatives wrt pressure and temperature.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
[out]rhodensity (kg/m^3)
[out]drho_dpderivative of density wrt pressure
[out]drho_dTderivative of density wrt temperature
[out]einternal energy (J/kg)
[out]de_dpderivative of internal energy wrt pressure
[out]de_dTderivative of internal energy wrt temperature

Implements SinglePhaseFluidPropertiesPT.

Definition at line 244 of file TabulatedFluidProperties.C.

252 {
254  rho_dpT(pressure, temperature, rho, drho_dp, drho_dT);
255  e_dpT(pressure, temperature, e, de_dp, de_dT);
256 }
virtual Real rho(Real pressure, Real temperature) const override
Density.
const std::string temperature
Definition: NS.h:25
void checkInputVariables(Real pressure, Real temperature) const
Checks that the inputs are within the range of the tabulated data, and throws an error if they are no...
virtual void e_dpT(Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
Internal energy and its derivatives wrt pressure and temperature.
virtual void rho_dpT(Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
Density and its derivatives wrt pressure and temperature.
const std::string pressure
Definition: NS.h:24
virtual Real e(Real pressure, Real temperature) const override
Internal energy.
Real TabulatedFluidProperties::s ( Real  pressure,
Real  temperature 
) const
overridevirtual

Specific entropy.

Parameters
pressurefluid pressure (Pa)
temperaturefluid temperature (K)
Returns
s (J/kg/K)

Implements SinglePhaseFluidPropertiesPT.

Definition at line 349 of file TabulatedFluidProperties.C.

350 {
351  return _fp.s(pressure, temperature);
352 }
const std::string temperature
Definition: NS.h:25
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
const std::string pressure
Definition: NS.h:24
virtual Real s(Real pressure, Real temperature) const =0
Specific entropy.
void TabulatedFluidProperties::writeTabulatedData ( std::string  file_name)
protected

Writes tabulated data to a file.

Parameters
file_namename of the file to be written

Definition at line 373 of file TabulatedFluidProperties.C.

Referenced by initialSetup().

374 {
375  if (processor_id() == 0)
376  {
377  MooseUtils::checkFileWriteable(file_name);
378 
379  std::ofstream file_out(file_name.c_str());
380 
381  // Write out date and fluid type
382  time_t now = time(&now);
383  file_out << "# " << _fp.fluidName() << " properties created by TabulatedFluidProperties on "
384  << ctime(&now) << "\n";
385 
386  std::string column_names{"pressure, temperature, density, enthalpy, internal_energy"};
387 
388  // Write out column names
389  file_out << column_names << "\n";
390 
391  // Write out the fluid property data
392  for (unsigned int i = 0; i < _num_p; ++i)
393  for (unsigned int j = 0; j < _num_T; ++j)
394  file_out << _pressure[i] << ", " << _temperature[j] << ", " << _density[i][j] << ", "
395  << _enthalpy[i][j] << ", " << _internal_energy[i][j] << "\n";
396  }
397 }
virtual std::string fluidName() const =0
Fluid name.
std::vector< std::vector< Real > > _internal_energy
Tabulated internal energy.
std::vector< std::vector< Real > > _density
Tabulated density.
const SinglePhaseFluidPropertiesPT & _fp
SinglePhaseFluidPropertiesPT UserObject.
std::vector< std::vector< Real > > _enthalpy
Tabulated enthalpy.
std::vector< Real > _pressure
Pressure vector.
std::vector< Real > _temperature
Temperature vector.
unsigned int _num_T
Number of temperature points in the tabulated data.
unsigned int _num_p
Number of pressure points in the tabulated data.

Member Data Documentation

MooseUtils::DelimitedFileReader TabulatedFluidProperties::_csv_reader
protected

The MOOSE delimited file reader.

Definition at line 238 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and TabulatedFluidProperties().

std::vector<Real> TabulatedFluidProperties::_de_dp_0
protected

Definition at line 211 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_de_dp_n
protected

Definition at line 211 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_de_dT_0
protected

Definition at line 211 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_de_dT_n
protected

Definition at line 211 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<std::vector<Real> > TabulatedFluidProperties::_density
protected

Tabulated density.

Definition at line 198 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

std::unique_ptr<BicubicSplineInterpolation> TabulatedFluidProperties::_density_ipol
protected

Interpoled density.

Definition at line 204 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), rho(), and rho_dpT().

std::vector<Real> TabulatedFluidProperties::_dh_dp_0
protected

Definition at line 212 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_dh_dp_n
protected

Definition at line 212 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_dh_dT_0
protected

Definition at line 212 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_dh_dT_n
protected

Definition at line 212 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_drho_dp_0
protected

Derivatives along the boundary.

Definition at line 210 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_drho_dp_n
protected

Definition at line 210 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_drho_dT_0
protected

Definition at line 210 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<Real> TabulatedFluidProperties::_drho_dT_n
protected

Definition at line 210 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

std::vector<std::vector<Real> > TabulatedFluidProperties::_enthalpy
protected

Tabulated enthalpy.

Definition at line 202 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

std::unique_ptr<BicubicSplineInterpolation> TabulatedFluidProperties::_enthalpy_ipol
protected

Interpoled enthalpy.

Definition at line 208 of file TabulatedFluidProperties.h.

Referenced by h(), h_dpT(), and initialSetup().

FileName TabulatedFluidProperties::_file_name
protected

File name of tabulated data file.

Definition at line 192 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

const SinglePhaseFluidPropertiesPT& TabulatedFluidProperties::_fp
protected
std::vector<std::vector<Real> > TabulatedFluidProperties::_internal_energy
protected

Tabulated internal energy.

Definition at line 200 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

std::unique_ptr<BicubicSplineInterpolation> TabulatedFluidProperties::_internal_energy_ipol
protected

Interpoled internal energy.

Definition at line 206 of file TabulatedFluidProperties.h.

Referenced by e(), e_dpT(), and initialSetup().

unsigned int TabulatedFluidProperties::_num_p
protected

Number of pressure points in the tabulated data.

Definition at line 225 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

unsigned int TabulatedFluidProperties::_num_T
protected

Number of temperature points in the tabulated data.

Definition at line 223 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

std::vector<Real> TabulatedFluidProperties::_pressure
protected

Pressure vector.

Definition at line 194 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

Real TabulatedFluidProperties::_pressure_max
protected

Maximum pressure in tabulated data.

Definition at line 221 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

Real TabulatedFluidProperties::_pressure_min
protected

Minimum pressure in tabulated data.

Definition at line 219 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

const Real SinglePhaseFluidPropertiesPT::_R
protectedinherited
const std::vector<std::string> TabulatedFluidProperties::_required_columns
protected
Initial value:
{
"pressure", "temperature", "density", "enthalpy", "internal_energy"}

List of required column names to be read.

Definition at line 235 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

const Real SinglePhaseFluidPropertiesPT::_T_c2k
protectedinherited
std::vector<Real> TabulatedFluidProperties::_temperature
protected

Temperature vector.

Definition at line 196 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData(), initialSetup(), and writeTabulatedData().

Real TabulatedFluidProperties::_temperature_max
protected

Maximum temperature in tabulated data.

Definition at line 217 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

Real TabulatedFluidProperties::_temperature_min
protected

Minimum temperature in tabulated data.

Definition at line 215 of file TabulatedFluidProperties.h.

Referenced by checkInputVariables(), generateTabulatedData(), initialSetup(), and TabulatedFluidProperties().

const unsigned int TabulatedFluidProperties::_wrt_p = 1
protected

Index for derivatives wrt pressure.

Definition at line 227 of file TabulatedFluidProperties.h.

Referenced by e_dpT(), h_dpT(), and rho_dpT().

const unsigned int TabulatedFluidProperties::_wrt_T = 2
protected

Index for derivatives wrt temperature.

Definition at line 229 of file TabulatedFluidProperties.h.

Referenced by e_dpT(), h_dpT(), and rho_dpT().


The documentation for this class was generated from the following files: