OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sorption_source_terms.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2013 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: sorption_source_terms.h
11 // - Description: This class is used to assemble cell matrix and cell residual
12 // corresponding to sorption/desorption of water inside the catalyst layer.
13 // - Developers: Madhur Bhaiya
14 // - $Id: sorption_source_terms.h 1452 2013-08-30 21:49:59Z madhur $
15 //
16 //---------------------------------------------------------------------------
17 
18 #ifndef _FCST_FUELCELLSHOP_EQUATION_SORPTION_SOURCE_TERMS_H_
19 #define _FCST_FUELCELLSHOP_EQUATION_SORPTION_SOURCE_TERMS_H_
20 
21 #include "utils/fcst_constants.h"
23 #include "layers/catalyst_layer.h"
24 
25 
26 namespace FuelCellShop
27 {
28  namespace Equation
29  {
31 
32 
37  DeclException2(VariableNotFoundForSorption,
38  std::string,
39  std::string,
40  << arg1 << " should be one of the solution variables, in order to account for " << arg2 << " .");
41 
43 
99  template<int dim>
100  class SorptionSourceTerms : public EquationBase<dim>
101  {
102  public:
103 
105 
106 
111 
115  virtual ~SorptionSourceTerms();
116 
120  virtual void declare_parameters(ParameterHandler& param) const;
121 
125  virtual void initialize(ParameterHandler& param);
126 
128 
130 
131 
135  virtual void assemble_cell_matrix(AppFrame::MatrixVector& cell_matrices,
136  const typename AppFrame::DoFApplication<dim>::CellInfo& cell_info,
138 
142  virtual void assemble_cell_residual(AppFrame::FEVector& cell_residual,
143  const typename AppFrame::DoFApplication<dim>::CellInfo& cell_info,
145 
147 
149 
150 
159  virtual void adjust_internal_cell_couplings(std::vector< couplings_map >& ) const;
160 
165  virtual void print_equation_info() const;
166 
170  double get_time_constant() const
171  {
172  return time_constant;
173  }
174 
176 
177  protected:
178 
180 
181 
191 
200  virtual void make_assemblers_cell_constant_data(const typename AppFrame::DoFApplication<dim>::CellInfo& cell_info);
201 
208 
227  virtual void assemble_matrix_for_equation(AppFrame::MatrixVector& cell_matrices,
228  const typename AppFrame::DoFApplication<dim>::CellInfo& cell_info,
229  const std::string& eq_name,
230  const FEValuesBase<dim>& test_fe,
231  const std::vector< std::vector<double> >& test_shape_functions,
232  const double& sourceterm_factor);
234 
236 
237 
242 
247 
252 
257 
259 
261 
262 
266  double rho_dry_cell;
267 
271  double EW_cell;
272 
277  std::vector<double> lambda_eq_cell;
278 
283  std::vector<double> dlambdaEq_dxWater_cell;
284 
289  std::vector<double> dlambdaEq_dT_cell;
290 
298  std::vector< std::vector<double> > phi_T_cell;
299 
307  std::vector< std::vector<double> > phi_lambda_cell;
308 
316  std::vector< std::vector<double> > phi_xWater_cell;
317 
319 
325 
330  unsigned int last_iter_cell;
331 
332  };
333 
334  } // Equation
335 
336 } // FuelCellShop
337 
338 #endif