www.mooseframework.org
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | 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
 
virtual Real molarMass () const override
 Fluid name. More...
 
virtual Real rho_from_p_T (Real pressure, Real temperature) const override
 
virtual void rho_from_p_T (Real pressure, Real temperature, Real &rho, Real &drho_dp, Real &drho_dT) const override
 
virtual Real e_from_p_T (Real pressure, Real temperature) const override
 
virtual void e_from_p_T (Real pressure, Real temperature, Real &e, Real &de_dp, Real &de_dT) const override
 
virtual Real h_from_p_T (Real p, Real T) const override
 
virtual void h_from_p_T (Real pressure, Real temperature, Real &h, Real &dh_dp, Real &dh_dT) const override
 
virtual Real mu_from_p_T (Real pressure, Real temperature) const override
 
virtual void mu_from_p_T (Real pressure, Real temperature, Real &mu, Real &dmu_dp, Real &dmu_dT) const override
 
virtual Real cp_from_p_T (Real pressure, Real temperature) const override
 
virtual Real cv_from_p_T (Real pressure, Real temperature) const override
 
virtual Real c_from_p_T (Real pressure, Real temperature) const override
 
virtual Real k_from_p_T (Real pressure, Real temperature) const override
 
virtual void k_from_p_T (Real pressure, Real temperature, Real &k, Real &dk_dp, Real &dk_dT) const override
 
virtual Real s_from_p_T (Real pressure, Real temperature) const override
 
virtual void s_from_p_T (Real p, Real T, Real &s, Real &ds_dp, Real &ds_dT) const override
 
virtual std::vector< Real > henryCoefficients () const override
 Henry's law coefficients for dissolution in water. More...
 
virtual Real vaporPressure (Real temperature) const override
 Vapor pressure. More...
 
virtual void vaporPressure (Real temperature, Real &psat, Real &dpsat_dT) const override
 
virtual Real criticalPressure () const
 Critical pressure. More...
 
virtual Real criticalTemperature () const
 Critical temperature. More...
 
virtual Real criticalDensity () const
 Critical density. More...
 
virtual Real criticalInternalEnergy () const
 Critical specific internal energy. More...
 
virtual Real triplePointPressure () const
 Triple point pressure. More...
 
virtual Real triplePointTemperature () const
 Triple point temperature. More...
 
virtual Real e_spndl_from_v (Real v) const
 Specific internal energy from temperature and specific volume. More...
 
virtual void v_e_spndl_from_T (Real T, Real &v, Real &e) const
 Specific internal energy from temperature and specific volume. More...
 
DualReal vaporPressure (const DualReal &T) const
 
virtual Real vaporTemperature (Real p) const
 Vapor temperature. More...
 
virtual void vaporTemperature (Real p, Real &Tsat, Real &dTsat_dp) const
 
DualReal vaporTemperature (const DualReal &p) const
 
virtual void rho_mu_from_p_T (Real p, Real T, Real &rho, Real &mu) const
 Combined methods. More...
 
virtual void rho_mu_from_p_T (Real p, Real T, Real &rho, Real &drho_dp, Real &drho_dT, Real &mu, Real &dmu_dp, Real &dmu_dT) const
 
virtual void rho_mu_from_p_T (const DualReal &p, const DualReal &T, DualReal &rho, DualReal &mu) const
 
virtual void rho_e_from_p_T (Real p, Real T, Real &rho, Real &drho_dp, Real &drho_dT, Real &e, Real &de_dp, Real &de_dT) const
 
virtual void execute () final
 
virtual void initialize () final
 
virtual void finalize () final
 
virtual void threadJoin (const UserObject &) final
 
virtual void subdomainSetup () final
 

Static Public Attributes

static const Real _R = 8.3144598
 Universal gas constant (J/mol/K) More...
 

Protected Member Functions

void writeTabulatedData (std::string file_name)
 Writes tabulated data to a file. More...
 
virtual 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...
 

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 > > _properties
 Tabulated fluid properties. More...
 
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
 Interpolated fluid property. More...
 
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 bool _save_file
 Whether to save a generated fluid properties file to disk. More...
 
const SinglePhaseFluidProperties_fp
 SinglePhaseFluidPropertiesPT UserObject. More...
 
const std::vector< std::string > _required_columns {"pressure", "temperature"}
 List of required column names to be read. More...
 
const std::vector< std::string > _property_columns
 List of possible property column names to be read. More...
 
MultiMooseEnum _interpolated_properties_enum
 Properties to be interpolated entered in the input file. More...
 
std::vector< std::string > _interpolated_properties
 List of properties to be interpolated. More...
 
bool _interpolate_density
 Set of flags to note whether a property is to be interpolated. More...
 
bool _interpolate_enthalpy
 
bool _interpolate_internal_energy
 
bool _interpolate_viscosity
 
bool _interpolate_k
 
bool _interpolate_cp
 
bool _interpolate_cv
 
bool _interpolate_entropy
 
unsigned int _density_idx
 Index of each property. More...
 
unsigned int _enthalpy_idx
 
unsigned int _internal_energy_idx
 
unsigned int _viscosity_idx
 
unsigned int _k_idx
 
unsigned int _cp_idx
 
unsigned int _cv_idx
 
unsigned int _entropy_idx
 
MooseUtils::DelimitedFileReader _csv_reader
 The MOOSE delimited file reader. More...
 
const Real _T_c2k
 Conversion of temperature from Celsius to Kelvin. More...
 
const bool _allow_imperfect_jacobians
 Flag to set unimplemented Jacobian entries to zero. More...
 

Private Member Functions

template<typename... Args>
void fluidPropError (Args... args) const
 
e e e e p h T T T T T v v v s h propfuncWithDefault (beta, p, T) propfuncWithDefault(v
 
e e e e p h T T T T T v v v s h T propfuncWithDefault (e, p, T) propfuncWithDefault(gamma
 
 propfunc (p, v, e) propfunc(T
 Compute a fluid property given for the state defined by two given properties. More...
 
propfunc (c, v, e) propfunc(cp
 
e e propfunc (cv, v, e) propfunc(mu
 
e e e propfunc (k, v, e) propfunc(s
 
e e e e propfunc (s, h, p) propfunc(T
 
e e e e p propfunc (rho, p, s) propfunc(e
 
e e e e p h propfunc (s, p, T) propfunc(pp_sat
 
e e e e p h T propfunc (mu, rho, T) propfunc(k
 
e e e e p h T T propfunc (c, p, T) propfunc(cp
 
e e e e p h T T T propfunc (cv, p, T) propfunc(mu
 
e e e e p h T T T T propfunc (k, p, T) propfunc(rho
 
e e e e p h T T T T T propfunc (e, p, rho) propfunc(e
 
e e e e p h T T T T T v propfunc (p, T, v) propfunc(h
 
e e e e p h T T T T T v v propfunc (s, T, v) propfunc(cv
 
e e e e p h T T T T T v v v propfunc (h, p, T) propfunc(p
 
e e e e p h T T T T T v v vpropfunc (g, v, e) propfuncWithDefault(T
 
 v
 
v
 
e e v
 
e e e v
 
e e e e p v
 
e e e e p h T T T T T v v v s h T v
 
e e e e h
 
e e e e p h T T T T T v v v h
 
e e e e p h p
 
e e e e p h T T p
 
e e e e p h T T T p
 
e e e e p h T T T T p
 
e e e e p h T T T T T v v vp
 
e e e e p h T T T T T v v v s h p
 
e e e e p h T rho
 
e e e e p h T T T T T T
 
e e e e p h T T T T T v T
 
e e e e p h T T T T T v v T
 
e e e e p h T T T T T v v v s h TpropfuncWithDefault (gamma, p, T)
 

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 fluid properties (for example, density 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.

Using interpolation to calculate these fluid properties can significantly reduce the computational time for these cases.

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" and "temperature", and the names of the fluid properties to be read. Available fluid property names are: "density", "enthalpy", "internal_energy", "viscosity", "k" (thermal conductivity), "cp" (isobaric specific heat capacity), "cv" (isochoric specific heat capacity), and "entropy". 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 the fluid supplied by the required FluidProperties UserObject will be generated using the pressure and temperature ranges specified in the input file at the beginning of the simulation. The properties to be tabulated are provided in the "interpolated_properties" input parameter (the properties that can be tabulated are listed above).

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.

Properties specified in the data file or listed in the input file (and their derivatives wrt pressure and temperature) will be calculated using bicubic interpolation, while all remaining fluid properties are calculated using the supplied FluidProperties UserObject.

Definition at line 92 of file TabulatedFluidProperties.h.

Constructor & Destructor Documentation

◆ TabulatedFluidProperties()

TabulatedFluidProperties::TabulatedFluidProperties ( const InputParameters &  parameters)

Definition at line 60 of file TabulatedFluidProperties.C.

61  : SinglePhaseFluidProperties(parameters),
62  _file_name(getParam<FileName>("fluid_property_file")),
63  _temperature_min(getParam<Real>("temperature_min")),
64  _temperature_max(getParam<Real>("temperature_max")),
65  _pressure_min(getParam<Real>("pressure_min")),
66  _pressure_max(getParam<Real>("pressure_max")),
67  _num_T(getParam<unsigned int>("num_T")),
68  _num_p(getParam<unsigned int>("num_p")),
69  _save_file(getParam<bool>("save_file")),
70  _fp(getUserObject<SinglePhaseFluidProperties>("fp")),
71  _interpolated_properties_enum(getParam<MultiMooseEnum>("interpolated_properties")),
73  _interpolate_density(false),
74  _interpolate_enthalpy(false),
77  _interpolate_k(false),
78  _interpolate_cp(false),
79  _interpolate_cv(false),
80  _interpolate_entropy(false),
81  _density_idx(0),
82  _enthalpy_idx(0),
84  _viscosity_idx(0),
85  _k_idx(0),
86  _cp_idx(0),
87  _cv_idx(0),
88  _entropy_idx(0),
89  _csv_reader(_file_name, &_communicator)
90 {
91  // Sanity check on minimum and maximum temperatures and pressures
93  mooseError(name(), ": temperature_max must be greater than temperature_min");
95  mooseError(name(), ": pressure_max must be greater than pressure_min");
96 
97  // Lines starting with # in the data file are treated as comments
98  _csv_reader.setComment("#");
99 }

◆ ~TabulatedFluidProperties()

TabulatedFluidProperties::~TabulatedFluidProperties ( )
virtual

Definition at line 101 of file TabulatedFluidProperties.C.

101 {}

Member Function Documentation

◆ c_from_p_T()

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

Definition at line 420 of file TabulatedFluidProperties.C.

421 {
422  return _fp.c_from_p_T(pressure, temperature);
423 }

◆ checkInputVariables()

void TabulatedFluidProperties::checkInputVariables ( Real &  pressure,
Real &  temperature 
) const
protectedvirtual

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 635 of file TabulatedFluidProperties.C.

636 {
637  if (pressure < _pressure_min || pressure > _pressure_max)
638  throw MooseException(
639  "Pressure " + Moose::stringify(pressure) + " is outside the range of tabulated pressure (" +
640  Moose::stringify(_pressure_min) + ", " + Moose::stringify(_pressure_max) + ").");
641 
642  if (temperature < _temperature_min || temperature > _temperature_max)
643  throw MooseException("Temperature " + Moose::stringify(temperature) +
644  " is outside the range of tabulated temperature (" +
645  Moose::stringify(_temperature_min) + ", " +
646  Moose::stringify(_temperature_max) + ").");
647 }

Referenced by cp_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), k_from_p_T(), mu_from_p_T(), rho_from_p_T(), and s_from_p_T().

◆ cp_from_p_T()

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

Definition at line 426 of file TabulatedFluidProperties.C.

427 {
428  if (_interpolate_cp)
429  {
431  return _property_ipol[_cp_idx]->sample(pressure, temperature);
432  }
433  else
434  return _fp.cp_from_p_T(pressure, temperature);
435 }

◆ criticalDensity()

Real SinglePhaseFluidProperties::criticalDensity ( ) const
virtualinherited

◆ criticalInternalEnergy()

Real SinglePhaseFluidProperties::criticalInternalEnergy ( ) const
virtualinherited

Critical specific internal energy.

Returns
specific internal energy (J/kg)

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 126 of file SinglePhaseFluidProperties.C.

127 {
128  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
129 }

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e(), and IdealRealGasMixtureFluidProperties::T_from_p_v().

◆ criticalPressure()

Real SinglePhaseFluidProperties::criticalPressure ( ) const
virtualinherited

Critical pressure.

Returns
critical pressure (Pa)

Reimplemented in CO2FluidProperties, HydrogenFluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 108 of file SinglePhaseFluidProperties.C.

109 {
110  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
111 }

◆ criticalTemperature()

Real SinglePhaseFluidProperties::criticalTemperature ( ) const
virtualinherited

◆ cv_from_p_T()

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

Definition at line 438 of file TabulatedFluidProperties.C.

439 {
440  if (_interpolate_cv)
441  {
443  return _property_ipol[_cv_idx]->sample(pressure, temperature);
444  }
445  else
446  return _fp.cv_from_p_T(pressure, temperature);
447 }

◆ e_from_p_T() [1/2]

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

Definition at line 342 of file TabulatedFluidProperties.C.

343 {
345  {
348  }
349  else
350  return _fp.e_from_p_T(pressure, temperature);
351 }

◆ e_from_p_T() [2/2]

void TabulatedFluidProperties::e_from_p_T ( Real  pressure,
Real  temperature,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
overridevirtual

Definition at line 354 of file TabulatedFluidProperties.C.

356 {
358  {
360  _property_ipol[_internal_energy_idx]->sampleValueAndDerivatives(
361  pressure, temperature, e, de_dp, de_dT);
362  }
363  else
364  _fp.e_from_p_T(pressure, temperature, e, de_dp, de_dT);
365 }

◆ e_spndl_from_v()

Real SinglePhaseFluidProperties::e_spndl_from_v ( Real  v) const
virtualinherited

Specific internal energy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 286 of file SinglePhaseFluidProperties.C.

287 {
288  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
289 }

Referenced by IdealRealGasMixtureFluidProperties::p_T_from_v_e(), and IdealRealGasMixtureFluidProperties::T_from_p_v().

◆ execute()

virtual void FluidProperties::execute ( )
inlinefinalvirtualinherited

Definition at line 34 of file FluidProperties.h.

34 {}

◆ finalize()

virtual void FluidProperties::finalize ( )
inlinefinalvirtualinherited

Definition at line 36 of file FluidProperties.h.

36 {}

◆ fluidName()

std::string TabulatedFluidProperties::fluidName ( ) const
overridevirtual

Definition at line 304 of file TabulatedFluidProperties.C.

305 {
306  return _fp.fluidName();
307 }

◆ fluidPropError()

template<typename... Args>
void SinglePhaseFluidProperties::fluidPropError ( Args...  args) const
inlineprivateinherited

Definition at line 326 of file SinglePhaseFluidProperties.h.

327  {
329  mooseDoOnce(mooseWarning(std::forward<Args>(args)...));
330  else
331  mooseError(std::forward<Args>(args)...);
332  }

Referenced by SinglePhaseFluidProperties::vaporPressure(), and SinglePhaseFluidProperties::vaporTemperature().

◆ generateTabulatedData()

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 544 of file TabulatedFluidProperties.C.

545 {
546  _pressure.resize(_num_p);
547  _temperature.resize(_num_T);
548 
549  // Generate data for all properties entered in input file
552 
553  for (std::size_t i = 0; i < _interpolated_properties_enum.size(); ++i)
555 
556  for (std::size_t i = 0; i < _properties.size(); ++i)
557  _properties[i].resize(_num_p * _num_T);
558 
559  // Temperature is divided equally into _num_T segments
560  Real delta_T = (_temperature_max - _temperature_min) / static_cast<Real>(_num_T - 1);
561 
562  for (unsigned int j = 0; j < _num_T; ++j)
563  _temperature[j] = _temperature_min + j * delta_T;
564 
565  // Divide the pressure into _num_p equal segments
566  Real delta_p = (_pressure_max - _pressure_min) / static_cast<Real>(_num_p - 1);
567 
568  for (unsigned int i = 0; i < _num_p; ++i)
569  _pressure[i] = _pressure_min + i * delta_p;
570 
571  // Generate the tabulated data at the pressure and temperature points
572  for (std::size_t i = 0; i < _properties.size(); ++i)
573  {
574  if (_interpolated_properties[i] == "density")
575  for (unsigned int p = 0; p < _num_p; ++p)
576  for (unsigned int t = 0; t < _num_T; ++t)
577  _properties[i][p * _num_T + t] = _fp.rho_from_p_T(_pressure[p], _temperature[t]);
578 
579  if (_interpolated_properties[i] == "enthalpy")
580  for (unsigned int p = 0; p < _num_p; ++p)
581  for (unsigned int t = 0; t < _num_T; ++t)
582  _properties[i][p * _num_T + t] = _fp.h_from_p_T(_pressure[p], _temperature[t]);
583 
584  if (_interpolated_properties[i] == "internal_energy")
585  for (unsigned int p = 0; p < _num_p; ++p)
586  for (unsigned int t = 0; t < _num_T; ++t)
587  _properties[i][p * _num_T + t] = _fp.e_from_p_T(_pressure[p], _temperature[t]);
588 
589  if (_interpolated_properties[i] == "viscosity")
590  for (unsigned int p = 0; p < _num_p; ++p)
591  for (unsigned int t = 0; t < _num_T; ++t)
592  _properties[i][p * _num_T + t] = _fp.mu_from_p_T(_pressure[p], _temperature[t]);
593 
594  if (_interpolated_properties[i] == "k")
595  for (unsigned int p = 0; p < _num_p; ++p)
596  for (unsigned int t = 0; t < _num_T; ++t)
597  _properties[i][p * _num_T + t] = _fp.k_from_p_T(_pressure[p], _temperature[t]);
598 
599  if (_interpolated_properties[i] == "cv")
600  for (unsigned int p = 0; p < _num_p; ++p)
601  for (unsigned int t = 0; t < _num_T; ++t)
602  _properties[i][p * _num_T + t] = _fp.cv_from_p_T(_pressure[p], _temperature[t]);
603 
604  if (_interpolated_properties[i] == "cp")
605  for (unsigned int p = 0; p < _num_p; ++p)
606  for (unsigned int t = 0; t < _num_T; ++t)
607  _properties[i][p * _num_T + t] = _fp.cp_from_p_T(_pressure[p], _temperature[t]);
608 
609  if (_interpolated_properties[i] == "entropy")
610  for (unsigned int p = 0; p < _num_p; ++p)
611  for (unsigned int t = 0; t < _num_T; ++t)
612  _properties[i][p * _num_T + t] = _fp.s_from_p_T(_pressure[p], _temperature[t]);
613  }
614 }

Referenced by initialSetup().

◆ h_from_p_T() [1/2]

Real TabulatedFluidProperties::h_from_p_T ( Real  p,
Real  T 
) const
overridevirtual

Definition at line 368 of file TabulatedFluidProperties.C.

369 {
371  {
374  }
375  else
376  return _fp.h_from_p_T(pressure, temperature);
377 }

◆ h_from_p_T() [2/2]

void TabulatedFluidProperties::h_from_p_T ( Real  pressure,
Real  temperature,
Real &  h,
Real &  dh_dp,
Real &  dh_dT 
) const
overridevirtual

Definition at line 380 of file TabulatedFluidProperties.C.

382 {
384  {
386  _property_ipol[_enthalpy_idx]->sampleValueAndDerivatives(
387  pressure, temperature, h, dh_dp, dh_dT);
388  }
389  else
390  _fp.h_from_p_T(pressure, temperature, h, dh_dp, dh_dT);
391 }

◆ henryCoefficients()

std::vector< Real > TabulatedFluidProperties::henryCoefficients ( ) const
overridevirtual

Henry's law coefficients for dissolution in water.

Returns
Henry's constant coefficients

Reimplemented from SinglePhaseFluidProperties.

Definition at line 494 of file TabulatedFluidProperties.C.

495 {
496  return _fp.henryCoefficients();
497 }

◆ initialize()

virtual void FluidProperties::initialize ( )
inlinefinalvirtualinherited

Definition at line 35 of file FluidProperties.h.

35 {}

◆ initialSetup()

void TabulatedFluidProperties::initialSetup ( )
overridevirtual

Definition at line 104 of file TabulatedFluidProperties.C.

105 {
106  // Check to see if _file_name supplied exists. If it does, that data
107  // will be used. If it does not exist, data will be generated and then
108  // written to _file_name.
109  std::ifstream file(_file_name.c_str());
110  if (file.good())
111  {
112  _console << name() + ": Reading tabulated properties from " << _file_name << "\n";
113  _csv_reader.read();
114 
115  const std::vector<std::string> & column_names = _csv_reader.getNames();
116 
117  // Check that all required columns are present
118  for (std::size_t i = 0; i < _required_columns.size(); ++i)
119  {
120  if (std::find(column_names.begin(), column_names.end(), _required_columns[i]) ==
121  column_names.end())
122  mooseError(name(),
123  ": no ",
125  " data read in ",
126  _file_name,
127  ". A column named ",
129  " must be present");
130  }
131 
132  // Check that any property names read from the file are present in the list of possible
133  // properties, and if they are, add them to the list of read properties
134  for (std::size_t i = 0; i < column_names.size(); ++i)
135  {
136  // Only check properties not in _required_columns
137  if (std::find(_required_columns.begin(), _required_columns.end(), column_names[i]) ==
138  _required_columns.end())
139  {
140  if (std::find(_property_columns.begin(), _property_columns.end(), column_names[i]) ==
141  _property_columns.end())
142  mooseError(name(),
143  ": ",
144  column_names[i],
145  " read in ",
146  _file_name,
147  " is not one of the properties that TabulatedFluidProperties understands");
148  else
149  _interpolated_properties.push_back(column_names[i]);
150  }
151  }
152 
153  std::map<std::string, unsigned int> data_index;
154  for (std::size_t i = 0; i < column_names.size(); ++i)
155  {
156  auto it = std::find(column_names.begin(), column_names.end(), column_names[i]);
157  data_index[column_names[i]] = std::distance(column_names.begin(), it);
158  }
159 
160  const std::vector<std::vector<Real>> & column_data = _csv_reader.getData();
161 
162  // Extract the pressure and temperature data vectors
163  _pressure = column_data[data_index.find("pressure")->second];
164  _temperature = column_data[data_index.find("temperature")->second];
165 
166  // Pressure and temperature data contains duplicates due to the csv format.
167  // First, check that pressure is monotonically increasing
168  if (!std::is_sorted(_pressure.begin(), _pressure.end()))
169  mooseError(
170  name(), ": the column data for pressure is not monotonically increasing in ", _file_name);
171 
172  // The first pressure value is repeated for each temperature value. Counting the
173  // number of repeats provides the number of temperature values
174  auto num_T = std::count(_pressure.begin(), _pressure.end(), _pressure.front());
175 
176  // Now remove the duplicates in the pressure vector
177  auto last_unique = std::unique(_pressure.begin(), _pressure.end());
178  _pressure.erase(last_unique, _pressure.end());
179  _num_p = _pressure.size();
180 
181  // Check that the number of rows in the csv file is equal to _num_p * _num_T
182  if (column_data[0].size() != _num_p * static_cast<unsigned int>(num_T))
183  mooseError(name(),
184  ": the number of rows in ",
185  _file_name,
186  " is not equal to the number of unique pressure values ",
187  _num_p,
188  " multiplied by the number of unique temperature values ",
189  num_T);
190 
191  // Need to make sure that the temperature values are provided in ascending order
192  // as well as duplicated for each pressure value
193  std::vector<Real> temp0(_temperature.begin(), _temperature.begin() + num_T);
194  if (!std::is_sorted(temp0.begin(), temp0.end()))
195  mooseError(name(),
196  ": the column data for temperature is not monotonically increasing in ",
197  _file_name);
198 
199  auto it_temp = _temperature.begin() + num_T;
200  for (std::size_t i = 1; i < _pressure.size(); ++i)
201  {
202  std::vector<Real> temp(it_temp, it_temp + num_T);
203  if (temp != temp0)
204  mooseError(name(),
205  ": temperature values for pressure ",
206  _pressure[i],
207  " are not identical to values for ",
208  _pressure[0]);
209 
210  std::advance(it_temp, num_T);
211  }
212 
213  // At this point, all temperature data has been provided in ascending order
214  // identically for each pressure value, so we can just keep the first range
215  _temperature.erase(_temperature.begin() + num_T, _temperature.end());
216  _num_T = _temperature.size();
217 
218  // Minimum and maximum pressure and temperature. Note that _pressure and
219  // _temperature are sorted
220  _pressure_min = _pressure.front();
221  _pressure_max = _pressure.back();
222  _temperature_min = _temperature.front();
224 
225  // Extract the fluid property data from the file
226  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
227  _properties.push_back(column_data[data_index.find(_interpolated_properties[i])->second]);
228  }
229  else
230  {
231  _console << name() + ": No tabulated properties file named " << _file_name << " exists.\n";
232  _console << name() + ": Generating tabulated data\n";
233 
234  if (_save_file)
235  _console << name() + ": Writing tabulated data to " << _file_name << "\n";
236 
238 
239  // Write tabulated data to file
240  if (_save_file)
242  }
243 
244  // At this point, all properties read or generated are able to be used by
245  // TabulatedFluidProperties. Now set flags and indexes for each property in
246  //_interpolated_properties to use in property calculations
247  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
248  {
249  if (_interpolated_properties[i] == "density")
250  {
251  _interpolate_density = true;
252  _density_idx = i;
253  }
254  if (_interpolated_properties[i] == "enthalpy")
255  {
256  _interpolate_enthalpy = true;
257  _enthalpy_idx = i;
258  }
259  if (_interpolated_properties[i] == "internal_energy")
260  {
263  }
264  if (_interpolated_properties[i] == "viscosity")
265  {
266  _interpolate_viscosity = true;
267  _viscosity_idx = i;
268  }
269  if (_interpolated_properties[i] == "k")
270  {
271  _interpolate_k = true;
272  _k_idx = i;
273  }
274  if (_interpolated_properties[i] == "cp")
275  {
276  _interpolate_cp = true;
277  _cp_idx = i;
278  }
279  if (_interpolated_properties[i] == "cv")
280  {
281  _interpolate_cv = true;
282  _cv_idx = i;
283  }
284  if (_interpolated_properties[i] == "entropy")
285  {
286  _interpolate_entropy = true;
287  _entropy_idx = i;
288  }
289  }
290 
291  // Construct bicubic interpolants from tabulated data
292  std::vector<std::vector<Real>> data_matrix;
293  _property_ipol.resize(_properties.size());
294 
295  for (std::size_t i = 0; i < _property_ipol.size(); ++i)
296  {
297  reshapeData2D(_num_p, _num_T, _properties[i], data_matrix);
298  _property_ipol[i] =
299  libmesh_make_unique<BicubicInterpolation>(_pressure, _temperature, data_matrix);
300  }
301 }

◆ k_from_p_T() [1/2]

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

Definition at line 450 of file TabulatedFluidProperties.C.

451 {
452  if (_interpolate_k)
453  {
455  return _property_ipol[_k_idx]->sample(pressure, temperature);
456  }
457  else
458  return _fp.k_from_p_T(pressure, temperature);
459 }

◆ k_from_p_T() [2/2]

void TabulatedFluidProperties::k_from_p_T ( Real  pressure,
Real  temperature,
Real &  k,
Real &  dk_dp,
Real &  dk_dT 
) const
overridevirtual

Definition at line 462 of file TabulatedFluidProperties.C.

464 {
465  if (_interpolate_k)
466  {
468  return _property_ipol[_k_idx]->sampleValueAndDerivatives(
469  pressure, temperature, k, dk_dp, dk_dT);
470  }
471  else
472  return _fp.k_from_p_T(pressure, temperature, k, dk_dp, dk_dT);
473 }

◆ molarMass()

Real TabulatedFluidProperties::molarMass ( ) const
overridevirtual

Fluid name.

Returns
string representing fluid name Molar mass [kg/mol]
molar mass

Reimplemented from SinglePhaseFluidProperties.

Definition at line 310 of file TabulatedFluidProperties.C.

311 {
312  return _fp.molarMass();
313 }

◆ mu_from_p_T() [1/2]

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

Definition at line 394 of file TabulatedFluidProperties.C.

395 {
397  {
400  }
401  else
402  return _fp.mu_from_p_T(pressure, temperature);
403 }

◆ mu_from_p_T() [2/2]

void TabulatedFluidProperties::mu_from_p_T ( Real  pressure,
Real  temperature,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
overridevirtual

Definition at line 406 of file TabulatedFluidProperties.C.

408 {
410  {
412  _property_ipol[_viscosity_idx]->sampleValueAndDerivatives(
413  pressure, temperature, mu, dmu_dp, dmu_dT);
414  }
415  else
416  return _fp.mu_from_p_T(pressure, temperature, mu, dmu_dp, dmu_dT);
417 }

◆ propfunc() [1/16]

e e e e p h T T SinglePhaseFluidProperties::propfunc ( ,
p  ,
T   
)
inherited

◆ propfunc() [2/16]

e SinglePhaseFluidProperties::propfunc ( ,
v  ,
 
)
inherited

◆ propfunc() [3/16]

e e e e p h T T T SinglePhaseFluidProperties::propfunc ( cv  ,
p  ,
T   
)
inherited

◆ propfunc() [4/16]

e e SinglePhaseFluidProperties::propfunc ( cv  ,
v  ,
 
)
inherited

◆ propfunc() [5/16]

e e e e p h T T T T T SinglePhaseFluidProperties::propfunc ( ,
p  ,
rho   
)
inherited

◆ propfunc() [6/16]

e e e e p h T T T T T v v v s SinglePhaseFluidProperties::propfunc ( ,
v  ,
 
)
inherited

◆ propfunc() [7/16]

e e e e p h T T T T T v v v SinglePhaseFluidProperties::propfunc ( h  ,
p  ,
T   
)
inherited

◆ propfunc() [8/16]

e e e e p h T T T T SinglePhaseFluidProperties::propfunc ( ,
p  ,
T   
)
inherited

◆ propfunc() [9/16]

e e e SinglePhaseFluidProperties::propfunc ( ,
v  ,
 
)
inherited

◆ propfunc() [10/16]

e e e e p h T SinglePhaseFluidProperties::propfunc ( mu  ,
rho  ,
T   
)
inherited

◆ propfunc() [11/16]

e e e e p h T T T T T v SinglePhaseFluidProperties::propfunc ( p  ,
T  ,
v   
)
inherited

◆ propfunc() [12/16]

SinglePhaseFluidProperties::propfunc ( p  ,
v  ,
 
)
inherited

Compute a fluid property given for the state defined by two given properties.

For all functions, the first two arguments are the given properties that define the fluid state. For the two-argument variants, the desired property is the return value. The five-argument variants also provide partial derivatives dx/da and dx/db where x is the desired property being computed, a is the first given property, and b is the second given property. The desired property, dx/da, and dx/db are stored into the 3rd, 4th, and 5th arguments respectively.

Properties/parameters used in these function are listed below with their units:

@begincode p pressure [Pa] T temperature [K] e specific internal energy [J/kg] v specific volume [m^3/kg] rho density [kg/m^3] h specific enthalpy [J/kg] s specific entropy [J/(kg*K)] mu viscosity [Pa*s] k thermal conductivity [W/(m*K)] c speed of sound [m/s] cp constant-pressure specific heat [J/K] cv constant-volume specific heat [J/K] beta volumetric thermal expansion coefficient [1/K] g Gibbs free energy [J] pp_sat partial pressure at saturation [Pa] gamma Adiabatic ratio (cp/cv) [-]

As an example:

@begincode // calculate pressure given specific vol and energy: auto pressure = your_fluid_properties_object.p_from_v_e(specific_vol, specific_energy);

// or use the derivative variant: Real dp_dv = 0; // derivative will be stored into here Real dp_de = 0; // derivative will be stored into here your_fluid_properties_object.p_from_v_e(specific_vol, specific_energy, pressure, dp_dv, dp_de);

Automatic differentiation (AD) support is provided through x_from_a_b(DualReal a, DualReal b) and x_from_a_b(DualReal a, DualReal b, DualReal x, DualReal dx_da, DualReal dx_db) versions of the functions where a and b must be ADReal/DualNumber's calculated using all AD-supporting values:

@begincode auto v = 1/rho; // rho must be an AD non-linear variable. auto e = rhoE/rho - vel_energy; // rhoE and vel_energy must be AD variables/numbers also. auto pressure = your_fluid_properties_object.p_from_v_e(v, e); // pressure now contains partial derivatives w.r.t. all degrees of freedom

◆ propfunc() [13/16]

e e e e p SinglePhaseFluidProperties::propfunc ( rho  ,
p  ,
 
)
inherited

◆ propfunc() [14/16]

e e e e SinglePhaseFluidProperties::propfunc ( ,
h  ,
p   
)
inherited

◆ propfunc() [15/16]

e e e e p h SinglePhaseFluidProperties::propfunc ( ,
p  ,
T   
)
inherited

◆ propfunc() [16/16]

e e e e p h T T T T T v v SinglePhaseFluidProperties::propfunc ( ,
T  ,
v   
)
inherited

◆ propfuncWithDefault() [1/2]

e e e e p h T T T T T v v v s h SinglePhaseFluidProperties::propfuncWithDefault ( beta  ,
p  ,
T   
)
inherited

◆ propfuncWithDefault() [2/2]

e e e e p h T T T T T v v v s h T SinglePhaseFluidProperties::propfuncWithDefault ( ,
p  ,
T   
)
inherited

◆ reshapeData2D()

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 617 of file TabulatedFluidProperties.C.

621 {
622  if (!vec.empty())
623  {
624  mat.resize(nrow);
625  for (unsigned int i = 0; i < nrow; ++i)
626  mat[i].resize(ncol);
627 
628  for (unsigned int i = 0; i < nrow; ++i)
629  for (unsigned int j = 0; j < ncol; ++j)
630  mat[i][j] = vec[i * ncol + j];
631  }
632 }

Referenced by initialSetup().

◆ rho_e_from_p_T()

void SinglePhaseFluidProperties::rho_e_from_p_T ( Real  p,
Real  T,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  e,
Real &  de_dp,
Real &  de_dT 
) const
virtualinherited

Definition at line 242 of file SinglePhaseFluidProperties.C.

250 {
251  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
252  e_from_p_T(p, T, e, de_dp, de_dT);
253 }

◆ rho_from_p_T() [1/2]

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

Definition at line 316 of file TabulatedFluidProperties.C.

317 {
319  {
322  }
323  else
324  return _fp.rho_from_p_T(pressure, temperature);
325 }

◆ rho_from_p_T() [2/2]

void TabulatedFluidProperties::rho_from_p_T ( Real  pressure,
Real  temperature,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT 
) const
overridevirtual

Definition at line 328 of file TabulatedFluidProperties.C.

330 {
332  {
334  _property_ipol[_density_idx]->sampleValueAndDerivatives(
335  pressure, temperature, rho, drho_dp, drho_dT);
336  }
337  else
338  _fp.rho_from_p_T(pressure, temperature, rho, drho_dp, drho_dT);
339 }

◆ rho_mu_from_p_T() [1/3]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( const DualReal &  p,
const DualReal &  T,
DualReal &  rho,
DualReal &  mu 
) const
virtualinherited

Definition at line 277 of file SinglePhaseFluidProperties.C.

281 {
282  rho = rho_from_p_T(p, T);
283  mu = mu_from_p_T(p, T);
284 }

◆ rho_mu_from_p_T() [2/3]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( Real  p,
Real  T,
Real &  rho,
Real &  drho_dp,
Real &  drho_dT,
Real &  mu,
Real &  dmu_dp,
Real &  dmu_dT 
) const
virtualinherited

Reimplemented in Water97FluidProperties, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 263 of file SinglePhaseFluidProperties.C.

271 {
272  rho_from_p_T(p, T, rho, drho_dp, drho_dT);
273  mu_from_p_T(p, T, mu, dmu_dp, dmu_dT);
274 }

◆ rho_mu_from_p_T() [3/3]

void SinglePhaseFluidProperties::rho_mu_from_p_T ( Real  p,
Real  T,
Real &  rho,
Real &  mu 
) const
virtualinherited

Combined methods.

These methods are particularly useful for the PorousFlow module, where density and viscosity are typically both computed everywhere. The combined methods allow the most efficient means of calculating both properties, especially where rho(p, T) and mu(rho, T). In this case, an extra density calculation would be required to calculate mu(p, T). All propery names are described above.

Reimplemented in Water97FluidProperties, CO2FluidProperties, HydrogenFluidProperties, and NitrogenFluidProperties.

Definition at line 256 of file SinglePhaseFluidProperties.C.

257 {
258  rho = rho_from_p_T(p, T);
259  mu = mu_from_p_T(p, T);
260 }

Referenced by PorousFlowSingleComponentFluid::computeQpProperties(), PorousFlowWaterNCG::gasProperties(), PorousFlowBrineCO2::gasProperties(), and PorousFlowWaterNCG::liquidProperties().

◆ s_from_p_T() [1/2]

void TabulatedFluidProperties::s_from_p_T ( Real  p,
Real  T,
Real &  s,
Real &  ds_dp,
Real &  ds_dT 
) const
overridevirtual

Definition at line 488 of file TabulatedFluidProperties.C.

489 {
490  SinglePhaseFluidProperties::s_from_p_T(p, T, s, ds_dp, ds_dT);
491 }

◆ s_from_p_T() [2/2]

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

Definition at line 476 of file TabulatedFluidProperties.C.

477 {
479  {
482  }
483  else
484  return _fp.s_from_p_T(pressure, temperature);
485 }

◆ subdomainSetup()

virtual void FluidProperties::subdomainSetup ( )
inlinefinalvirtualinherited

Definition at line 39 of file FluidProperties.h.

39 {}

◆ threadJoin()

virtual void FluidProperties::threadJoin ( const UserObject &  )
inlinefinalvirtualinherited

Definition at line 38 of file FluidProperties.h.

38 {}

◆ triplePointPressure()

Real SinglePhaseFluidProperties::triplePointPressure ( ) const
virtualinherited

Triple point pressure.

Returns
triple point pressure (Pa)

Reimplemented in CO2FluidProperties, HydrogenFluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 132 of file SinglePhaseFluidProperties.C.

133 {
134  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
135 }

◆ triplePointTemperature()

Real SinglePhaseFluidProperties::triplePointTemperature ( ) const
virtualinherited

Triple point temperature.

Returns
triple point temperature (K)

Reimplemented in CO2FluidProperties, HydrogenFluidProperties, NitrogenFluidProperties, MethaneFluidProperties, NaClFluidProperties, and Water97FluidProperties.

Definition at line 138 of file SinglePhaseFluidProperties.C.

139 {
140  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
141 }

◆ v_e_spndl_from_T()

void SinglePhaseFluidProperties::v_e_spndl_from_T ( Real  T,
Real &  v,
Real &  e 
) const
virtualinherited

Specific internal energy from temperature and specific volume.

Parameters
[in]Ttemperature
[in]vspecific volume

Reimplemented in IdealGasFluidProperties, and StiffenedGasFluidProperties.

Definition at line 292 of file SinglePhaseFluidProperties.C.

293 {
294  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
295 }

Referenced by IdealRealGasMixtureFluidProperties::v_from_p_T().

◆ vaporPressure() [1/3]

DualReal SinglePhaseFluidProperties::vaporPressure ( const DualReal &  T) const
inherited

Definition at line 198 of file SinglePhaseFluidProperties.C.

199 {
200  Real p = 0.0;
201  Real temperature = T.value();
202  Real dpdT = 0.0;
203 
204  vaporPressure(temperature, p, dpdT);
205 
206  DualReal result = p;
207  result.derivatives() = T.derivatives() * dpdT;
208 
209  return result;
210 }

◆ vaporPressure() [2/3]

Real TabulatedFluidProperties::vaporPressure ( Real  T) const
overridevirtual

Vapor pressure.

Used to delineate liquid and gas phases. Valid for temperatures between the triple point temperature and the critical temperature

Parameters
Tfluid temperature (K)
[out]saturationpressure (Pa)
[out]derivativeof saturation pressure wrt temperature (Pa/K)

Reimplemented from SinglePhaseFluidProperties.

Definition at line 500 of file TabulatedFluidProperties.C.

501 {
502  return _fp.vaporPressure(temperature);
503 }

◆ vaporPressure() [3/3]

void TabulatedFluidProperties::vaporPressure ( Real  temperature,
Real &  psat,
Real &  dpsat_dT 
) const
overridevirtual

Reimplemented from SinglePhaseFluidProperties.

Definition at line 506 of file TabulatedFluidProperties.C.

507 {
508  _fp.vaporPressure(temperature, psat, dpsat_dT);
509 }

◆ vaporTemperature() [1/3]

DualReal SinglePhaseFluidProperties::vaporTemperature ( const DualReal &  p) const
inherited

Definition at line 227 of file SinglePhaseFluidProperties.C.

228 {
229  Real T = 0.0;
230  Real pressure = p.value();
231  Real dTdp = 0.0;
232 
233  vaporTemperature(pressure, T, dTdp);
234 
235  DualReal result = T;
236  result.derivatives() = p.derivatives() * dTdp;
237 
238  return result;
239 }

◆ vaporTemperature() [2/3]

Real SinglePhaseFluidProperties::vaporTemperature ( Real  p) const
virtualinherited

Vapor temperature.

Used to delineate liquid and gas phases. Valid for pressures between the triple point pressure and the critical pressure

Parameters
pfluid pressure (Pa)
[out]saturationtemperature (K)
[out]derivativeof saturation temperature wrt pressure

Reimplemented in Water97FluidProperties.

Definition at line 212 of file SinglePhaseFluidProperties.C.

213 {
214  mooseError(name(), ": ", __PRETTY_FUNCTION__, " not implemented.");
215 }

Referenced by PorousFlowWaterVapor::thermophysicalProperties(), and SinglePhaseFluidProperties::vaporTemperature().

◆ vaporTemperature() [3/3]

void SinglePhaseFluidProperties::vaporTemperature ( Real  p,
Real &  Tsat,
Real &  dTsat_dp 
) const
virtualinherited

Reimplemented in Water97FluidProperties.

Definition at line 218 of file SinglePhaseFluidProperties.C.

219 {
220  fluidPropError(name(), ": ", __PRETTY_FUNCTION__, " derivatives not implemented.");
221 
222  dT_dp = 0.0;
223  T = vaporTemperature(p);
224 }

◆ writeTabulatedData()

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 512 of file TabulatedFluidProperties.C.

513 {
514  if (processor_id() == 0)
515  {
516  MooseUtils::checkFileWriteable(file_name);
517 
518  std::ofstream file_out(file_name.c_str());
519 
520  // Write out date and fluid type
521  time_t now = time(&now);
522  file_out << "# " << _fp.fluidName() << " properties created by TabulatedFluidProperties on "
523  << ctime(&now) << "\n";
524 
525  // Write out column names
526  file_out << "pressure, temperature";
527  for (std::size_t i = 0; i < _interpolated_properties.size(); ++i)
528  file_out << ", " << _interpolated_properties[i];
529  file_out << "\n";
530 
531  // Write out the fluid property data
532  for (unsigned int p = 0; p < _num_p; ++p)
533  for (unsigned int t = 0; t < _num_T; ++t)
534  {
535  file_out << _pressure[p] << ", " << _temperature[t];
536  for (std::size_t i = 0; i < _properties.size(); ++i)
537  file_out << ", " << _properties[i][p * _num_T + t];
538  file_out << "\n";
539  }
540  }
541 }

Referenced by initialSetup().

Member Data Documentation

◆ _allow_imperfect_jacobians

const bool FluidProperties::_allow_imperfect_jacobians
protectedinherited

Flag to set unimplemented Jacobian entries to zero.

Definition at line 48 of file FluidProperties.h.

Referenced by SinglePhaseFluidProperties::fluidPropError().

◆ _cp_idx

unsigned int TabulatedFluidProperties::_cp_idx
protected

Definition at line 235 of file TabulatedFluidProperties.h.

Referenced by cp_from_p_T(), and initialSetup().

◆ _csv_reader

MooseUtils::DelimitedFileReader TabulatedFluidProperties::_csv_reader
protected

The MOOSE delimited file reader.

Definition at line 240 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and TabulatedFluidProperties().

◆ _cv_idx

unsigned int TabulatedFluidProperties::_cv_idx
protected

Definition at line 236 of file TabulatedFluidProperties.h.

Referenced by cv_from_p_T(), and initialSetup().

◆ _density_idx

unsigned int TabulatedFluidProperties::_density_idx
protected

Index of each property.

Definition at line 230 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and rho_from_p_T().

◆ _enthalpy_idx

unsigned int TabulatedFluidProperties::_enthalpy_idx
protected

Definition at line 231 of file TabulatedFluidProperties.h.

Referenced by h_from_p_T(), and initialSetup().

◆ _entropy_idx

unsigned int TabulatedFluidProperties::_entropy_idx
protected

Definition at line 237 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and s_from_p_T().

◆ _file_name

FileName TabulatedFluidProperties::_file_name
protected

File name of tabulated data file.

Definition at line 181 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _fp

const SinglePhaseFluidProperties& TabulatedFluidProperties::_fp
protected

◆ _internal_energy_idx

unsigned int TabulatedFluidProperties::_internal_energy_idx
protected

Definition at line 232 of file TabulatedFluidProperties.h.

Referenced by e_from_p_T(), and initialSetup().

◆ _interpolate_cp

bool TabulatedFluidProperties::_interpolate_cp
protected

Definition at line 225 of file TabulatedFluidProperties.h.

Referenced by cp_from_p_T(), and initialSetup().

◆ _interpolate_cv

bool TabulatedFluidProperties::_interpolate_cv
protected

Definition at line 226 of file TabulatedFluidProperties.h.

Referenced by cv_from_p_T(), and initialSetup().

◆ _interpolate_density

bool TabulatedFluidProperties::_interpolate_density
protected

Set of flags to note whether a property is to be interpolated.

Definition at line 220 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and rho_from_p_T().

◆ _interpolate_enthalpy

bool TabulatedFluidProperties::_interpolate_enthalpy
protected

Definition at line 221 of file TabulatedFluidProperties.h.

Referenced by h_from_p_T(), and initialSetup().

◆ _interpolate_entropy

bool TabulatedFluidProperties::_interpolate_entropy
protected

Definition at line 227 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and s_from_p_T().

◆ _interpolate_internal_energy

bool TabulatedFluidProperties::_interpolate_internal_energy
protected

Definition at line 222 of file TabulatedFluidProperties.h.

Referenced by e_from_p_T(), and initialSetup().

◆ _interpolate_k

bool TabulatedFluidProperties::_interpolate_k
protected

Definition at line 224 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and k_from_p_T().

◆ _interpolate_viscosity

bool TabulatedFluidProperties::_interpolate_viscosity
protected

Definition at line 223 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and mu_from_p_T().

◆ _interpolated_properties

std::vector<std::string> TabulatedFluidProperties::_interpolated_properties
protected

List of properties to be interpolated.

Definition at line 218 of file TabulatedFluidProperties.h.

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

◆ _interpolated_properties_enum

MultiMooseEnum TabulatedFluidProperties::_interpolated_properties_enum
protected

Properties to be interpolated entered in the input file.

Definition at line 216 of file TabulatedFluidProperties.h.

Referenced by generateTabulatedData().

◆ _k_idx

unsigned int TabulatedFluidProperties::_k_idx
protected

Definition at line 234 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and k_from_p_T().

◆ _num_p

unsigned int TabulatedFluidProperties::_num_p
protected

Number of pressure points in the tabulated data.

Definition at line 203 of file TabulatedFluidProperties.h.

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

◆ _num_T

unsigned int TabulatedFluidProperties::_num_T
protected

Number of temperature points in the tabulated data.

Definition at line 201 of file TabulatedFluidProperties.h.

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

◆ _pressure

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

Pressure vector.

Definition at line 183 of file TabulatedFluidProperties.h.

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

◆ _pressure_max

Real TabulatedFluidProperties::_pressure_max
protected

Maximum pressure in tabulated data.

Definition at line 199 of file TabulatedFluidProperties.h.

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

◆ _pressure_min

Real TabulatedFluidProperties::_pressure_min
protected

Minimum pressure in tabulated data.

Definition at line 197 of file TabulatedFluidProperties.h.

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

◆ _properties

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

Tabulated fluid properties.

Definition at line 187 of file TabulatedFluidProperties.h.

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

◆ _property_columns

const std::vector<std::string> TabulatedFluidProperties::_property_columns
protected
Initial value:
{
"density", "enthalpy", "internal_energy", "viscosity", "k", "cv", "cp", "entropy"}

List of possible property column names to be read.

Definition at line 213 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _property_ipol

std::vector<std::unique_ptr<BicubicInterpolation> > TabulatedFluidProperties::_property_ipol
protected

Interpolated fluid property.

Definition at line 190 of file TabulatedFluidProperties.h.

Referenced by cp_from_p_T(), cv_from_p_T(), e_from_p_T(), h_from_p_T(), initialSetup(), k_from_p_T(), mu_from_p_T(), rho_from_p_T(), and s_from_p_T().

◆ _R

const Real FluidProperties::_R = 8.3144598
staticinherited

◆ _required_columns

const std::vector<std::string> TabulatedFluidProperties::_required_columns {"pressure", "temperature"}
protected

List of required column names to be read.

Definition at line 211 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _save_file

const bool TabulatedFluidProperties::_save_file
protected

Whether to save a generated fluid properties file to disk.

Definition at line 205 of file TabulatedFluidProperties.h.

Referenced by initialSetup().

◆ _T_c2k

const Real FluidProperties::_T_c2k
protectedinherited

◆ _temperature

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

Temperature vector.

Definition at line 185 of file TabulatedFluidProperties.h.

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

◆ _temperature_max

Real TabulatedFluidProperties::_temperature_max
protected

Maximum temperature in tabulated data.

Definition at line 195 of file TabulatedFluidProperties.h.

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

◆ _temperature_min

Real TabulatedFluidProperties::_temperature_min
protected

Minimum temperature in tabulated data.

Definition at line 193 of file TabulatedFluidProperties.h.

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

◆ _viscosity_idx

unsigned int TabulatedFluidProperties::_viscosity_idx
protected

Definition at line 233 of file TabulatedFluidProperties.h.

Referenced by initialSetup(), and mu_from_p_T().

◆ h [1/2]

e e e e SinglePhaseFluidProperties::h
inherited

◆ h [2/2]

e e e e p h T T T T T v v v SinglePhaseFluidProperties::h
inherited

Definition at line 183 of file SinglePhaseFluidProperties.h.

◆ p [1/6]

e e e e p h SinglePhaseFluidProperties::p
inherited

Definition at line 167 of file SinglePhaseFluidProperties.h.

Referenced by StiffenedGasFluidProperties::c_from_v_e(), HeliumFluidProperties::c_from_v_e(), IdealGasFluidProperties::cp_from_p_T(), IdealGasFluidProperties::cv_from_p_T(), StiffenedGasFluidProperties::e_from_p_rho(), IdealGasFluidProperties::e_from_p_rho(), StiffenedGasFluidProperties::e_from_p_T(), IdealGasFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), generateTabulatedData(), StiffenedGasFluidProperties::h_from_p_T(), IdealGasFluidProperties::h_from_p_T(), Water97FluidProperties::henryConstant(), IdealGasFluidProperties::k_from_p_T(), StiffenedGasFluidProperties::p_from_h_s(), IdealGasFluidProperties::p_from_h_s(), StiffenedGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_v_e(), StiffenedGasFluidProperties::p_from_v_e(), HeliumFluidProperties::p_from_v_e(), FlinakFluidProperties::p_from_v_e(), FlibeFluidProperties::p_from_v_e(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), SinglePhaseFluidProperties::rho_mu_from_p_T(), StiffenedGasFluidProperties::s_from_h_p(), IdealGasFluidProperties::s_from_h_p(), StiffenedGasFluidProperties::s_from_p_T(), IdealGasFluidProperties::s_from_p_T(), SimpleFluidProperties::s_from_p_T(), Water97FluidProperties::s_from_p_T(), s_from_p_T(), IdealGasFluidProperties::s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), Water97FluidProperties::T_from_p_h(), FlinakFluidProperties::T_from_v_e(), FlibeFluidProperties::T_from_v_e(), Water97FluidProperties::vaporPressure(), SinglePhaseFluidProperties::vaporPressure(), Water97FluidProperties::vaporTemperature(), SinglePhaseFluidProperties::vaporTemperature(), and writeTabulatedData().

◆ p [2/6]

e e e e p h T T SinglePhaseFluidProperties::p
inherited

Definition at line 171 of file SinglePhaseFluidProperties.h.

◆ p [3/6]

e e e e p h T T T SinglePhaseFluidProperties::p
inherited

Definition at line 173 of file SinglePhaseFluidProperties.h.

◆ p [4/6]

e e e e p h T T T T SinglePhaseFluidProperties::p
inherited

Definition at line 175 of file SinglePhaseFluidProperties.h.

◆ p [5/6]

e e e e p h T T T T T v v v s SinglePhaseFluidProperties::p
inherited

Definition at line 185 of file SinglePhaseFluidProperties.h.

◆ p [6/6]

e e e e p h T T T T T v v v s h SinglePhaseFluidProperties::p
inherited

Definition at line 187 of file SinglePhaseFluidProperties.h.

◆ propfuncWithDefault

e e e e p h T T T T T v v v s h T e SinglePhaseFluidProperties::propfuncWithDefault(gamma, p, T)
inherited

Definition at line 190 of file SinglePhaseFluidProperties.h.

◆ rho

e e e e p h T SinglePhaseFluidProperties::rho
inherited

◆ T [1/3]

e e e e p h T T T T T SinglePhaseFluidProperties::T
inherited

Definition at line 177 of file SinglePhaseFluidProperties.h.

Referenced by IdealGasFluidProperties::c_from_p_T(), IdealGasFluidProperties::c_from_v_e(), HeliumFluidProperties::c_from_v_e(), IdealGasFluidProperties::cp_from_p_T(), IdealGasFluidProperties::cv_from_p_T(), StiffenedGasFluidProperties::e_from_p_T(), IdealGasFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::e_from_T_v(), StiffenedGasFluidProperties::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), StiffenedGasFluidProperties::h_from_p_T(), IdealGasFluidProperties::h_from_p_T(), StiffenedGasFluidProperties::h_from_T_v(), IdealGasFluidProperties::h_from_T_v(), Water97FluidProperties::henryConstant(), IdealGasFluidProperties::k_from_p_T(), HeliumFluidProperties::k_from_v_e(), IdealGasFluidProperties::mu_from_p_T(), StiffenedGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), HeliumFluidProperties::p_from_v_e(), FlibeFluidProperties::p_from_v_e(), FlinakFluidProperties::p_from_v_e(), SinglePhaseFluidProperties::rho_e_from_p_T(), StiffenedGasFluidProperties::rho_from_p_s(), IdealGasFluidProperties::rho_from_p_s(), StiffenedGasFluidProperties::rho_from_p_T(), IdealGasFluidProperties::rho_from_p_T(), SinglePhaseFluidProperties::rho_mu_from_p_T(), StiffenedGasFluidProperties::s_from_p_T(), IdealGasFluidProperties::s_from_p_T(), SimpleFluidProperties::s_from_p_T(), Water97FluidProperties::s_from_p_T(), s_from_p_T(), StiffenedGasFluidProperties::s_from_T_v(), IdealGasFluidProperties::s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::T_from_p_h(), Water97FluidProperties::T_from_p_h(), StiffenedGasFluidProperties::T_from_v_e(), IdealGasFluidProperties::T_from_v_e(), FlinakFluidProperties::T_from_v_e(), FlibeFluidProperties::T_from_v_e(), HeliumFluidProperties::T_from_v_e(), SinglePhaseFluidProperties::vaporPressure(), Water97FluidProperties::vaporTemperature(), and SinglePhaseFluidProperties::vaporTemperature().

◆ T [2/3]

e e e e p h T T T T T v SinglePhaseFluidProperties::T
inherited

Definition at line 179 of file SinglePhaseFluidProperties.h.

◆ T [3/3]

e e e e p h T T T T T v v SinglePhaseFluidProperties::T
inherited

Definition at line 181 of file SinglePhaseFluidProperties.h.

◆ v [1/6]

SinglePhaseFluidProperties::v
inherited

Definition at line 155 of file SinglePhaseFluidProperties.h.

Referenced by StiffenedGasFluidProperties::c_from_v_e(), IdealGasFluidProperties::c_from_v_e(), HeliumFluidProperties::c_from_v_e(), StiffenedGasFluidProperties::cp_from_v_e(), IdealGasFluidProperties::cp_from_v_e(), FlibeFluidProperties::cp_from_v_e(), FlinakFluidProperties::cp_from_v_e(), HeliumFluidProperties::cp_from_v_e(), FlibeFluidProperties::cv_from_p_T(), FlinakFluidProperties::cv_from_p_T(), IdealGasFluidProperties::cv_from_v_e(), FlibeFluidProperties::cv_from_v_e(), FlinakFluidProperties::cv_from_v_e(), HeliumFluidProperties::cv_from_v_e(), FlinakFluidProperties::e_from_p_T(), FlibeFluidProperties::e_from_p_T(), StiffenedGasFluidProperties::e_from_T_v(), IdealGasFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::e_from_v_h(), StiffenedGasFluidProperties::g_from_v_e(), IdealGasFluidProperties::g_from_v_e(), FlibeFluidProperties::k_from_v_e(), FlinakFluidProperties::k_from_v_e(), HeliumFluidProperties::k_from_v_e(), FlibeFluidProperties::mu_from_v_e(), FlinakFluidProperties::mu_from_v_e(), HeliumFluidProperties::mu_from_v_e(), StiffenedGasFluidProperties::p_from_T_v(), IdealGasFluidProperties::p_from_T_v(), StiffenedGasFluidProperties::p_from_v_e(), IdealGasFluidProperties::p_from_v_e(), HeliumFluidProperties::p_from_v_e(), FlibeFluidProperties::p_from_v_e(), FlinakFluidProperties::p_from_v_e(), StiffenedGasFluidProperties::s_from_T_v(), IdealGasFluidProperties::s_from_T_v(), StiffenedGasFluidProperties::s_from_v_e(), IdealGasFluidProperties::s_from_v_e(), StiffenedGasFluidProperties::T_from_v_e(), IdealGasFluidProperties::T_from_v_e(), FlinakFluidProperties::T_from_v_e(), FlibeFluidProperties::T_from_v_e(), HeliumFluidProperties::T_from_v_e(), StiffenedGasFluidProperties::v_e_spndl_from_T(), IdealGasFluidProperties::v_e_spndl_from_T(), FlinakFluidProperties::v_from_p_T(), and FlibeFluidProperties::v_from_p_T().

◆ v [2/6]

e SinglePhaseFluidProperties::v
inherited

Definition at line 157 of file SinglePhaseFluidProperties.h.

◆ v [3/6]

e e SinglePhaseFluidProperties::v
inherited

Definition at line 159 of file SinglePhaseFluidProperties.h.

◆ v [4/6]

e e e SinglePhaseFluidProperties::v
inherited

Definition at line 161 of file SinglePhaseFluidProperties.h.

◆ v [5/6]

e e e e p SinglePhaseFluidProperties::v
inherited

Definition at line 165 of file SinglePhaseFluidProperties.h.

◆ v [6/6]

e e e e p h T T T T T v v v s h T SinglePhaseFluidProperties::v
inherited

Definition at line 189 of file SinglePhaseFluidProperties.h.


The documentation for this class was generated from the following files:
TabulatedFluidProperties::_interpolate_enthalpy
bool _interpolate_enthalpy
Definition: TabulatedFluidProperties.h:221
TabulatedFluidProperties::_csv_reader
MooseUtils::DelimitedFileReader _csv_reader
The MOOSE delimited file reader.
Definition: TabulatedFluidProperties.h:240
SinglePhaseFluidProperties::henryCoefficients
virtual std::vector< Real > henryCoefficients() const
Henry's law coefficients for dissolution in water.
Definition: SinglePhaseFluidProperties.C:183
TabulatedFluidProperties::generateTabulatedData
virtual void generateTabulatedData()
Generates a table of fluid properties by looping over pressure and temperature and calculating proper...
Definition: TabulatedFluidProperties.C:544
TabulatedFluidProperties::_interpolated_properties_enum
MultiMooseEnum _interpolated_properties_enum
Properties to be interpolated entered in the input file.
Definition: TabulatedFluidProperties.h:216
TabulatedFluidProperties::_fp
const SinglePhaseFluidProperties & _fp
SinglePhaseFluidPropertiesPT UserObject.
Definition: TabulatedFluidProperties.h:208
TabulatedFluidProperties::_viscosity_idx
unsigned int _viscosity_idx
Definition: TabulatedFluidProperties.h:233
TabulatedFluidProperties::checkInputVariables
virtual 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...
Definition: TabulatedFluidProperties.C:635
TabulatedFluidProperties::_interpolate_entropy
bool _interpolate_entropy
Definition: TabulatedFluidProperties.h:227
TabulatedFluidProperties::_required_columns
const std::vector< std::string > _required_columns
List of required column names to be read.
Definition: TabulatedFluidProperties.h:211
TabulatedFluidProperties::_interpolate_cv
bool _interpolate_cv
Definition: TabulatedFluidProperties.h:226
SinglePhaseFluidProperties::SinglePhaseFluidProperties
SinglePhaseFluidProperties(const InputParameters &parameters)
Definition: SinglePhaseFluidProperties.C:22
TabulatedFluidProperties::_interpolated_properties
std::vector< std::string > _interpolated_properties
List of properties to be interpolated.
Definition: TabulatedFluidProperties.h:218
TabulatedFluidProperties::_pressure
std::vector< Real > _pressure
Pressure vector.
Definition: TabulatedFluidProperties.h:183
TabulatedFluidProperties::_pressure_max
Real _pressure_max
Maximum pressure in tabulated data.
Definition: TabulatedFluidProperties.h:199
TabulatedFluidProperties::_interpolate_cp
bool _interpolate_cp
Definition: TabulatedFluidProperties.h:225
TabulatedFluidProperties::_num_T
unsigned int _num_T
Number of temperature points in the tabulated data.
Definition: TabulatedFluidProperties.h:201
SinglePhaseFluidProperties::T
e e e e p h T T T T T T
Definition: SinglePhaseFluidProperties.h:177
TabulatedFluidProperties::_properties
std::vector< std::vector< Real > > _properties
Tabulated fluid properties.
Definition: TabulatedFluidProperties.h:187
TabulatedFluidProperties::_internal_energy_idx
unsigned int _internal_energy_idx
Definition: TabulatedFluidProperties.h:232
TabulatedFluidProperties::_cv_idx
unsigned int _cv_idx
Definition: TabulatedFluidProperties.h:236
SinglePhaseFluidProperties::rho
e e e e p h T rho
Definition: SinglePhaseFluidProperties.h:169
SinglePhaseFluidProperties::vaporPressure
virtual Real vaporPressure(Real T) const
Vapor pressure.
Definition: SinglePhaseFluidProperties.C:177
TabulatedFluidProperties::_density_idx
unsigned int _density_idx
Index of each property.
Definition: TabulatedFluidProperties.h:230
SinglePhaseFluidProperties::vaporTemperature
virtual Real vaporTemperature(Real p) const
Vapor temperature.
Definition: SinglePhaseFluidProperties.C:212
name
const std::string name
Definition: Setup.h:21
TabulatedFluidProperties::_property_columns
const std::vector< std::string > _property_columns
List of possible property column names to be read.
Definition: TabulatedFluidProperties.h:213
TabulatedFluidProperties::_interpolate_density
bool _interpolate_density
Set of flags to note whether a property is to be interpolated.
Definition: TabulatedFluidProperties.h:220
TabulatedFluidProperties::reshapeData2D
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.
Definition: TabulatedFluidProperties.C:617
TabulatedFluidProperties::_cp_idx
unsigned int _cp_idx
Definition: TabulatedFluidProperties.h:235
TabulatedFluidProperties::_temperature_min
Real _temperature_min
Minimum temperature in tabulated data.
Definition: TabulatedFluidProperties.h:193
TabulatedFluidProperties::_interpolate_internal_energy
bool _interpolate_internal_energy
Definition: TabulatedFluidProperties.h:222
TabulatedFluidProperties::_save_file
const bool _save_file
Whether to save a generated fluid properties file to disk.
Definition: TabulatedFluidProperties.h:205
TabulatedFluidProperties::_property_ipol
std::vector< std::unique_ptr< BicubicInterpolation > > _property_ipol
Interpolated fluid property.
Definition: TabulatedFluidProperties.h:190
SinglePhaseFluidProperties::molarMass
virtual virtual std Real molarMass() const
Fluid name.
Definition: SinglePhaseFluidProperties.C:96
SinglePhaseFluidProperties::fluidPropError
void fluidPropError(Args... args) const
Definition: SinglePhaseFluidProperties.h:326
TabulatedFluidProperties::writeTabulatedData
void writeTabulatedData(std::string file_name)
Writes tabulated data to a file.
Definition: TabulatedFluidProperties.C:512
NS::temperature
const std::string temperature
Definition: NS.h:26
TabulatedFluidProperties::_file_name
FileName _file_name
File name of tabulated data file.
Definition: TabulatedFluidProperties.h:181
TabulatedFluidProperties::_temperature
std::vector< Real > _temperature
Temperature vector.
Definition: TabulatedFluidProperties.h:185
FluidProperties::_allow_imperfect_jacobians
const bool _allow_imperfect_jacobians
Flag to set unimplemented Jacobian entries to zero.
Definition: FluidProperties.h:48
TabulatedFluidProperties::_pressure_min
Real _pressure_min
Minimum pressure in tabulated data.
Definition: TabulatedFluidProperties.h:197
TabulatedFluidProperties::_enthalpy_idx
unsigned int _enthalpy_idx
Definition: TabulatedFluidProperties.h:231
TabulatedFluidProperties::_interpolate_k
bool _interpolate_k
Definition: TabulatedFluidProperties.h:224
SinglePhaseFluidProperties::p
e e e e p h p
Definition: SinglePhaseFluidProperties.h:167
TabulatedFluidProperties::_interpolate_viscosity
bool _interpolate_viscosity
Definition: TabulatedFluidProperties.h:223
TabulatedFluidProperties::_num_p
unsigned int _num_p
Number of pressure points in the tabulated data.
Definition: TabulatedFluidProperties.h:203
TabulatedFluidProperties::_k_idx
unsigned int _k_idx
Definition: TabulatedFluidProperties.h:234
TabulatedFluidProperties::_entropy_idx
unsigned int _entropy_idx
Definition: TabulatedFluidProperties.h:237
TabulatedFluidProperties::_temperature_max
Real _temperature_max
Maximum temperature in tabulated data.
Definition: TabulatedFluidProperties.h:195
NS::pressure
const std::string pressure
Definition: NS.h:25
SinglePhaseFluidProperties::h
e e e e h
Definition: SinglePhaseFluidProperties.h:163