Memosa-FVM  0.2
BatteryModel.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 _BATTERYMODEL_H_
6 #define _BATTERYMODEL_H_
7 
8 #include "Model.h"
9 
10 #include "GeomFields.h"
11 #include "BatteryFields.h"
12 
13 #include "Mesh.h"
14 
15 
16 #include "BatteryBC.h"
17 
18 template<class T>
19 class BatteryModel : public Model
20 {
21 public:
22 
23  typedef std::map<int,BatterySpeciesBC<T>*> BatterySpeciesBCMap;
24  typedef std::map<int,BatterySpeciesVC<T>*> BatterySpeciesVCMap;
25  typedef std::map<int,BatteryPotentialBC<T>*> BatteryPotentialBCMap;
26  typedef std::map<int,BatteryPotentialVC<T>*> BatteryPotentialVCMap;
27  typedef std::map<int,BatteryThermalBC<T>*> BatteryThermalBCMap;
28  typedef std::map<int,BatteryThermalVC<T>*> BatteryThermalVCMap;
29 
30  class Impl;
31 
32 
33  BatteryModel(GeomFields& geomFields,
34  const MeshList& realMeshes,
35  const MeshList& meshes,
36  const int nSpecies);
37 
38  virtual ~BatteryModel();
39 
40  virtual void init();
41 
42  BatterySpeciesFields& getBatterySpeciesFields(const int speciesId);
44  BatterySpeciesBCMap& getSpeciesBCMap(const int speciesId);
47  BatterySpeciesVCMap& getSpeciesVCMap(const int speciesId);
50 
51  //SpeciesBC<T>& getBC(const int id, const int speciesId);
52 
54 
55  T getMassFluxIntegral(const Mesh& mesh, const int faceGroupId, const int m);
56  T getPotentialFluxIntegral(const Mesh& mesh, const int faceGroupId);
57  T getHeatFluxIntegral(const Mesh& mesh, const int faceGroupId);
58  T getAverageConcentration(const Mesh& mesh, const int m);
59  T getFaceGroupArea(const Mesh& mesh, const int fgID);
60  T getFaceGroupVoltage(const Mesh& mesh, const int fgID);
61  T getMeshVolume(const Mesh& mesh);
62  T getSpeciesResidual(const int speciesId);
65  T getPCResidual(const int v);
66 
67  //void printBCs();
68 
69  void updateTime();
70  void recoverLastTimestep();
71  void advanceSpecies(const int niter);
72  void advancePotential(const int niter);
73  void advanceThermal(const int niter);
74  void advanceCoupled(const int niter);
75 
76  void copySeparateToCoupled();
77  void copyCoupledToSeparate();
78 private:
79  shared_ptr<Impl> _impl;
80 };
81 
82 #endif
83 
void advanceThermal(const int niter)
BatterySpeciesBCMap & getSpeciesBCMap(const int speciesId)
BatteryPotentialVCMap & getPotentialVCMap()
BatteryModelOptions< T > & getOptions()
BatteryPotentialBCMap & getPotentialBCMap()
T getMassFluxIntegral(const Mesh &mesh, const int faceGroupId, const int m)
void copySeparateToCoupled()
T getAverageConcentration(const Mesh &mesh, const int m)
BatterySpeciesVCMap & getSpeciesVCMap(const int speciesId)
void advanceCoupled(const int niter)
Definition: Mesh.h:49
T getPotentialFluxIntegral(const Mesh &mesh, const int faceGroupId)
virtual ~BatteryModel()
BatteryModelFields & getBatteryModelFields()
void advanceSpecies(const int niter)
T getFaceGroupVoltage(const Mesh &mesh, const int fgID)
void advancePotential(const int niter)
std::map< int, BatterySpeciesVC< T > * > BatterySpeciesVCMap
Definition: BatteryModel.h:24
BatteryModel(GeomFields &geomFields, const MeshList &realMeshes, const MeshList &meshes, const int nSpecies)
shared_ptr< Impl > _impl
Definition: BatteryModel.h:79
T getSpeciesResidual(const int speciesId)
void recoverLastTimestep()
std::map< int, BatterySpeciesBC< T > * > BatterySpeciesBCMap
Definition: BatteryModel.h:23
Definition: Model.h:13
BatteryThermalVCMap & getThermalVCMap()
std::map< int, BatteryPotentialBC< T > * > BatteryPotentialBCMap
Definition: BatteryModel.h:25
T getPCResidual(const int v)
T getFaceGroupArea(const Mesh &mesh, const int fgID)
void copyCoupledToSeparate()
BatterySpeciesFields & getBatterySpeciesFields(const int speciesId)
T getMeshVolume(const Mesh &mesh)
virtual void init()
std::map< int, BatteryPotentialVC< T > * > BatteryPotentialVCMap
Definition: BatteryModel.h:26
std::map< int, BatteryThermalBC< T > * > BatteryThermalBCMap
Definition: BatteryModel.h:27
T getHeatFluxIntegral(const Mesh &mesh, const int faceGroupId)
std::map< int, BatteryThermalVC< T > * > BatteryThermalVCMap
Definition: BatteryModel.h:28
BatteryThermalBCMap & getThermalBCMap()
vector< Mesh * > MeshList
Definition: Mesh.h:439