Cantera  2.4.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 {
24  // The expectation is that we have a VPStandardStateTP derived object
25  VPStandardStateTP* vpthermo = dynamic_cast<VPStandardStateTP*>(m_thermo);
26  if (!vpthermo) {
27  WaterSSTP* wsstp = dynamic_cast<WaterSSTP*>(m_thermo);
28  if (!wsstp) {
29  throw CanteraError("WaterTransport::initTP()",
30  "Expectation is that ThermoPhase be a VPStandardStateTP");
31  } else {
32  m_sub = wsstp->getWater();
33  AssertTrace(m_sub != 0);
34  // Get a pointer to a changeable WaterProps object
35  m_waterProps = wsstp->getWaterProps();
37  }
38  } else {
39  m_waterPDSS = dynamic_cast<PDSS_Water*>(vpthermo->providePDSS(0));
40  if (!m_waterPDSS) {
41  throw CanteraError("WaterTransport::initTP()",
42  "Expectation is that first species be water with a PDSS_Water object");
43  }
44  // Get a pointer to a changeable WaterPropsIAPWS object
46  AssertTrace(m_sub != 0);
47  // Get a pointer to a changeable WaterProps object
50  }
51 }
52 
54 {
55  return m_waterProps->viscosityWater();
56 }
57 
59 {
61 }
62 
63 }
WaterProps * getWaterProps()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: WaterSSTP.h:229
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.
STL namespace.
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:224
WaterPropsIAPWS * getWater()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: PDSS_Water.h:142
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:147
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:280
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 ...
#define AssertTrace(expr)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:233
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:330
WaterProps * m_waterProps
Pointer to the WaterProps object.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
virtual doublereal thermalConductivity()
Returns the thermal conductivity of water at the current conditions (W/m/K)