Memosa-FVM  0.2
phononbase/COMETBC.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 _COMETBC_H_
6 #define _COMETBC_H_
7 
8 #include "misc.h"
9 #include "FloatVarDict.h"
10 #include "KSConnectivity.h"
11 
12 template<class T>
13 struct COMETBC : public FloatVarDict<T>
14 {
16  {
17  this->defineVar("specifiedTemperature",T(300.0));
18  this->defineVar("specifiedReflection",T(0.0));
19  this->defineVar("FullyImplicit",false);
20  this->InterfaceModel="DMM";
21  this->bcType="temperature"; //-- if it is not specified, default is interface
22  }
23  string bcType;
25 };
26 
27 template<class T>
28 struct COMETModelOptions : public FloatVarDict<T>
29 {
31  {
32  this->defineVar("timeStep",T(0.1));
33  this->defineVar("initialTemperature",T(310.0));
34  this->defineVar("Tref",T(299.0));
35  this->printNormalizedResiduals = true;
36  this->transient = false;
38  this->absTolerance=1e-8;
39  this->relTolerance=1-4;
40  this->showResidual=5;
41  this->maxLevels=2;
42  this->AgglomerationMethod="FaceArea";
43  this->preSweeps=0;
44  this->postSweeps=2;
45  this->relFactor=.1;
46  this->withNormal=false;
47  this->NewtonTol=1e-4;
48  this->BinsPerBand=10;
49  this->Convection="FirstOrder";
50  this->DomainStats="Quiet";
51  this->minNewton=0;
52  this->maxNewton=15;
53  this->Scattering="SMRT";
54  this->Source=false;
55  }
56 
58  bool transient;
60  double absTolerance;
61  double relTolerance;
62  int showResidual;
63  int maxLevels;
64  string AgglomerationMethod;
65  int preSweeps;
66  int postSweeps;
67  double relFactor;
68  bool withNormal;
69  double NewtonTol;
71  string Convection;
72  string DomainStats;
73  int minNewton;
74  int maxNewton;
75  string Scattering;
76  bool Source;
77 
78 };
79 
80 template<class T>
81 struct COMETIC
82 {
85  typedef vector<TKCptr> TKClist;
86 
87  COMETIC(const int mID0, const int fID0, const int mID1, const int fID1, const int faceNumber)
88  {
89  this->InterfaceModel="DMM";
90  this->MeshID0=mID0;
91  this->FgID0=fID0;
92  this->MeshID1=mID1;
93  this->FgID1=fID1;
94  this->FineToCoarse0=NULL;
95  this->FineToCoarse1=NULL;
96  }
97 
98  const TKClist& getKConnectivity(const int fgid) const
99  {
100  if(fgid==FgID0)
101  return Connect0to1;
102  else if (fgid==FgID1)
103  return Connect1to0;
104 
105  throw CException("FaceGroup not apart of this interface!");
106  };
107 
108  TKClist& getKConnectivity(const int fgid)
109  {
110  if(fgid==FgID0)
111  return Connect0to1;
112  else if (fgid==FgID1)
113  return Connect1to0;
114 
115  throw CException("FaceGroup not apart of this interface!");
116  };
117 
118  int getSelfFaceID(const int mesh)
119  {
120  if(mesh==MeshID0)
121  return FgID0;
122  else if(mesh==MeshID1)
123  return FgID1;
124 
125  throw CException("Mesh not apart of this interface!");
126  }
127 
129  {
130 
131  if(!Connect0to1.empty())
132  {
133  for(int i=0;i<int(Connect0to1.size());i++)
134  {
135  //Connect0to1[i]->emptyConnections();
136  delete Connect0to1[i];
137  //Connect1to0[i]->emptyConnections();
138  delete Connect1to0[i];
139  }
140 
141  Connect0to1.clear();
142  Connect1to0.clear();
143  }
144 
145  }
146 
150  int MeshID0;
151  int FgID0;
152  int MeshID1;
153  int FgID1;
154  Array<int>* FineToCoarse0; //to be added to the finer model
156 
157 };
158 
159 #endif
TKConnectivity * TKCptr
KSConnectivity< T > TKConnectivity
TKClist Connect1to0
TKClist Connect0to1
Array< int > * FineToCoarse1
void defineVar(const string varName, const T defaultValue)
Definition: FloatVarDict.h:94
vector< TKCptr > TKClist
int getSelfFaceID(const int mesh)
string InterfaceModel
string bcType
TKClist & getKConnectivity(const int fgid)
string InterfaceModel
void clearConnections()
Array< int > * FineToCoarse0
COMETIC(const int mID0, const int fID0, const int mID1, const int fID1, const int faceNumber)
const TKClist & getKConnectivity(const int fgid) const