29 #include "libmesh/quadrature.h"
33 template<
typename Chemistry>
36 const unsigned int reactant_gas_species_idx,
37 const unsigned int reactant_solid_species_idx,
38 const unsigned int product_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)
47 template<
typename Chemistry>
53 template<
typename Chemistry>
56 const std::string r_var_name = std::string(
"w_"+this->_chemistry.species_name( this->_reactant_gas_species_idx ) );
58 const std::string p_var_name = std::string(
"w_"+this->_chemistry.species_name( this->_product_species_idx ) );
60 libmesh_assert( system.has_variable( r_var_name ) );
61 libmesh_assert( system.has_variable( p_var_name ) );
63 this->_reactant_gas_var_idx = system.variable_number( r_var_name );
65 this->_product_var_idx = system.variable_number( p_var_name );
70 template<
typename Chemistry>
73 const bool request_jacobian )
75 libMesh::FEGenericBase<libMesh::Real>* side_fe = NULL;
76 context.get_side_fe( _reactant_gas_var_idx, side_fe );
79 const unsigned int n_var_dofs = context.get_dof_indices(_reactant_gas_var_idx).size();
81 libmesh_assert_equal_to( n_var_dofs, context.get_dof_indices(_product_var_idx).size() );
84 const std::vector<libMesh::Real> &JxW_side = side_fe->get_JxW();
87 const std::vector<std::vector<libMesh::Real> >& var_phi_side = side_fe->get_phi();
90 const std::vector<libMesh::Point>& var_qpoint = side_fe->get_xyz();
93 libMesh::DenseSubVector<libMesh::Number> &F_r_var = context.get_elem_residual(_reactant_gas_var_idx);
96 libMesh::DenseSubVector<libMesh::Number> &F_p_var = context.get_elem_residual(_product_var_idx);
98 unsigned int n_qpoints = context.get_side_qrule().n_points();
100 for (
unsigned int qp=0; qp != n_qpoints; qp++)
102 libMesh::Real jac = JxW_side[qp];
104 if( this->_is_axisymmetric )
106 const libMesh::Number r = var_qpoint[qp](0);
116 const libMesh::Real r_value = this->compute_reactant_gas_mass_flux(rho, Y_r, T);
118 const libMesh::Real p_value = this->compute_product_mass_flux(rho, Y_r, T);
120 for (
unsigned int i=0; i != n_var_dofs; i++)
122 F_r_var(i) += r_value*var_phi_side[i][qp]*jac;
124 F_p_var(i) += p_value*var_phi_side[i][qp]*jac;
126 if( request_jacobian )
128 libmesh_not_implemented();
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 void init(const libMesh::FEMSystem &system)
virtual ~GasSolidCatalyticWall()
const std::vector< std::vector< libMesh::Number > > & get_cached_vector_values(unsigned int quantity) const
virtual void apply_fluxes(AssemblyContext &context, const CachedValues &cache, const bool request_jacobian)
const std::vector< libMesh::Number > & get_cached_values(unsigned int quantity) const