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 // - Id: $Id: thermal_transport_equation.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FCST_FUELCELLSHOP_EQUATION_THERMAL_TRANSPORT_EQUATION_H_
18 #define _FCST_FUELCELLSHOP_EQUATION_THERMAL_TRANSPORT_EQUATION_H_
19 
20 #include "fcst_units.h"
21 #include "equation_base.h"
22 #include "gas_diffusion_layer.h"
23 #include "micro_porous_layer.h"
24 #include "catalyst_layer.h"
25 #include "membrane_layer.h"
26 #include "fcst_constants.h"
27 #include "fcst_utilities.h"
28 
29 //STD
30 #include <string>
31 #include <sstream>
32 
33 
34 namespace FuelCellShop
35 {
36  namespace Equation
37  {
39 
40 
45  DeclException2(VariableNotFoundForOhmicHeat,
46  std::string,
47  std::string,
48  << "For " << arg1 << " ohmic heating source term set as True, \"" << arg2 << "\" is not found as one of the solution variables.");
50 
189  template<int dim>
191  {
192  public:
193 
195 
196 
201 
205  virtual ~ThermalTransportEquation();
206 
210  virtual void declare_parameters(ParameterHandler& param) const;
211 
217  virtual void initialize(ParameterHandler& param);
218 
220 
222 
223 
230 
237 
244 
251 
253 
255 
256 
261  virtual void print_equation_info() const;
262 
267  inline bool get_electron_ohmic_heat_gdl() const
268  { return electron_ohmic_heat_gdl;}
269 
274  inline bool get_electron_ohmic_heat_mpl() const
275  { return electron_ohmic_heat_mpl;}
276 
281  inline bool get_electron_ohmic_heat_cl() const
282  { return electron_ohmic_heat_cl;}
283 
288  inline bool get_proton_ohmic_heat_cl() const
289  { return proton_ohmic_heat_cl;}
290 
295  inline bool get_proton_ohmic_heat_ml() const
296  { return proton_ohmic_heat_ml;}
297 
299 
300  protected:
301 
303 
304 
310 
316 
322 
328 
334 
339 
344 
349 
351 
353 
354 
360  std::map<unsigned int, double> const_heat_flux_map;
361 
366  std::map<unsigned int, std::vector<double>> conv_heat_flux_map;
367 
369 
371 
372 
378 
388 
398 
405 
412 
413 
417  template <typename porelayer>
419  porelayer* const layer);
420 
424  template <typename polymer>
426  const polymer* const layer);
427 
429 
431 
432 
437  virtual void make_internal_cell_couplings();
438 
440 
442 
443 
448 
453 
458 
463 
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 
589  std::vector< Tensor<1,dim> > grad_phiM_cell_old;
590 
595  std::vector< Tensor<1,dim> > grad_phiS_cell_old;
596 
601  std::vector< Tensor<1,dim> > grad_lambda_cell_old;
602 
604 
606 
607 
612  std::map< std::string, std::vector< Tensor<2,dim> > > conc_Deff_dHdT_map;
613 
618  std::map< std::string, std::vector< Tensor<2,dim> > > dT_concDeffdHdT_map;
619 
624  std::map< std::string, std::vector< Tensor<2,dim> > > ds_concDeffdHdT_map;
625 
633  std::map< std::string, std::vector< std::vector< Tensor<1,dim> > > > grad_phi_xi_map;
634 
638  std::vector<double> electroosmotic_dhdT;
639 
643  std::vector<double> delectroosmotic_dhdT_dlambda;
644 
648  std::vector<double> delectroosmotic_dhdT_dT;
649 
653  std::vector<double> backdiff_dhdT;
654 
658  std::vector<double> dbackdiff_dhdT_dlambda;
659 
663  std::vector<double> dbackdiff_dhdT_dT;
664 
668  std::vector<double> thermoosmotic_dhdT;
669 
673  std::vector<double> dthermoosmotic_dhdT_dT;
674 
676 
678 
679 
685  std::vector< Tensor<2,dim> > dkeff_dT_bdry;
686 
694  std::vector< std::vector<double> > phi_T_bdry;
695 
697 
703 
709 
714  unsigned int last_iter_cell;
715 
720  unsigned int last_iter_bdry;
721 
722  };
723 
724  } // Equation
725 
726 } // FuelCellShop
727 
728 #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:618
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:601
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:327
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...
ThermalTransportEquation(FuelCell::SystemManagement &system_management)
Constructor.
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.
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:288
VariableInfo phi_m
VariableInfo structure corresponding to &quot;protonic_electrical_potential&quot;.
Definition: thermal_transport_equation.h:457
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:281
bool flag_thermoosmosis
This flag indicates that lambda transport due to thermo-osmotic diffusion is ON or OFF...
Definition: thermal_transport_equation.h:348
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:694
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:817
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:267
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:633
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:295
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:333
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:338
This class deals with Thermal Transport Equation.
Definition: thermal_transport_equation.h:190
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:595
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:274
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:714
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:653
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:321
std::vector< double > thermoosmotic_dhdT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:668
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:625
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:315
std::vector< double > electroosmotic_dhdT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:638
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:720
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:452
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:589
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:708
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:467
std::vector< double > dthermoosmotic_dhdT_dT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:673
std::vector< double > delectroosmotic_dhdT_dlambda
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:643
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.
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:612
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:360
bool enthalpy_lambda_transport
This boolean data member indicates that the enthalpy transport associated with lambda (sorbed water) ...
Definition: thermal_transport_equation.h:343
std::vector< double > delectroosmotic_dhdT_dT
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:648
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:663
bool cell_residual_counter
Counter set to TRUE when cell_residual is being assembled.
Definition: thermal_transport_equation.h:702
This class contains generic data and methods heavily used by all derived equation classes...
Definition: equation_base.h:199
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:271
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:309
This simple structure stores certain information regarding a particular variable for the equation (al...
Definition: equation_base.h:121
std::map< unsigned int, std::vector< double > > conv_heat_flux_map
Container for details regarding Convective Heat Flux boundaries.
Definition: thermal_transport_equation.h:366
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:462
VariableInfo t_rev
VariableInfo structure corresponding to base variable of this equation class, &quot;temperature_of_REV&quot;.
Definition: thermal_transport_equation.h:447
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:39
std::vector< double > dbackdiff_dhdT_dlambda
, at all quadrature points in the cell.
Definition: thermal_transport_equation.h:658
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:685
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:624