Cantera  2.4.0
LiquidTransportData.cpp
Go to the documentation of this file.
1 /**
2  * @file LiquidTransportData.cpp
3  * Source code for liquid transport property evaluations.
4  */
5 
6 // This file is part of Cantera. See License.txt in the top-level directory or
7 // at http://www.cantera.org/license.txt for license and copyright information.
8 
10 using namespace std;
11 
12 namespace Cantera
13 {
14 LiquidTransportData::LiquidTransportData() :
15  speciesName("-"),
16  hydroRadius(0),
17  viscosity(0),
18  ionConductivity(0),
19  thermalCond(0),
20  electCond(0),
21  speciesDiffusivity(0)
22 {
23  warn_deprecated("class LiquidTransportData", "To be removed after Cantera 2.4");
24 }
25 
26 LiquidTransportData::LiquidTransportData(const LiquidTransportData& right) :
27  speciesName("-"),
28  hydroRadius(0),
29  viscosity(0),
30  ionConductivity(0),
31  thermalCond(0),
32  electCond(0),
33  speciesDiffusivity(0)
34 {
35  *this = right; //use assignment operator to do other work
36 }
37 
38 LiquidTransportData& LiquidTransportData::operator=(const LiquidTransportData& right)
39 {
40  if (&right != this) {
41  // These are all shallow pointer copies - yes, yes, yes horrible crime.
42  speciesName = right.speciesName;
43  if (right.hydroRadius) {
44  hydroRadius = (right.hydroRadius)->duplMyselfAsLTPspecies();
45  }
46  if (right.viscosity) {
47  viscosity = (right.viscosity)->duplMyselfAsLTPspecies();
48  }
49  if (right.ionConductivity) {
50  ionConductivity = (right.ionConductivity)->duplMyselfAsLTPspecies();
51  }
52 
53  mobilityRatio = right.mobilityRatio;
54  for (size_t k = 0; k < mobilityRatio.size(); k++) {
55  if (right.mobilityRatio[k]) {
56  mobilityRatio[k] = (right.mobilityRatio[k])->duplMyselfAsLTPspecies();
57  }
58  }
59 
60  selfDiffusion = right.selfDiffusion;
61  for (size_t k = 0; k < selfDiffusion.size(); k++) {
62  if (right.selfDiffusion[k]) {
63  selfDiffusion[k] = (right.selfDiffusion[k])->duplMyselfAsLTPspecies();
64  }
65  }
66 
67  if (right.thermalCond) {
68  thermalCond = (right.thermalCond)->duplMyselfAsLTPspecies();
69  }
70  if (right.electCond) {
71  electCond = (right.electCond)->duplMyselfAsLTPspecies();
72  }
73  if (right.speciesDiffusivity) {
74  speciesDiffusivity = (right.speciesDiffusivity)->duplMyselfAsLTPspecies();
75  }
76  }
77  return *this;
78 }
79 
80 LiquidTransportData::~LiquidTransportData()
81 {
82  delete hydroRadius;
83  delete viscosity;
84  delete ionConductivity;
85 
86  for (size_t k = 0; k < mobilityRatio.size(); k++) {
87  delete mobilityRatio[k];
88  }
89  for (size_t k = 0; k < selfDiffusion.size(); k++) {
90  delete selfDiffusion[k];
91  }
92 
93  delete thermalCond;
94  delete electCond;
95  delete speciesDiffusivity;
96 }
97 
98 }
LTPspecies * thermalCond
Model type for the thermal conductivity.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
STL namespace.
LTPspecies * speciesDiffusivity
Model type for the speciesDiffusivity.
Header file defining class LiquidTransportData.
LTPspecies * electCond
Model type for the electrical conductivity.
std::string speciesName
A LiquidTransportData object is instantiated for each species.
std::vector< LTPspecies * > mobilityRatio
Model type for the mobility ratio.
LTPspecies * hydroRadius
Model type for the hydroradius.
std::vector< LTPspecies * > selfDiffusion
Model type for the self diffusion coefficients.
LTPspecies * viscosity
Model type for the viscosity.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
LTPspecies * ionConductivity
Model type for the ionic conductivity.