GRINS-0.6.0
Public Member Functions | Protected Attributes | List of all members
GRINS::GasSolidCatalyticWall< Chemistry > Class Template Reference

#include <gas_solid_catalytic_wall.h>

Inheritance diagram for GRINS::GasSolidCatalyticWall< Chemistry >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::GasSolidCatalyticWall< Chemistry >:
Collaboration graph
[legend]

Public Member Functions

 GasSolidCatalyticWall (const Chemistry &chem_mixture, CatalycityBase &gamma, const unsigned int reactant_gas_species_idx, const unsigned int reactant_solid_species_idx, const unsigned int product_species_idx)
 
virtual ~GasSolidCatalyticWall ()
 
virtual void init (const libMesh::FEMSystem &system)
 
virtual void apply_fluxes (AssemblyContext &context, const CachedValues &cache, const bool request_jacobian)
 
libMesh::Real compute_reactant_gas_mass_flux (const libMesh::Real rho, const libMesh::Real Y_r, const libMesh::Real T)
 
libMesh::Real compute_reactant_solid_mass_consumption (const libMesh::Real rho, const libMesh::Real Y_r, const libMesh::Real T)
 
libMesh::Real compute_product_mass_flux (const libMesh::Real rho, const libMesh::Real Y_r, const libMesh::Real T)
 
libMesh::Real compute_reactant_solid_mass_consumption_dT (const libMesh::Real rho, const libMesh::Real Y_r, const libMesh::Real T)
 
libMesh::Real compute_reactant_solid_mass_consumption_dYs (const libMesh::Real rho, const std::vector< libMesh::Real > Y, const libMesh::Real T)
 
void set_axisymmetric (bool is_axisymmetric)
 
libMesh::Real omega_dot (const libMesh::Real rho_s, const libMesh::Real T) const
 $ \rho_s \gamma \sqrt{ \frac{R_s T}{2\pi} } $ More...
 
libMesh::Real domega_dot_dws (const libMesh::Real rho_s, const libMesh::Real w_s, const libMesh::Real T, const libMesh::Real R) const
 
libMesh::Real domega_dot_dT (const libMesh::Real rho_s, const libMesh::Real T) const
 
void set_catalycity_params (const std::vector< libMesh::Real > &params)
 

Protected Attributes

const unsigned int _reactant_gas_species_idx
 
VariableIndex _reactant_gas_var_idx
 
const unsigned int _reactant_solid_species_idx
 
const unsigned int _product_species_idx
 
VariableIndex _product_var_idx
 
const Chemistry & _chemistry
 
boost::scoped_ptr< CatalycityBase_gamma_s
 
const libMesh::Real _C
 $ \sqrt{ \frac{R_s}{2\pi} } $ More...
 
bool _is_axisymmetric
 

Detailed Description

template<typename Chemistry>
class GRINS::GasSolidCatalyticWall< Chemistry >

Definition at line 36 of file gas_solid_catalytic_wall.h.

Constructor & Destructor Documentation

template<typename Chemistry >
GRINS::GasSolidCatalyticWall< Chemistry >::GasSolidCatalyticWall ( const Chemistry &  chem_mixture,
CatalycityBase gamma,
const unsigned int  reactant_gas_species_idx,
const unsigned int  reactant_solid_species_idx,
const unsigned int  product_species_idx 
)

Definition at line 34 of file gas_solid_catalytic_wall.C.

39  : CatalyticWallBase<Chemistry>(chem_mixture,gamma,reactant_gas_species_idx),
40  _reactant_gas_species_idx(reactant_gas_species_idx),
41  _reactant_solid_species_idx(reactant_solid_species_idx),
42  _product_species_idx(product_species_idx)
43  {
44  return;
45  }
const unsigned int _reactant_gas_species_idx
const unsigned int _reactant_solid_species_idx
template<typename Chemistry >
GRINS::GasSolidCatalyticWall< Chemistry >::~GasSolidCatalyticWall ( )
virtual

Definition at line 48 of file gas_solid_catalytic_wall.C.

49  {
50  return;
51  }

Member Function Documentation

template<typename Chemistry >
void GRINS::GasSolidCatalyticWall< Chemistry >::apply_fluxes ( AssemblyContext context,
const CachedValues cache,
const bool  request_jacobian 
)
virtual

Implements GRINS::CatalyticWallBase< Chemistry >.

Definition at line 71 of file gas_solid_catalytic_wall.C.

References GRINS::CachedValues::get_cached_values(), GRINS::CachedValues::get_cached_vector_values(), GRINS::Cache::MASS_FRACTIONS, GRINS::Cache::MIXTURE_DENSITY, and GRINS::Cache::TEMPERATURE.

74  {
75  libMesh::FEGenericBase<libMesh::Real>* side_fe = NULL;
76  context.get_side_fe( _reactant_gas_var_idx, side_fe );
77 
78  // The number of local degrees of freedom in each variable.
79  const unsigned int n_var_dofs = context.get_dof_indices(_reactant_gas_var_idx).size();
80 
81  libmesh_assert_equal_to( n_var_dofs, context.get_dof_indices(_product_var_idx).size() );
82 
83  // Element Jacobian * quadrature weight for side integration.
84  const std::vector<libMesh::Real> &JxW_side = side_fe->get_JxW();
85 
86  // The var shape functions at side quadrature points.
87  const std::vector<std::vector<libMesh::Real> >& var_phi_side = side_fe->get_phi();
88 
89  // Physical location of the quadrature points
90  const std::vector<libMesh::Point>& var_qpoint = side_fe->get_xyz();
91 
92  // reactant residual
93  libMesh::DenseSubVector<libMesh::Number> &F_r_var = context.get_elem_residual(_reactant_gas_var_idx);
94 
95  // product residual
96  libMesh::DenseSubVector<libMesh::Number> &F_p_var = context.get_elem_residual(_product_var_idx);
97 
98  unsigned int n_qpoints = context.get_side_qrule().n_points();
99 
100  for (unsigned int qp=0; qp != n_qpoints; qp++)
101  {
102  libMesh::Real jac = JxW_side[qp];
103 
104  if( this->_is_axisymmetric )
105  {
106  const libMesh::Number r = var_qpoint[qp](0);
107  jac *= r;
108  }
109 
110  const libMesh::Real rho = cache.get_cached_values(Cache::MIXTURE_DENSITY)[qp];
111 
112  const libMesh::Real Y_r = cache.get_cached_vector_values(Cache::MASS_FRACTIONS)[qp][this->_reactant_gas_species_idx];
113 
114  const libMesh::Real T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
115 
116  const libMesh::Real r_value = this->compute_reactant_gas_mass_flux(rho, Y_r, T);
117 
118  const libMesh::Real p_value = this->compute_product_mass_flux(rho, Y_r, T);
119 
120  for (unsigned int i=0; i != n_var_dofs; i++)
121  {
122  F_r_var(i) += r_value*var_phi_side[i][qp]*jac;
123 
124  F_p_var(i) += p_value*var_phi_side[i][qp]*jac;
125 
126  if( request_jacobian )
127  {
128  libmesh_not_implemented();
129  }
130  }
131  }
132 
133  return;
134  }
const unsigned int _reactant_gas_species_idx
libMesh::Real compute_reactant_gas_mass_flux(const libMesh::Real rho, const libMesh::Real Y_r, const libMesh::Real T)
libMesh::Real compute_product_mass_flux(const libMesh::Real rho, const libMesh::Real Y_r, const libMesh::Real T)
template<typename Chemistry >
libMesh::Real GRINS::GasSolidCatalyticWall< Chemistry >::compute_product_mass_flux ( const libMesh::Real  rho,
const libMesh::Real  Y_r,
const libMesh::Real  T 
)
inline

Definition at line 119 of file gas_solid_catalytic_wall.h.

Referenced by test().

122  {
123  const libMesh::Real rho_r = rho*Y_r;
124 
125  const libMesh::Real M_r = this->_chemistry.M(_reactant_gas_species_idx);
126 
127  const libMesh::Real M_p = this->_chemistry.M(_product_species_idx);
128 
129  const libMesh::Real omega_dot = this->omega_dot( rho_r, T )*M_p/M_r;
130 
131  return omega_dot;
132  }
const unsigned int _reactant_gas_species_idx
libMesh::Real omega_dot(const libMesh::Real rho_s, const libMesh::Real T) const
const Chemistry & _chemistry
template<typename Chemistry >
libMesh::Real GRINS::GasSolidCatalyticWall< Chemistry >::compute_reactant_gas_mass_flux ( const libMesh::Real  rho,
const libMesh::Real  Y_r,
const libMesh::Real  T 
)
inline

Definition at line 89 of file gas_solid_catalytic_wall.h.

Referenced by test().

92  {
93  const libMesh::Real rho_r = rho*Y_r;
94 
95  const libMesh::Real omega_dot = this->omega_dot( rho_r, T );
96 
97  return -omega_dot;
98  }
libMesh::Real omega_dot(const libMesh::Real rho_s, const libMesh::Real T) const
template<typename Chemistry >
libMesh::Real GRINS::GasSolidCatalyticWall< Chemistry >::compute_reactant_solid_mass_consumption ( const libMesh::Real  rho,
const libMesh::Real  Y_r,
const libMesh::Real  T 
)
inline

Definition at line 102 of file gas_solid_catalytic_wall.h.

Referenced by test().

105  {
106  const libMesh::Real rho_r = rho*Y_r;
107 
108  const libMesh::Real M_r = this->_chemistry.M(_reactant_gas_species_idx);
109 
110  const libMesh::Real M_solid = this->_chemistry.M(_reactant_solid_species_idx);
111 
112  const libMesh::Real omega_dot = this->omega_dot( rho_r, T )*M_solid/M_r;
113 
114  return -omega_dot;
115  }
const unsigned int _reactant_gas_species_idx
const unsigned int _reactant_solid_species_idx
libMesh::Real omega_dot(const libMesh::Real rho_s, const libMesh::Real T) const
const Chemistry & _chemistry
template<typename Chemistry >
libMesh::Real GRINS::GasSolidCatalyticWall< Chemistry >::compute_reactant_solid_mass_consumption_dT ( const libMesh::Real  rho,
const libMesh::Real  Y_r,
const libMesh::Real  T 
)
inline

Definition at line 136 of file gas_solid_catalytic_wall.h.

139  {
140  const libMesh::Real rho_r = rho*Y_r;
141 
142  const libMesh::Real M_r = this->_chemistry.M(_reactant_gas_species_idx);
143 
144  const libMesh::Real M_solid = this->_chemistry.M(_reactant_solid_species_idx);
145 
146  const libMesh::Real domega_dot_dT = this->domega_dot_dT( rho_r, T )*M_solid/M_r;
147 
148  return -domega_dot_dT;
149  }
const unsigned int _reactant_gas_species_idx
const unsigned int _reactant_solid_species_idx
libMesh::Real domega_dot_dT(const libMesh::Real rho_s, const libMesh::Real T) const
const Chemistry & _chemistry
template<typename Chemistry >
libMesh::Real GRINS::GasSolidCatalyticWall< Chemistry >::compute_reactant_solid_mass_consumption_dYs ( const libMesh::Real  rho,
const std::vector< libMesh::Real >  Y,
const libMesh::Real  T 
)
inline

Definition at line 153 of file gas_solid_catalytic_wall.h.

156  {
157  const libMesh::Real Y_r = Y[_reactant_gas_species_idx];
158 
159  const libMesh::Real rho_r = rho*Y_r;
160 
161  const libMesh::Real M_r = this->_chemistry.M(_reactant_gas_species_idx);
162 
163  const libMesh::Real M_solid = this->_chemistry.M(_reactant_solid_species_idx);
164 
165  const libMesh::Real R = this->_chemistry.R_mix(Y);
166 
167  const libMesh::Real domega_dot_dYs = this->domega_dot_dws( rho_r, Y_r, T, R )*M_solid/M_r;
168 
169  return -domega_dot_dYs;
170  }
const unsigned int _reactant_gas_species_idx
const unsigned int _reactant_solid_species_idx
libMesh::Real domega_dot_dws(const libMesh::Real rho_s, const libMesh::Real w_s, const libMesh::Real T, const libMesh::Real R) const
const Chemistry & _chemistry
template<typename Chemistry >
libMesh::Real GRINS::CatalyticWallBase< Chemistry >::domega_dot_dT ( const libMesh::Real  rho_s,
const libMesh::Real  T 
) const
inlineinherited

Definition at line 108 of file catalytic_wall_base.h.

Referenced by test().

109  {
110  libMesh::Real sqrtT = std::sqrt(T);
111 
112  return rho_s*_C*( 0.5/sqrtT*(*_gamma_s)(T) + sqrtT*(*_gamma_s).dT(T) );
113  }
const libMesh::Real _C
template<typename Chemistry >
libMesh::Real GRINS::CatalyticWallBase< Chemistry >::domega_dot_dws ( const libMesh::Real  rho_s,
const libMesh::Real  w_s,
const libMesh::Real  T,
const libMesh::Real  R 
) const
inlineinherited

Definition at line 100 of file catalytic_wall_base.h.

Referenced by test().

102  {
103  return (1.0/w_s - rho_s/R)*(this->omega_dot( rho_s, T ));
104  }
libMesh::Real omega_dot(const libMesh::Real rho_s, const libMesh::Real T) const
template<typename Chemistry >
void GRINS::GasSolidCatalyticWall< Chemistry >::init ( const libMesh::FEMSystem &  system)
virtual

Reimplemented from GRINS::CatalyticWallBase< Chemistry >.

Definition at line 54 of file gas_solid_catalytic_wall.C.

55  {
56  const std::string r_var_name = std::string("w_"+this->_chemistry.species_name( this->_reactant_gas_species_idx ) );
57 
58  const std::string p_var_name = std::string("w_"+this->_chemistry.species_name( this->_product_species_idx ) );
59 
60  libmesh_assert( system.has_variable( r_var_name ) );
61  libmesh_assert( system.has_variable( p_var_name ) );
62 
63  this->_reactant_gas_var_idx = system.variable_number( r_var_name );
64 
65  this->_product_var_idx = system.variable_number( p_var_name );
66 
67  return;
68  }
const Chemistry & _chemistry
template<typename Chemistry >
libMesh::Real GRINS::CatalyticWallBase< Chemistry >::omega_dot ( const libMesh::Real  rho_s,
const libMesh::Real  T 
) const
inlineinherited

$ \rho_s \gamma \sqrt{ \frac{R_s T}{2\pi} } $

Definition at line 93 of file catalytic_wall_base.h.

Referenced by test().

94  {
95  return rho_s*(*_gamma_s)(T)*_C*std::sqrt(T);
96  }
const libMesh::Real _C
template<typename Chemistry >
void GRINS::CatalyticWallBase< Chemistry >::set_axisymmetric ( bool  is_axisymmetric)
inherited

Definition at line 64 of file catalytic_wall_base.C.

65  {
66  this->_is_axisymmetric = is_axisymmetric;
67 
68  return;
69  }
template<typename Chemistry >
void GRINS::CatalyticWallBase< Chemistry >::set_catalycity_params ( const std::vector< libMesh::Real > &  params)
inherited

Definition at line 73 of file catalytic_wall_base.C.

74  {
75  _gamma_s->set_params( params );
76  return;
77  }
boost::scoped_ptr< CatalycityBase > _gamma_s

Member Data Documentation

template<typename Chemistry>
const libMesh::Real GRINS::CatalyticWallBase< Chemistry >::_C
protectedinherited

$ \sqrt{ \frac{R_s}{2\pi} } $

Definition at line 84 of file catalytic_wall_base.h.

template<typename Chemistry>
const Chemistry& GRINS::CatalyticWallBase< Chemistry >::_chemistry
protectedinherited

Definition at line 79 of file catalytic_wall_base.h.

template<typename Chemistry>
boost::scoped_ptr<CatalycityBase> GRINS::CatalyticWallBase< Chemistry >::_gamma_s
protectedinherited

Definition at line 81 of file catalytic_wall_base.h.

template<typename Chemistry>
bool GRINS::CatalyticWallBase< Chemistry >::_is_axisymmetric
protectedinherited

Definition at line 86 of file catalytic_wall_base.h.

template<typename Chemistry>
const unsigned int GRINS::GasSolidCatalyticWall< Chemistry >::_product_species_idx
protected

Definition at line 82 of file gas_solid_catalytic_wall.h.

template<typename Chemistry>
VariableIndex GRINS::GasSolidCatalyticWall< Chemistry >::_product_var_idx
protected

Definition at line 83 of file gas_solid_catalytic_wall.h.

template<typename Chemistry>
const unsigned int GRINS::GasSolidCatalyticWall< Chemistry >::_reactant_gas_species_idx
protected

Definition at line 77 of file gas_solid_catalytic_wall.h.

template<typename Chemistry>
VariableIndex GRINS::GasSolidCatalyticWall< Chemistry >::_reactant_gas_var_idx
protected

Definition at line 78 of file gas_solid_catalytic_wall.h.

template<typename Chemistry>
const unsigned int GRINS::GasSolidCatalyticWall< Chemistry >::_reactant_solid_species_idx
protected

Definition at line 80 of file gas_solid_catalytic_wall.h.


The documentation for this class was generated from the following files:

Generated on Mon Jun 22 2015 21:32:22 for GRINS-0.6.0 by  doxygen 1.8.9.1