Cantera  2.3.0
WaterTransport.cpp
Go to the documentation of this file.
1 //! @file WaterTransport.cpp
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at http://www.cantera.org/license.txt for license and copyright information.
5 
10 
11 using namespace std;
12 
13 namespace Cantera
14 {
15 
16 WaterTransport::WaterTransport(thermo_t* thermo, int ndim) :
17  Transport(thermo, ndim)
18 {
19  initTP();
20 }
21 
23  Transport(right.m_thermo, right.m_nDim)
24 {
25  *this = right;
26 }
27 
28 WaterTransport& WaterTransport::operator=(const WaterTransport& right)
29 {
30  if (&right != this) {
31  return *this;
32  }
33  Transport::operator=(right);
34 
35  // All pointers in this routine are shallow pointers. Therefore, it's
36  // ok just to reinitialize them
37  initTP();
38 
39  return *this;
40 }
41 
43 {
44  return new WaterTransport(*this);
45 }
46 
48 {
49  // The expectation is that we have a VPStandardStateTP derived object
50  VPStandardStateTP* vpthermo = dynamic_cast<VPStandardStateTP*>(m_thermo);
51  if (!vpthermo) {
52  WaterSSTP* wsstp = dynamic_cast<WaterSSTP*>(m_thermo);
53  if (!wsstp) {
54  throw CanteraError("WaterTransport::initTP()",
55  "Expectation is that ThermoPhase be a VPStandardStateTP");
56  } else {
57  m_sub = wsstp->getWater();
58  AssertTrace(m_sub != 0);
59  // Get a pointer to a changeable WaterProps object
60  m_waterProps = wsstp->getWaterProps();
62  }
63  } else {
64  m_waterPDSS = dynamic_cast<PDSS_Water*>(vpthermo->providePDSS(0));
65  if (!m_waterPDSS) {
66  throw CanteraError("WaterTransport::initTP()",
67  "Expectation is that first species be water with a PDSS_Water object");
68  }
69  // Get a pointer to a changeable WaterPropsIAPWS object
71  AssertTrace(m_sub != 0);
72  // Get a pointer to a changeable WaterProps object
75  }
76 }
77 
79 {
80  return m_waterProps->viscosityWater();
81 }
82 
84 {
86 }
87 
88 }
WaterProps * getWaterProps()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: WaterSSTP.h:238
virtual doublereal viscosity()
Returns the viscosity of water at the current conditions (kg/m/s)
Header file defining class WaterTransport.
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.
STL namespace.
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:93
WaterPropsIAPWS * getWater()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: WaterSSTP.h:233
WaterPropsIAPWS * getWater()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: PDSS_Water.h:193
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:49
WaterProps * getWaterProps()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: PDSS_Water.h:198
PDSS_Water * m_waterPDSS
Pressure dependent standard state object for water.
Class for single-component water.
Definition: WaterSSTP.h:114
doublereal viscosityWater() const
Returns the viscosity of water at the current conditions (kg/m/s)
Definition: WaterProps.cpp:307
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual Transport * duplMyselfAsTransport() const
Duplication routine for objects which inherit from Transport.
#define AssertTrace(expr)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:239
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.
doublereal thermalConductivityWater() const
Returns the thermal conductivity of water at the current conditions (W/m/K)
Definition: WaterProps.cpp:357
WaterProps * m_waterProps
Pointer to the WaterProps object.
Namespace for the Cantera kernel.
Definition: application.cpp:29
virtual doublereal thermalConductivity()
Returns the thermal conductivity of water at the current conditions (W/m/K)
Transport & operator=(const Transport &right)