18 #ifndef _FUELCELLSHOP__GEOMETRY_H
19 #define _FUELCELLSHOP__GEOMETRY_H
30 #include <deal.II/grid/tria.h>
31 #include <deal.II/grid/tria_accessor.h>
32 #include <deal.II/grid/tria_iterator.h>
33 #include <deal.II/grid/tria_boundary_lib.h>
34 #include <deal.II/grid/grid_generator.h>
35 #include <deal.II/grid/grid_in.h>
36 #include <deal.II/grid/grid_out.h>
37 #include <deal.II/base/parameter_handler.h>
38 #include <deal.II/base/exceptions.h>
42 using namespace dealii;
44 namespace FuelCellShop
183 static void declare_GridGenerator_parameters (ParameterHandler ¶m);
188 static boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> >
create_GridGenerator (ParameterHandler ¶m)
190 boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> > pointer;
191 std::string concrete_name;
193 param.enter_subsection(
"Grid generation");
195 concrete_name = param.get(
"Type of mesh");
199 param.leave_subsection();
205 if (iterator->second)
221 pointer->initialize(param);
232 const std::type_info& info =
typeid ( *this );
234 <<
" called in Class "
235 << info.name() << std::endl;
244 const types::boundary_id& bdry_id,
245 boost::shared_ptr< Boundary<dim> > boundary)
const
252 grid_in.attach_triangulation(triangulation);
253 std::ifstream input_file( this->mesh_name.c_str() );
254 grid_in.read( input_file , grid_in.parse_format( this->mesh_type ) );
257 triangulation.set_boundary(bdry_id,
260 triangulation.refine_global(this->num_refine);
268 std::vector<unsigned int> get_material_id (
const std::string )
const;
271 unsigned int get_boundary_id ( ParameterHandler& param,
272 const std::string boundary )
const;
275 unsigned int get_boundary_id (
const std::string )
const;
278 void output_grid (
const Triangulation<dim> &triangulation,
const std::string filename )
const;
283 void refine_area (
Triangulation<dim> &triangulation,
const unsigned int material_id );
292 return mesh_type_name;
327 inline std::vector<double>
L_cat_c(){
return l_cat_c;}
338 inline double L_mem(){
return l_mem;}
387 void initialize(ParameterHandler& param);
418 virtual boost::shared_ptr<FuelCellShop::Geometry::GridBase<dim> >
create_replica (
const std::string &name)
420 const std::type_info& info =
typeid(*this);
422 <<
" called in Class "
423 << info.name() << std::endl;
429 void print_material_id_and_boundary_id (
const Triangulation<dim> &triangulation )
const;
unsigned int c_Ch_base_bid
Boundary id cathode channel entrance/exit base.
Definition: geometry.h:628
unsigned int c_CL_Membrane_bid
Boundary id cathode CL and membrane.
Definition: geometry.h:648
unsigned int c_Ch_Inlet_bid
Boundary id cathode channel inlet.
Definition: geometry.h:620
unsigned int c_Ch_GDL_bid
Boundary id cathode channel and GDL.
Definition: geometry.h:636
std::string get_mesh_type()
Return the type of mesh that is being used.
Definition: geometry.h:290
unsigned int num_c_GDL
Number of cells wide cathode gas diffusion layer.
Definition: geometry.h:531
double l_land_c
Width of the cathode current collector.
Definition: geometry.h:473
unsigned int a_Membrane_CL_bid
Boundary id anode membrane and CL.
Definition: geometry.h:662
unsigned int c_Ch_Outlet_bid
Boundary id cathode channel outlet.
Definition: geometry.h:624
double L_gdl_c()
Return the Thickness of the cathode gas diffusion layer.
Definition: geometry.h:323
unsigned int c_GDL_CL_bid
Boundary id cathode GDL and CL.
Definition: geometry.h:644
unsigned int c_GDL_mid
Material id cathode GDL.
Definition: geometry.h:578
unsigned int a_GDL_Ch_bid
Boundary id anode GDL and channel.
Definition: geometry.h:674
double l_land_a
Width of the anode current collector.
Definition: geometry.h:510
unsigned int c_BPP_GDL_bid
Boundary id cathode BPP and GDL.
Definition: geometry.h:640
unsigned int c_MPL_CL_bid
Boundary id cathode MPL and CL.
Definition: geometry.h:657
double L_channel_c()
Return the Width of the cathode gas channel.
Definition: geometry.h:299
std::vector< double > L_cat_c()
Return the thickness of the cathode catalyst layer.
Definition: geometry.h:327
double r_agg
Agglomerate radius.
Definition: geometry.h:705
unsigned int c_Ch_roof_bid
Boundary id cathode channel entrance/exit roof.
Definition: geometry.h:632
unsigned int a_MPL_GDL_bid
Boundary id anode GDL and MPL.
Definition: geometry.h:679
unsigned int membrane_mid
Material id membrane.
Definition: geometry.h:590
unsigned int a_Ch_roof_bid
Boundary id cathode channel entrance/exit roof.
Definition: geometry.h:699
double l_cube
Cube edge for HyperCube mesh.
Definition: geometry.h:513
double L_mpl_c()
Return the Thickness of the cathode microporous layer.
Definition: geometry.h:332
double l_channelLength_c
Length of the cathode gas channel.
Definition: geometry.h:457
static _mapFactory * get_mapFactory()
Definition: geometry.h:405
double l_gdl_a
Thickness of the anode gas diffusion layer.
Definition: geometry.h:502
static boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_GridGenerator(ParameterHandler ¶m)
Generate the appropriate mesh generator object based on the parameters in the input file...
Definition: geometry.h:188
void generate_grid_with_curved_boundaries(Triangulation< dim > &triangulation, const types::boundary_id &bdry_id, boost::shared_ptr< Boundary< dim > > boundary) const
This function is like the previous one generate_grid() but allows to assign a curved boundary boundar...
Definition: geometry.h:243
std::string mesh_type_name
Specify if you would like to load a mesh from file or if you would like a module from the mesh genera...
Definition: geometry.h:438
bool read_from_file
Definition: geometry.h:362
unsigned int a_Ch_Outlet_bid
Boundary id cathode channel outlet.
Definition: geometry.h:691
double L_channelHeight_c()
Return the Height of the cathode gas channel.
Definition: geometry.h:307
unsigned int a_CL_MPL_bid
Boundary id anode MPL and CL.
Definition: geometry.h:683
std::string mesh_type
Specify if it is a UNV file, MSH file, etc.
Definition: geometry.h:442
double l_channel_a
Width of the anode gas channel.
Definition: geometry.h:506
double L_land_a()
Return the Width of the anode current collector.
Definition: geometry.h:359
unsigned int num_c_MPL
Number of cells wide cathode microporous layer.
Definition: geometry.h:535
double L_channelEntrance_c()
Return the Entrance Length of the cathode gas channel.
Definition: geometry.h:311
unsigned int num_refine
Initial number of refinements.
Definition: geometry.h:444
double L_channel_a()
Return the Width of the anode gas channel.
Definition: geometry.h:355
double L_mem()
Return the Thickness of the membrane.
Definition: geometry.h:338
unsigned int a_CC_mid
Material id anode current collector.
Definition: geometry.h:606
double l_gdl_c
Thickness of the cathode gas diffusion layer.
Definition: geometry.h:477
unsigned int a_CL_GDL_bid
Boundary id anode CL and GDL.
Definition: geometry.h:666
Point< dim > center
Centre point of the circular/spherical domain.
Definition: geometry.h:723
double L_mpl_a()
Return the Thickness of the anode microporous layer.
Definition: geometry.h:347
FCSTLogStream log
Object used to output data to file and, if file attached recorded to a file as well.
unsigned int test_mid
Material id for test cell (GridTest app)
Definition: geometry.h:566
unsigned int c_GDL_MPL_bid
Boundary id cathode GDL and MPL.
Definition: geometry.h:653
unsigned int num_a_MPL
Number of cells wide anode microporous layer.
Definition: geometry.h:552
std::map< std::string, GridBase< dim > * > _mapFactory
This object is used to store all objects of type GasDiffusionLayer.
Definition: geometry.h:397
unsigned int a_Ch_base_bid
Boundary id cathode channel entrance/exit base.
Definition: geometry.h:695
unsigned int num_c_CL
Number of cells wide cathode catalyst layer.
Definition: geometry.h:539
std::string mesh_name
Name of the mesh file.
Definition: geometry.h:440
unsigned int delta_agg_mid
Electrolyte Thin Film Material ID.
Definition: geometry.h:714
unsigned int num_c_Channel
Number of cells wide cathode channel.
Definition: geometry.h:527
double l_mpl_c
Thickness of the cathode microporous layer.
Definition: geometry.h:481
double L_land_c()
Return the Width of the cathode current collector.
Definition: geometry.h:319
double l_cat_a
Thickness of the anode catalyst layer.
Definition: geometry.h:494
unsigned int a_GDL_BPP_bid
Boundary id anode GDL and BPP.
Definition: geometry.h:670
double l_channel_c
Width of the cathode gas channel.
Definition: geometry.h:453
unsigned int c_MPL_mid
Material id cathode MPL.
Definition: geometry.h:582
unsigned int a_GC_mid
Material id anode gas channel.
Definition: geometry.h:610
double l_mpl_a
Thickness of the anode microporous layer.
Definition: geometry.h:498
double L_cat_a()
Return the Thickness of the anode catalyst layer.
Definition: geometry.h:343
boost::shared_ptr< GridIn< dim > > grid_in
GridIn class object of dealii which allows to read various types of mesh formats. ...
Definition: geometry.h:367
std::vector< unsigned int > c_CL_mid
Material id cathode catalyst layer.
Definition: geometry.h:586
unsigned int num_a_CL
Number of cells wide anode catalyst layer.
Definition: geometry.h:548
FuelCell Geometry information class.
Definition: geometry.h:92
unsigned int num_a_GDL
Number of cells wide anode gas diffusion layer.
Definition: geometry.h:556
unsigned int num_vert
Number of cells tall the initial grid.
Definition: geometry.h:522
unsigned int c_CC_mid
Material id cathode current collector.
Definition: geometry.h:570
double L_channelLength_c()
Return the Length of the cathode gas channel.
Definition: geometry.h:303
double L_channelExit_c()
Return the Exit Length of the cathode gas channel.
Definition: geometry.h:315
double l_mem
Thickness of the membrane.
Definition: geometry.h:490
double L_gdl_a()
Return the Thickness of the anode gas diffusion layer.
Definition: geometry.h:351
unsigned int a_Ch_Inlet_bid
Boundary id cathode channel inlet.
Definition: geometry.h:687
std::vector< double > l_cat_c
Thickness of the cathode catalyst layer.
Definition: geometry.h:486
unsigned int a_GDL_mid
Material id anode GDL.
Definition: geometry.h:602
double delta_agg
Electrolyte thin film thickness.
Definition: geometry.h:708
virtual void generate_grid(Triangulation< dim > &)
Function is empty and must be reimplemented in derived classes.
Definition: geometry.h:230
double l_channelEntrance_c
Entrance length of the cathode gas channel.
Definition: geometry.h:465
unsigned int r_delta_bid
Boundary ID for agglomerate/thin film boundary.
Definition: geometry.h:717
unsigned int r_agg_mid
Porous Agglomerate Material ID.
Definition: geometry.h:711
virtual boost::shared_ptr< FuelCellShop::Geometry::GridBase< dim > > create_replica(const std::string &name)
This member function is used to create an object of type gas diffusion layer.
Definition: geometry.h:418
double l_channelExit_c
Exit Length of the cathode gas channel.
Definition: geometry.h:469
unsigned int a_CL_mid
Material id anode catalyst layer.
Definition: geometry.h:594
unsigned int c_GC_mid
Material id cathode gas channel.
Definition: geometry.h:574
double l_channelHeight_c
Height of the cathode gas channel.
Definition: geometry.h:461
unsigned int a_MPL_mid
Material id anode MPL.
Definition: geometry.h:598
unsigned int delta_bid
Boundary ID for thin film external boundary.
Definition: geometry.h:720
unsigned int num_membrane
Number of cells wide membrane layer.
Definition: geometry.h:544