OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
new_ficks_transport_equation.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: new_ficks_transport_equation.h
11 // - Description: Header file of Ficks diffusion equation class.
12 // - Developers: M. Secanell, Madhur Bhaiya, Valentin N. Zingan
13 // - $Id: new_ficks_transport_equation.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FCST_FUELCELLSHOP_EQUATION_NEW_FICKS_EQUATION_H_
18 #define _FCST_FUELCELLSHOP_EQUATION_NEW_FICKS_EQUATION_H_
19 
20 // FCST includes
21 #include "fcst_units.h"
22 #include "fcst_constants.h"
23 #include "equation_base.h"
24 #include "gas_diffusion_layer.h"
25 #include "micro_porous_layer.h"
26 #include "catalyst_layer.h"
27 
28 // STD
29 #include <sstream>
30 #include <string>
31 
32 namespace FuelCellShop
33 {
34  namespace Equation
35  {
131  template<int dim>
133  :
134  public EquationBase<dim>
135  {
136  public:
138 
139 
148 
154  NewFicksTransportEquation(FuelCell::SystemManagement& system_management, std::string& name_section);
155 
159  virtual ~NewFicksTransportEquation();
160 
164  virtual void declare_parameters(ParameterHandler& param);
165 
169  virtual void initialize(ParameterHandler& param);
170 
177  inline void set_solute_and_solvent( FuelCellShop::Material::PureGas* solute, FuelCellShop::Material::PureGas* solvent, ParameterHandler& param )
178  {
179  this->gas = solute;
180  this->solvent = solvent;
181 
182  std::stringstream s;
183  s <<"Ficks Transport Equation - "<<gas->name_material();
184  this->equation_name = s.str();
185 
186  std::stringstream ss;
187  ss <<gas->name_material()<<"_molar_fraction";
188  this->name_base_variable = ss.str();
189  }
190 
192 
194 
195 
202 
209 
216 
223 
225 
227 
228 
232  virtual void print_equation_info() const;
233 
239  void class_test();
240 
241  protected:
243 
244 
248  std::vector<unsigned int> dirichlet_bdry_ids;
249 
254  std::map<unsigned int, double> species_flux;
255 
257 
259 
265 
275 
285 
292 
299 
301 
303 
304 
309  virtual void make_internal_cell_couplings();
310 
315  virtual void make_boundary_types();
316 
318 
320 
321 
326 
332 
338 
343 
348 
350 
352 
353 
358  std::vector< Tensor< 2, dim > > conc_Deff_cell;
359 
365  std::vector< Tensor<2,dim> > dconc_Deff_dT_cell;
366 
372  std::vector< Tensor<2,dim> > dconc_Deff_ds_cell;
373 
381  std::vector< std::vector< Tensor<1,dim> > > grad_phi_xi_cell;
382 
390  std::vector< std::vector< double > > phi_T_cell;
391 
399  std::vector< std::vector< double > > phi_s_cell;
400 
402 
404 
405 
413  std::vector< std::vector<double> > phi_xi_bdry;
414 
416 
421  unsigned int last_iter_cell;
422 
427  unsigned int last_iter_bdry;
428  };
429 
430 } // Equation
431 
432 } // FuelCellShop
433 
434 #endif
virtual void initialize(ParameterHandler &param)
Initialize parameters.
FuelCellShop::Material::PureGas * gas
Gas for which the equation is setup.
Definition: new_ficks_transport_equation.h:325
VariableInfo t_rev
VariableInfo structure corresponding to &quot;temperature_of_REV&quot;.
Definition: new_ficks_transport_equation.h:342
virtual void print_equation_info() const
The function printing out the equations info.
unsigned int last_iter_bdry
Variable used to store the index in bdry_info-&gt;global_data of the previous Newton solution The soluti...
Definition: new_ficks_transport_equation.h:427
std::vector< std::vector< double > > phi_s_cell
shape functions.
Definition: new_ficks_transport_equation.h:399
virtual void make_assemblers_generic_constant_data()
This function computes Local CG FEM based assemblers - constant data (generic).
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings.
virtual void declare_parameters(ParameterHandler &param)
Declare parameters.
unsigned int last_iter_cell
Variable used to store the index in cell_info-&gt;global_data of the previous Newton solution The soluti...
Definition: new_ficks_transport_equation.h:421
std::vector< std::vector< double > > phi_xi_bdry
shape functions.
Definition: new_ficks_transport_equation.h:413
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_xi_cell
shape function gradients.
Definition: new_ficks_transport_equation.h:381
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:798
virtual void make_assemblers_cell_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info)
This function computes Local CG FEM based assemblers - constant data (cell) and allocates the memor...
virtual void make_assemblers_bdry_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
This function computes Local CG FEM based assemblers - variable data (boundary) .
virtual void assemble_cell_matrix(FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell matrix.
void class_test()
Member function used to test the functionality of the class.
VariableInfo s_liquid_water
VariableInfo structure corresponding to &quot;liquid_water_saturation&quot;.
Definition: new_ficks_transport_equation.h:347
virtual void make_boundary_types()
This function fills out boundary_types.
std::string name_base_variable
Const std::string member storing name of the base solution variable corresponding to the equation rep...
Definition: equation_base.h:861
virtual void make_assemblers_cell_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
This function computes Local CG FEM based assemblers - variable data (cell) .
This class deals with Ficks Transport Equation.
Definition: new_ficks_transport_equation.h:132
std::vector< Tensor< 2, dim > > dconc_Deff_dT_cell
Derivative of concentration times effective molecular diffusivity w.r.t &quot;temperature_of_REV&quot; [mol/(cm...
Definition: new_ficks_transport_equation.h:365
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
NewFicksTransportEquation(FuelCell::SystemManagement &system_management, FuelCellShop::Material::PureGas *solute, FuelCellShop::Material::PureGas *solvent)
Constructor.
std::map< unsigned int, double > species_flux
std::map&lt; unsigned int, double &gt; container for details regarding Neumann boundary conditions...
Definition: new_ficks_transport_equation.h:254
VariableInfo xi
VariableInfo structure corresponding to base variable of this equation class, &quot;solute.name()_molar_fraction&quot;.
Definition: new_ficks_transport_equation.h:337
virtual void assemble_bdry_residual(FuelCell::ApplicationCore::FEVector &bdry_rhs, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary residual.
std::vector< std::vector< double > > phi_T_cell
shape functions.
Definition: new_ficks_transport_equation.h:390
const std::string & name_material() const
Return the name of the layer.
Definition: base_material.h:77
std::vector< Tensor< 2, dim > > dconc_Deff_ds_cell
Derivative of concentration times effective molecular diffusivity w.r.t &quot;liquid_water_saturation&quot; [mo...
Definition: new_ficks_transport_equation.h:372
std::vector< Tensor< 2, dim > > conc_Deff_cell
Tensor with concentration times effective molecular diffusivity [mol/(cm-s )], at all quadrature poin...
Definition: new_ficks_transport_equation.h:358
This class is a base class for all pure gases used in OpenFCST.
Definition: PureGas.h:88
This is the base class used for all Equation classes.
Definition: equation_base.h:160
FuelCellShop::Material::PureGas * solvent
Solvent gas for which the equation is setup.
Definition: new_ficks_transport_equation.h:331
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
void set_solute_and_solvent(FuelCellShop::Material::PureGas *solute, FuelCellShop::Material::PureGas *solvent, ParameterHandler &param)
Method to set solute and solve if other constructor (not passing solute and solvent in the constructo...
Definition: new_ficks_transport_equation.h:177
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_auxiliaries.h:51
virtual void make_assemblers_bdry_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info)
This function computes Local CG FEM based assemblers - constant data (boundary) and allocates the m...
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
virtual void assemble_cell_residual(FuelCell::ApplicationCore::FEVector &cell_rhs, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell residual.
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
virtual void assemble_bdry_matrix(FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary matrix.
std::vector< unsigned int > dirichlet_bdry_ids
Container of boundary_id (s ) for Dirichlet boundaries.
Definition: new_ficks_transport_equation.h:248
std::string equation_name
The name of a derived equation class.
Definition: equation_base.h:855