Memosa-FVM  0.2
SpeciesBC.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #include "FloatVarDict.h"
6 #include "AMG.h"
7 
8 template<class T>
9 struct SpeciesBC : public FloatVarDict<T>
10 {
12  {
13  this->defineVar("specifiedMassFraction",T(0.0));
14  this->defineVar("specifiedMassFlux",T(0.0));
15 
16  }
17  string bcType;
18 };
19 
20 template<class T>
21 struct SpeciesVC : public FloatVarDict<T>
22 {
24  {
25  this->defineVar("massDiffusivity",T(1.e-9));
26  this->defineVar("initialMassFraction",T(1.0));
27  }
28  string vcType;
29 };
30 
31 template<class T>
33 {
35  {
36  this->defineVar("A_coeff",T(1.0));
37  this->defineVar("B_coeff",T(0.0));
38  this->defineVar("ButlerVolmerRRConstant",T(5.0e-7));
39  this->defineVar("ButlerVolmerAnodeShellMeshID", int(-1));
40  this->defineVar("ButlerVolmerCathodeShellMeshID", int(-1));
41  this->defineVar("timeStep",T(0.1));
42  this->defineVar("interfaceUnderRelax",T(1.0));
43  this->relativeTolerance=1e-8;
44  this->absoluteTolerance=1e-16;
45  this->linearSolver = 0;
46  this->useCentralDifference=false;
47  this->transient = false;
48  this->ButlerVolmer = false;
50  }
55  bool transient;
58 
59 #ifndef SWIG
61  {
62  if (this->linearSolver == 0)
63  {
64  LinearSolver* ls(new AMG());
65  ls->relativeTolerance = 1e-1;
66  ls->nMaxIterations = 20;
67  ls->verbosity=0;
68  this->linearSolver = ls;
69  }
70  return *this->linearSolver ;
71  }
72 #endif
73 };
74 
double absoluteTolerance
Definition: SpeciesBC.h:52
int timeDiscretizationOrder
Definition: SpeciesBC.h:57
string bcType
Definition: SpeciesBC.h:17
Definition: AMG.h:27
void defineVar(const string varName, const T defaultValue)
Definition: FloatVarDict.h:94
double relativeTolerance
Definition: SpeciesBC.h:51
SpeciesVC()
Definition: SpeciesBC.h:23
int nMaxIterations
Definition: LinearSolver.h:31
double relativeTolerance
Definition: LinearSolver.h:33
LinearSolver & getLinearSolver()
Definition: SpeciesBC.h:60
string vcType
Definition: SpeciesBC.h:28
bool useCentralDifference
Definition: SpeciesBC.h:53
LinearSolver * linearSolver
Definition: SpeciesBC.h:54
SpeciesBC()
Definition: SpeciesBC.h:11