OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
thermal_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: thermal_transport_equation.h 18-04-2013
11 // - Description: Equation class for Thermal transport
12 // - Developers: Madhur Bhaiya
13 //
14 //---------------------------------------------------------------------------
15 
16 #ifndef _FCST_FUELCELLSHOP_EQUATION_THERMAL_TRANSPORT_EQUATION_H_
17 #define _FCST_FUELCELLSHOP_EQUATION_THERMAL_TRANSPORT_EQUATION_H_
18 
19 #include <utils/fcst_units.h>
23 #include <layers/catalyst_layer.h>
24 #include <layers/membrane_layer.h>
25 
26 //STD
27 #include <string>
28 #include <sstream>
29 
30 
31 namespace FuelCellShop
32 {
33  namespace Equation
34  {
36 
37 
42  DeclException2(VariableNotFoundForOhmicHeat,
43  std::string,
44  std::string,
45  << "For " << arg1 << " ohmic heating source term set as True, \"" << arg2 << "\" is not found as one of the solution variables.");
47 
186  template<int dim>
188  {
189  public:
190 
192 
193 
197  ThermalTransportEquation(FuelCell::SystemManagement& system_management,boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
198  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
199 
203  virtual ~ThermalTransportEquation();
204 
208  virtual void declare_parameters(ParameterHandler& param) const;
209 
215  virtual void initialize(ParameterHandler& param);
216 
218 
220 
221 
228 
235 
242 
249 
251 
253 
254 
259  virtual void print_equation_info() const;
260 
265  inline bool get_electron_ohmic_heat_gdl() const
266  { return electron_ohmic_heat_gdl;}
267 
272  inline bool get_electron_ohmic_heat_mpl() const
273  { return electron_ohmic_heat_mpl;}
274 
279  inline bool get_electron_ohmic_heat_cl() const
280  { return electron_ohmic_heat_cl;}
281 
286  inline bool get_proton_ohmic_heat_cl() const
287  { return proton_ohmic_heat_cl;}
288 
293  inline bool get_proton_ohmic_heat_ml() const
294  { return proton_ohmic_heat_ml;}
295 
297 
298  protected:
299 
301 
302 
308 
314 
320 
326 
332 
337 
342 
347 
349 
351 
352 
358  std::map<unsigned int, double> const_heat_flux_map;
359 
364  std::map<unsigned int, std::vector<double>> conv_heat_flux_map;
365 
367 
369 
370 
376 
386 
396 
403 
410 
411 
415  template <typename porelayer>
417  porelayer* const layer);
418 
422  template <typename polymer>
424  const polymer* const layer);
425 
427 
429 
430 
435  virtual void make_internal_cell_couplings();
436 
438 
440 
441 
446 
451 
456 
461 
466 
468 
473  std::map< std::string, VariableInfo > xi_map;
474 
476 
478 
479 
484  std::vector< Tensor<2,dim> > keff_cell;
485 
491  std::vector< Tensor<2,dim> > dkeff_dT_cell;
492 
497  Tensor<2,dim> sigmaSeff_cell;
498 
504  std::vector<double> sigmaMeff_cell;
505 
511  std::vector<double> dsigmaMeff_dT_cell;
512 
518  std::vector<double> dsigmaMeff_dlambda_cell;
519 
520 
528  std::vector< std::vector<double> > phi_T_cell;
529 
537  std::vector< std::vector< Tensor<1,dim> > > grad_phi_T_cell;
538 
546  std::vector< std::vector< Tensor<1,dim> > > grad_phi_phiS_cell;
547 
555  std::vector< std::vector< Tensor<1,dim> > > grad_phi_phiM_cell;
556 
564  std::vector< std::vector<double> > phi_lambda_cell;
565 
573  std::vector< std::vector< Tensor<1,dim> > > grad_phi_lambda_cell;
574 
582  std::vector< std::vector<double> > phi_s_cell;
583 
584  std::vector< std::vector<double> > phi_p_cell;
585 
586 
591  std::vector< Tensor<1,dim> > grad_phiM_cell_old;
592 
597  std::vector< Tensor<1,dim> > grad_phiS_cell_old;
598 
603  std::vector< Tensor<1,dim> > grad_lambda_cell_old;
604 
606 
608 
609 
614  std::map< std::string, std::vector< Tensor<2,dim> > > conc_Deff_dHdT_map;
615 
620  std::map< std::string, std::vector< Tensor<2,dim> > > dT_concDeffdHdT_map;
621 
626  std::map< std::string, std::vector< Tensor<2,dim> > > ds_concDeffdHdT_map;
627 
628  std::map< std::string, std::vector< Tensor<2,dim> > > dp_concDeffdHdT_map;
636  std::map< std::string, std::vector< std::vector< Tensor<1,dim> > > > grad_phi_xi_map;
637 
641  std::vector<double> electroosmotic_dhdT;
642 
646  std::vector<double> delectroosmotic_dhdT_dlambda;
647 
651  std::vector<double> delectroosmotic_dhdT_dT;
652 
656  std::vector<double> backdiff_dhdT;
657 
661  std::vector<double> dbackdiff_dhdT_dlambda;
662 
666  std::vector<double> dbackdiff_dhdT_dT;
667 
671  std::vector<double> thermoosmotic_dhdT;
672 
676  std::vector<double> dthermoosmotic_dhdT_dT;
677 
679 
681 
682 
688  std::vector< Tensor<2,dim> > dkeff_dT_bdry;
689 
697  std::vector< std::vector<double> > phi_T_bdry;
698 
700 
706 
712 
717  unsigned int last_iter_cell;
718 
723  unsigned int last_iter_bdry;
724 
725  };
726 
727  } // Equation
728 
729 } // FuelCellShop
730 
731 #endif
std::map< std::string, std::vector< Tensor< 2, dim > > > dT_concDeffdHdT_map
Value in the map represents [W/(cm-K^2)], at previous iteration step at all quadrature points in the...
Definition: thermal_transport_equation.h:620
std::vector< Tensor< 2, dim > > keff_cell
Effective thermal conductivity, [W/(cm-k )], at all quadrature points of the cell.
Definition: thermal_transport_equation.h:484
std::vector< Tensor< 1, dim > > grad_lambda_cell_old
Gradient of &quot;membrane_water_content&quot; at a previous Newton iteration, at all quadrature points in the ...
Definition: thermal_transport_equation.h:603
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
bool proton_ohmic_heat_cl
This boolean data member indicates that the protonic ohmic heating in Catalyst layer is ON or OFF...
Definition: thermal_transport_equation.h:325
void gas_enthalpy_transport_assemblers_cell_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, porelayer *const layer)
This function computes Enthalpy transport assemblers - variable data (cell) corresponding to enthalpy...
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_phiM_cell
shape function gradients.
Definition: thermal_transport_equation.h:555
std::vector< double > sigmaMeff_cell
Effective protonic conductivity, [S/cm], at all quadrature points of the cell.
Definition: thermal_transport_equation.h:504
std::vector< double > dsigmaMeff_dT_cell
Derivative of effective protonic conductivity w.r.t &quot;temperature_of_REV&quot;, at all quadrature points in...
Definition: thermal_transport_equation.h:511
virtual void print_equation_info() const
This function prints out the equations info.
VariableInfo p_liquid_water
Definition: thermal_transport_equation.h:467
bool get_proton_ohmic_heat_cl() const
Inline method to get whether the protonic ohmic heating in Catalyst layer is ON or OFF (proton_ohmic_...
Definition: thermal_transport_equation.h:286
VariableInfo phi_m
VariableInfo structure corresponding to &quot;protonic_electrical_potential&quot;.
Definition: thermal_transport_equation.h:455
bool get_electron_ohmic_heat_cl() const
Inline method to get whether the electronic ohmic heating in Catalyst layer is ON or OFF (electron_oh...
Definition: thermal_transport_equation.h:279
bool flag_thermoosmosis
This flag indicates that lambda transport due to thermo-osmotic diffusion is ON or OFF...
Definition: thermal_transport_equation.h:346
std::vector< std::vector< double > > phi_s_cell
shape functions.
Definition: thermal_transport_equation.h:582
std::vector< std::vector< double > > phi_T_bdry
shape functions.
Definition: thermal_transport_equation.h:697
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:798
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_T_cell
shape function gradients.
Definition: thermal_transport_equation.h:537
bool get_electron_ohmic_heat_gdl() const
Inline method to get whether the electronic ohmic heating in Gas diffusion layer is ON or OFF (electr...
Definition: thermal_transport_equation.h:265
std::vector< double > dsigmaMeff_dlambda_cell
Derivative of effective protonic conductivity w.r.t &quot;membrane_water_content&quot;, at all quadrature point...
Definition: thermal_transport_equation.h:518
std::map< std::string, std::vector< std::vector< Tensor< 1, dim > > > > grad_phi_xi_map
Map of shape function gradients.
Definition: thermal_transport_equation.h:636
Tensor< 2, dim > sigmaSeff_cell
Effective electronic conductivity, [S/cm], of the cell.
Definition: thermal_transport_equation.h:497
bool get_proton_ohmic_heat_ml() const
Inline method to get whether the protonic ohmic heating in Membrane layer is ON or OFF (proton_ohmic_...
Definition: thermal_transport_equation.h:293
bool proton_ohmic_heat_ml
This boolean data member indicates that the protonic ohmic heating in Membrane layer is ON or OFF...
Definition: thermal_transport_equation.h:331
bool enthalpy_fickian_transport
This boolean data member indicates that the enthalpy transport via Fickian diffusion is ON or OFF...
Definition: thermal_transport_equation.h:336
This class deals with Thermal Transport Equation.
Definition: thermal_transport_equation.h:187
std::vector< Tensor< 1, dim > > grad_phiS_cell_old
Gradient of &quot;electronic_electrical_potential&quot; at a previous Newton iteration, at all quadrature point...
Definition: thermal_transport_equation.h:597
virtual void initialize(ParameterHandler &param)
Initialize parameters.
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< Tensor< 1, dim > > > grad_phi_lambda_cell
shape function gradients.
Definition: thermal_transport_equation.h:573
bool get_electron_ohmic_heat_mpl() const
Inline method to get whether the electronic ohmic heating in Microporous layer is ON or OFF (electron...
Definition: thermal_transport_equation.h:272
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: thermal_transport_equation.h:717
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters.
std::vector< double > backdiff_dhdT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:656
ThermalTransportEquation(FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
Constructor.
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...
std::vector< std::vector< Tensor< 1, dim > > > grad_phi_phiS_cell
shape function gradients.
Definition: thermal_transport_equation.h:546
bool electron_ohmic_heat_cl
This boolean data member indicates that the electronic ohmic heating in Catalyst layer is ON or OFF...
Definition: thermal_transport_equation.h:319
std::vector< double > thermoosmotic_dhdT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:671
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
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...
bool electron_ohmic_heat_mpl
This boolean data member indicates that the electronic ohmic heating in Microporous layer is ON or OF...
Definition: thermal_transport_equation.h:313
std::vector< double > electroosmotic_dhdT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:641
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: thermal_transport_equation.h:723
std::vector< Tensor< 2, dim > > dkeff_dT_cell
Derivative of effective thermal conductivity w.r.t &quot;temperature_of_REV&quot;, at all quadrature points of ...
Definition: thermal_transport_equation.h:491
VariableInfo phi_s
VariableInfo structure corresponding to &quot;electronic_electrical_potential&quot;.
Definition: thermal_transport_equation.h:450
std::vector< Tensor< 1, dim > > grad_phiM_cell_old
Gradient of &quot;protonic_electrical_potential&quot; at a previous Newton iteration, at all quadrature points ...
Definition: thermal_transport_equation.h:591
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
bool bdry_residual_counter
Counter set to TRUE when bdry_residual is being assembled.
Definition: thermal_transport_equation.h:711
std::vector< std::vector< double > > phi_T_cell
shape functions.
Definition: thermal_transport_equation.h:528
virtual void assemble_cell_residual(FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell residual.
VariableInfo s_liquid_water
VariableInfo structure corresponding to &quot;liquid_water_saturation&quot;.
Definition: thermal_transport_equation.h:465
std::vector< double > dthermoosmotic_dhdT_dT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:676
std::vector< double > delectroosmotic_dhdT_dlambda
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:646
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings.
DeclException2(VariableShouldExistForEquation, std::string, std::string,<< "The user-defined variable with name \""<< arg1<< "\" should be one of the solution variables for equation with name \""<< arg2<< "\"")
Exception thrown when a particular variable required by the equation class, does not exist in the use...
virtual void make_assemblers_generic_constant_data()
This function computes Local CG FEM based assemblers - constant data (generic).
virtual void assemble_bdry_residual(FuelCell::ApplicationCore::FEVector &bdry_residual, 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_p_cell
Definition: thermal_transport_equation.h:584
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< std::string, std::vector< Tensor< 2, dim > > > conc_Deff_dHdT_map
Value in the map represents [W/(cm-K)], at previous iteration step at all quadrature points in the c...
Definition: thermal_transport_equation.h:614
std::map< std::string, std::vector< Tensor< 2, dim > > > dp_concDeffdHdT_map
Definition: thermal_transport_equation.h:628
std::map< unsigned int, double > const_heat_flux_map
std::map&lt; unsigned int, double &gt; container for details regarding Constant Heat Flux boundaries...
Definition: thermal_transport_equation.h:358
bool enthalpy_lambda_transport
This boolean data member indicates that the enthalpy transport associated with lambda (sorbed water) ...
Definition: thermal_transport_equation.h:341
std::vector< double > delectroosmotic_dhdT_dT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:651
void lambda_enthalpy_transport_assemblers_cell_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, const polymer *const layer)
This function computes Enthalpy transport assemblers - variable data (cell) corresponding to enthalpy...
std::vector< double > dbackdiff_dhdT_dT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:666
bool cell_residual_counter
Counter set to TRUE when cell_residual is being assembled.
Definition: thermal_transport_equation.h:705
This is the base class used for all Equation classes.
Definition: equation_base.h:160
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) .
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
bool electron_ohmic_heat_gdl
This boolean data member indicates that the electronic ohmic heating in Gas diffusion layer is ON or ...
Definition: thermal_transport_equation.h:307
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_auxiliaries.h:51
std::map< unsigned int, std::vector< double > > conv_heat_flux_map
Container for details regarding Convective Heat Flux boundaries.
Definition: thermal_transport_equation.h:364
std::map< std::string, VariableInfo > xi_map
Map of VariableInfo structures of various gaseous species, whose diffusion is being considered in the...
Definition: thermal_transport_equation.h:473
VariableInfo lambda
VariableInfo structure corresponding to &quot;membrane_water_content&quot;.
Definition: thermal_transport_equation.h:460
VariableInfo t_rev
VariableInfo structure corresponding to base variable of this equation class, &quot;temperature_of_REV&quot;.
Definition: thermal_transport_equation.h:445
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
std::vector< double > dbackdiff_dhdT_dlambda
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:661
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.
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
std::vector< Tensor< 2, dim > > dkeff_dT_bdry
Derivative of effective thermal conductivity w.r.t &quot;temperature_of_REV&quot;, at all quadrature points of ...
Definition: thermal_transport_equation.h:688
std::vector< std::vector< double > > phi_lambda_cell
shape functions.
Definition: thermal_transport_equation.h:564
std::map< std::string, std::vector< Tensor< 2, dim > > > ds_concDeffdHdT_map
Value in the map represents [W/(cm-K)], at previous iteration step at all quadrature points in the c...
Definition: thermal_transport_equation.h:626