OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
data_out.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2014 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: data_out.h
11 // - Description:
12 // - Developers: M. Secanell
13 // - $Id: data_out.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__POSTPROCESSING__DATAOUT_H
18 #define _FUELCELLSHOP__POSTPROCESSING__DATAOUT_H
19 
20 // Include deal.II classes
21 #include <deal.II/numerics/data_out.h>
22 
23 //Include STL
24 #include <boost/shared_ptr.hpp>
25 #include <mutex>
26 #include <typeinfo>
27 
28 // Include OpenFCST routines:
29 
30 #include <layers/porous_layer.h>
31 #include <layers/catalyst_layer.h>
34 
35 #include <materials/PureGas.h>
36 
38 
39 using namespace dealii;
40 
41 namespace FuelCellShop
42 {
50  namespace PostProcessing
51  {
52 
91  template <int dim>
93  :
94  public dealii::DataPostprocessor<dim>
95  {
96  public:
97 
99 
100 
104  boost::shared_ptr< FuelCellShop::Layer::CatalystLayer<dim> > ,
110 
116  virtual std::vector<std::string> get_names() const;
117 
121  virtual std::vector<DataComponentInterpretation::DataComponentInterpretation> get_data_component_interpretation () const;
122 
126  virtual UpdateFlags get_needed_update_flags() const;
127 
132  void set_oxygen_density_name(std::string name)
133  {
134  oxygen_density_name = name;
135  }
136 
150  virtual void compute_derived_quantities_vector (const std::vector< Vector< double > > &uh,
151  const std::vector< std::vector< Tensor< 1, dim > > > & /*duh*/,
152  const std::vector< std::vector< Tensor< 2, dim > > > & /*dduh*/,
153  const std::vector< Point< dim > > & /*normals*/,
154  const std::vector< Point<dim> > & /*evaluation_points*/,
155  const types::material_id & mat_id,
156  std::vector< Vector< double > > &computed_quantities) const;
157 
158 
159  private:
163  boost::shared_ptr< FuelCellShop::Layer::CatalystLayer<dim> > catalyst_layer;
164 
169 
174 
181  mutable std::mutex catalyst_layer_mutex;
182 
186  std::string oxygen_density_name;
187  };
188 
189  //-------------------------------------------------------------------------------------------
190  //-------------------------------------------------------------------------------------------
191  //-------------------------------------------------------------------------------------------
192 
232  template <int dim>
234  :
235  public dealii::DataPostprocessor<dim>
236  {
237  public:
238 
240 
241 
245  boost::shared_ptr< FuelCellShop::Layer::CatalystLayer<dim> > ,
251 
257  virtual std::vector<std::string> get_names() const;
258 
262  virtual std::vector<DataComponentInterpretation::DataComponentInterpretation> get_data_component_interpretation () const;
263 
267  virtual UpdateFlags get_needed_update_flags() const;
268 
273  void set_hydrogen_density_name(std::string name)
274  {
275  hydrogen_density_name = name;
276  }
290  virtual void compute_derived_quantities_vector (const std::vector< Vector< double > > &uh,
291  const std::vector< std::vector< Tensor< 1, dim > > > & /*duh*/,
292  const std::vector< std::vector< Tensor< 2, dim > > > & /*dduh*/,
293  const std::vector< Point< dim > > & /*normals*/,
294  const std::vector< Point<dim> > & /*evaluation_points*/,
295  const types::material_id & mat_id,
296  std::vector< Vector< double > > &computed_quantities) const;
297 
298 
299  private:
303  boost::shared_ptr< FuelCellShop::Layer::CatalystLayer<dim> > catalyst_layer;
304 
309 
314 
321  mutable std::mutex catalyst_layer_mutex;
322 
327  };
328 
329  //-------------------------------------------------------------------------------------------
330  //-------------------------------------------------------------------------------------------
331  //-------------------------------------------------------------------------------------------
332 
378  template <int dim>
380  :
381  public dealii::DataPostprocessorScalar<dim>
382  {
383  public:
384 
386 
387 
391  std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer<dim> > > ,
397 
398 
399  virtual void compute_derived_quantities_vector (const std::vector< Vector< double > > &uh,
400  const std::vector< std::vector< Tensor< 1, dim > > > & /*duh*/,
401  const std::vector< std::vector< Tensor< 2, dim > > > & /*dduh*/,
402  const std::vector< Point< dim > > & /*normals*/,
403  const std::vector< Point<dim> > & /*evaluation_points*/,
404  const types::material_id & mat_id,
405  std::vector< Vector< double > > &computed_quantities) const;
406 
407 
408  private:
409 
414 
419 
423  std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer<dim> > > porous_layers;
424 
429 
430  };
431 
432  //-------------------------------------------------------------------------------------------
433  //-------------------------------------------------------------------------------------------
434  //-------------------------------------------------------------------------------------------
435 
482  template <int dim>
484  :
485  public dealii::DataPostprocessorScalar<dim>
486  {
487  public:
488 
490 
491 
495  std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer<dim> > > pls,
501 
505  virtual UpdateFlags get_needed_update_flags() const;
506 
510  virtual void compute_derived_quantities_vector (const std::vector< Vector< double > > &uh,
511  const std::vector< std::vector< Tensor< 1, dim > > > & /*duh*/,
512  const std::vector< std::vector< Tensor< 2, dim > > > & /*dduh*/,
513  const std::vector< Point< dim > > & /*normals*/,
514  const std::vector< Point<dim> > & /*evaluation_points*/,
515  const types::material_id & mat_id,
516  std::vector< Vector< double > > &computed_quantities) const;
517 
518 
519  private:
524 
528  std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer<dim> > > porous_layers;
529 
534 
535  };
536 
540  template <int dim>
542  :
543  public dealii::DataPostprocessorScalar<dim>
544  {
545  public:
546 
548 
549 
553  std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer<dim> > > pls,
558  virtual ~SaturationDataOut() {}
559 
565  virtual std::vector<std::string> get_names() const;
566 
570  virtual std::vector<DataComponentInterpretation::DataComponentInterpretation> get_data_component_interpretation () const;
571 
575  virtual UpdateFlags get_needed_update_flags() const;
576 
580  virtual void compute_derived_quantities_vector (const std::vector< Vector< double > > &uh,
581  const std::vector< std::vector< Tensor< 1, dim > > > & /*duh*/,
582  const std::vector< std::vector< Tensor< 2, dim > > > & /*dduh*/,
583  const std::vector< Point< dim > > & /*normals*/,
584  const std::vector< Point<dim> > & /*evaluation_points*/,
585  const types::material_id & mat_id,
586  std::vector< Vector< double > > &computed_quantities) const;
587 
588 
589  private:
594 
598  std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer<dim> > > porous_layers;
599 
604 
605  };
606  }
607 
608 }
609 
610 
611 
612 #endif
FuelCell::OperatingConditions * opCond
Pointer to operating conditions class.
Definition: data_out.h:603
std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer< dim > > > porous_layers
Vector of pointer to PorousLayer objects.
Definition: data_out.h:423
Class used to store, read from file and define the operating conditions for a fuel cell...
Definition: operating_conditions.h:118
FuelCell::OperatingConditions * opCond
Pointer to operating conditions class.
Definition: data_out.h:173
FuelCell::SystemManagement * system_management
Pointer to system management.
Definition: data_out.h:168
FuelCell::OperatingConditions * opCond
Pointer to operating conditions class.
Definition: data_out.h:313
void set_oxygen_density_name(std::string name)
For the case of multi-component solvers, we need to specify which one of the variables contains the o...
Definition: data_out.h:132
FuelCell::SystemManagement * system_management
Pointer to system management.
Definition: data_out.h:418
Class used to output saturation inside the layer.
Definition: data_out.h:541
virtual ~RelativeHumidityDataOut()
Destructor.
Definition: data_out.h:396
boost::shared_ptr< FuelCellShop::Layer::CatalystLayer< dim > > catalyst_layer
Pointer to catalyst layer object.
Definition: data_out.h:163
std::mutex catalyst_layer_mutex
The mutex class used to prevent simultaneous calls to the layer objects from multiple threads...
Definition: data_out.h:321
virtual ~HORCurrentDensityDataOut()
Destructor.
Definition: data_out.h:250
FuelCell::SystemManagement * system_management
Pointer to system management.
Definition: data_out.h:523
FuelCell::OperatingConditions * opCond
Pointer to operating conditions class.
Definition: data_out.h:428
virtual ~SaturationDataOut()
Destructor.
Definition: data_out.h:558
virtual ~CapillaryPressureDataOut()
Destructor.
Definition: data_out.h:500
std::string oxygen_density_name
Set oxygen concentration name.
Definition: data_out.h:186
FuelCellShop::Material::WaterVapor water
WaterVapor object, used to compute saturation pressure as a function of temperature.
Definition: data_out.h:413
boost::shared_ptr< FuelCellShop::Layer::CatalystLayer< dim > > catalyst_layer
Pointer to catalyst layer object.
Definition: data_out.h:303
FuelCell::SystemManagement * system_management
Pointer to system management.
Definition: data_out.h:593
std::mutex catalyst_layer_mutex
The mutex class used to prevent simultaneous calls to the layer objects from multiple threads...
Definition: data_out.h:181
virtual ~ORRCurrentDensityDataOut()
Destructor.
Definition: data_out.h:109
Class used to evaluate the capillary pressure at PorousLayer (viz., GDL, MPL and CL) DoF point in the...
Definition: data_out.h:483
std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer< dim > > > porous_layers
Vector of pointer to PorousLayer objects.
Definition: data_out.h:528
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
FuelCell::SystemManagement * system_management
Pointer to system management.
Definition: data_out.h:308
std::string hydrogen_density_name
Set hydrogen density name.
Definition: data_out.h:326
void set_hydrogen_density_name(std::string name)
For the case of multi-component solvers, we need to specify which one of the variables contains the o...
Definition: data_out.h:273
Virtual class used to implement properties that are characteristic of a porous layer.
Definition: porous_layer.h:75
Class used to evaluate the HOR current density, overpotential and effectiveness at catalyst layer DoF...
Definition: data_out.h:233
Class used to evaluate the ORR current density, overpotential, effectiveness and the oxygen coverages...
Definition: data_out.h:92
FuelCell::OperatingConditions * opCond
Pointer to operating conditions class.
Definition: data_out.h:533
std::vector< boost::shared_ptr< FuelCellShop::Layer::PorousLayer< dim > > > porous_layers
Vector of pointer to PorousLayer objects.
Definition: data_out.h:598
Virtual class used to provide the interface for all CatalystLayer children.
Definition: catalyst_layer.h:124
This class describes properties of pure WaterVapor.
Definition: PureGas.h:1134
Class used to evaluate the relative humidity at PorousLayer (viz., GDL, MPL and CL) DoF point in the ...
Definition: data_out.h:379