Cantera  2.1.2
WaterTransport.cpp
Go to the documentation of this file.
1 //! @file WaterTransport.cpp
2 #include "cantera/base/ct_defs.h"
8 
13 
14 using namespace std;
15 
16 namespace Cantera
17 {
18 
19 WaterTransport::WaterTransport(thermo_t* thermo, int ndim) :
20  Transport(thermo, ndim)
21 {
22  initTP();
23 }
24 
26  Transport(right.m_thermo, right.m_nDim)
27 {
28  *this = right;
29 }
30 
31 WaterTransport& WaterTransport::operator=(const WaterTransport& right)
32 {
33  if (&right != this) {
34  return *this;
35  }
36  Transport::operator=(right);
37 
38  // All pointers in this routine are shallow pointers. Therefore, it's
39  // ok just to reinitialize them
40  initTP();
41 
42  return *this;
43 }
44 
46 {
47  return new WaterTransport(*this);
48 }
49 
51 {
52  // The expectation is that we have a VPStandardStateTP derived object
53  VPStandardStateTP* vpthermo = dynamic_cast<VPStandardStateTP*>(m_thermo);
54  if (!vpthermo) {
55 
56  WaterSSTP* wsstp = dynamic_cast<WaterSSTP*>(m_thermo);
57  if (!wsstp) {
58  throw CanteraError("WaterTransport::initTP()",
59  "Expectation is that ThermoPhase be a VPStandardStateTP");
60  } else {
61 
62  m_sub = wsstp->getWater();
63  AssertTrace(m_sub != 0);
64  // Get a pointer to a changeable WaterProps object
65  m_waterProps = wsstp->getWaterProps();
67  }
68  } else {
69  m_waterPDSS = dynamic_cast<PDSS_Water*>(vpthermo->providePDSS(0));
70  if (!m_waterPDSS) {
71  throw CanteraError("WaterTransport::initTP()",
72  "Expectation is that first species be water with a PDSS_Water object");
73  }
74  // Get a pointer to a changeable WaterPropsIAPWS object
76  AssertTrace(m_sub != 0);
77  // Get a pointer to a changeable WaterProps object
80  }
81 }
82 
84 {
85  return m_waterProps->viscosityWater();
86 }
87 
89 {
91 }
92 
93 }
WaterProps * getWaterProps()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: WaterSSTP.h:445
virtual doublereal viscosity()
Returns the viscosity of water at the current conditions (kg/m/s)
Header file defining class WaterTransport.
doublereal viscosityWater() const
Returns the viscosity of water at the current conditions (kg/m/s)
Definition: WaterProps.cpp:383
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
thermo_t * m_thermo
pointer to the object representing the phase
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
Base class for transport property managers.
Transport Parameters for pure water.
Header for a class used to house several approximation routines for properties of water...
WaterTransport(thermo_t *thermo=0, int ndim=1)
default constructor
Declares a ThermoPhase class consisting of pure water (see Thermodynamic Properties and class WaterSS...
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:101
Header file defining class LiquidTransportParams.
WaterPropsIAPWS * getWater()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: WaterSSTP.h:440
virtual Transport * duplMyselfAsTransport() const
Duplication routine for objects which inherit from Transport.
WaterPropsIAPWS * getWater()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: PDSS_Water.h:218
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:54
WaterProps * getWaterProps()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: PDSS_Water.h:223
PDSS_Water * m_waterPDSS
Pressure dependent standard state object for water.
doublereal thermalConductivityWater() const
Returns the thermal conductivity of water at the current conditions (W/m/K)
Definition: WaterProps.cpp:447
Class for single-component water.
Definition: WaterSSTP.h:125
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:68
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
#define AssertTrace(expr)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:216
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
WaterPropsIAPWS * m_sub
Pointer to the WaterPropsIAPWS object, which does the actual calculations for the real equation of st...
void initTP()
Routine to do some common initializations at the start of using this routine.
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
WaterProps * m_waterProps
Pointer to the WaterProps object.
virtual doublereal thermalConductivity()
Returns the thermal conductivity of water at the current conditions (W/m/K)
Headers for a class for calculating the equation of state of water from the IAPWS 1995 Formulation ba...