Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LiquidTransportParams.cpp
Go to the documentation of this file.
1 /**
2  * @file LiquidTransportParams.cpp
3  * Source code for liquid mixture transport property evaluations.
4  */
5 
7 using namespace std;
8 
9 namespace Cantera
10 {
11 //! Exception thrown if an error is encountered while reading the transport database.
12 class LTPmodelError : public CanteraError
13 {
14 public:
15  explicit LTPmodelError(const std::string& msg) :
16  CanteraError("LTPspecies", "error parsing transport data: " + msg + "\n") {
17  }
18 };
19 
20 LiquidTransportParams::LiquidTransportParams() :
21  viscosity(0),
22  ionConductivity(0),
23  thermalCond(0),
24  speciesDiffusivity(0),
25  electCond(0),
26  hydroRadius(0),
27  model_viscosity(LTI_MODEL_NOTSET),
28  model_speciesDiffusivity(LTI_MODEL_NOTSET),
29  model_hydroradius(LTI_MODEL_NOTSET),
30  compositionDepTypeDefault_(LTI_MODEL_NOTSET)
31 {
32 }
33 
34 LiquidTransportParams::~LiquidTransportParams()
35 {
36  delete viscosity;
37  delete ionConductivity;
38  delete thermalCond;
39  delete speciesDiffusivity;
40  delete electCond;
41  delete hydroRadius;
42 }
43 
44 LiquidTransportParams::LiquidTransportParams(const LiquidTransportParams& right) :
45  viscosity(0),
46  thermalCond(0),
47  speciesDiffusivity(0),
48  electCond(0),
49  hydroRadius(0),
50  model_viscosity(LTI_MODEL_NOTSET),
51  model_speciesDiffusivity(LTI_MODEL_NOTSET),
52  model_hydroradius(LTI_MODEL_NOTSET),
53  compositionDepTypeDefault_(LTI_MODEL_NOTSET)
54 {
55  operator=(right);
56 }
57 
58 LiquidTransportParams& LiquidTransportParams::operator=(const LiquidTransportParams& right)
59 {
60  if (&right != this) {
61  return *this;
62  }
63 
64  LTData = right.LTData;
65 
66  delete viscosity;
67  if (right.viscosity) {
68  viscosity = new LiquidTranInteraction(*(right.viscosity));
69  }
70  delete ionConductivity;
71  if (right.ionConductivity) {
72  ionConductivity = new LiquidTranInteraction(*(right.ionConductivity));
73  }
74  deepStdVectorPointerCopy<LiquidTranInteraction>(right.mobilityRatio, mobilityRatio);
75  deepStdVectorPointerCopy<LiquidTranInteraction>(right.selfDiffusion, selfDiffusion);
76 
77  delete thermalCond;
78  if (right.thermalCond) {
79  thermalCond = new LiquidTranInteraction(*(right.thermalCond));
80  }
81  delete speciesDiffusivity;
82  if (right.speciesDiffusivity) {
83  speciesDiffusivity = new LiquidTranInteraction(*(right.speciesDiffusivity));
84  }
85 
86  delete electCond;
87  if (right.electCond) {
88  electCond = new LiquidTranInteraction(*(right.electCond));
89  }
90  delete hydroRadius;
91  if (right.hydroRadius) {
92  hydroRadius = new LiquidTranInteraction(*(right.hydroRadius));
93  }
94  model_viscosity = right.model_viscosity;
95  model_ionConductivity = right.model_ionConductivity;
96  deepStdVectorPointerCopy<LiquidTranMixingModel>(right.model_mobilityRatio, model_mobilityRatio);
97  deepStdVectorPointerCopy<LiquidTranMixingModel>(right.model_selfDiffusion, model_selfDiffusion);
98  thermalCond_Aij = right.thermalCond_Aij;
99  model_speciesDiffusivity = right.model_speciesDiffusivity;
100  diff_Dij = right.diff_Dij;
101  model_hydroradius = right.model_hydroradius;
102  radius_Aij = right.radius_Aij;
103  compositionDepTypeDefault_ = right.compositionDepTypeDefault_;
104 
105  throw CanteraError("LiquidTransportParams(const LiquidTransportParams &right)", "not tested");
106 
107  return *this;
108 }
109 
110 } //namespace Cantera
LiquidTranMixingModel model_ionConductivity
Model for species interaction effects for ionic conductivity Takes enum LiquidTranMixingModel.
DenseMatrix radius_Aij
Interaction associated with hydrodynamic radius.
std::vector< LiquidTranInteraction * > mobilityRatio
Vector of pointer to the LiquidTranInteraction object which handles the calculation of the mobility r...
LiquidTranMixingModel model_hydroradius
Model for species interaction effects for hydrodynamic radius Takes enum LiquidTranMixingModel.
LiquidTranInteraction * viscosity
Object that specifies the viscosity interaction for the mixture.
LiquidTranMixingModel model_speciesDiffusivity
Model for species interaction effects for mass diffusivity Takes enum LiquidTranMixingModel.
std::vector< LiquidTranInteraction * > selfDiffusion
Vector of pointer to the LiquidTranInteraction object which handles the calculation of each species' ...
Header file defining class LiquidTransportParams.
LiquidTranInteraction * ionConductivity
Object that specifes the ionic Conductivity of the mixture.
DenseMatrix thermalCond_Aij
Interaction associated with linear weighting of thermal conductivity.
LiquidTranMixingModel compositionDepTypeDefault_
Default composition dependence of the transport properties.
LiquidTranInteraction * speciesDiffusivity
Pointer to the LiquidTranInteraction object which handles the calculation of the species diffusivity ...
std::vector< Cantera::LiquidTransportData > LTData
Species transport parameters.
std::vector< LiquidTranMixingModel * > model_selfDiffusion
Model for species interaction effects for mobility ratio Takes enum LiquidTranMixingModel.
std::vector< LiquidTranMixingModel * > model_mobilityRatio
Model for species interaction effects for mobility ratio Takes enum LiquidTranMixingModel.
DenseMatrix diff_Dij
Interaction associated with linear weighting of thermal conductivity.
LiquidTranInteraction * hydroRadius
Pointer to the LiquidTranInteraction object which handles the calculation of the hydrodynamic radius ...
LiquidTranMixingModel model_viscosity
Model for species interaction effects for viscosity Takes enum LiquidTranMixingModel.
LiquidTranInteraction * thermalCond
Pointer to the LiquidTranInteraction object which handles the calculation of the mixture thermal cond...
LiquidTranInteraction * electCond
Pointer to the LiquidTranInteraction object which handles the calculation of the electrical conductiv...