OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
agglomerate_water_sadeghi.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-2014 by Energy Systems Design Laboratory, University of Alberta
6 //
7 // This software is distributed under the MIT License
8 // For more information, see the README file in /doc/LICENSE
9 //
10 // - Class: todo
11 // - Description: todo
12 // - Developers: Philip Wardlaw <wardlaw@ualberta.ca>
13 // University of Alberta
14 //
15 // ----------------------------------------------------------------------------
16 
17 #ifndef FUEL_CELL__WATER_PORE_AGGLOMERATE
18 #define FUEL_CELL__WATER_PORE_AGGLOMERATE
19 
20 //------------------------------
21 // STD LIBRARY DECLARATIONS
22 //------------------------------
23 
24 
25 //------------------------------
26 // DEAL.II DECLARATIONS
27 //------------------------------
28 
29 //------------------------------
30 // FUEL CELL DECLARATIONS
31 //-----------------------------
32 
33 #include "agglomerate_base.h"
34 
35 //Test Class
36 class WaterPoreAgglomerateTest;
37 
38 namespace FuelCellShop
39 {
40  namespace MicroScale
41  {
49  {
50  public:
51 
52 
53  static const std::string concrete_name;
54 
55 
63  virtual SolutionMap compute_current ( );
64 
68  //virtual std::vector<double> compute_derivative_current ();
69 
70 
75  friend class ::WaterPoreAgglomerateTest;
76 
77  virtual std::string get_name(){
78  return concrete_name;
79  }
80 
81  virtual double aux_volume_fraction(){
82  return 0;
83  }
84 
85 
86  protected:
87 
88 
89  virtual double get_film_thickness(){
90  return delta_agg*1e9;
91  }
92  virtual double get_radius(){
93  return r_agg*1e9;
94  }
95 
96 
97 
98 
99 
100 
101  virtual void set_structure ();
103 
107 
108  virtual boost::shared_ptr<FuelCellShop::MicroScale::MicroScaleBase> create_replica ()
109  {
110  return boost::shared_ptr<FuelCellShop::MicroScale::MicroScaleBase> (new FuelCellShop::MicroScale::WaterConicalPoreAgglomerate());
111  }
112 
113 
114  virtual void declare_parameters (ParameterHandler &param) const
115  {
117  param.enter_subsection(concrete_name);{
118  }
119  param.leave_subsection();
120 
121 
122 
123 
124  }
125 
126  virtual void initialize (ParameterHandler &param)
127  {
129  param.enter_subsection(concrete_name);{
130 
131  }
132  param.leave_subsection();
133 
134 
135  }
136 
137 
138  /*
139  * Domain temperature
140  */
141  double T;
142 
143 
144 
145 
146 
147 
148 
149 
150 
151 
152  private:
153 
159  bool initialize_problem(std::string& error_msg);
160 
166  bool interpret_solution(std::string& error_msg);
167 
168 
175  bool solveProtonPotentials(std::string& error_msg);
176  bool solveO2(std::string& error_msg);
177 
178 
185  double calculate_j(double& E_r);
186 
191  };
192 
193 
194 
195 
196  std::map<SolutionIteration, std::vector<std::vector<double>>> PorePotential;
197  std::map<SolutionIteration,std::vector<std::vector<double>>> cO2;
198  std::vector<double> cHwall;
199  std::vector<double> etaWall;
200  std::vector<double> jWall;
201 
202 
203 
204  //u_in goes inside newton-rapson function
205  //double gama, u[201, 201, 201], h, k, pii, beta, kisi, CH;
206  //f_u, df_u,
207 
208 
209  //Factor F/(R*T)
210  double beta;
211 
212  //Surface OverPotential
213  double eta;
214 
215  //Angular steps
216  double alfa, lambda;
217 
218  //Pore angle
219  double teta;
220 
221  //Inner and outer radii
222  double innerRadius;
223  double outerRadius;
224 
225  //Number of pores per agglomerate
226  double NP;
227 
228  //Surface Area inner/outer pore
229  double S_i, S_o;
230  //Dimensionless source term, dimensionless initial potential
231  double eva, u_0;
232 
233  //Potential difference at agglomerate surface, dimensionless omega
234  double omega, del_u;
235 
236  //Potential of zero charge
237  double phi_pzc;
238 
239  //Dimensionless surface potential
240  double u_s;
241 
242  //Iteraion Number for r and teta
243  int N, M;
244 
245  //Helmholtz Capacitance
246  double Helm;
247 
248  //Radius of a water molecule
249  double waterRadius;
250 
251  //Relative permittivity of water
253 
254 
255  };// class IonomerAgglomerate2
256 
257  } // namespace Layer
258 
259 } // namespace FuelCellShop
260 
261 #endif
double lambda
Definition: agglomerate_water_sadeghi.h:216
bool interpret_solution(std::string &error_msg)
Function for interpreting solution provided by another class.
virtual double aux_volume_fraction()
MicroScale object may have extra contribution to volume of layer, e.g.
Definition: agglomerate_water_sadeghi.h:81
virtual void declare_parameters(ParameterHandler &param) const
double r_agg
Definition: agglomerate_base.h:361
double waterRadius
Definition: agglomerate_water_sadeghi.h:249
double delta_agg
Definition: agglomerate_base.h:367
double u_s
Definition: agglomerate_water_sadeghi.h:240
Definition: agglomerate_water_sadeghi.h:189
The base class for agglomerate objects in OpenFCST.
Definition: agglomerate_base.h:70
double eva
Definition: agglomerate_water_sadeghi.h:231
std::map< SolutionIteration, std::vector< std::vector< double > > > PorePotential
Definition: agglomerate_water_sadeghi.h:196
double teta
Definition: agglomerate_water_sadeghi.h:219
Convenient storage object for SolutionVariables.
Definition: fcst_variables.h:447
double rel_permittivity
Definition: agglomerate_water_sadeghi.h:252
double del_u
Definition: agglomerate_water_sadeghi.h:234
double T
Definition: agglomerate_water_sadeghi.h:141
double eta
Definition: agglomerate_water_sadeghi.h:213
double S_o
Definition: agglomerate_water_sadeghi.h:229
Class implementing water pore agglomerate model developed by Ehsan Sadeghi.
Definition: agglomerate_water_sadeghi.h:48
std::vector< double > cHwall
Definition: agglomerate_water_sadeghi.h:198
static WaterConicalPoreAgglomerate const * PROTOTYPE
Definition: agglomerate_water_sadeghi.h:102
double innerRadius
Definition: agglomerate_water_sadeghi.h:222
virtual std::string get_name()
Return name of class instance, i.e.
Definition: agglomerate_water_sadeghi.h:77
double calculate_j(double &E_r)
Functions which calculates current density, proton potential and o2 concentration must be solved...
int N
Definition: agglomerate_water_sadeghi.h:243
virtual double get_radius()
Definition: agglomerate_water_sadeghi.h:92
Definition: agglomerate_water_sadeghi.h:188
SolutionIteration
Definition: agglomerate_water_sadeghi.h:187
double omega
Definition: agglomerate_water_sadeghi.h:234
virtual void initialize(ParameterHandler &param)
std::vector< double > etaWall
Definition: agglomerate_water_sadeghi.h:199
double phi_pzc
Definition: agglomerate_water_sadeghi.h:237
virtual void declare_parameters(ParameterHandler &param) const
Definition: agglomerate_water_sadeghi.h:114
double S_i
Definition: agglomerate_water_sadeghi.h:229
double alfa
Definition: agglomerate_water_sadeghi.h:216
virtual void initialize(ParameterHandler &param)
Definition: agglomerate_water_sadeghi.h:126
bool initialize_problem(std::string &error_msg)
Function for initializing data before problem is solved.
virtual double get_film_thickness()
Definition: agglomerate_water_sadeghi.h:89
virtual boost::shared_ptr< FuelCellShop::MicroScale::MicroScaleBase > create_replica()
This member function is used to create an object of MicroScaleBase.
Definition: agglomerate_water_sadeghi.h:108
double outerRadius
Definition: agglomerate_water_sadeghi.h:223
virtual SolutionMap compute_current()
Set the composition and structure of the agglomerate.
std::map< SolutionIteration, std::vector< std::vector< double > > > cO2
Definition: agglomerate_water_sadeghi.h:197
std::vector< double > jWall
Definition: agglomerate_water_sadeghi.h:200
double Helm
Definition: agglomerate_water_sadeghi.h:246
static const std::string concrete_name
Definition: agglomerate_water_sadeghi.h:53
double beta
Definition: agglomerate_water_sadeghi.h:210
double u_0
Definition: agglomerate_water_sadeghi.h:231
double NP
Definition: agglomerate_water_sadeghi.h:226
bool solveProtonPotentials(std::string &error_msg)
Functions which solve for Proton Potential and oxygen concentration Profiles across the pore...
int M
Definition: agglomerate_water_sadeghi.h:243