Memosa-FVM  0.2
FlowBC.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 "misc.h"
6 #include "FloatVarDict.h"
7 #include "AMG.h"
8 
9 template<class T>
10 struct FlowBC : public FloatVarDict<T>
11 {
13  {
14  this->defineVar("specifiedXVelocity",T(0.0));
15  this->defineVar("specifiedYVelocity",T(0.0));
16  this->defineVar("specifiedZVelocity",T(0.0));
17  this->defineVar("specifiedPressure",T(0.0));
18  this->defineVar("accomodationCoefficient",T(1.0));
19  }
20  string bcType;
21 };
22 
23 template<class T>
24 struct FlowVC : public FloatVarDict<T>
25 {
27  {
28  this->defineVar("viscosity",T(1e-3));
29  this->defineVar("density",T(1.0));
30  this->defineVar("eddyviscosity",T(1e-5));
31  this->defineVar("totalviscosity",T(2e-3));
32  }
33  string vcType;
34 };
35 
36 
37 template<class T>
38 struct FlowModelOptions : public FloatVarDict<T>
39 {
41  {
42  this->defineVar("initialXVelocity",T(0.0));
43  this->defineVar("initialYVelocity",T(0.0));
44  this->defineVar("initialZVelocity",T(0.0));
45  this->defineVar("initialPressure",T(0.0));
46  this->defineVar("momentumURF",T(0.7));
47  this->defineVar("velocityURF",T(1.0));
48  this->defineVar("pressureURF",T(0.3));
49  this->defineVar("timeStep",T(0.1));
50  this->defineVar("operatingPressure",T(101325.0));
51  this->defineVar("operatingTemperature",T(300.0));
52  this->defineVar("molecularWeight",T(28.966));
53 
54  this->momentumTolerance=1e-3;
55  this->continuityTolerance=1e-3;
56  this->printNormalizedResiduals = true;
57  this->transient = false;
58  this->correctVelocity = true;
60  this->momentumLinearSolver = 0;
61  this->pressureLinearSolver = 0;
62  this->coupledLinearSolver = 0;
63 
64  this->incompressible = true;
65  this->turbulent = false;
66  this->vk = 0.4187;
67  this->emp = 9.793;
68  this-> cmu = 0.09;
69 
70 
71  }
72 
76  bool transient;
77  bool turbulent;
83  double cmu;
84  double vk;
85  double emp;
87 #ifndef SWIG
89  {
90  if (this->momentumLinearSolver == 0)
91  {
92  LinearSolver* ls(new AMG());
93  ls->relativeTolerance = 1e-1;
94  ls->nMaxIterations = 20;
95  ls->verbosity=0;
96  this->momentumLinearSolver = ls;
97  }
98  return *this->momentumLinearSolver ;
99  }
100 
102  {
103  if (this->pressureLinearSolver == 0)
104  {
105  LinearSolver* ls(new AMG());
106  ls->relativeTolerance = 1e-1;
107  ls->nMaxIterations = 20;
108  ls->verbosity=0;
109  this->pressureLinearSolver = ls;
110  }
111  return *this->pressureLinearSolver ;
112  }
113 #endif
114 };
115 
FlowBC()
Definition: FlowBC.h:12
LinearSolver & getPressureLinearSolver()
Definition: FlowBC.h:101
bool incompressible
Definition: FlowBC.h:86
FlowModelOptions()
Definition: FlowBC.h:40
double momentumTolerance
Definition: FlowBC.h:74
Definition: FlowBC.h:10
string bcType
Definition: FlowBC.h:20
bool turbulent
Definition: FlowBC.h:77
double emp
Definition: FlowBC.h:85
LinearSolver * coupledLinearSolver
Definition: FlowBC.h:82
double cmu
Definition: FlowBC.h:83
FlowVC()
Definition: FlowBC.h:26
string vcType
Definition: FlowBC.h:33
Definition: AMG.h:27
void defineVar(const string varName, const T defaultValue)
Definition: FloatVarDict.h:94
LinearSolver * momentumLinearSolver
Definition: FlowBC.h:80
int nMaxIterations
Definition: LinearSolver.h:31
Definition: FlowBC.h:24
double relativeTolerance
Definition: LinearSolver.h:33
bool correctVelocity
Definition: FlowBC.h:78
int timeDiscretizationOrder
Definition: FlowBC.h:79
bool printNormalizedResiduals
Definition: FlowBC.h:73
LinearSolver & getMomentumLinearSolver()
Definition: FlowBC.h:88
double vk
Definition: FlowBC.h:84
double continuityTolerance
Definition: FlowBC.h:75
LinearSolver * pressureLinearSolver
Definition: FlowBC.h:81