OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fcst_constants.h
Go to the documentation of this file.
1 // ------------------------------------------------------------------
2 //
3 // $Id: fcst_constants.h 1354 2013-08-17 00:01:22Z secanell $
4 //
5 // Copyright (C) 2009 by Marc Secanell, University of Alberta.
6 //
7 // This file is subject to QPL and may not be distributed
8 // without copyright and license information. Please refer
9 // to the file deal.II/doc/license.html for the text and
10 // further information on this license.
11 //
12 // ------------------------------------------------------------------
13 
14 #ifndef _FCST_CONSTANTS_H_
15 #define _FCST_CONSTANTS_H_
16 
17 #include <deal.II/base/tensor.h>
18 #include <deal.II/base/symmetric_tensor.h>
19 
20 const unsigned int dim = deal_II_dimension;
21 
22 namespace Constants
23 {
25  extern inline double R() { return 8.314462176; }
26 
28  extern inline double F() { return 96483.399242424; }
29 
31  extern inline double Pi() { return 3.141592654; }
32 
34  extern inline double E0() { return 8.854187818e-12; }
35 
37  extern inline double K() { return 8.617332478e-5; }
38 
43  extern inline const dealii::Tensor<1,dim> gravity_acceleration()
44  {
45  dealii::Tensor<1,dim> result;
46  result[dim-1] = -9.81;
47  return result;
48  }
49 
53  extern inline const dealii::SymmetricTensor<2,dim> unit_tensor()
54  {
55  dealii::SymmetricTensor<2,dim> result;
56 
57  for(unsigned int i = 0; i < dim; ++i)
58  for(unsigned int j = 0; j < dim; ++j)
59  if( i == j )
60  result[i][j] = 1.0;
61 
62  return result;
63  }
64 }
65 
66 #endif