Memosa-FVM  0.2
ThermalModel_impl.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 "Mesh.h"
6 #include <sstream>
7 
8 #include "NumType.h"
9 #include "Array.h"
10 #include "Field.h"
11 #include "CRConnectivity.h"
12 #include "LinearSystem.h"
13 //#include "FieldSet.h"
14 #include "StorageSite.h"
15 #include "MultiFieldMatrix.h"
16 #include "CRMatrix.h"
17 #include "FluxJacobianMatrix.h"
18 #include "DiagonalMatrix.h"
19 #include "GenericBCS.h"
20 #include "Vector.h"
23 #include "AMG.h"
24 #include "Linearizer.h"
25 #include "GradientModel.h"
27 #include "SourceDiscretization.h"
29 
30 template<class T>
31 class ThermalModel<T>::Impl
32 {
33 public:
34  typedef Array<T> TArray;
40 
41  Impl(const GeomFields& geomFields,
42  ThermalFields& thermalFields,
43  const MeshList& meshes) :
44  _meshes(meshes),
45  _geomFields(geomFields),
46  _thermalFields(thermalFields),
47  _temperatureGradientModel(_meshes,_thermalFields.temperature,
48  _thermalFields.temperatureGradient,_geomFields),
49  _initialNorm(),
50  _niters(0)
51  {
52  const int numMeshes = _meshes.size();
53  for (int n=0; n<numMeshes; n++)
54  {
55  const Mesh& mesh = *_meshes[n];
56  ThermalVC<T> *vc(new ThermalVC<T>());
57  vc->vcType = "flow";
58  _vcMap[mesh.getID()] = vc;
59 
60  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
61  {
62  const FaceGroup& fg = *fgPtr;
63  ThermalBC<T> *bc(new ThermalBC<T>());
64 
65  _bcMap[fg.id] = bc;
66 
67  if ((fg.groupType == "wall") ||
68  (fg.groupType == "symmetry"))
69  {
70  bc->bcType = "SpecifiedHeatFlux";
71  }
72  else if ((fg.groupType == "velocity-inlet") ||
73  (fg.groupType == "pressure-outlet"))
74  {
75  bc->bcType = "SpecifiedTemperature";
76  }
77  else
78  throw CException("ThermalModel: unknown face group type "
79  + fg.groupType);
80  }
81  }
82  }
83 
84  void init()
85  {
86  const int numMeshes = _meshes.size();
87  for (int n=0; n<numMeshes; n++)
88  {
89  const Mesh& mesh = *_meshes[n];
90 
91  const StorageSite& cells = mesh.getCells();
92  const ThermalVC<T>& vc = *_vcMap[mesh.getID()];
93 
94  //temperature
95  shared_ptr<TArray> tCell(new TArray(cells.getCountLevel1()));
96  *tCell = _options["initialTemperature"];
97  _thermalFields.temperature.addArray(cells,tCell);
98 
99  if(_options.transient)
100  {
101  _thermalFields.temperatureN1.addArray(cells, dynamic_pointer_cast<ArrayBase>(tCell->newCopy()));
102  if (_options.timeDiscretizationOrder > 1)
103  _thermalFields.temperatureN2.addArray(cells, dynamic_pointer_cast<ArrayBase>(tCell->newCopy()));
104  }
105 
106  //conductivity
107  shared_ptr<TArray> condCell(new TArray(cells.getCountLevel1()));
108  *condCell = vc["thermalConductivity"];
109  _thermalFields.conductivity.addArray(cells,condCell);
110 
111  //source
112  shared_ptr<TArray> sCell(new TArray(cells.getCountLevel1()));
113  *sCell = T(0.);
114  _thermalFields.source.addArray(cells,sCell);
115 
116  //create a zero field
117  shared_ptr<TArray> zeroCell(new TArray(cells.getCountLevel1()));
118  *zeroCell = T(0.0);
119  _thermalFields.zero.addArray(cells,zeroCell);
120 
121  //create a one field
122  shared_ptr<TArray> oneCell(new TArray(cells.getCountLevel1()));
123  *oneCell = T(1.0);
124  _thermalFields.one.addArray(cells,oneCell);
125 
126  //create specific heat field rho*Cp
127  shared_ptr<TArray> cp(new TArray(cells.getCount()));
128  *cp = vc["density"] * vc["specificHeat"];
129  _thermalFields.specificHeat.addArray(cells, cp);
130 
131  //initial temparature gradient array
132  shared_ptr<TGradArray> gradT(new TGradArray(cells.getCountLevel1()));
133  gradT->zero();
134  _thermalFields.temperatureGradient.addArray(cells,gradT);
135 
136  //inital convection flux at faces
137 
138  const StorageSite& allFaces = mesh.getFaces();
139  shared_ptr<TArray> convFlux(new TArray(allFaces.getCount()));
140  convFlux->zero();
141  _thermalFields.convectionFlux.addArray(allFaces,convFlux);
142 
143  //heat flux at faces
144  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
145  {
146  const FaceGroup& fg = *fgPtr;
147  const StorageSite& faces = fg.site;
148 
149  shared_ptr<TArray> fluxFace(new TArray(faces.getCount()));
150 
151  fluxFace->zero();
152  _thermalFields.heatFlux.addArray(faces,fluxFace);
153 
154  }
155  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
156  {
157  const FaceGroup& fg = *fgPtr;
158  const StorageSite& faces = fg.site;
159 
160  shared_ptr<TArray> fluxFace(new TArray(faces.getCount()));
161 
162  fluxFace->zero();
163  _thermalFields.heatFlux.addArray(faces,fluxFace);
164 
165  }
166 
167 
168  }
169  _thermalFields.conductivity.syncLocal();
170  _niters =0;
171  _initialNorm = MFRPtr();
172  }
173 
174  ThermalBCMap& getBCMap() {return _bcMap;}
175  ThermalVCMap& getVCMap() {return _vcMap;}
176 
177  ThermalBC<T>& getBC(const int id) {return *_bcMap[id];}
178 
179  ThermalModelOptions<T>& getOptions() {return _options;}
180 
182  {
183  const int numMeshes = _meshes.size();
184  for (int n=0; n<numMeshes; n++)
185  {
186  const Mesh& mesh = *_meshes[n];
187 
188  const StorageSite& cells = mesh.getCells();
189  MultiField::ArrayIndex tIndex(&_thermalFields.temperature,&cells);
190 
191  ls.getX().addArray(tIndex,_thermalFields.temperature.getArrayPtr(cells));
192 
193  const CRConnectivity& cellCells = mesh.getCellCells();
194 
195  shared_ptr<Matrix> m(new CRMatrix<T,T,T>(cellCells));
196 
197  ls.getMatrix().addMatrix(tIndex,tIndex,m);
198 
199  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
200  {
201  const FaceGroup& fg = *fgPtr;
202  const StorageSite& faces = fg.site;
203 
204  MultiField::ArrayIndex fIndex(&_thermalFields.heatFlux,&faces);
205  ls.getX().addArray(fIndex,_thermalFields.heatFlux.getArrayPtr(faces));
206 
207  const CRConnectivity& faceCells = mesh.getFaceCells(faces);
208 
209  shared_ptr<Matrix> mft(new FluxJacobianMatrix<T,T>(faceCells));
210  ls.getMatrix().addMatrix(fIndex,tIndex,mft);
211 
212  shared_ptr<Matrix> mff(new DiagonalMatrix<T,T>(faces.getCount()));
213  ls.getMatrix().addMatrix(fIndex,fIndex,mff);
214  }
215 
216  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
217  {
218  const FaceGroup& fg = *fgPtr;
219  const StorageSite& faces = fg.site;
220 
221  MultiField::ArrayIndex fIndex(&_thermalFields.heatFlux,&faces);
222  ls.getX().addArray(fIndex,_thermalFields.heatFlux.getArrayPtr(faces));
223 
224  const CRConnectivity& faceCells = mesh.getFaceCells(faces);
225 
226  shared_ptr<Matrix> mft(new FluxJacobianMatrix<T,T>(faceCells));
227  ls.getMatrix().addMatrix(fIndex,tIndex,mft);
228 
229  shared_ptr<Matrix> mff(new DiagonalMatrix<T,T>(faces.getCount()));
230  ls.getMatrix().addMatrix(fIndex,fIndex,mff);
231  }
232 
233  }
234  }
235 
237  {
238  _temperatureGradientModel.compute();
239 
240  DiscrList discretizations;
241 
242  shared_ptr<Discretization>
244  (_meshes,_geomFields,
245  _thermalFields.temperature,
246  _thermalFields.conductivity,
247  _thermalFields.temperatureGradient));
248  discretizations.push_back(dd);
249 
250  shared_ptr<Discretization>
252  (_meshes,_geomFields,
253  _thermalFields.temperature,
254  _thermalFields.convectionFlux,
255  _thermalFields.zero,
256  _thermalFields.temperatureGradient,
257  _options.useCentralDifference));
258  discretizations.push_back(cd);
259 
260 
261  shared_ptr<Discretization>
263  (_meshes,
264  _geomFields,
265  _thermalFields.temperature,
266  _thermalFields.source));
267  discretizations.push_back(sd);
268 
269  if (_options.transient)
270  {
271  shared_ptr<Discretization>
273  (_meshes, _geomFields,
274  _thermalFields.temperature,
275  _thermalFields.temperatureN1,
276  _thermalFields.temperatureN2,
277  _thermalFields.specificHeat,
278  _options["timeStep"]));
279  discretizations.push_back(td);
280  }
281 
282  shared_ptr<Discretization>
284  (_meshes,_geomFields,_thermalFields.temperature));
285 
286  discretizations.push_back(ibm);
287 
288 
289  Linearizer linearizer;
290 
291  linearizer.linearize(discretizations,_meshes,ls.getMatrix(),
292  ls.getX(), ls.getB());
293 
294  const int numMeshes = _meshes.size();
295  for (int n=0; n<numMeshes; n++)
296  {
297  const Mesh& mesh = *_meshes[n];
298 
299  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
300  {
301  const FaceGroup& fg = *fgPtr;
302  const StorageSite& faces = fg.site;
303 
304  const ThermalBC<T>& bc = *_bcMap[fg.id];
305 
306 
307  GenericBCS<T,T,T> gbc(faces,mesh,
308  _geomFields,
309  _thermalFields.temperature,
310  _thermalFields.heatFlux,
311  ls.getMatrix(), ls.getX(), ls.getB());
312 
313  if (bc.bcType == "SpecifiedTemperature")
314  {
316  bT(bc.getVal("specifiedTemperature"),faces);
317  if (_thermalFields.convectionFlux.hasArray(faces))
318  {
319  const TArray& convectingFlux =
320  dynamic_cast<const TArray&>
321  (_thermalFields.convectionFlux[faces]);
322  const int nFaces = faces.getCount();
323 
324  for(int f=0; f<nFaces; f++)
325  {
326  if (convectingFlux[f] > 0.)
327  {
328  gbc.applyExtrapolationBC(f);
329  }
330  else
331  {
332  gbc.applyDirichletBC(f,bT[f]);
333  }
334  }
335  }
336  else
337  gbc.applyDirichletBC(bT);
338  }
339  else if (bc.bcType == "SpecifiedHeatFlux")
340  {
342  bHeatFlux(bc.getVal("specifiedHeatFlux"),faces);
343 
344  const int nFaces = faces.getCount();
345 
346  for(int f=0; f<nFaces; f++)
347  {
348  gbc.applyNeumannBC(f, bHeatFlux[f]);
349  }
350  }
351  else if (bc.bcType == "Symmetry")
352  {
353  T zeroFlux(NumTypeTraits<T>::getZero());
354  gbc.applyNeumannBC(zeroFlux);
355  }
356  else if (bc.bcType == "Convective")
357  {
358  FloatValEvaluator<T> hCoeff(bc.getVal("convectiveCoefficient"), faces);
359  FloatValEvaluator<T> Xinf(bc.getVal("farFieldTemperature"), faces);
360  const int nFaces = faces.getCount();
361  for(int f=0; f<nFaces; f++)
362  gbc.applyConvectionBC(f, hCoeff[f], Xinf[f]);
363  }
364  else if (bc.bcType == "Radiative")
365  {
366  FloatValEvaluator<T> emissivity(bc.getVal("surfaceEmissivity"), faces);
367  FloatValEvaluator<T> Xinf(bc.getVal("farFieldTemperature"), faces);
368  const int nFaces = faces.getCount();
369  for(int f=0; f<nFaces; f++)
370  gbc.applyRadiationBC(f, emissivity[f], Xinf[f]);
371  }
372  else if (bc.bcType == "Mixed")
373  {
374  FloatValEvaluator<T> hCoeff(bc.getVal("convectiveCoefficient"), faces);
375  FloatValEvaluator<T> emissivity(bc.getVal("surfaceEmissivity"), faces);
376  FloatValEvaluator<T> Xinf(bc.getVal("farFieldTemperature"), faces);
377  const int nFaces = faces.getCount();
378  for(int f=0; f<nFaces; f++)
379  gbc.applyMixedBC(f, hCoeff[f], emissivity[f], Xinf[f]);
380  }
381  else
382  throw CException(bc.bcType + " not implemented for ThermalModel");
383  }
384 
385  foreach(const FaceGroupPtr fgPtr, mesh.getInterfaceGroups())
386  {
387  const FaceGroup& fg = *fgPtr;
388  const StorageSite& faces = fg.site;
389  GenericBCS<T,T,T> gbc(faces,mesh,
390  _geomFields,
391  _thermalFields.temperature,
392  _thermalFields.heatFlux,
393  ls.getMatrix(), ls.getX(), ls.getB());
394 
395  gbc.applyInterfaceBC();
396  }
397  }
398  }
399 
400  T getHeatFluxIntegral(const Mesh& mesh, const int faceGroupId)
401  {
402  T r(0.);
403  bool found = false;
404  foreach(const FaceGroupPtr fgPtr, mesh.getBoundaryFaceGroups())
405  {
406  const FaceGroup& fg = *fgPtr;
407  if (fg.id == faceGroupId)
408  {
409  const StorageSite& faces = fg.site;
410  const int nFaces = faces.getCount();
411  const TArray& heatFlux =
412  dynamic_cast<const TArray&>(_thermalFields.heatFlux[faces]);
413  for(int f=0; f<nFaces; f++)
414  r += heatFlux[f];
415  found=true;
416  }
417  }
418  if (!found)
419  throw CException("getHeatFluxIntegral: invalid faceGroupID");
420  return r;
421  }
422 
423 
424  void advance(const int niter)
425  {
426  for(int n=0; n<niter; n++)
427  {
428  LinearSystem ls;
429  initLinearization(ls);
430 
431  ls.initAssembly();
432 
433  linearize(ls);
434 
435  ls.initSolve();
436 
437  MFRPtr rNorm(_options.getLinearSolver().solve(ls));
438 
439  if (!_initialNorm) _initialNorm = rNorm;
440 
441  MFRPtr normRatio((*rNorm)/(*_initialNorm));
442 
443  cout << _niters << ": " << *rNorm << endl;
444 
445 
446  _options.getLinearSolver().cleanup();
447 
448  ls.postSolve();
449  ls.updateSolution();
450 
451  _niters++;
452  if (*rNorm < _options.absoluteTolerance ||
453  *normRatio < _options.relativeTolerance)
454  break;
455  }
456  }
457 
458  void printBCs()
459  {
460  foreach(typename ThermalBCMap::value_type& pos, _bcMap)
461  {
462  cout << "Face Group " << pos.first << ":" << endl;
463  cout << " bc type " << pos.second->bcType << endl;
464  foreach(typename ThermalBC<T>::value_type& vp, *pos.second)
465  {
466  cout << " " << vp.first << " " << vp.second.constant << endl;
467  }
468  }
469  }
470 
471 
472  void updateTime()
473  {
474  const int numMeshes = _meshes.size();
475  for (int n=0; n<numMeshes; n++) {
476 
477  const Mesh& mesh = *_meshes[n];
478  const StorageSite& cells = mesh.getCells();
479  const int nCells = cells.getCountLevel1();
480 
481  TArray& temperature =
482  dynamic_cast<TArray&>(_thermalFields.temperature[cells]);
483  TArray& temperatureN1 =
484  dynamic_cast<TArray&>(_thermalFields.temperatureN1[cells]);
485 
486  if (_options.timeDiscretizationOrder > 1)
487  {
488  TArray& temperatureN2 =
489  dynamic_cast<TArray&>(_thermalFields.temperatureN2[cells]);
490  temperatureN2 = temperatureN1;
491  }
492  temperatureN1 = temperature;
493  }
494  }
495 
496 
497 #if !(defined(USING_ATYPE_TANGENT) || defined(USING_ATYPE_PC))
498 
499  void dumpMatrix(const string fileBase)
500  {
501  LinearSystem ls;
502  initLinearization(ls);
503 
504  ls.initAssembly();
505 
506  linearize(ls);
507 
508  ls.initSolve();
509 
510  MultiFieldMatrix& matrix = ls.getMatrix();
511  MultiField& b = ls.getB();
512 for ( unsigned int id = 0; id < _meshes.size(); id++ ){
513  const Mesh& mesh = *_meshes[id];
514  const StorageSite& cells = mesh.getCells();
515 
516  MultiField::ArrayIndex tIndex(&_thermalFields.temperature,&cells);
517 
518  T_Matrix& tMatrix =
519  dynamic_cast<T_Matrix&>(matrix.getMatrix(tIndex,tIndex));
520 
521  TArray& tDiag = tMatrix.getDiag();
522  TArray& tCoeff = tMatrix.getOffDiag();
523 
524  TArray& rCell = dynamic_cast<TArray&>(b[tIndex]);
525 
526  const CRConnectivity& cr = tMatrix.getConnectivity();
527 
528  const Array<int>& row = cr.getRow();
529  const Array<int>& col = cr.getCol();
530 
531  const int nCells = cells.getSelfCount();
532  int nCoeffs = nCells;
533 
534  for(int i=0; i<nCells; i++)
535  for(int jp=row[i]; jp<row[i+1]; jp++)
536  {
537  const int j = col[jp];
538  if (j<nCells) nCoeffs++;
539  }
540  stringstream ss;
541  ss << id;
542  string matFileName = fileBase + "_mesh" + ss.str() + ".mat";
543 
544 
545  FILE *matFile = fopen(matFileName.c_str(),"wb");
546 
547  fprintf(matFile,"%%%%MatrixMarket matrix coordinate real general\n");
548  fprintf(matFile,"%d %d %d\n", nCells,nCells,nCoeffs);
549 
550  for(int i=0; i<nCells; i++)
551  {
552  fprintf(matFile,"%d %d %lf\n", i+1, i+1, tDiag[i]);
553  for(int jp=row[i]; jp<row[i+1]; jp++)
554  {
555  const int j = col[jp];
556  if (j<nCells)
557  fprintf(matFile,"%d %d %lf\n", i+1, j+1, tCoeff[jp]);
558  }
559  }
560 
561  fclose(matFile);
562 
563  string rhsFileName = fileBase + ".rhs";
564  FILE *rhsFile = fopen(rhsFileName.c_str(),"wb");
565 
566  for(int i=0; i<nCells; i++)
567  fprintf(rhsFile,"%lf\n",-rCell[i]);
568 
569  fclose(rhsFile);
570 
571  }
572 }
573 #endif
574 
575  void computeIBFaceTemperature(const StorageSite& particles)
576  {
577  typedef CRMatrixTranspose<T,T,T> IMatrix;
578 
579  const TArray& pT =
580  dynamic_cast<const TArray&>(_thermalFields.temperature[particles]);
581 
582  const int numMeshes = _meshes.size();
583  for (int n=0; n<numMeshes; n++)
584  {
585  const Mesh& mesh = *_meshes[n];
586  if (!mesh.isShell() && mesh.getIBFaces().getCount() > 0){
587  const StorageSite& cells = mesh.getCells();
588  const StorageSite& ibFaces = mesh.getIBFaces();
589 
590  GeomFields::SSPair key1(&ibFaces,&cells);
591  const IMatrix& mIC =
592  dynamic_cast<const IMatrix&>
593  (*_geomFields._interpolationMatrices[key1]);
594 
595  GeomFields::SSPair key2(&ibFaces,&particles);
596  const IMatrix& mIP =
597  dynamic_cast<const IMatrix&>
598  (*_geomFields._interpolationMatrices[key2]);
599 
600  shared_ptr<TArray> ibT(new TArray(ibFaces.getCount()));
601 
602  const TArray& cT =
603  dynamic_cast<const TArray&>(_thermalFields.temperature[cells]);
604 
605 
606  ibT->zero();
607 
608  mIC.multiplyAndAdd(*ibT,cT);
609  mIP.multiplyAndAdd(*ibT,pT);
610  _thermalFields.temperature.addArray(ibFaces,ibT);
611  }
612  }
613 
614  }
615 
616 private:
620 
625 
627  int _niters;
628 };
629 
630 template<class T>
632  ThermalFields& thermalFields,
633  const MeshList& meshes) :
634  Model(meshes),
635  _impl(new Impl(geomFields,thermalFields,meshes))
636 {
637  logCtor();
638 }
639 
640 
641 template<class T>
643 {
644  logDtor();
645 }
646 
647 template<class T>
648 void
650 {
651  _impl->init();
652 }
653 
654 template<class T>
656 ThermalModel<T>::getBCMap() {return _impl->getBCMap();}
657 
658 template<class T>
660 ThermalModel<T>::getVCMap() {return _impl->getVCMap();}
661 
662 template<class T>
664 ThermalModel<T>::getBC(const int id) {return _impl->getBC(id);}
665 
666 template<class T>
668 ThermalModel<T>::getOptions() {return _impl->getOptions();}
669 
670 
671 template<class T>
672 void
674 {
675  _impl->printBCs();
676 }
677 
678 template<class T>
679 void
680 ThermalModel<T>::advance(const int niter)
681 {
682  _impl->advance(niter);
683 }
684 
685 template<class T>
686 void
688 {
689  _impl->computeIBFaceTemperature(particles);
690 }
691 
692 #if !(defined(USING_ATYPE_TANGENT) || defined(USING_ATYPE_PC))
693 
694 template<class T>
695 void
696 ThermalModel<T>::dumpMatrix(const string fileBase)
697 {
698  _impl->dumpMatrix(fileBase);
699 }
700 #endif
701 
702 template<class T>
703 T
704 ThermalModel<T>::getHeatFluxIntegral(const Mesh& mesh, const int faceGroupId)
705 {
706  return _impl->getHeatFluxIntegral(mesh, faceGroupId);
707 }
708 
709 template<class T>
710 void
712 {
713  _impl->updateTime();
714 }
Array< Gradient< T > > TGradArray
const FaceGroupList & getBoundaryFaceGroups() const
Definition: Mesh.h:187
const Array< int > & getCol() const
void linearize(LinearSystem &ls)
virtual void zero()
Definition: Array.h:281
const Array< int > & getRow() const
void initAssembly()
void advance(const int niter)
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
shared_ptr< FaceGroup > FaceGroupPtr
Definition: Mesh.h:46
int getSelfCount() const
Definition: StorageSite.h:40
const StorageSite & getIBFaces() const
Definition: Mesh.h:111
T getHeatFluxIntegral(const Mesh &mesh, const int faceGroupId)
ThermalBCMap & getBCMap()
Vector< T, 3 > VectorT3
ThermalFields & _thermalFields
ThermalModelOptions< T > & getOptions()
ThermalModelOptions< T > & getOptions()
Definition: Mesh.h:28
ThermalModel(const GeomFields &geomFields, ThermalFields &thermalFields, const MeshList &meshes)
void advance(const int niter)
Definition: Mesh.h:49
void initLinearization(LinearSystem &ls)
string vcType
Definition: ThermalBC.h:32
Array< Diag > & getDiag()
Definition: CRMatrix.h:856
ThermalVCMap & getVCMap()
void dumpMatrix(const string fileBase)
void computeIBFaceTemperature(const StorageSite &particles)
#define logCtor()
Definition: RLogInterface.h:26
std::map< int, ThermalBC< T > * > ThermalBCMap
Definition: ThermalModel.h:23
void dumpMatrix(const string fileBase)
virtual const CRConnectivity & getConnectivity() const
Definition: CRMatrix.h:834
string groupType
Definition: Mesh.h:42
FloatVal< T > getVal(const string varName) const
Definition: FloatVarDict.h:85
std::map< int, ThermalVC< T > * > ThermalVCMap
Definition: ThermalModel.h:24
Impl(const GeomFields &geomFields, ThermalFields &thermalFields, const MeshList &meshes)
GradientModel< T > _temperatureGradientModel
Array< OffDiag > & getOffDiag()
Definition: CRMatrix.h:857
const int id
Definition: Mesh.h:41
void updateSolution()
ThermalVCMap & getVCMap()
pair< const Field *, const StorageSite * > ArrayIndex
Definition: MultiField.h:21
void initSolve()
ThermalBCMap & getBCMap()
Gradient< T > TGradType
Array< VectorT3 > VectorT3Array
vector< shared_ptr< Discretization > > DiscrList
const StorageSite & getFaces() const
Definition: Mesh.h:108
const MeshList _meshes
Definition: Model.h:29
const CRConnectivity & getCellCells() const
Definition: Mesh.cpp:480
Definition: Model.h:13
const StorageSite & getCells() const
Definition: Mesh.h:109
const GeomFields & _geomFields
void applyInterfaceBC(const int f) const
Definition: GenericBCS.h:325
virtual void init()
CRMatrix< T, T, T > T_Matrix
#define logDtor()
Definition: RLogInterface.h:33
int getCountLevel1() const
Definition: StorageSite.h:72
ThermalModelOptions< T > _options
const CRConnectivity & getFaceCells(const StorageSite &site) const
Definition: Mesh.cpp:388
Definition: Array.h:14
void addMatrix(const Index &rowI, const Index &colI, shared_ptr< Matrix > m)
void computeIBFaceTemperature(const StorageSite &particles)
bool isShell() const
Definition: Mesh.h:323
const MeshList _meshes
T getHeatFluxIntegral(const Mesh &mesh, const int faceGroupId)
int getCount() const
Definition: StorageSite.h:39
MultiField & getB()
Definition: LinearSystem.h:33
string bcType
Definition: ThermalBC.h:19
shared_ptr< MultiFieldReduction > MFRPtr
void addArray(const ArrayIndex &aIndex, shared_ptr< ArrayBase > a)
Definition: MultiField.cpp:270
const FaceGroupList & getInterfaceGroups() const
Definition: Mesh.h:190
ThermalBC< T > & getBC(const int id)
MultiField & getX()
Definition: LinearSystem.h:32
virtual ~ThermalModel()
ThermalBC< T > & getBC(const int id)
int getID() const
Definition: Mesh.h:106
virtual void linearize(DiscrList &discretizations, const MeshList &meshes, MultiFieldMatrix &matrix, MultiField &x, MultiField &b)
Definition: Linearizer.cpp:17
pair< const StorageSite *, const StorageSite * > SSPair
Definition: GeomFields.h:48
MultiFieldMatrix & getMatrix()
Definition: LinearSystem.h:37
vector< Mesh * > MeshList
Definition: Mesh.h:439
StorageSite site
Definition: Mesh.h:40