Memosa-FVM  0.2
IdealGasDensityModel.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 #ifndef _IDEALGASDENSITYMODEL_H_
6 #define _IDEALGASDENSITYMODEL_H_
7 
8 #include "Model.h"
9 
10 #include "GeomFields.h"
11 #include "FlowFields.h"
12 
13 #include "Mesh.h"
14 #include "LinearSolver.h"
15 
16 
17 #include "misc.h"
18 #include "FloatVarDict.h"
19 
20 
21 
22 template<class T>
23 struct IdealGasVC : public FloatVarDict<T>
24 {
26  {
27  this->defineVar("pressure",T(0.0));
28  this->defineVar("operatingPressure",T(101325.0));
29  this->defineVar("temperature",T(300.0));
30  this->defineVar("molecularWeight",T(28.966));
31  this->defineVar("urf",T(1.0));
32 
33  }
34 };
35 
36 
37 template<class T>
39 {
40 public:
41 
42  typedef std::map<int,IdealGasVC<T>*> VCMap;
43 
44  class Impl;
45 
46 
47  IdealGasDensityModel(const GeomFields& geomFields,
48  FlowFields& thermalFields, const MeshList& meshes);
49 
50  virtual ~IdealGasDensityModel();
51 
52  virtual void init();
53 
54  VCMap& getVCMap();
55 
56  // do the specified number of iterations, return true if converged
57  bool advance(const int niter);
58 
59 private:
60  shared_ptr<Impl> _impl;
61 };
62 
63 
64 #endif
std::map< int, IdealGasVC< T > * > VCMap
void defineVar(const string varName, const T defaultValue)
Definition: FloatVarDict.h:94
Definition: Model.h:13
shared_ptr< Impl > _impl
IdealGasDensityModel(const GeomFields &geomFields, FlowFields &thermalFields, const MeshList &meshes)
bool advance(const int niter)
vector< Mesh * > MeshList
Definition: Mesh.h:439