OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compressible_multi_component_KG_equations_coupled.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: compressible_multi_component_KG_equations_coupled.h
11 // - Description: This class describes steady-state compressible and isothermal Kerkhof-Geboers
12 // fluid transport equations for a single-phase multi-component case coupled with fuel cell
13 // physics
14 // - Developers: Valentin N. Zingan, Chad Balen and Marc Secanell, University of Alberta
15 //
16 // ----------------------------------------------------------------------------
17 
18 #ifndef _FCST_FUELCELLSHOP_EQUATION_COMPRESSIBLE_MULTI_COMPONENT_KG_EQUATIONS_COUPLED_H_
19 #define _FCST_FUELCELLSHOP_EQUATION_COMPRESSIBLE_MULTI_COMPONENT_KG_EQUATIONS_COUPLED_H_
20 
22 #include <layers/channel.h>
26 #include <layers/catalyst_layer.h>
27 #include <utils/fcst_units.h>
28 
29 namespace FuelCellShop
30 {
31  namespace Equation
32  {
33 
222  template<int dim>
224  {
225  public:
226 
228 
229 
233  CompressibleMultiComponentKGEquationsCoupled(FuelCell::SystemManagement& system_management,boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data =
234  boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >());
235 
240 
244  virtual void declare_parameters(ParameterHandler& param) const;
245 
249  virtual void initialize(ParameterHandler& param);
250 
252 
254 
255 
268 
275 
282 
284 
286 
287 
291  const std::vector<double>& get_inlet_outlet_velocity_max() const
292  {
294  }
295 
301  {
303  }
304 
311  const bool get_use_parabolic_profile() const
312  {
313  return use_parabolic_profile;
314  }
315 
321  {
323  }
324 
330  {
332  }
333 
340  {
342  }
343 
348  const std::string get_press_vel_comp_apply_to() const
349  {
351  }
352 
359  {
361  }
362 
370  const std::map<unsigned int, std::string> get_gas_species_map() const
371  {
372  return gas_species_map;
373  }
374 
378  const unsigned int get_num_of_species() const
379  {
380  return n_species;
381  }
382 
387  virtual void print_equation_info() const;
388 
390 
391  protected:
392 
394 
395 
407  template<typename INFO>
408  void make_assemblers_generic_constant_data(const INFO& InFo,
410 
422 
434 
444 
454 
456 
458 
459 
464  virtual void make_internal_cell_couplings();
465 
470  virtual void make_matrix_block_indices();
471 
476  virtual void make_residual_indices();
477 
479 
481  // DATA //
483 
485 
486 
492  std::vector<bool> inertia_in_channels;
493 
499  std::vector<bool> shear_stress_in_channels;
500 
506  std::vector<bool> gravity_in_channels;
507 
513  std::vector<bool> inertia_in_porous_media;
514 
520  std::vector<bool> shear_stress_in_porous_media;
521 
527  std::vector<bool> gravity_in_porous_media;
528 
542  std::vector<std::string> drag_in_porous_media;
543 
575 
577 
579 
580 
584  unsigned int n_species;
585 
587 
591  std::map<unsigned int, std::string> gas_species_map;
592 
596  double R_universal;
597 
601  double T_mixture;
602 
606  double P_in;
607 
612  Tensor<1,dim> gravity_acceleration;
613 
617  SymmetricTensor<2,dim> unit;
618 
622  std::vector<double> molar_mass;
623 
627  std::vector<double> dynamic_viscosity;
628 
632  std::vector<double> bulk_viscosity;
633 
637  std::vector<double> collision_diameter;
638 
642  std::vector<double> theta;
643 
647  std::vector<double> eta;
648 
655 
659  std::vector<double> inlet_outlet_velocity_max;
660 
671 
675  std::vector<double> maxwell_constant;
676 
678 
680 
681 
685  std::vector< FEValuesExtractors::Scalar > density;
686 
690  std::vector< FEValuesExtractors::Vector > velocity;
691 
693 
695 
696 
703 
705 
706 
713 
715 
716 
723 
725 
726 
732  std::vector< std::vector<double> > density_cell_old;
733 
739  std::vector< std::vector< Tensor<1,dim> > > grad_density_cell_old;
740 
746  std::vector< std::vector< Tensor<1,dim> > > velocity_cell_old;
747 
753  std::vector< std::vector<double> > div_velocity_cell_old;
754 
760  std::vector< std::vector< SymmetricTensor<2,dim> > > grads_velocity_cell_old;
761 
767  std::vector< std::vector< Tensor<1,dim> > > mass_flux_cell_old;
768 
774  std::vector< std::vector< SymmetricTensor<2,dim> > > momentum_flux_cell_old;
775 
781  std::vector< std::vector<double> > pressure_cell_old;
782 
788  std::vector< std::vector< SymmetricTensor<2,dim> > > shear_stress_cell_old;
789 
796  std::vector< std::vector<double> > partial_viscosity_old;
797 
804  std::vector< std::vector<double> > bulk_viscosity_old;
805 
812  std::vector< std::vector< std::vector<double> > > paramMatrix_old;
813 
819  std::vector< FullMatrix<double> > PInv_old;
820 
826  std::vector< std::vector< Tensor<1,dim> > > drag_cell_old;
827 
833  std::vector< std::vector< Tensor<1,dim> > > diffusion_cell_old;
834 
840  std::vector< std::vector< Tensor<1,dim> > > gravity_cell_old;
841 
843 
845 
846 
855  std::vector< std::vector< std::vector<double> > > phi_density_cell;
856 
865  std::vector< std::vector< std::vector< Tensor<1,dim> > > > grad_phi_density_cell;
866 
875  std::vector< std::vector< std::vector< Tensor<1,dim> > > > phi_velocity_cell;
876 
885  std::vector< std::vector< std::vector<double> > > div_phi_velocity_cell;
886 
895  std::vector< std::vector< std::vector< SymmetricTensor<2,dim> > > > grads_phi_velocity_cell;
896 
905  std::vector< std::vector< std::vector< Tensor<1,dim> > > > delta_mass_flux_cell;
906 
915  std::vector< std::vector< std::vector< SymmetricTensor<2,dim> > > > delta_momentum_flux_cell;
916 
925  std::vector< std::vector< std::vector<double> > > delta_pressure_cell;
926 
935  std::vector< std::vector< std::vector<double> > > delta_partial_viscosity_cell;
936 
945  std::vector< std::vector< std::vector<double> > > delta_bulk_viscosity_cell;
946 
955  std::vector< std::vector< std::vector< SymmetricTensor<2,dim> > > > delta_shear_stress_cell;
956 
965  std::vector< std::vector< std::vector< Tensor<1,dim> > > > delta_drag_cell;
966 
975  std::vector< std::vector< std::vector< Tensor<1,dim> > > > delta_diffusion_cell;
976 
985  std::vector< std::vector< std::vector< Tensor<1,dim> > > > delta_gravity_cell;
986 
988 
990 
991 
998 
1000 
1001 
1006  std::vector< std::vector<double> > density_bdry_old;
1007 
1012  std::vector< std::vector< Tensor<1,dim> > > grad_density_bdry_old;
1013 
1018  std::vector< std::vector< Tensor<1,dim> > > velocity_bdry_old;
1019 
1024  std::vector< std::vector<double> > div_velocity_bdry_old;
1025 
1030  std::vector< std::vector< SymmetricTensor<2,dim> > > grads_velocity_bdry_old;
1031 
1036  std::vector< std::vector< Tensor<1,dim> > > mass_flux_bdry_old;
1037 
1042  std::vector< std::vector< SymmetricTensor<2,dim> > > momentum_flux_bdry_old;
1043 
1048  std::vector< std::vector<double> > pressure_bdry_old;
1049 
1054  std::vector< std::vector< SymmetricTensor<2,dim> > > shear_stress_bdry_old;
1055 
1062  std::vector< std::vector<double> > partial_viscosity_bdry_old;
1063 
1070  std::vector< std::vector<double> > bulk_viscosity_bdry_old;
1071 
1077  std::vector< std::vector< std::vector<double> > > paramMatrix_bdry_old;
1078 
1084  std::vector< FullMatrix<double> > PInv_bdry_old;
1085 
1087 
1089 
1090 
1099  std::vector< std::vector< std::vector<double> > > phi_density_bdry;
1100 
1109  std::vector< std::vector< std::vector< Tensor<1,dim> > > > grad_phi_density_bdry;
1110 
1119  std::vector< std::vector< std::vector< Tensor<1,dim> > > > phi_velocity_bdry;
1120 
1129  std::vector< std::vector< std::vector<double> > > div_phi_velocity_bdry;
1130 
1139  std::vector< std::vector< std::vector< SymmetricTensor<2,dim> > > > grads_phi_velocity_bdry;
1140 
1149  std::vector< std::vector< std::vector< Tensor<1,dim> > > > delta_mass_flux_bdry;
1150 
1159  std::vector< std::vector< std::vector< SymmetricTensor<2,dim> > > > delta_momentum_flux_bdry;
1160 
1169  std::vector< std::vector< std::vector<double> > > delta_pressure_bdry;
1170 
1179  std::vector< std::vector< std::vector< SymmetricTensor<2,dim> > > > delta_shear_stress_bdry;
1180 
1189  std::vector< std::vector< std::vector<double> > > delta_partial_viscosity_bdry;
1190 
1199  std::vector< std::vector< std::vector<double> > > delta_bulk_viscosity_bdry;
1200 
1202 
1204 
1205 
1213  std::vector< std::vector< std::vector< SymmetricTensor<2,dim> > > > n_BY_phi_velocity_bdry_S;
1214 
1216 
1218 
1227  template <typename LAYER, typename INFO>
1228  inline void update_porosity(const LAYER* ptr,
1229  const INFO info,
1230  std::vector<double>& porosity)
1231  {
1232  if( ptr->get_porosity_is_constant() )
1233  ptr->get_porosity(porosity);
1234  else
1235  ptr->get_porosity(porosity, info.get_fe_val_unsplit().get_quadrature_points());
1236  }
1237 
1248  template <typename LAYER, typename INFO>
1249  inline void update_permeability(const LAYER* ptr,
1250  const INFO info,
1251  std::vector< SymmetricTensor<2,dim> >& permeability_INV,
1252  std::vector< SymmetricTensor<2,dim> >& Forchheimer_permeability)
1253  {
1254  if( ptr->get_permeability_is_constant() )
1255  {
1256  ptr->get_permeability_INV(permeability_INV);
1257  ptr->get_Forchheimer_permeability(Forchheimer_permeability);
1258  }
1259  else
1260  {
1261  ptr->get_permeability_INV(permeability_INV, info.get_fe_val_unsplit().get_quadrature_points());
1262  ptr->get_Forchheimer_permeability(Forchheimer_permeability, info.get_fe_val_unsplit().get_quadrature_points());
1263  }
1264  }
1274  template <typename LAYER, typename INFO>
1275  inline void update_tortuosity(const LAYER* ptr,
1276  const INFO info,
1277  std::vector< SymmetricTensor<2,dim> >& tortuosity )
1278  {
1279  if( ptr->get_tortuosity_is_constant() )
1280  ptr->get_tortuosity(tortuosity);
1281  else
1282  ptr->get_tortuosity(tortuosity, info.get_fe_val_unsplit().get_quadrature_points());
1283  }
1284 
1292  template <typename LAYER>
1293  inline void update_gas_properties(const LAYER* ptr)
1294  {
1295  //TODO: these parameters should be coming from the same location not different classes
1296  T_mixture = ptr->get_gas_mixture()->get_temperature();
1297  P_in = ptr->get_gas_mixture()->get_total_pressure();
1298 
1299  for(unsigned int s = 0; s < n_species; ++s)
1300  {
1301  molar_mass[s] = ptr->get_gas_mixture()->get_gases()[s]->get_molar_mass() * 1.0e3; // Convert kg/mol to 1000 g/mol
1302  dynamic_viscosity[s] = ptr->get_gas_mixture()->get_gases()[s]->get_dynamic_viscosity(T_mixture) * 1.0e1; // Convert kg/m*s to 10 g/cm*s
1303  collision_diameter[s] = ptr->get_gas_mixture()->get_gases()[s]->get_collision_diameter() * 1e-10; // Convert Angstroms to 1e-10 meters
1304  maxwell_stefan_isobaric_diffusion_coefficient = ptr->get_gas_mixture()->get_ChapmanEnskog_isobaric_diffusion_coefficients(T_mixture); // [m^2/s]
1305  }
1306  }
1307 
1320  template <typename LAYER>
1321  inline void update_inv_diffusion_coefficients(const LAYER* ptr,
1322  std::vector< Table< 2, SymmetricTensor<2,dim> > >& inv_pDeff) const
1323  {
1324  //************************************
1325  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1326  // !!!!!!!!!!!!!! THIS NEEDS TO BE IMPROVED !!!!!!!!!!!!!!
1327  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1328  //************************************
1329  Table< 2, Tensor<2,dim> > Deff;
1330 
1331  //I would like to replace this...
1332  ptr->effective_gas_diffusivity(Deff); // m^2/s
1333  // with
1334  /*
1335  ptr->get_T_and_p(T,p);
1336  SolutionVariable temperature = SolutionVariable(T, this->n_q_points_cell , temperature_of_REV);
1337  ptr->set_temperature( temperature );
1338  SolutionVariable pressure = SolutionVariable(1.0/101325.0, this->n_q_points_cell, temperature_of_REV); // Value of 1.0/101325.0 is equivalent to 1 Pa, i.e. we return D(T)
1339  const std::vector< PureGas *> gases = ptr->get_gases ();
1340  */
1341  /* If saturation:
1342  if (p_liquid_water.indices_exist)
1343  {
1344  ptr->set_capillary_pressure( FuelCellShop::SolutionVariable(&cell_info.values[last_iter_cell][p_liquid_water.solution_index], capillary_pressure) );
1345  deriv_flags.push_back(capillary_pressure);
1346  }
1347  */
1348 
1349  unsigned int n_q_points_cell = inv_pDeff.size();
1350 
1351  for(unsigned int s = 0; s < n_species; ++s)
1352  for(unsigned int s1 = 0; s1 < n_species; ++s1)
1353  {
1354  // std::vector< double > Deff_noniso;
1355  // ptr->compute_gas_diffusion(gases[s], gases[s1]);
1356  // ptr->effective_gas_diffusivity(Deff_noniso); // m^2/s
1357 
1358  if( s1 != s )
1359  {
1360  for(unsigned int q = 0; q < this->n_q_points_cell; ++q)
1361  {
1362  Tensor<2, dim> pDeff_CGS = P_in*Deff(s,s1)*Units::convert(1.,Units::C_UNIT2, Units::UNIT2);
1363  // Units are Pa*cm^2/s, however Pa are NOT CGS, ( 1 Pa = 10 g/(cm s^2):
1364  pDeff_CGS *= 10;
1365  // Now, compute 1/(p*Deff):
1366  Tensor<2, dim> invTest;
1367  invTest[0][0] = 1 / ( pDeff_CGS[0][0] );
1368  invTest[1][1] = 1 / ( pDeff_CGS[1][1] );
1369  #if deal_II_dimension == 3
1370  invTest[2][2] = 1 / ( pDeff_CGS[2][2] );
1371  #endif
1372  inv_pDeff[q](s,s1) = invTest;
1373  }
1374  }
1375  }
1376 
1377  //Print out Deff* for debugging
1378 // bool printDeff = false;
1379 //
1380 // if( printDeff )
1381 // {
1382 // FcstUtilities::log << "-----------------------------------" <<std::endl;
1383 // for( unsigned int s1 = 0; s1 < n_species; ++s1 )
1384 // {
1385 // for( unsigned int s2 = 0; s2 < n_species; ++s2 )
1386 // {
1387 // if( s1 != s2 )
1388 // {
1389 // FcstUtilities::log << "Name layer is: "<<ptr->name_layer()<<std::endl;
1390 // FcstUtilities::log << "Species " << s1 << " and " << s2 << ": " <<std::endl;
1391 // FcstUtilities::log << "Deff[0][0]: " << Deff(s1,s2)[0][0]*Units::convert(1.,Units::C_UNIT2, Units::UNIT2) << std::endl;
1392 // FcstUtilities::log << "Deff[1][1]: " << Deff(s1,s2)[1][1]*Units::convert(1.,Units::C_UNIT2, Units::UNIT2) << std::endl;
1393 //
1394 // FcstUtilities::log << "inv_pDeff[0][0]: " << inv_pDeff[0](s1,s2)[0][0] << std::endl;
1395 // FcstUtilities::log << "inv_pDeff[1][1]: " << inv_pDeff[0](s1,s2)[1][1] << std::endl;
1396 // }
1397 // }
1398 // }
1399 // FcstUtilities::log << "-----------------------------------" <<std::endl;
1400 // }
1401  }
1402 
1422  template <typename LAYER>
1423  inline void update_partial_viscosities(const LAYER* ptr,
1424  const unsigned int& quadraturePoints,
1425  const std::vector<double>& porosity,
1426  const std::vector< std::vector<double> >& density,
1427  std::vector< std::vector< std::vector<double> > >& paramMatrix,
1428  std::vector< FullMatrix<double> >& PInv,
1429  std::vector< std::vector<double> >& partialViscosity,
1430  std::vector< std::vector<double> >& bulkViscosity) const
1431  {
1432 
1433  partialViscosity = ptr->get_gas_mixture()->get_isothermal_nonisobaric_partial_viscosity(T_mixture, // [K]
1434  density, // [g/cm^3]
1435  molar_mass, // [g/mol]
1436  dynamic_viscosity, // [g/cm*s]
1437  collision_diameter, // [m]
1438  porosity,
1439  paramMatrix,
1440  PInv); // returns in [g/cm*s]
1441 
1442  bulkViscosity.clear(); //reset bulk viscosity vector
1443  bulkViscosity.resize(quadraturePoints, std::vector<double>(this->n_species, 0.0)); //size appropriately
1444  for(unsigned int q = 0; q < quadraturePoints; ++q)
1445  {
1446  double porosityInv = 1 / porosity[q];
1447  for(unsigned int s = 0; s < this->n_species; ++s)
1448  bulkViscosity[q][s] = ptr->get_gas_mixture()->get_gases()[s]->get_bulk_viscosity(partialViscosity[q][s]); // [g/cm*s]
1449  }
1450  }
1451 
1464  template <typename LAYER>
1465  inline void update_delta_partial_viscosities(const LAYER* ptr,
1466  const std::vector< std::vector<double> >& partialViscosity,
1467  const std::vector< std::vector< std::vector<double> > >& paramMatrix,
1468  std::vector< FullMatrix<double> >& PInv,
1469  const std::vector<double>& porosity,
1470  const std::vector< std::vector< std::vector<double> > >& deltaDensity,
1471  const std::vector< std::vector<double> >& density,
1472  std::vector< std::vector< std::vector<double> > >& deltaPartialViscosity) const
1473  {
1474  ptr->get_gas_mixture()->get_isothermal_nonisobaric_delta_partial_viscosity(T_mixture, // [K]
1475  paramMatrix,
1476  PInv,
1477  porosity,
1478  molar_mass, // [g/mol]
1479  dynamic_viscosity, // [g/cm*s]
1480  collision_diameter, // [m]
1481  deltaDensity,
1482  density, // [g/cm^3]
1483  deltaPartialViscosity); // returns in cgs units
1484  }
1485 
1490  template <typename LAYER>
1491  inline void update_delta_bulk_viscosities(const LAYER* ptr,
1492  const std::vector< std::vector< std::vector<double> > >& deltaPartialViscosity,
1493  std::vector< std::vector< std::vector<double> > >& deltaBulkViscosity) const
1494  {
1495  ptr->get_gas_mixture()->get_delta_bulk_viscosity(ptr->get_gas_mixture()->get_gases(),
1496  deltaPartialViscosity,
1497  deltaBulkViscosity);
1498  }
1499 
1500  };
1501 
1502  } // Equation
1503 
1504 } // FuelCellShop
1505 
1506 #endif
std::vector< std::vector< Tensor< 1, dim > > > velocity_bdry_old
Velocity of each species in the quadrature points of a boundary at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:1018
void update_inv_diffusion_coefficients(const LAYER *ptr, std::vector< Table< 2, SymmetricTensor< 2, dim > > > &inv_pDeff) const
This private member function is used in make_assemblers_cell_variable_data in order to compute the in...
Definition: compressible_multi_component_KG_equations_coupled.h:1321
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > grad_phi_density_bdry
Density shape function gradients.
Definition: compressible_multi_component_KG_equations_coupled.h:1109
std::vector< bool > shear_stress_in_porous_media
This object indicates whether the shear stress term is ON or OFF in porous media.
Definition: compressible_multi_component_KG_equations_coupled.h:520
void update_partial_viscosities(const LAYER *ptr, const unsigned int &quadraturePoints, const std::vector< double > &porosity, const std::vector< std::vector< double > > &density, std::vector< std::vector< std::vector< double > > > &paramMatrix, std::vector< FullMatrix< double > > &PInv, std::vector< std::vector< double > > &partialViscosity, std::vector< std::vector< double > > &bulkViscosity) const
This private member function is used to calculate the partial viscosity of the mixture and bulk visco...
Definition: compressible_multi_component_KG_equations_coupled.h:1423
unsigned int n_species
Number of species, .
Definition: compressible_multi_component_KG_equations_coupled.h:584
boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data
Data object for the application data to be passed to the equation classes.
Definition: equation_base.h:890
std::vector< std::vector< Tensor< 1, dim > > > diffusion_cell_old
Diffusion force of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:833
std::vector< std::vector< std::vector< double > > > delta_bulk_viscosity_cell
Partial bulk viscosity perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:945
std::vector< std::vector< std::vector< double > > > delta_partial_viscosity_bdry
Partial dyanmic viscosity perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:1189
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > phi_velocity_cell
Velocity shape functions.
Definition: compressible_multi_component_KG_equations_coupled.h:875
std::vector< std::vector< std::vector< SymmetricTensor< 2, dim > > > > grads_phi_velocity_cell
Velocity shape function symmetric gradients.
Definition: compressible_multi_component_KG_equations_coupled.h:895
std::vector< double > maxwell_constant
These constants are used in the Maxwell slip boundary condition.
Definition: compressible_multi_component_KG_equations_coupled.h:675
virtual void make_assemblers_bdry_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info)
This function computes Local CG FEM based assemblers - constant data (boundary) and allocates the mem...
std::vector< std::vector< SymmetricTensor< 2, dim > > > momentum_flux_bdry_old
Momentum flux of each species in the quadrature points of a boundary at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:1042
int inlet_outlet_boundary_ID
Definition: compressible_multi_component_KG_equations_coupled.h:668
std::vector< std::vector< std::vector< SymmetricTensor< 2, dim > > > > grads_phi_velocity_bdry
Velocity shape function symmetric gradients.
Definition: compressible_multi_component_KG_equations_coupled.h:1139
const std::string get_inlet_outlet_velocity_mixture_equation() const
If get_use_parabolic_profile() is false then user can specify an equation to use for velocity profile...
Definition: compressible_multi_component_KG_equations_coupled.h:358
std::vector< std::vector< std::vector< SymmetricTensor< 2, dim > > > > n_BY_phi_velocity_bdry_S
Symmetrized tensor product of normal_vectors [ q ] and phi_velocity_bdry [ s ] [ q ] [ k ] in the qua...
Definition: compressible_multi_component_KG_equations_coupled.h:1213
virtual void assemble_cell_matrix(FuelCell::ApplicationCore::MatrixVector &cell_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell matrix.
FuelCell::SystemManagement * system_management
Pointer to the external YourApplication&lt;dim&gt;::system_management object.
Definition: equation_base.h:798
virtual void assemble_bdry_residual(FuelCell::ApplicationCore::FEVector &bdry_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary residual.
virtual void assemble_cell_residual(FuelCell::ApplicationCore::FEVector &cell_residual, const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local cell residual.
const double get_inlet_outlet_velocity_channel_base() const
This function tells the application the height [cm] of the base of the channel with respect to origin...
Definition: compressible_multi_component_KG_equations_coupled.h:320
std::vector< std::vector< std::vector< SymmetricTensor< 2, dim > > > > delta_shear_stress_bdry
Shear stress perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:1179
std::vector< std::vector< Tensor< 1, dim > > > gravity_cell_old
Gravity force of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:840
Table< 2, double > maxwell_stefan_isobaric_diffusion_coefficient
Each entry of this structure defines a Maxwell-Stefan isobaric diffusion coefficient of gas in gas ...
Definition: compressible_multi_component_KG_equations_coupled.h:654
const std::vector< double > & get_inlet_outlet_velocity_max() const
This function returns inlet_outlet_velocity_max.
Definition: compressible_multi_component_KG_equations_coupled.h:291
std::vector< std::vector< std::vector< double > > > div_phi_velocity_cell
Velocity shape function divergences.
Definition: compressible_multi_component_KG_equations_coupled.h:885
std::vector< std::vector< std::vector< double > > > phi_density_cell
Density shape functions.
Definition: compressible_multi_component_KG_equations_coupled.h:855
virtual void make_matrix_block_indices()
This function fills out matrix_block_indices.
std::vector< double > theta
Navier slip coefficient of pure gas, .
Definition: compressible_multi_component_KG_equations_coupled.h:642
std::vector< std::vector< std::vector< SymmetricTensor< 2, dim > > > > delta_momentum_flux_cell
Momentum flux perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:915
std::vector< bool > inertia_in_porous_media
This object indicates whether the inertia term is ON or OFF in porous media.
Definition: compressible_multi_component_KG_equations_coupled.h:513
bool use_parabolic_profile
Definition: compressible_multi_component_KG_equations_coupled.h:665
void update_delta_partial_viscosities(const LAYER *ptr, const std::vector< std::vector< double > > &partialViscosity, const std::vector< std::vector< std::vector< double > > > &paramMatrix, std::vector< FullMatrix< double > > &PInv, const std::vector< double > &porosity, const std::vector< std::vector< std::vector< double > > > &deltaDensity, const std::vector< std::vector< double > > &density, std::vector< std::vector< std::vector< double > > > &deltaPartialViscosity) const
This private member function is used to calculate the variation in partial viscosity of the mixture...
Definition: compressible_multi_component_KG_equations_coupled.h:1465
void update_tortuosity(const LAYER *ptr, const INFO info, std::vector< SymmetricTensor< 2, dim > > &tortuosity)
Inline member function used to obtain the tortuosity for a given layer.
Definition: compressible_multi_component_KG_equations_coupled.h:1275
std::vector< std::vector< double > > partial_viscosity_old
Partial viscosity of mixture of each species, , in the quadrature points of a cell at a previous Newt...
Definition: compressible_multi_component_KG_equations_coupled.h:796
std::vector< bool > gravity_in_channels
This object indicates whether the gravity term is ON or OFF in channels.
Definition: compressible_multi_component_KG_equations_coupled.h:506
std::string inlet_outlet_velocity_mixture_equation
Definition: compressible_multi_component_KG_equations_coupled.h:670
std::vector< double > eta
Normal velocity suppression coefficient of pure gas, .
Definition: compressible_multi_component_KG_equations_coupled.h:647
void update_delta_bulk_viscosities(const LAYER *ptr, const std::vector< std::vector< std::vector< double > > > &deltaPartialViscosity, std::vector< std::vector< std::vector< double > > > &deltaBulkViscosity) const
Calls GasMixture function to loop through all variations of partial viscosity and calculates the vara...
Definition: compressible_multi_component_KG_equations_coupled.h:1491
std::vector< double > bulk_viscosity
Bulk viscosity of pure gas, .
Definition: compressible_multi_component_KG_equations_coupled.h:632
std::vector< std::vector< Tensor< 1, dim > > > mass_flux_bdry_old
Mass flux of each species in the quadrature points of a boundary at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:1036
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > delta_diffusion_cell
Diffusion force perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:975
std::vector< std::vector< double > > pressure_bdry_old
Partial pressure of each species in the quadrature points of a boundary at a previous Newton iteratio...
Definition: compressible_multi_component_KG_equations_coupled.h:1048
std::vector< std::vector< SymmetricTensor< 2, dim > > > momentum_flux_cell_old
Momentum flux of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:774
const std::string get_press_vel_comp_apply_to() const
Outputs which component to apply variable boundary equation to (i.e.
Definition: compressible_multi_component_KG_equations_coupled.h:348
std::vector< std::vector< double > > density_cell_old
Density of each species in the quadrature points of a cell at a previous Newton iteration.
Definition: compressible_multi_component_KG_equations_coupled.h:732
std::vector< bool > shear_stress_in_channels
This object indicates whether the shear stress term is ON or OFF in channels.
Definition: compressible_multi_component_KG_equations_coupled.h:499
std::vector< std::vector< SymmetricTensor< 2, dim > > > grads_velocity_bdry_old
Velocity symmetric gradient of each species in the quadrature points of a boundary at a previous Newt...
Definition: compressible_multi_component_KG_equations_coupled.h:1030
std::vector< std::vector< std::vector< double > > > phi_density_bdry
Density shape functions.
Definition: compressible_multi_component_KG_equations_coupled.h:1099
std::vector< std::vector< SymmetricTensor< 2, dim > > > shear_stress_bdry_old
Shear stress of each species in the quadrature points of a boundary at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:1054
std::vector< std::vector< double > > pressure_cell_old
Partial pressure of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:781
virtual void make_assemblers_cell_constant_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info)
This function computes Local CG FEM based assemblers - constant data (cell) and allocates the memory ...
void update_porosity(const LAYER *ptr, const INFO info, std::vector< double > &porosity)
Inline function to obtain update the porosity for a given layer class.
Definition: compressible_multi_component_KG_equations_coupled.h:1228
const double get_inlet_outlet_velocity_mixture_max() const
This function returns inlet_outlet_velocity_mixture_max.
Definition: compressible_multi_component_KG_equations_coupled.h:300
std::vector< FullMatrix< double > > PInv_bdry_old
PInv_bdry_old is used for calculating the inverse of P when using the OmegaKG model for calculating p...
Definition: compressible_multi_component_KG_equations_coupled.h:1084
std::vector< std::vector< Tensor< 1, dim > > > velocity_cell_old
Velocity of each species in the quadrature points of a cell at a previous Newton iteration.
Definition: compressible_multi_component_KG_equations_coupled.h:746
std::vector< std::string > drag_in_porous_media
This object indicates which form of the drag term is supposed to be chosen.
Definition: compressible_multi_component_KG_equations_coupled.h:542
double T_mixture
Temperature of species mixture, .
Definition: compressible_multi_component_KG_equations_coupled.h:601
std::vector< double > inlet_outlet_velocity_max
Maximum inlet-outlet velocity of pure gas, .
Definition: compressible_multi_component_KG_equations_coupled.h:659
This class is created for the objects handed to the mesh loops.
Definition: mesh_loop_info_objects.h:544
virtual void make_residual_indices()
This function fills out residual_indices.
std::string press_vel_comp_apply_to
Definition: compressible_multi_component_KG_equations_coupled.h:669
std::vector< std::vector< double > > partial_viscosity_bdry_old
Partial dynamic viscosity, , for each species in the quadrature points of a boundary at a previous Ne...
Definition: compressible_multi_component_KG_equations_coupled.h:1062
virtual void declare_parameters(ParameterHandler &param) const
Declare parameters.
std::vector< MatrixBlock< FullMatrix< double > > > MatrixVector
The matrix vector used in the mesh loops.
Definition: matrix_block.h:102
SymmetricTensor< 2, dim > unit
Unit tensor, .
Definition: compressible_multi_component_KG_equations_coupled.h:617
std::vector< std::vector< Tensor< 1, dim > > > grad_density_cell_old
Density gradient of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:739
std::vector< bool > normal_velocity_is_suppressed_weakly
Sometimes we implement different types of slip boundary conditions on the curved impermeable walls of...
Definition: compressible_multi_component_KG_equations_coupled.h:574
double P_in
Pressure at inlet, .
Definition: compressible_multi_component_KG_equations_coupled.h:606
CompressibleMultiComponentKGEquationsCoupled(FuelCell::SystemManagement &system_management, boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData > data=boost::shared_ptr< FuelCell::ApplicationCore::ApplicationData >())
Constructor.
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > delta_mass_flux_bdry
Mass flux perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:1149
std::vector< std::vector< Tensor< 1, dim > > > grad_density_bdry_old
Density gradient of each species in the quadrature points of a boundary at a previous Newton iteratio...
Definition: compressible_multi_component_KG_equations_coupled.h:1012
static double C_UNIT2
Definition: fcst_units.h:134
virtual void assemble_bdry_matrix(FuelCell::ApplicationCore::MatrixVector &bdry_matrices, const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
Assemble local boundary matrix.
std::vector< bool > gravity_in_porous_media
This object indicates whether the gravity term is ON or OFF in porous media.
Definition: compressible_multi_component_KG_equations_coupled.h:527
std::vector< bool > inertia_in_channels
This object indicates whether the inertia term is ON or OFF in channels.
Definition: compressible_multi_component_KG_equations_coupled.h:492
const std::map< unsigned int, std::string > get_gas_species_map() const
get_gas_species_map() returns a map relating the different KG species equations to the desired gas sp...
Definition: compressible_multi_component_KG_equations_coupled.h:370
std::vector< FEValuesExtractors::Scalar > density
Density extractors.
Definition: compressible_multi_component_KG_equations_coupled.h:685
std::vector< std::vector< std::vector< double > > > paramMatrix_old
paramMatrix is used for calculating partial viscosity of mixture in the quadrature points of a cell a...
Definition: compressible_multi_component_KG_equations_coupled.h:812
std::vector< std::vector< std::vector< double > > > paramMatrix_bdry_old
paramMatrix is used for calculating partial viscosity of mixture in the quadrature points of a bounda...
Definition: compressible_multi_component_KG_equations_coupled.h:1077
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > delta_mass_flux_cell
Mass flux perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:905
std::vector< std::vector< double > > div_velocity_bdry_old
Velocity divergence of each species in the quadrature points of a boundary at a previous Newton itera...
Definition: compressible_multi_component_KG_equations_coupled.h:1024
std::vector< std::vector< SymmetricTensor< 2, dim > > > grads_velocity_cell_old
Velocity symmetric gradient of each species in the quadrature points of a cell at a previous Newton i...
Definition: compressible_multi_component_KG_equations_coupled.h:760
std::vector< std::vector< std::vector< double > > > delta_bulk_viscosity_bdry
Partial bulk viscosity perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:1199
virtual void make_assemblers_generic_constant_data()
Function used to initialize variable information that will be needed to assemble matrix and residual ...
Definition: equation_base.h:430
static double UNIT2
Definition: fcst_units.h:133
double inlet_outlet_velocity_mixture_max
Maximum inlet-outlet velocity of the mixture, .
Definition: compressible_multi_component_KG_equations_coupled.h:664
bool coupled_with_fuel_cell_physics
Definition: compressible_multi_component_KG_equations_coupled.h:586
std::map< unsigned int, std::string > gas_species_map
Map of the gas species to their respective equation species number.
Definition: compressible_multi_component_KG_equations_coupled.h:591
std::vector< std::vector< SymmetricTensor< 2, dim > > > shear_stress_cell_old
Shear stress of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:788
std::vector< double > dynamic_viscosity
Dynamic viscosity of pure gas, .
Definition: compressible_multi_component_KG_equations_coupled.h:627
virtual void make_assemblers_cell_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::CellInfo &cell_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
This function computes.
const int get_inlet_outlet_boundary_ID() const
This function tells the application the boundary id to apply velocity profile equation to...
Definition: compressible_multi_component_KG_equations_coupled.h:339
std::vector< std::vector< std::vector< double > > > div_phi_velocity_bdry
Velocity shape function divergences.
Definition: compressible_multi_component_KG_equations_coupled.h:1129
double R_universal
Universal gas constant, .
Definition: compressible_multi_component_KG_equations_coupled.h:596
This is the base class used for all Equation classes.
Definition: equation_base.h:160
std::vector< std::vector< double > > bulk_viscosity_old
Bulk viscosity of mixture of each species, .
Definition: compressible_multi_component_KG_equations_coupled.h:804
IMPORTANT: Add all new solution variables and equations here !
Definition: system_management.h:300
double inlet_outlet_velocity_channel_roof
Definition: compressible_multi_component_KG_equations_coupled.h:667
std::vector< std::vector< std::vector< SymmetricTensor< 2, dim > > > > delta_momentum_flux_bdry
Momentum flux perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:1159
virtual void initialize(ParameterHandler &param)
Initialize parameters.
std::vector< FullMatrix< double > > PInv_old
PInv_old is used for calculating the inverse of P when using the OmegaKG model for calculating partia...
Definition: compressible_multi_component_KG_equations_coupled.h:819
double inlet_outlet_velocity_channel_base
Definition: compressible_multi_component_KG_equations_coupled.h:666
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > delta_drag_cell
Drag force perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:965
const double get_inlet_outlet_velocity_channel_roof() const
This function tells the application the height [cm] of the roof of the channel with respect to origin...
Definition: compressible_multi_component_KG_equations_coupled.h:329
std::vector< std::vector< Tensor< 1, dim > > > mass_flux_cell_old
Mass flux of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:767
std::vector< FEValuesExtractors::Vector > velocity
Velocity extractors.
Definition: compressible_multi_component_KG_equations_coupled.h:690
std::vector< std::vector< std::vector< SymmetricTensor< 2, dim > > > > delta_shear_stress_cell
Shear stress perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:955
std::vector< std::vector< double > > density_bdry_old
Density of each species in the quadrature points of a boundary at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:1006
void update_gas_properties(const LAYER *ptr)
Inline member function used to update.
Definition: compressible_multi_component_KG_equations_coupled.h:1293
const unsigned int get_num_of_species() const
If returns the number of species to use in the parameter file.
Definition: compressible_multi_component_KG_equations_coupled.h:378
virtual void make_internal_cell_couplings()
This function fills out internal_cell_couplings.
std::vector< std::vector< double > > div_velocity_cell_old
Velocity divergence of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:753
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > grad_phi_density_cell
Density shape function gradients.
Definition: compressible_multi_component_KG_equations_coupled.h:865
BlockVector< double > FEVector
The vector class used by applications.
Definition: application_data.h:46
Tensor< 1, dim > gravity_acceleration
Gravitational acceleration, .
Definition: compressible_multi_component_KG_equations_coupled.h:612
void update_permeability(const LAYER *ptr, const INFO info, std::vector< SymmetricTensor< 2, dim > > &permeability_INV, std::vector< SymmetricTensor< 2, dim > > &Forchheimer_permeability)
Inline member function used to obtain the inverse permeability and the Forchheimer permeability for a...
Definition: compressible_multi_component_KG_equations_coupled.h:1249
std::vector< std::vector< std::vector< double > > > delta_partial_viscosity_cell
Partial dynamic viscosity perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:935
std::vector< double > molar_mass
Molar mass of pure gas, .
Definition: compressible_multi_component_KG_equations_coupled.h:622
virtual void print_equation_info() const
This function prints out the equations info.
Virtual class used to characterize a generic layer interface.
Definition: base_layer.h:58
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > phi_velocity_bdry
Velocity shape functions.
Definition: compressible_multi_component_KG_equations_coupled.h:1119
std::vector< std::vector< std::vector< Tensor< 1, dim > > > > delta_gravity_cell
Gravity force perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:985
const bool get_use_parabolic_profile() const
This function tells the application if the user wishes to use a parabolic profile for a boundary cond...
Definition: compressible_multi_component_KG_equations_coupled.h:311
virtual void make_assemblers_bdry_variable_data(const typename FuelCell::ApplicationCore::DoFApplication< dim >::FaceInfo &bdry_info, FuelCellShop::Layer::BaseLayer< dim > *const layer)
This function computes.
static double convert(double unitToConvert, double to, double from)
The conversion routine convert(unitToConvert, X, Y) should be read as:
Definition: fcst_units.h:57
This class implements the multi-component mass transport equations proposed by Kerkhof-Geboers for fl...
Definition: compressible_multi_component_KG_equations_coupled.h:223
unsigned int n_q_points_cell
Number of quadrature points per cell.
Definition: equation_base.h:729
std::vector< std::vector< Tensor< 1, dim > > > drag_cell_old
Drag force of each species in the quadrature points of a cell at a previous Newton iteration...
Definition: compressible_multi_component_KG_equations_coupled.h:826
std::vector< double > collision_diameter
Collision diameter of pure gas, .
Definition: compressible_multi_component_KG_equations_coupled.h:637
std::vector< std::vector< double > > bulk_viscosity_bdry_old
Bulk viscosity of mixture of each species, .
Definition: compressible_multi_component_KG_equations_coupled.h:1070
std::vector< std::vector< std::vector< double > > > delta_pressure_bdry
Partial pressure perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:1169
std::vector< std::vector< std::vector< double > > > delta_pressure_cell
Partial pressure perturbations.
Definition: compressible_multi_component_KG_equations_coupled.h:925