OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
liquid_transport_equation.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2015 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: liquid_transport_equation.h
11 // - Description: Equation class for liquid water transport using Darcy's law
12 // - Developers: Jie Zhou and Marc Secanell
13 //
14 //---------------------------------------------------------------------------
15 
16 #ifndef _FCST_FUELCELLSHOP_EQUATION_LIQUID_PRESSURE_EQUATION_H_
17 #define _FCST_FUELCELLSHOP_EQUATION_LIQUID_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  {
149  template<int dim>
151  {
152  public:
153 
155 
156 
161  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data = boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
162 
166  virtual ~LiquidPressureEquation();
167 
171  virtual void declare_parameters(ParameterHandler& param) const;
172 
176  virtual void initialize(ParameterHandler& param);
177 
179 
181 
182 
188 
195 
203 
211 
213 
215 
216 
220  virtual void print_equation_info() const;
221 
223 
224  protected:
225 
227 
228 
234 
244 
256 
263 
272 
274 
276 
277 
282  virtual void make_internal_cell_couplings();
283 
290  virtual void make_boundary_types(){};
291 
298  virtual void make_output_types()
299  {};
300 
302 
304 
305 
309 
314 
319 
324 
329 
334 
339 
344 
349 
353  double M_water;
354 
358  double rho_l;
359 
363  double k_sat;
364 
368  double k_sat_bdry;
369 
371 
373 
374 
378  double p_cell;
379 
383  std::vector< Tensor<2,dim> > rhok_mu_cell;
384 
388  std::vector< Tensor<2,dim> > rhok_mu_cell_bdry;
389 
393  std::vector< Tensor<2,dim> > rho_mu_dk_dp_cell;
394 
398  std::vector< Tensor<2,dim> > dT_rhok_mu_cell;
399 
406  std::vector< std::vector<double> > phi_p_cell;
407 
414  std::vector< std::vector<double> > phi_p_cell_bdry;
415 
423  std::vector< std::vector<double> > phi_xwater_cell;
424 
432  std::vector< std::vector<double> > phi_T_cell;
433 
441  std::vector< std::vector< Tensor<1,dim> > > grad_phi_p_cell;
442 
450  std::vector< std::vector< Tensor<1,dim> > > grad_phi_T_cell;
451 
453 
459 
464  unsigned int last_iter_cell;
465 
470  unsigned int last_iter_bdry;
471 
483 
489  std::vector <bool> reached_breakthrough_pressure;
490 
501  std::map<unsigned int, double> capillary_pressure_current_flux_map;
502 
514 
530  double temperature;
531 
532  };
533  } // Equation
534 } // FuelCellShop
535 
536 #endif
double p_cell
Total pressure in the cell.
Definition: liquid_transport_equation.h:378
unsigned int thermal_blockindex_xwater
Block index for &quot;water_molar_fraction&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: liquid_transport_equation.h:338
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters.
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
unsigned int thermal_blockindex_pliquid
Block index for &quot;liquid_pressure&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: liquid_transport_equation.h:343
double p_channel_GDL
The boundary condition term which indicates the liquid pressure (Pa) in .
Definition: liquid_transport_equation.h:513
unsigned int fickswater_blockindex_trev
Block index for &quot;temperature_of_REV&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: liquid_transport_equation.h:333
unsigned int fickswater_blockindex_pliquid
Block index for &quot;liquid_pressure&quot; corresponding to &quot;Ficks Transport Equation - water&quot;.
Definition: liquid_transport_equation.h:328
unsigned int fickswater_blockindex_xwater
Block index for &quot;water_molar_fraction&quot; corresponding to &quot;Ficks Transport Equation - water&quot;...
Definition: liquid_transport_equation.h:323
std::vector< std::vector< double > > phi_p_cell_bdry
shape functions at the boundary.
Definition: liquid_transport_equation.h:414
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...
unsigned int thermal_blockindex_trev
Block index for &quot;temperature_of_REV&quot; corresponding to &quot;Thermal Transport Equation&quot;.
Definition: liquid_transport_equation.h:348
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 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 rho_l
Density of liquid water, .
Definition: liquid_transport_equation.h:358
virtual void make_assemblers_generic_constant_data()
This function computes Local CG FEM based assemblers - constant data (generic).
std::vector< Tensor< 2, dim > > rhok_mu_cell
, at all quadrature points in the cell.
Definition: liquid_transport_equation.h:383
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:798
bool cell_residual_counter
Counter set to TRUE when cell_residual is being assembled.
Definition: liquid_transport_equation.h:458
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_T_cell
shape function gradients.
Definition: liquid_transport_equation.h:450
std::vector< bool > reached_breakthrough_pressure
Once the liquid pressure at the GDL and channel interface reaches the breakthrouhg pressure the follo...
Definition: liquid_transport_equation.h:489
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) .
std::vector< std::vector< double > > phi_p_cell
shape functions.
Definition: liquid_transport_equation.h:406
VariableInfo p_liquid_water
VariableInfo structure corresponding to &quot;liquid_pressure&quot;.
Definition: liquid_transport_equation.h:308
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_p_cell
shape function gradients.
Definition: liquid_transport_equation.h:441
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings.
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: liquid_transport_equation.h:464
virtual void initialize(ParameterHandler &param)
Initialize parameters.
virtual void print_equation_info() const
The function prints out the equation&#39;s info.
VariableInfo t_rev
VariableInfo structure corresponding to &quot;temperature_of_REV&quot;.
Definition: liquid_transport_equation.h:318
double M_water
Molar weight of water in grams/mole.
Definition: liquid_transport_equation.h:353
std::vector< Tensor< 2, dim > > rhok_mu_cell_bdry
, at all quadrature points in the boundary.
Definition: liquid_transport_equation.h:388
double temperature
Temperature [in K] of the layer.
Definition: liquid_transport_equation.h:530
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
LiquidPressureEquation(FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
Constructor.
This class implements a mass conservation equation for liquid transport in a fuel cell porous media...
Definition: liquid_transport_equation.h:150
bool breakthrough_phenomenon
This data member is set to true when the following boundary condition is to be applied at the boundar...
Definition: liquid_transport_equation.h:482
std::map< unsigned int, double > capillary_pressure_current_flux_map
The map is used as the parameter in .
Definition: liquid_transport_equation.h:501
VariableInfo x_water
VariableInfo structure corresponding to &quot;water_molar_fraction&quot;.
Definition: liquid_transport_equation.h:313
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) .
std::vector< std::vector< double > > phi_xwater_cell
shape functions.
Definition: liquid_transport_equation.h:423
std::vector< Tensor< 2, dim > > dT_rhok_mu_cell
Computing the derivitive with respect to in the function , at all quadrature points in the cell...
Definition: liquid_transport_equation.h:398
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: liquid_transport_equation.h:470
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.
This is the base class used for all Equation classes.
Definition: equation_base.h:160
virtual void make_boundary_types()
This function fills out boundary_types.
Definition: liquid_transport_equation.h:290
double k_sat
Saturated permeability inside the porous media, .
Definition: liquid_transport_equation.h:363
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
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< double > > phi_T_cell
shape functions.
Definition: liquid_transport_equation.h:432
double k_sat_bdry
Saturated permeability at the boundary of the domain, .
Definition: liquid_transport_equation.h:368
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
virtual void make_output_types()
This function fills out output_types.
Definition: liquid_transport_equation.h:298
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.
double p_channel_GDL_second
The boundary condition term which indicates the breakthrough liquid pressure (Pa).
Definition: liquid_transport_equation.h:526
std::vector< Tensor< 2, dim > > rho_mu_dk_dp_cell
Computing the derivitive with respect to in the function , at all quadrature points in the cell...
Definition: liquid_transport_equation.h:393