29 #include "libmesh/quadrature.h"
33 template<
typename Chemistry>
36 const unsigned int reactant_species_idx,
37 const unsigned int product_species_idx )
39 _reactant_species_idx(reactant_species_idx),
40 _product_species_idx(product_species_idx)
45 template<
typename Chemistry>
51 template<
typename Chemistry>
54 const std::string r_var_name = std::string(
"w_"+this->_chemistry.species_name( this->_reactant_species_idx ) );
56 const std::string p_var_name = std::string(
"w_"+this->_chemistry.species_name( this->_product_species_idx ) );
58 libmesh_assert( system.has_variable( r_var_name ) );
59 libmesh_assert( system.has_variable( p_var_name ) );
61 this->_reactant_var_idx = system.variable_number( r_var_name );
63 this->_product_var_idx = system.variable_number( p_var_name );
68 template<
typename Chemistry>
71 const bool request_jacobian )
73 libMesh::FEGenericBase<libMesh::Real>* side_fe = NULL;
74 context.get_side_fe( _reactant_var_idx, side_fe );
77 const unsigned int n_var_dofs = context.get_dof_indices(_reactant_var_idx).size();
79 libmesh_assert_equal_to( n_var_dofs, context.get_dof_indices(_product_var_idx).size() );
82 const std::vector<libMesh::Real> &JxW_side = side_fe->get_JxW();
85 const std::vector<std::vector<libMesh::Real> >& var_phi_side = side_fe->get_phi();
88 const std::vector<libMesh::Point>& var_qpoint = side_fe->get_xyz();
91 libMesh::DenseSubVector<libMesh::Number> &F_r_var = context.get_elem_residual(_reactant_var_idx);
94 libMesh::DenseSubVector<libMesh::Number> &F_p_var = context.get_elem_residual(_product_var_idx);
96 unsigned int n_qpoints = context.get_side_qrule().n_points();
98 for (
unsigned int qp=0; qp != n_qpoints; qp++)
100 libMesh::Real jac = JxW_side[qp];
102 if( this->_is_axisymmetric )
104 const libMesh::Number r = var_qpoint[qp](0);
114 const libMesh::Real r_value = this->compute_reactant_mass_flux(rho, Y_r, T);
116 const libMesh::Real p_value = -r_value;
118 for (
unsigned int i=0; i != n_var_dofs; i++)
120 F_r_var(i) += r_value*var_phi_side[i][qp]*jac;
122 F_p_var(i) += p_value*var_phi_side[i][qp]*jac;
124 if( request_jacobian )
126 libmesh_not_implemented();
virtual void init(const libMesh::FEMSystem &system)
virtual ~GasRecombinationCatalyticWall()
virtual void apply_fluxes(AssemblyContext &context, const CachedValues &cache, const bool request_jacobian)
const std::vector< std::vector< libMesh::Number > > & get_cached_vector_values(unsigned int quantity) const
const std::vector< libMesh::Number > & get_cached_values(unsigned int quantity) const
GasRecombinationCatalyticWall(const Chemistry &chem_mixture, CatalycityBase &gamma, const unsigned int reactant_species_idx, const unsigned int product_species_idx)