OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
saturation_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: saturation_transport_equation.h
11 // - Description: Equation class for liquid water saturation transport due to capillary diffusion
12 // - Developers: Madhur Bhaiya
13 //
14 //---------------------------------------------------------------------------
15 
16 #ifndef _FCST_FUELCELLSHOP_EQUATION_SATURATION_TRANSPORT_EQUATION_H_
17 #define _FCST_FUELCELLSHOP_EQUATION_SATURATION_TRANSPORT_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 
29 // STD
30 #include <sstream>
31 #include <string>
32 
33 namespace FuelCellShop
34 {
35  namespace Equation
36  {
119  template<int dim>
121  {
122  public:
123 
125 
126 
130  SaturationTransportEquation(FuelCell::SystemManagement& system_management,boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
131  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
132 
137 
141  virtual void declare_parameters(ParameterHandler& param) const;
142 
146  virtual void initialize(ParameterHandler& param);
147 
149 
151 
152 
158 
165 
172  FuelCellShop::Layer::BaseLayer<dim>* const layer){};
173 
180  FuelCellShop::Layer::BaseLayer<dim>* const layer){};
181 
183 
185 
186 
190  virtual void print_equation_info() const;
191 
195  double get_kevap() const
196  {
197  return k_e;
198  }
199 
203  double get_kcond() const
204  {
205  return k_c;
206  }
207 
209 
210  protected:
211 
213 
214 
220 
230 
242 
249 
257  FuelCellShop::Layer::BaseLayer<dim>* const layer){};
258 
260 
262 
263 
268  virtual void make_internal_cell_couplings();
269 
276  virtual void make_boundary_types(){};
277 
284  virtual void make_output_types()
285  {};
286 
288 
290 
291 
295 
300 
305 
310 
315 
320 
325 
330 
335 
339  double M_water;
340 
344  double k_e;
348  double k_c;
349 
353  double rho_l;
354 
356 
358 
359 
363  double p_cell;
364 
368  std::vector<double> area_lv_cell;
369 
373  std::vector<double> darea_lv_ds_cell;
374 
378  std::vector< Tensor<2,dim> > rhok_mu_dpcds_cell;
379 
384  std::vector< Tensor<2,dim> > ds_rhok_mu_dpcds_cell;
385 
390  std::vector< Tensor<2,dim> > dT_rhok_mu_dpcds_cell;
391 
399  std::vector< std::vector<double> > phi_s_cell;
400 
408  std::vector< std::vector<double> > phi_xwater_cell;
409 
417  std::vector< std::vector<double> > phi_T_cell;
418 
426  std::vector< std::vector< Tensor<1,dim> > > grad_phi_s_cell;
427 
435  std::vector< std::vector< Tensor<1,dim> > > grad_phi_T_cell;
436 
438 
444 
449  unsigned int last_iter_cell;
450 
451  };
452  } // Equation
453 } // FuelCellShop
454 
455 #endif
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: saturation_transport_equation.h:449
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
double get_kevap() const
Returns evaporation rate constant, .
Definition: saturation_transport_equation.h:195
virtual void make_boundary_types()
This function fills out boundary_types.
Definition: saturation_transport_equation.h:276
VariableInfo x_water
VariableInfo structure corresponding to &quot;water_molar_fraction&quot;.
Definition: saturation_transport_equation.h:299
double k_e
Evaporation rate constant, .
Definition: saturation_transport_equation.h:344
SaturationTransportEquation(FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
Constructor.
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:798
std::vector< Tensor< 2, dim > > dT_rhok_mu_dpcds_cell
, at all quadrature points in the cell.
Definition: saturation_transport_equation.h:390
std::vector< std::vector< double > > phi_xwater_cell
shape functions.
Definition: saturation_transport_equation.h:408
unsigned int fickswater_blockindex_trev
Block index for &quot;temperature_of_REV&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: saturation_transport_equation.h:319
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings.
unsigned int thermal_blockindex_trev
Block index for &quot;temperature_of_REV&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: saturation_transport_equation.h:334
std::vector< double > area_lv_cell
Interfacial surface area per unit volume, , at all quadrature points in the cell. ...
Definition: saturation_transport_equation.h:368
virtual void make_output_types()
This function fills out output_types.
Definition: saturation_transport_equation.h:284
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) .
Definition: saturation_transport_equation.h:256
virtual void print_equation_info() const
The function prints out the equation&#39;s info.
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters.
double k_c
Condensation rate constant, .
Definition: saturation_transport_equation.h:348
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
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.
Definition: saturation_transport_equation.h:170
std::vector< std::vector< double > > phi_s_cell
shape functions.
Definition: saturation_transport_equation.h:399
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
unsigned int fickswater_blockindex_sliquid
Block index for &quot;liquid_water_saturation&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: saturation_transport_equation.h:314
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.
Definition: saturation_transport_equation.h:178
std::vector< Tensor< 2, dim > > ds_rhok_mu_dpcds_cell
, at all quadrature points in the cell.
Definition: saturation_transport_equation.h:384
This class deals with Liquid Water Saturation Transport Equation.
Definition: saturation_transport_equation.h:120
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_s_cell
shape function gradients.
Definition: saturation_transport_equation.h:426
unsigned int fickswater_blockindex_xwater
Block index for &quot;water_molar_fraction&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: saturation_transport_equation.h:309
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.
This is the base class used for all Equation classes.
Definition: equation_base.h:160
unsigned int thermal_blockindex_sliquid
Block index for &quot;liquid_water_saturation&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: saturation_transport_equation.h:329
std::vector< Tensor< 2, dim > > rhok_mu_dpcds_cell
, at all quadrature points in the cell.
Definition: saturation_transport_equation.h:378
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_auxiliaries.h:51
double rho_l
Density of liquid water, .
Definition: saturation_transport_equation.h:353
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_T_cell
shape function gradients.
Definition: saturation_transport_equation.h:435
virtual void make_assemblers_generic_constant_data()
This function computes Local CG FEM based assemblers - constant data (generic).
unsigned int thermal_blockindex_xwater
Block index for &quot;water_molar_fraction&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: saturation_transport_equation.h:324
VariableInfo s_liquid_water
VariableInfo structure corresponding to &quot;liquid_water_saturation&quot;.
Definition: saturation_transport_equation.h:294
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...
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
double get_kcond() const
Returns condensation rate constant, .
Definition: saturation_transport_equation.h:203
double p_cell
Total pressure in the cell.
Definition: saturation_transport_equation.h:363
std::vector< std::vector< double > > phi_T_cell
shape functions.
Definition: saturation_transport_equation.h:417
double M_water
Molar weight of water in grams/mole.
Definition: saturation_transport_equation.h:339
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< double > darea_lv_ds_cell
, at all quadrature points in the cell.
Definition: saturation_transport_equation.h:373
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...
Definition: saturation_transport_equation.h:241
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
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) .
VariableInfo t_rev
VariableInfo structure corresponding to &quot;temperature_of_REV&quot;.
Definition: saturation_transport_equation.h:304
virtual void initialize(ParameterHandler &param)
Initialize parameters.
bool cell_residual_counter
Counter set to TRUE when cell_residual is being assembled.
Definition: saturation_transport_equation.h:443