OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
capillary_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: capillary_transport_equation.h
11 // - Description: Equation class for liquid water capillary transport due to capillary diffusion
12 // - Developers: Jie Zhou
13 //
14 //---------------------------------------------------------------------------
15 
16 #ifndef _FCST_FUELCELLSHOP_EQUATION_CAPILLARY_PRESSURE_EQUATION_H_
17 #define _FCST_FUELCELLSHOP_EQUATION_CAPILLARY_PRESSURE_EQUATION_H_
18 
19 // FCST includes
20 #include <utils/fcst_units.h>
21 #include <materials/PureLiquid.h>
22 
24 
27 #include <layers/catalyst_layer.h>
28 #include <microscale/PSD_base.h>
29 // STD
30 #include <sstream>
31 #include <string>
32 
33 namespace FuelCellShop
34 {
35  namespace Equation
36  {
37  template<int dim>
39  {
40  public:
41 
43 
44 
48  CapillaryPressureEquation(FuelCell::SystemManagement& system_management,boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
49  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
50 
55 
59  virtual void declare_parameters(ParameterHandler& param) const;
60 
64  virtual void initialize(ParameterHandler& param);
65 
67 
69 
70 
76 
83 
91 
99 
101 
103 
104 
108  virtual void print_equation_info() const;
109 
113  double get_kevap() const
114  {
115  return k_e;
116  }
117 
121  double get_kcond() const
122  {
123  return k_c;
124  }
125 
127 
128  protected:
129 
130 
131  std::map<unsigned int, double> capillary_pressure_current_flux_map;
132 
133 
135 
136 
142 
152 
164 
171 
180 
182 
184 
185 
190  virtual void make_internal_cell_couplings();
191 
198  virtual void make_boundary_types(){};
199 
206  virtual void make_output_types()
207  {};
208 
210 
212 
213 
217 
222 
227 
232 
237 
242 
247 
252 
257 
261  double M_water;
262 
266  double k_e;
270  double k_c;
271 
276 
280  double rho_l;
281 
282  double k_sat;
283 
284  double k_sat_bdry;
285 
287 
289 
290 
294  double p_cell;
295 
299  std::vector<double> area_lv_cell;
303  std::vector<double> darea_lv_dp_cell;
304 
309  std::vector< Tensor<2,dim> > rhok_mu_cell;
310 
311  std::vector< Tensor<2,dim> > rhok_mu_cell_bdry;
312 
313  std::vector< Tensor<2,dim> > rho_mu_dk_dp_cell;
314 
315  std::vector< Tensor<2,dim> > dT_rhok_mu_cell;
316 
317 
325  std::vector< std::vector<double> > phi_p_cell;
326 
327  std::vector< std::vector<double> > phi_p_cell_bdry;
328 
336  std::vector< std::vector<double> > phi_xwater_cell;
337 
345  std::vector< std::vector<double> > phi_T_cell;
346 
354  std::vector< std::vector< Tensor<1,dim> > > grad_phi_p_cell;
355 
363  std::vector< std::vector< Tensor<1,dim> > > grad_phi_T_cell;
364 
366 
372 
377  unsigned int last_iter_cell;
378  unsigned int last_iter_bdry;
379 
383  double T_constant;
384 
385  };
386  } // Equation
387 } // FuelCellShop
388 
389 #endif
std::vector< Tensor< 2, dim > > dT_rhok_mu_cell
Definition: capillary_transport_equation.h:315
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) .
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) .
VariableInfo t_rev
VariableInfo structure corresponding to &quot;temperature_of_REV&quot;.
Definition: capillary_transport_equation.h:226
boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data
Data object for the application data to be passed to the equation classes.
Definition: equation_base.h:890
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::map< unsigned int, double > capillary_pressure_current_flux_map
Definition: capillary_transport_equation.h:131
unsigned int thermal_blockindex_trev
Block index for &quot;temperature_of_REV&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: capillary_transport_equation.h:256
double get_kevap() const
Returns evaporation rate constant, .
Definition: capillary_transport_equation.h:113
std::vector< std::vector< double > > phi_xwater_cell
shape functions.
Definition: capillary_transport_equation.h:336
virtual void declare_parameters(ParameterHandler &param) const
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: capillary_transport_equation.h:377
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:798
double M_water
Molar weight of water in grams/mole.
Definition: capillary_transport_equation.h:261
VariableInfo p_liquid_water
VariableInfo structure corresponding to &quot;liquid_water_saturation&quot;.
Definition: capillary_transport_equation.h:216
double p_cell
Total pressure in the cell.
Definition: capillary_transport_equation.h:294
double k_sat
Definition: capillary_transport_equation.h:282
unsigned int fickswater_blockindex_xwater
Block index for &quot;water_molar_fraction&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: capillary_transport_equation.h:231
unsigned int last_iter_bdry
Definition: capillary_transport_equation.h:378
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...
double rho_l
Density of liquid water, .
Definition: capillary_transport_equation.h:280
double get_kcond() const
Returns condensation rate constant, .
Definition: capillary_transport_equation.h:121
virtual void make_boundary_types()
This function fills out boundary_types.
Definition: capillary_transport_equation.h:198
double k_e
Evaporation rate constant, .
Definition: capillary_transport_equation.h:266
virtual void initialize(ParameterHandler &param)
Initialize parameters.
std::vector< Tensor< 2, dim > > rhok_mu_cell_bdry
Definition: capillary_transport_equation.h:311
Definition: capillary_transport_equation.h:38
unsigned int fickswater_blockindex_pliquid
Block index for &quot;liquid_water_saturation&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: capillary_transport_equation.h:236
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
std::vector< double > area_lv_cell
Interfacial surface area per unit volume, , at all quadrature points in the cell. ...
Definition: capillary_transport_equation.h:299
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...
double T_constant
This tempearture is used when not solving temperature as the solution variable.
Definition: capillary_transport_equation.h:383
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
double k_sat_bdry
Definition: capillary_transport_equation.h:284
std::vector< double > darea_lv_dp_cell
, at all quadrature points in the cell.
Definition: capillary_transport_equation.h:303
VariableInfo x_water
VariableInfo structure corresponding to &quot;water_molar_fraction&quot;.
Definition: capillary_transport_equation.h:221
unsigned int thermal_blockindex_xwater
Block index for &quot;water_molar_fraction&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: capillary_transport_equation.h:246
bool cell_residual_counter
Counter set to TRUE when cell_residual is being assembled.
Definition: capillary_transport_equation.h:371
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.
virtual void print_equation_info() const
The function prints out the equation&#39;s info.
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 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.
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_p_cell
shape function gradients.
Definition: capillary_transport_equation.h:354
This is the base class used for all Equation classes.
Definition: equation_base.h:160
std::vector< std::vector< double > > phi_T_cell
shape functions.
Definition: capillary_transport_equation.h:345
CapillaryPressureEquation(FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
Constructor.
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings.
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_auxiliaries.h:51
unsigned int thermal_blockindex_pliquid
Block index for &quot;liquid_water_saturation&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: capillary_transport_equation.h:251
double k_c
Condensation rate constant, .
Definition: capillary_transport_equation.h:270
unsigned int fickswater_blockindex_trev
Block index for &quot;temperature_of_REV&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: capillary_transport_equation.h:241
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_T_cell
shape function gradients.
Definition: capillary_transport_equation.h:363
std::vector< std::vector< double > > phi_p_cell_bdry
Definition: capillary_transport_equation.h:327
virtual void make_output_types()
This function fills out output_types.
Definition: capillary_transport_equation.h:206
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
virtual void make_assemblers_generic_constant_data()
This function computes Local CG FEM based assemblers - constant data (generic).
double p_channel_GDL
The boundary condition term which indicates the capillary pressure in the channel.
Definition: capillary_transport_equation.h:275
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
std::vector< Tensor< 2, dim > > rho_mu_dk_dp_cell
Definition: capillary_transport_equation.h:313
std::vector< Tensor< 2, dim > > rhok_mu_cell
, at all quadrature points in the cell.
Definition: capillary_transport_equation.h:309
std::vector< std::vector< double > > phi_p_cell
shape functions.
Definition: capillary_transport_equation.h:325