Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WaterTransport.cpp
Go to the documentation of this file.
1 //! @file WaterTransport.cpp
3 
7 
8 using namespace std;
9 
10 namespace Cantera
11 {
12 
13 WaterTransport::WaterTransport(thermo_t* thermo, int ndim) :
14  Transport(thermo, ndim)
15 {
16  initTP();
17 }
18 
20  Transport(right.m_thermo, right.m_nDim)
21 {
22  *this = right;
23 }
24 
25 WaterTransport& WaterTransport::operator=(const WaterTransport& right)
26 {
27  if (&right != this) {
28  return *this;
29  }
30  Transport::operator=(right);
31 
32  // All pointers in this routine are shallow pointers. Therefore, it's
33  // ok just to reinitialize them
34  initTP();
35 
36  return *this;
37 }
38 
40 {
41  return new WaterTransport(*this);
42 }
43 
45 {
46  // The expectation is that we have a VPStandardStateTP derived object
47  VPStandardStateTP* vpthermo = dynamic_cast<VPStandardStateTP*>(m_thermo);
48  if (!vpthermo) {
49 
50  WaterSSTP* wsstp = dynamic_cast<WaterSSTP*>(m_thermo);
51  if (!wsstp) {
52  throw CanteraError("WaterTransport::initTP()",
53  "Expectation is that ThermoPhase be a VPStandardStateTP");
54  } else {
55 
56  m_sub = wsstp->getWater();
57  AssertTrace(m_sub != 0);
58  // Get a pointer to a changeable WaterProps object
59  m_waterProps = wsstp->getWaterProps();
61  }
62  } else {
63  m_waterPDSS = dynamic_cast<PDSS_Water*>(vpthermo->providePDSS(0));
64  if (!m_waterPDSS) {
65  throw CanteraError("WaterTransport::initTP()",
66  "Expectation is that first species be water with a PDSS_Water object");
67  }
68  // Get a pointer to a changeable WaterPropsIAPWS object
70  AssertTrace(m_sub != 0);
71  // Get a pointer to a changeable WaterProps object
74  }
75 }
76 
78 {
79  return m_waterProps->viscosityWater();
80 }
81 
83 {
85 }
86 
87 }
WaterProps * getWaterProps()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: WaterSSTP.h:425
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:341
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...
Base class for transport property managers.
Transport Parameters for pure 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:97
WaterPropsIAPWS * getWater()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: WaterSSTP.h:420
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:212
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:51
WaterProps * getWaterProps()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: PDSS_Water.h:217
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:395
Class for single-component water.
Definition: WaterSSTP.h:125
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:99
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:270
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.
WaterProps * m_waterProps
Pointer to the WaterProps object.
virtual doublereal thermalConductivity()
Returns the thermal conductivity of water at the current conditions (W/m/K)