OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PureSolid.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: PureSolid.h
11 // - Description: Material class for pure liquids.
12 // - Developers: Marc Secanell, Jie Zhou
13 // - $Id: PureSolid.h 2605 2014-08-15 03:36:44Z secanell $
14 //
15 //---------------------------------------------------------------------------
16 
17 #ifndef _FUELCELLSHOP__PURESOLID__H
18 #define _FUELCELLSHOP__PURESOLID__H
19 
20 //Include STL
21 #include <cmath>
22 #include <iostream>
23 #include <cstdlib>
24 #include <vector>
25 #include <fstream>
26 #include <string>
27 #include <map>
28 
29 #include <deal.II/base/parameter_handler.h>
30 #include "base_material.h"
31 #include "system_management.h"
32 
34 {
38 };
39 
40 namespace FuelCellShop
41 
42 {
43  namespace Material
44  {
45 
60  class PureSolid : public BaseMaterial
61  {
62  public:
63 
65 
66 
71  :
72  BaseMaterial()
73  {};
74 
78  virtual ~PureSolid();
79 
95  static void declare_PureSolid_parameters (ParameterHandler &param)
96  {
97 
98  for (typename FuelCellShop::Material::PureSolid::_mapFactory::iterator iterator = FuelCellShop::Material::PureSolid::get_mapFactory()->begin();
100  iterator++)
101  {
102  param.enter_subsection("Material Database");
103  {
104  param.enter_subsection("PureSolid");
105  {
106  iterator->second->declare_parameters(param);
107  }
108  param.leave_subsection();
109  }
110  param.leave_subsection();
111  }
112 
113  }
114 
120  static boost::shared_ptr<FuelCellShop::Material::PureSolid > create_PureSolid (std::string concrete_name,
121  ParameterHandler &param)
122  {
123 
124  boost::shared_ptr<FuelCellShop::Material::PureSolid> pointer;
125 
126  typename FuelCellShop::Material::PureSolid::_mapFactory::iterator iterator = FuelCellShop::Material::PureSolid::get_mapFactory()->find(concrete_name);
127 
128  if (iterator != FuelCellShop::Material::PureSolid::get_mapFactory()->end())
129  {
130  if (iterator->second)
131  {
132  pointer = iterator->second->create_replica(concrete_name);
133  }
134  else
135  {
136  FcstUtilities::log<<"Pointer not initialized"<<std::endl;
137  abort();
138  }
139  }
140  else
141  {
142  AssertThrow(false, ExcMessage("Concrete name in FuelCellShop::Material::PureSolid::create_PureSolid does not exist"));
143  }
144 
145  param.enter_subsection("Material Database");
146  {
147  param.enter_subsection("PureSolid");
148  {
149  pointer->initialize(param);
150  }
151  param.leave_subsection();
152  }
153  param.leave_subsection();
154 
155  return pointer;
156 
157  }
159 
161 
162 
164  virtual double get_density() const = 0;
165 
167  virtual double get_electrical_conductivity(double temperature) const = 0 ;
168 
172  virtual void get_electrical_conductivity(std::vector<double> temperature,std::vector<double>& dst) const = 0;
173 
175  virtual double get_Delectrical_conductivity_Dtemperature(double temperature) const = 0;
176 
178  virtual void get_Delectrical_conductivity_Dtemperature(std::vector<double> temperature,std::vector<double> &dst) const = 0;
179 
181  virtual double get_thermal_conductivity(double temperature) const = 0;
182 
184  virtual void get_thermal_conductivity(std::vector<double> temperature,std::vector<double>&dst) const = 0;
185 
187  virtual double get_Dthermal_conductivity_Dtemperature(double temperature) const = 0;
188 
190  virtual void get_Dthermal_conductivity_Dtemperature(std::vector<double> temperature,std::vector<double> &dst) const = 0;
191 
193  virtual double get_coefficient_thermal_expansion(double temperature) const = 0;
194 
196  virtual double get_compressive_strength(double temperature) const = 0;
197 
199  virtual double get_H2_permeability(double temperature) const = 0;
200 
202  virtual double get_Poissons_ratio(double temperature) const = 0;
203 
205 
207 
208 
212  typedef std::map< std::string, PureSolid* > _mapFactory;
214 
216 
217 
221  {
222  static _mapFactory mapFactory;
223  return &mapFactory;
224  }
225 
226 
227 
228  protected:
229 
231 
232 
247  static const std::string concrete_name;
249 
251 
252 
267  static PureSolid const* PROTOTYPE;
269 
271 
272 
277  virtual boost::shared_ptr<FuelCellShop::Material::PureSolid > create_replica (const std::string &name)
278  {
279  const std::type_info& info = typeid(*this);
280  FcstUtilities::log << "Pure function " << __FUNCTION__
281  << " called in Class "
282  << info.name() << std::endl;
283  }
284 
286 
288 
289 
293  PureSolid(const std::string& name);
294 
299  virtual void declare_parameters (ParameterHandler &param) const {};
300 
305  virtual void initialize (ParameterHandler &param) {};
306 
308 
310  // DATA //
312 
314 
315 
316  double density;
317 
320 
323 
326 
329 
332 
334  double Poissons_ratio;
335 
336 // /** Solutions at every quadrature point inside the cell.
337 // * for this mapping key is the Enumerator of VariableName_of_REV
338 // * the mapped value is of type SolutionVariable
339 // */
340 // std::map <VariableNames, SolutionVariable> Solutions;
341 //
342 // SolutionVariable T_vector;
344 
345  };
346 
357  class Graphite : public PureSolid
358  {
359  public:
360 
362 
363 
366  Graphite();
370  virtual ~Graphite();
372 
374 
375 
377  virtual inline double get_density() const;
378 
380  virtual inline double get_electrical_conductivity(double temperature) const;
381 
383  virtual inline void get_electrical_conductivity(std::vector<double> temperature,std::vector<double>& dst) const;
384 
386  virtual inline double get_Delectrical_conductivity_Dtemperature(double temperature) const
387  {
388  const std::type_info& info = typeid(*this);
389  FcstUtilities::log << "Pure function " << __FUNCTION__
390  << " called in Class "
391  << info.name() << std::endl;
392  return 0;
393  }
394 
396  virtual inline void get_Delectrical_conductivity_Dtemperature(std::vector<double>,std::vector<double>&) const {}
397 
399  virtual inline double get_thermal_conductivity(double temperature) const;
400 
402  virtual inline void get_thermal_conductivity(std::vector<double>,std::vector<double>&) const;
403 
405  virtual inline double get_Dthermal_conductivity_Dtemperature(double temperature) const
406  {
407  const std::type_info& info = typeid(*this);
408  FcstUtilities::log << "Pure function " << __FUNCTION__
409  << " called in Class "
410  << info.name() << std::endl;
411  return 0;
412  }
413 
415  virtual inline void get_Dthermal_conductivity_Dtemperature(std::vector<double>,std::vector<double>&) const {}
416 
418  virtual inline double get_coefficient_thermal_expansion(double temperature) const;
419 
421  virtual inline double get_compressive_strength(double temperature) const;
422 
424  virtual inline double get_H2_permeability(double temperature) const;
425 
427  virtual inline double get_Poissons_ratio(double temperature) const;
429 
430  protected:
431 
433 
434 
439  virtual boost::shared_ptr<FuelCellShop::Material::PureSolid > create_replica (const std::string &name)
440  {
441  return boost::shared_ptr<FuelCellShop::Material::PureSolid > (new FuelCellShop::Material::Graphite ());
442  }
444 
446 
447 
451  static const std::string concrete_name;
456  static Graphite const* PROTOTYPE;
458 
460 
461 
464  Graphite(const std::string& name);
465 
470  virtual void declare_parameters (ParameterHandler &param) const;
471 
476  virtual void initialize (ParameterHandler &param);
478 
479  };
480 
488  class DummySolid : public PureSolid
489  {
490  public:
492 
493 
496  DummySolid();
500  virtual ~DummySolid();
502 
504 
505 
506  virtual inline double get_density() const;
507 
509  virtual inline double get_electrical_conductivity(double temperature) const ;
510 
512  virtual inline void get_electrical_conductivity(std::vector<double> temperature,std::vector<double>& dst) const;
513 
515  virtual inline double get_Delectrical_conductivity_Dtemperature(double temperature) const;
516 
518  virtual inline void get_Delectrical_conductivity_Dtemperature(std::vector<double> temperature ,std::vector<double>& dst) const;
519 
521  virtual inline double get_thermal_conductivity(double temperature) const;
522 
524  virtual inline void get_thermal_conductivity(std::vector<double> temperature,std::vector<double>& dst) const;
525 
527  virtual inline double get_Dthermal_conductivity_Dtemperature(double temperature) const;
528 
530  virtual inline void get_Dthermal_conductivity_Dtemperature(std::vector<double> temperature,std::vector<double>& dst) const;
531 
533  virtual inline double get_coefficient_thermal_expansion(double temperature) const;
534 
536  virtual inline double get_compressive_strength(double temperature) const;
537 
539  virtual inline double get_H2_permeability(double temperature) const;
540 
542  virtual inline double get_Poissons_ratio(double temperature) const;
544 
545  protected:
546 
548 
549 
554  virtual boost::shared_ptr<FuelCellShop::Material::PureSolid > create_replica (const std::string &name)
555  {
556  return boost::shared_ptr<FuelCellShop::Material::PureSolid > (new FuelCellShop::Material::DummySolid ());
557  }
559 
564  static const std::string concrete_name;
569  static DummySolid const* PROTOTYPE;
571 
572 
574 
575 
579  DummySolid(const std::string& name);
584  virtual void declare_parameters (ParameterHandler &param) const;
585 
590  virtual void initialize (ParameterHandler &param);
592  };
593 
594  }
595 }
596 
597 #endif
This class is a base class for all pure solid materials used in FCST.
Definition: PureSolid.h:60
PureSolid()
Consturctor.
Definition: PureSolid.h:70
virtual boost::shared_ptr< FuelCellShop::Material::PureSolid > create_replica(const std::string &name)
This member function is used to create an object of type PureSolid Material.
Definition: PureSolid.h:439
virtual boost::shared_ptr< FuelCellShop::Material::PureSolid > create_replica(const std::string &name)
This member function is used to create an object of type PureSolid Material.
Definition: PureSolid.h:554
virtual double get_electrical_conductivity(double temperature) const
Obtain the electrical conductivity units (S/M)
SolidMaterialTypes
Definition: PureSolid.h:33
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PureSolid.h:564
Definition: PureSolid.h:35
This class describes properties of pure Dummy.
Definition: PureSolid.h:488
virtual double get_H2_permeability(double temperature) const =0
Obtain the H2_permeability (unit cm3*cm-2*s-1)
static PureSolid const * PROTOTYPE
PROTOTYPE used for pointing to this class.
Definition: PureSolid.h:267
virtual double get_density() const =0
Obtain the density.
const std::string name
Name of the layer.
Definition: base_material.h:155
virtual double get_coefficient_thermal_expansion(double temperature) const =0
Obtain the coefficient_thermal_expansion (microns/m °C)
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters for a parameter file.
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters for a parameter file.
virtual double get_electrical_conductivity(double temperature) const
Obtain the electrical conductivity units (S/M)
virtual double get_compressive_strength(double temperature) const =0
Obtain the compressive_strength (unit N/mm2)
static Graphite const * PROTOTYPE
PROTOTYPE used for pointing to this class.
Definition: PureSolid.h:456
virtual double get_Delectrical_conductivity_Dtemperature(double temperature) const
Obtain the derivative of the electrical conductivity.
Definition: PureSolid.h:386
virtual double get_compressive_strength(double temperature) const
Obtain the coefficient_thermal_expansion units (N/mm2)
double H2_permeability
H2 permeability.
Definition: PureSolid.h:331
virtual void get_Delectrical_conductivity_Dtemperature(std::vector< double >, std::vector< double > &) const
Obtain the derivative of the electrical conductivity.
Definition: PureSolid.h:396
virtual double get_H2_permeability(double temperature) const
Obtain the H2_permeability units (cm3*cm-2*s-1)
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PureSolid.h:451
Definition: PureSolid.h:37
virtual boost::shared_ptr< FuelCellShop::Material::PureSolid > create_replica(const std::string &name)
This member function is used to create an object of type PureSolid Material.
Definition: PureSolid.h:277
double coefficient_thermal_expansion
Coefficient of Thermal Expansion.
Definition: PureSolid.h:325
virtual double get_density() const
Obtain the density units (g/cm3)
virtual double get_Dthermal_conductivity_Dtemperature(double temperature) const
Obtain the derivative of the thermal conductivity.
Definition: PureSolid.h:405
virtual double get_thermal_conductivity(double temperature) const
Obtain the thermal conductivity units (watts/m K)
static DummySolid const * PROTOTYPE
PROTOTYPE used for pointing to this class.
Definition: PureSolid.h:569
double thermal_conductivity
thermal_conductivity
Definition: PureSolid.h:322
virtual void initialize(ParameterHandler &param)
Member function used to read in data and initialize the necessary data to compute the coefficients...
Definition: PureSolid.h:305
virtual double get_coefficient_thermal_expansion(double temperature) const
Obtain the coefficient_thermal_expansion units (microns/m °C)
virtual double get_H2_permeability(double temperature) const
Obtain the H2_permeability units (cm3*cm-2*s-1)
virtual ~Graphite()
Destructor.
static void declare_PureSolid_parameters(ParameterHandler &param)
This routine is used to create a PureSolid with the desired properties.
Definition: PureSolid.h:95
virtual double get_Dthermal_conductivity_Dtemperature(double temperature) const =0
Obtain the derivative of the thermal conductivity.
double Poissons_ratio
Poissons_ratio.
Definition: PureSolid.h:334
virtual double get_Delectrical_conductivity_Dtemperature(double temperature) const =0
Obtain the derivative of the electrical conductivity.
std::map< std::string, PureSolid * > _mapFactory
This object is used to store all objects of type PureSolid.
Definition: PureSolid.h:212
virtual void get_Dthermal_conductivity_Dtemperature(std::vector< double >, std::vector< double > &) const
Obtain the derivative of the thermal conductivity.
Definition: PureSolid.h:415
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
virtual ~PureSolid()
Destructor.
virtual double get_Dthermal_conductivity_Dtemperature(double temperature) const
Obtain the derivative of the thermal conductivity.
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters for a parameter file.
Definition: PureSolid.h:299
double density
Density.
Definition: PureSolid.h:316
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PureSolid.h:247
virtual ~DummySolid()
Destructor.
Definition: PureSolid.h:36
virtual double get_compressive_strength(double temperature) const
Obtain the coefficient_thermal_expansion units (N/mm2)
static boost::shared_ptr< FuelCellShop::Material::PureSolid > create_PureSolid(std::string concrete_name, ParameterHandler &param)
This function returns a boost shared ptr of a certain material with the name of concrete_name and it ...
Definition: PureSolid.h:120
virtual void initialize(ParameterHandler &param)
Member function used to read in data and initialize the necessary data to compute the coefficients...
This class describes properties of pure Poco Graphite.
Definition: PureSolid.h:357
virtual double get_thermal_conductivity(double temperature) const =0
Obtain the thermal conductivity (watts/m K)
virtual double get_Poissons_ratio(double temperature) const =0
Obtain the Poissons ratio (unitless)
virtual void initialize(ParameterHandler &param)
Member function used to read in data and initialize the necessary data to compute the coefficients...
virtual double get_Poissons_ratio(double temperature) const
Obtain the Poissons_ratio units ()
virtual double get_electrical_conductivity(double temperature) const =0
Obtain the electrical conductivity units (S/M)
virtual double get_thermal_conductivity(double temperature) const
Obtain the thermal conductivity units (watts/m K)
double electrical_conductivity
electrical_conductivity
Definition: PureSolid.h:319
double compressive_strength
Compressive strength.
Definition: PureSolid.h:328
virtual double get_density() const
Obtain the density units (g/cm3)
static _mapFactory * get_mapFactory()
Definition: PureSolid.h:220
virtual double get_Delectrical_conductivity_Dtemperature(double temperature) const
Obtain the derivative of the electrical conductivity.
Virtual class used to provide the interface for all material classes.
Definition: base_material.h:54
virtual double get_Poissons_ratio(double temperature) const
Obtain the Poissons_ratio units ()
virtual double get_coefficient_thermal_expansion(double temperature) const
Obtain the coefficient_thermal_expansion units (microns/m °C)