antioch-0.4.0
transport_species.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 //
27 // $Id$
28 //
29 //--------------------------------------------------------------------------
30 //--------------------------------------------------------------------------
31 
32 #ifndef ANTIOCH_TRANSPORT_SPECIES_H
33 #define ANTIOCH_TRANSPORT_SPECIES_H
34 
35 // Antioch
39 
40 // C++
41 #include <vector>
42 #include <iostream>
43 #include <limits>
44 
45 namespace Antioch
46 {
47 
48  typedef unsigned int Species;
49 
51 
57  template<typename CoeffType=double>
59  {
60  public:
61 
63  TransportSpecies(const Species name,
64  const CoeffType LJ_depth,
65  const CoeffType LJ_diameter,
66  const CoeffType dipole_moment,
67  const CoeffType polarizability,
68  const CoeffType rot_relax,
69  const CoeffType mass);
70 
72 
79 
82 
84  Species species() const;
85 
87  CoeffType LJ_depth() const;
88 
90  CoeffType LJ_diameter() const;
91 
94 
96  CoeffType dipole_moment() const;
97 
99  CoeffType polarizability() const;
100 
102  CoeffType rotational_relaxation() const;
103 
105  CoeffType M() const;
106 
108  bool polar() const;
109 
111 
114  void print(std::ostream &os = std::cout) const;
115 
117 
120  friend std::ostream& operator<<( std::ostream& os,
121  const TransportSpecies<CoeffType>& species )
122  {
123  species.print(os);
124  return os;
125  }
126 
127  protected:
128 
130  const Species _name;
131 
134 
136  CoeffType _dipole_moment;
137 
139  CoeffType _polarizability;
140 
143 
145  CoeffType _mass;
146 
147  }; // class TransportSpecies
148 
149 
150  /* ------------------------- Friend Functions ------------------------- */
151 
152 
153 
154  /* ------------------------- Inline Functions ------------------------- */
155 
156  template<typename CoeffType>
157  inline
159  { return _name; }
160 
161  template<typename CoeffType>
162  inline
164  { return _LJ.depth(); }
165 
166  template<typename CoeffType>
167  inline
169  { return _LJ.diameter(); }
170 
171  template<typename CoeffType>
172  inline
174  {
175  return _LJ;
176  }
177 
178  template<typename CoeffType>
179  inline
181  { return _dipole_moment; }
182 
183  template<typename CoeffType>
184  inline
186  { return _polarizability; }
187 
188  template<typename CoeffType>
189  inline
191  { return _rotational_relaxation; }
192 
193  template<typename CoeffType>
194  inline
196  { return _mass; }
197 
198  template<typename CoeffType>
199  inline
201  {
202  return (_dipole_moment > std::numeric_limits<CoeffType>::epsilon());
203  }
204 
205  template<typename CoeffType>
206  inline
208  const CoeffType LJ_depth,
209  const CoeffType LJ_diameter,
210  const CoeffType dipole_moment,
211  const CoeffType polarizability,
212  const CoeffType rotational_relaxation,
213  const CoeffType mass)
214  : _name (name),
215  _LJ (LJ_depth,LJ_diameter),
216  _dipole_moment (dipole_moment),
217  _polarizability (polarizability),
218  _rotational_relaxation (rotational_relaxation),
219  _mass (mass)
220  {
221  return;
222  }
223 
224 
225  template<typename CoeffType>
226  inline
228  : _name(-1),
229  _LJ(0.,0.),
230  _polarizability(0.),
231  _rotational_relaxation(0.)
232  {
233  antioch_error();
234  return;
235  }
236 
237 
238  template<typename CoeffType>
239  inline
241  {
242  return;
243  }
244 
245 
246  template<typename CoeffType>
247  inline
248  void TransportSpecies<CoeffType>::print (std::ostream &os) const
249  {
250  os << " -----------------------------\n"
251  << "| Species enum " << this->species() << '\n'
252  << "| Transport data " << '\n'
253  << " -----------------------------\n"
254  << std::scientific
255  << " LJ depth = " << this->LJ_depth() << '\n'
256  << " LJ diameter = " << this->LJ_diameter() << '\n'
257  << " polarizability = " << this->polarizability() << '\n'
258  << " rot relax = " << this->rotational_relaxation() << '\n';
259 
260  os << '\n';
261 
262  return;
263  }
264 
265 
266 } // end namespace Antioch
267 
268 #endif // ANTIOCH_CHEMICAL_SPECIES_H
unsigned int Species
CoeffType LJ_depth() const
returns the Lennard-Jones depth in (K), this is .
CoeffType polarizability() const
Returns polarizability in units of [Angström^3].
CoeffType dipole_moment() const
returns dipole moment in units of [D]
TransportSpecies()
Default constructor.
bool polar() const
boolean testing polarity
CoeffType _mass
molar mass in kg/mol
Class to encapsulate data relevant for transport for each chemical species.
CoeffType M() const
Returns molecular mass in kg.
#define antioch_error()
CoeffType _polarizability
Polarizability in units of [Angström^3].
const Species _name
chemical species
CoeffType LJ_diameter() const
returns the Lennard-Jones diameter in (Angström).
void print(std::ostream &os=std::cout) const
Formatted print.
CoeffType _rotational_relaxation
Rotational relaxation.
LennardJonesPotential< CoeffType > _LJ
Lennard-Jones potential.
CoeffType rotational_relaxation() const
Returns rotational relaxation collision number at 298 K, no unit.
LennardJonesPotential< CoeffType > & LJ() const
return Lennard-Jones potential
The parameters are reduced parameters.
Species species() const
returns a descriptive name for this species.
friend std::ostream & operator<<(std::ostream &os, const TransportSpecies< CoeffType > &species)
Formatted print.
CoeffType _dipole_moment
Dipole moment in units of [D].

Generated on Thu Jul 7 2016 11:09:46 for antioch-0.4.0 by  doxygen 1.8.8