OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
app_compressible_flows.h
Go to the documentation of this file.
1 // ------------------------------------------------------------------------------------------------------------------------------
2 //
3 // FCST: Fuel Cell Simulation Toolbox
4 //
5 // Copyright (C) 2006-2015 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: app_compressible_flows.h
11 // - Description: This class deals with steady-state compressible and isothermal Kerkhof-Geboers
12 // fluid transport equations for a single-phase multi-component case
13 //
14 // - serpentine_comp - serpentine flow (channel + porous layer) - experiment
15 // - DarcyCTest_comp - Darcy equation convergence test ( porous layer) - test
16 // - ThInPlane_comp - through-plane & in-plane permeability experiments (channel + porous layer) - experiment
17 // - pore_network_comp - pore network flow (channel) - study
18 // - StefanTube - Stefan tube flow (channel) - test
19 // - KerkhofGeboersTest_1 - one component flow in narrow capillary (channel) - test
20 // - KerkhofGeboersTest_2 - two components flow in narrow capillary (channel) - test
21 //
22 // - Developers: Valentin N. Zingan, Chad Balen and Marc Secanell, University of Alberta
23 //
24 // ------------------------------------------------------------------------------------------------------------------------------
25 
26 #ifndef _FCST_APPLICATION_APP_COMPRESSIBLE_FLOWS_H_
27 #define _FCST_APPLICATION_APP_COMPRESSIBLE_FLOWS_H_
28 //-- deal II
29 #include <deal.II/base/function_parser.h>
30 //-- OpenFCST
33 #include <postprocessing/response_mass_flux.h> //For calculating the mass flux at a boundary
35 #include <utils/scaling.h> // For scaling equations and residuals to help with convergence with MUMPS
36 
38 
39 using namespace dealii;
40 using namespace FuelCell::ApplicationCore;
41 
46 namespace FuelCell
47 {
48  namespace Application
49  {
50 
66  template<int dim>
68  {
69  public:
70 
72 
73 
77  AppCompressibleFlows( boost::shared_ptr<ApplicationData> data = boost::shared_ptr<ApplicationData>() );
78 
83 
87  virtual void declare_parameters(ParameterHandler& param);
88 
92  virtual void initialize(ParameterHandler& param);
93 
99  virtual void initialize_solution(FEVector& initial_guess,
100  std::shared_ptr< Function<dim> > function = std::shared_ptr< Function<dim> >());
101 
103 
105 
106 
110  virtual void cell_matrix(MatrixVector& cell_matrices,
111  const typename DoFApplication<dim>::CellInfo& cell_info);
112 
116  virtual void cell_residual(FEVector& cell_res,
117  const typename DoFApplication<dim>::CellInfo& cell_info);
118 
122  virtual void bdry_matrix(MatrixVector& bdry_matrices,
123  const typename DoFApplication<dim>::FaceInfo& bdry_info);
124 
128  virtual void bdry_residual(FEVector& bdry_res,
129  const typename DoFApplication<dim>::FaceInfo& bdry_info);
130 
132 
134 
135 
139  virtual void dirichlet_bc(std::map<unsigned int, double>& boundary_values) const;
140 
142 
144 
145 
149  virtual void data_out(const std::string& filename,
150  const FEVectors& src);
151 
155  virtual void bdry_responses(std::vector<double>& dst,
159 
160  protected:
161 
163 
164 
170  void make_variable_initial_data(FEVector& initial_guess);
171 
177  void make_variable_boundary_data(FEVector& initial_guess);
178 
183 
187  bool applyScaling = false;
188 
190 
192 
193 
197 
201  std::map<unsigned int, std::string> gasSpeciesMap;
202 
207  void set_gas_species(std::map<unsigned int, std::string> tmp, std::vector< FuelCellShop::Material::PureGas* >& gases);
209 
211 
212 
214 
215 
221 
223 
225 
226 
230 
235 
240 
245 
250 
255 
260 
265 
267 
269 
270 
274 
279 
283  boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer<dim> > CGDL;
285 
297  std::string app_specification;
298 
300 
302 
303 
307 
309  };
310 
311  } // Application
312 
313 } // FuelCell
314 
315 #endif
FuelCell::OperatingConditions OC
Operating conditions.
Definition: app_compressible_flows.h:196
Class used to store, read from file and define the operating conditions for a fuel cell...
Definition: operating_conditions.h:118
FuelCellShop::Material::WaterVapor water
Water vapor as a part of fluid.
Definition: app_compressible_flows.h:234
FuelCellShop::Material::DummyGas dummyGas
DummyGas as a part of fluid.
Definition: app_compressible_flows.h:264
FuelCellShop::Equation::CompressibleMultiComponentKGEquationsCoupled< dim > fluid_transport_equations
This object describes the equations that we are going to solve here.
Definition: app_compressible_flows.h:220
FuelCellShop::Material::GasMixture fluid
Fluid used in channel AND/OR porous layer.
Definition: app_compressible_flows.h:273
FuelCellShop::Material::Oxygen oxygen
Oxygen as a part of fluid.
Definition: app_compressible_flows.h:229
std::map< unsigned int, std::string > gasSpeciesMap
map relating species number (key) to species material (value)
Definition: app_compressible_flows.h:201
FuelCellShop::Layer::Channel< dim > CChannel
Channel.
Definition: app_compressible_flows.h:278
This class deals with steady-state compressible and isothermal Kerkhof-Geboers fluid transport equati...
Definition: app_compressible_flows.h:67
std::string app_specification
Application specification.
Definition: app_compressible_flows.h:297
This class describes properties of pure Acetone.
Definition: PureGas.h:1410
FuelCellShop::Material::Hydrogen hydrogen
Hydrogen as a part of fluid.
Definition: app_compressible_flows.h:244
boost::shared_ptr< FuelCellShop::Layer::GasDiffusionLayer< dim > > CGDL
Cathode GDL.
Definition: app_compressible_flows.h:283
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
This class describes properties of pure oxygen.
Definition: PureGas.h:974
Class used to calculate the total mass flux at a boundary.
Definition: response_mass_flux.h:118
This class describes properties of pure Methanol.
Definition: PureGas.h:1467
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
FuelCellShop::PostProcessing::MassFluxResponse< dim > mass_flux_response
Calculates mass flux.
Definition: app_compressible_flows.h:306
This class describes properties of pure nitrogen.
Definition: PureGas.h:1027
FuelCellShop::Material::Methanol methanol
Methanol as a part of fluid.
Definition: app_compressible_flows.h:259
This class describes properties of pure air.
Definition: PureGas.h:1187
This class describes properties of a dummy gas, with all properties of 1.0 Use this name in the param...
Definition: PureGas.h:912
This class describes properties of gas mixtures.
Definition: GasMixture.h:102
FuelCell::Scaling Scale
Object for performing scaling on equation matrix and residual vector.
Definition: app_compressible_flows.h:182
This class describes a channel and stores pointers to.
Definition: channel.h:51
Class used to store, read from file and define scaling factors to be applied to equations in equation...
Definition: scaling.h:99
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
The data type used in function calls of Application.
Definition: fe_vectors.h:59
Application handling matrices and assembling the linear system to solve the sensitivity equations...
Definition: optimization_block_matrix_application.h:49
This class describes properties of pure hydrogen.
Definition: PureGas.h:1081
FuelCellShop::Material::Acetone acetone
Acetone as a part of fluid.
Definition: app_compressible_flows.h:254
This class implements the multi-component mass transport equations proposed by Kerkhof-Geboers for fl...
Definition: compressible_multi_component_KG_equations_coupled.h:223
This class describes properties of pure WaterVapor.
Definition: PureGas.h:1134
FuelCellShop::Material::Air air
Air as a part of fluid.
Definition: app_compressible_flows.h:249
FuelCellShop::Material::Nitrogen nitrogen
Nitrogen as a part of fluid.
Definition: app_compressible_flows.h:239