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 <cstdlib>
22 #include <vector>
23 #include <fstream>
24 #include <string>
25 #include <map>
26 
27 #include <deal.II/base/parameter_handler.h>
28 
31 
33 {
37 };
38 
39 namespace FuelCellShop
40 
41 {
42  namespace Material
43  {
44 
59  class PureSolid : public BaseMaterial
60  {
61  public:
62 
64 
65 
70  :
71  BaseMaterial()
72  {};
73 
77  virtual ~PureSolid();
78 
94  static void declare_PureSolid_parameters (ParameterHandler &param)
95  {
96 
97  for (typename FuelCellShop::Material::PureSolid::_mapFactory::iterator iterator = FuelCellShop::Material::PureSolid::get_mapFactory()->begin();
99  iterator++)
100  {
101  param.enter_subsection("Material Database");
102  {
103  param.enter_subsection("PureSolid");
104  {
105  iterator->second->declare_parameters(param);
106  }
107  param.leave_subsection();
108  }
109  param.leave_subsection();
110  }
111 
112  }
113 
119  static boost::shared_ptr<FuelCellShop::Material::PureSolid > create_PureSolid (std::string concrete_name,
120  ParameterHandler &param)
121  {
122 
123  boost::shared_ptr<FuelCellShop::Material::PureSolid> pointer;
124 
125  typename FuelCellShop::Material::PureSolid::_mapFactory::iterator iterator = FuelCellShop::Material::PureSolid::get_mapFactory()->find(concrete_name);
126 
127  if (iterator != FuelCellShop::Material::PureSolid::get_mapFactory()->end())
128  {
129  if (iterator->second)
130  {
131  pointer = iterator->second->create_replica(concrete_name);
132  }
133  else
134  {
135  FcstUtilities::log<<"Pointer not initialized"<<std::endl;
136  abort();
137  }
138  }
139  else
140  {
141  AssertThrow(false, ExcMessage("Concrete name in FuelCellShop::Material::PureSolid::create_PureSolid does not exist"));
142  }
143 
144  param.enter_subsection("Material Database");
145  {
146  param.enter_subsection("PureSolid");
147  {
148  pointer->initialize(param);
149  }
150  param.leave_subsection();
151  }
152  param.leave_subsection();
153 
154  return pointer;
155 
156  }
158 
160 
161 
163  virtual double get_density() const = 0;
164 
166  virtual double get_electrical_conductivity(double temperature) const = 0 ;
167 
171  virtual void get_electrical_conductivity(std::vector<double> temperature,std::vector<double>& dst) const = 0;
172 
174  virtual double get_Delectrical_conductivity_Dtemperature(double temperature) const = 0;
175 
177  virtual void get_Delectrical_conductivity_Dtemperature(std::vector<double> temperature,std::vector<double> &dst) const = 0;
178 
180  virtual double get_thermal_conductivity(double temperature) const = 0;
181 
183  virtual void get_thermal_conductivity(std::vector<double> temperature,std::vector<double>&dst) const = 0;
184 
186  virtual double get_Dthermal_conductivity_Dtemperature(double temperature) const = 0;
187 
189  virtual void get_Dthermal_conductivity_Dtemperature(std::vector<double> temperature,std::vector<double> &dst) const = 0;
190 
192  virtual double get_coefficient_thermal_expansion(double temperature) const = 0;
193 
195  virtual double get_compressive_strength(double temperature) const = 0;
196 
198  virtual double get_H2_permeability(double temperature) const = 0;
199 
201  virtual double get_Poissons_ratio(double temperature) const = 0;
202 
204 
206 
207 
211  typedef std::map< std::string, PureSolid* > _mapFactory;
213 
215 
216 
220  {
221  static _mapFactory mapFactory;
222  return &mapFactory;
223  }
224 
225 
226 
227  protected:
228 
230 
231 
246  static const std::string concrete_name;
248 
250 
251 
266  static PureSolid const* PROTOTYPE;
268 
270 
271 
276  virtual boost::shared_ptr<FuelCellShop::Material::PureSolid > create_replica (const std::string &name)
277  {
278  const std::type_info& info = typeid(*this);
279  FcstUtilities::log << "Pure function " << __FUNCTION__
280  << " called in Class "
281  << info.name() << std::endl;
282  }
283 
285 
287 
288 
292  PureSolid(const std::string& name);
293 
298  virtual void declare_parameters (ParameterHandler &param) const {};
299 
304  virtual void initialize (ParameterHandler &param) {};
305 
307 
309  // DATA //
311 
313 
314 
315  double density;
316 
319 
322 
325 
328 
331 
333  double Poissons_ratio;
334 
335 // /** Solutions at every quadrature point inside the cell.
336 // * for this mapping key is the Enumerator of VariableName_of_REV
337 // * the mapped value is of type SolutionVariable
338 // */
339 // std::map <VariableNames, SolutionVariable> Solutions;
340 //
341 // SolutionVariable T_vector;
343 
344  };
345 
356  class Graphite : public PureSolid
357  {
358  public:
359 
361 
362 
365  Graphite();
369  virtual ~Graphite();
371 
373 
374 
376  virtual inline double get_density() const;
377 
379  virtual inline double get_electrical_conductivity(double temperature) const;
380 
382  virtual inline void get_electrical_conductivity(std::vector<double> temperature,std::vector<double>& dst) const;
383 
385  virtual inline double get_Delectrical_conductivity_Dtemperature(double temperature) const
386  {
387  const std::type_info& info = typeid(*this);
388  FcstUtilities::log << "Pure function " << __FUNCTION__
389  << " called in Class "
390  << info.name() << std::endl;
391  return 0;
392  }
393 
395  virtual inline void get_Delectrical_conductivity_Dtemperature(std::vector<double>,std::vector<double>&) const {}
396 
398  virtual inline double get_thermal_conductivity(double temperature) const;
399 
401  virtual inline void get_thermal_conductivity(std::vector<double>,std::vector<double>&) const;
402 
404  virtual inline double get_Dthermal_conductivity_Dtemperature(double temperature) const
405  {
406  const std::type_info& info = typeid(*this);
407  FcstUtilities::log << "Pure function " << __FUNCTION__
408  << " called in Class "
409  << info.name() << std::endl;
410  return 0;
411  }
412 
414  virtual inline void get_Dthermal_conductivity_Dtemperature(std::vector<double>,std::vector<double>&) const {}
415 
417  virtual inline double get_coefficient_thermal_expansion(double temperature) const;
418 
420  virtual inline double get_compressive_strength(double temperature) const;
421 
423  virtual inline double get_H2_permeability(double temperature) const;
424 
426  virtual inline double get_Poissons_ratio(double temperature) const;
428 
429  protected:
430 
432 
433 
438  virtual boost::shared_ptr<FuelCellShop::Material::PureSolid > create_replica (const std::string &name)
439  {
440  return boost::shared_ptr<FuelCellShop::Material::PureSolid > (new FuelCellShop::Material::Graphite ());
441  }
443 
445 
446 
450  static const std::string concrete_name;
455  static Graphite const* PROTOTYPE;
457 
459 
460 
463  Graphite(const std::string& name);
464 
469  virtual void declare_parameters (ParameterHandler &param) const;
470 
475  virtual void initialize (ParameterHandler &param);
477 
478  };
479 
487  class DummySolid : public PureSolid
488  {
489  public:
491 
492 
495  DummySolid();
499  virtual ~DummySolid();
501 
503 
504 
505  virtual inline double get_density() const;
506 
508  virtual inline double get_electrical_conductivity(double temperature) const ;
509 
511  virtual inline void get_electrical_conductivity(std::vector<double> temperature,std::vector<double>& dst) const;
512 
514  virtual inline double get_Delectrical_conductivity_Dtemperature(double temperature) const;
515 
517  virtual inline void get_Delectrical_conductivity_Dtemperature(std::vector<double> temperature ,std::vector<double>& dst) const;
518 
520  virtual inline double get_thermal_conductivity(double temperature) const;
521 
523  virtual inline void get_thermal_conductivity(std::vector<double> temperature,std::vector<double>& dst) const;
524 
526  virtual inline double get_Dthermal_conductivity_Dtemperature(double temperature) const;
527 
529  virtual inline void get_Dthermal_conductivity_Dtemperature(std::vector<double> temperature,std::vector<double>& dst) const;
530 
532  virtual inline double get_coefficient_thermal_expansion(double temperature) const;
533 
535  virtual inline double get_compressive_strength(double temperature) const;
536 
538  virtual inline double get_H2_permeability(double temperature) const;
539 
541  virtual inline double get_Poissons_ratio(double temperature) const;
543 
544  protected:
545 
547 
548 
553  virtual boost::shared_ptr<FuelCellShop::Material::PureSolid > create_replica (const std::string &name)
554  {
555  return boost::shared_ptr<FuelCellShop::Material::PureSolid > (new FuelCellShop::Material::DummySolid ());
556  }
558 
563  static const std::string concrete_name;
568  static DummySolid const* PROTOTYPE;
570 
571 
573 
574 
578  DummySolid(const std::string& name);
583  virtual void declare_parameters (ParameterHandler &param) const;
584 
589  virtual void initialize (ParameterHandler &param);
591  };
592 
593  }
594 }
595 
596 #endif
This class is a base class for all pure solid materials used in FCST.
Definition: PureSolid.h:59
PureSolid()
Consturctor.
Definition: PureSolid.h:69
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:438
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:553
virtual double get_electrical_conductivity(double temperature) const
Obtain the electrical conductivity units (S/M)
SolidMaterialTypes
Definition: PureSolid.h:32
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PureSolid.h:563
Definition: PureSolid.h:34
This class describes properties of pure Dummy.
Definition: PureSolid.h:487
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:266
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:455
virtual double get_Delectrical_conductivity_Dtemperature(double temperature) const
Obtain the derivative of the electrical conductivity.
Definition: PureSolid.h:385
virtual double get_compressive_strength(double temperature) const
Obtain the coefficient_thermal_expansion units (N/mm2)
double H2_permeability
H2 permeability.
Definition: PureSolid.h:330
virtual void get_Delectrical_conductivity_Dtemperature(std::vector< double >, std::vector< double > &) const
Obtain the derivative of the electrical conductivity.
Definition: PureSolid.h:395
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:450
Definition: PureSolid.h:36
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:276
double coefficient_thermal_expansion
Coefficient of Thermal Expansion.
Definition: PureSolid.h:324
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:404
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:568
double thermal_conductivity
thermal_conductivity
Definition: PureSolid.h:321
virtual void initialize(ParameterHandler &param)
Member function used to read in data and initialize the necessary data to compute the coefficients...
Definition: PureSolid.h:304
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:94
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:333
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:211
virtual void get_Dthermal_conductivity_Dtemperature(std::vector< double >, std::vector< double > &) const
Obtain the derivative of the thermal conductivity.
Definition: PureSolid.h:414
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:298
double density
Density.
Definition: PureSolid.h:315
static const std::string concrete_name
Concrete name used for objects of this class.
Definition: PureSolid.h:246
virtual ~DummySolid()
Destructor.
Definition: PureSolid.h:35
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:119
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:356
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:318
double compressive_strength
Compressive strength.
Definition: PureSolid.h:327
virtual double get_density() const
Obtain the density units (g/cm3)
static _mapFactory * get_mapFactory()
Definition: PureSolid.h:219
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)