From f68093a3ae772b2b36c9bb6890f7b607a9ceca72 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 8 Jan 2018 14:24:37 -0500 Subject: [PATCH 01/41] A One Dimensional Premixed Flame Physics Kernel --- src/physics/include/grins/od_premixed_flame.h | 195 ++++++ src/physics/src/od_premixed_flame.C | 618 ++++++++++++++++++ 2 files changed, 813 insertions(+) create mode 100644 src/physics/include/grins/od_premixed_flame.h create mode 100644 src/physics/src/od_premixed_flame.C diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h new file mode 100644 index 000000000..b397fafce --- /dev/null +++ b/src/physics/include/grins/od_premixed_flame.h @@ -0,0 +1,195 @@ +#ifndef GRINS_OD_PREMIXED_FLAME_H +#define GRINS_OD_PREMIXED_FLAME_H + +// Grins items, can see not needing multi-component-vector variable but will leave in until i've written more of the code. +#include "grins_config.h" +#include "grins/grins_enums.h" +#include "grins/physics.h" +#include "grins/assembly_context.h" + + +#include "grins/single_variable.h" +#include "grins/materials_parsing.h" + +namespace GRINS +{ + class ODPremixedFlame : public Physics + { + public: + ODPremixedFlame(const PhysicsName& physics_name, + const GetPot & input, + std::unique_ptr & gas_mix); + + virtual ~ODPremixedFlame(){}; + + + + + //! Sets variables to be time-evolving + virtual void set_time_evolving_vars( libMesh::FEMSystem* system ); + + unsigned int n_species() const; + + libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; + + libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; + + void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, + std::vector& mass_fracs ) const; + + libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; + + libMesh::Real get_p0() const; + + + + // + + + //Register postprocessing variables for OD Premixed Flame + virtual void register_postprocessing_vars( const GetPot& input, + PostProcessedQuantities& postprocessing); + + // Context Initializations + virual void init_context( AssemblyContext& context ); + + //Time dependent part(s) // The Energy and species, and Mass equations will be included here, F(u,v) + virtual void element_time_derivative( bool compute_jacobian, + AssemblyContext & context); + + + //Mass matrix part(s) //This would by my LHS of the species and energy, and mass residuals M(u,v) + virtual void mass_residual( bool compute_jacobian, + AssemblyContext & context ); + + virtual void element_constraint(bool compute_jacobian, + AssemblyContext & context ); + + virtual void compute_postprocessed_quantity( unsigned int quantity_index, + const AssemblyContext& context, + const libMesh::Point& point, + libMesh::Real& value ); + //Ditched the Caching of the time derivatives + + + + + + + + + + + + + + protected: + //Variables + PrimitiveTempFEVariables& _temp_vars; + SingleVariable& _mass_flux_vars; + SpeciesMassFractionsVariable& _species_vars; + + + //! Number of species + unsigned int _n_species; + + + bool _fixed_density; + + libMesh::Real _fixed_rho_value; + + + + + + + //! Index from registering this quantity + unsigned int _rho_index; + + //! Index from registering this quantity //This is the coefficient of thermal conductivity, or lambda in my case + unsigned int _k_index; + + //!Index from registering this quantity + unsigned int _cp_index; + + //!Index from registering this quantity + libMesh::Number _p0; + + //! Index from registering this quantity. Each species will have it's own index. + std::vector _h_s_index; + + //! Index from registering this quantity. Each species will have it's own index. + std::vector _omega_dot_index; + + //! Index from registering this quantity. Each species will have it's own index. + std::vector _Ds_index; + + /* //! Index from registering this quantity. Each species will have it's own index. + std::vector _cp_s_index;*/ + + + private: + + void read_input_options( const GetPot& input ); + + ODPremixedFlame(); + + }; //Class ODPremixedFlame + + + inline + unsigned int ODPremixedFlame::n_species() const + { return _n_species } + + + inline + libMesh::Real ODPremixedFlame::T( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_temp_vars.T(),p); } + + + inline + libMesh::Real M_dot( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_mass_flux_vars.M(),p); } + + + inline + void ODPremixedFlame::mass_fractions( const libMesh::Point& p, + const AssemblyContext& c, + std::vector& mass_fracs ) const + { + libmesh_assert_equal_to(mass_fracs.size(), this->_n_species); + + for( unsigned int var = 0; var < this->_n_species; var++ ) + { + mass_fracs[var] = c.point_value(_species_vars.species(var),p); + } + } + + + inline + libMesh::Real ODPremixedFlame::rho( libMesh::Real T, + libMesh::Real p0, + libMesh::Real R_mix) const + { + libMesh::Real value = 0; + if( this->_fixed_density ) + value = this->_fixed_rho_value; + else + value = p0/(R_mix*T); + + return value; + } + + + inline + libMesh::Real get_p0() const + {return _p0;} + + + +} // namespace Grins + + +#endif // OD_Premixed_Flame diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C new file mode 100644 index 000000000..8ceac320d --- /dev/null +++ b/src/physics/src/od_premixed_flame.C @@ -0,0 +1,618 @@ +// This class +#include "grins/od_premixed_flame.h" + +#include "grins_config.h" + +// GRINS +#include "grins/assembly_context.h" +#include "grins/cantera_mixture.h" +#include "grins/grins_enums.h" +#include "grins/antioch_mixture.h" +#include "grins/materials_parsing.h" +#include "grins/variables_parsing.h" +#include "grins/variable_warehouse.h" +#include "grins/generic_ic_handler.h" +#include "grins/postprocessed_quantities.h" + +// libMesh +#include "libmesh/string_to_enum.h" +#include "libmesh/quadrature.h" +#include "libmesh/fem_system.h" + +namespace GRINS +{ + + template + + ODPremixedFlame::ODPremixedFlame(const std::string& physics_name, + const GetPot& input, + std::unique_ptr & gas_mix) + : Physics(physics_name,input), + _temp_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _species_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariableParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _n_species(_species_vars.n_species()), + _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame+"/fixed_density", false ) ), + _fixed_rho_value(0.0), + _gas_mixture(gas_mix.release()), + _rho_index(0), + _k_index(0), + _cp_index(0) + { + this->set_parameter + (_fixed_rho_value, input, + "Physics/"+PhysicsNaming::od_premixed_flame+"fixed_rho_value", 0.0 ); + + this->read_input_options(input); + + this->check_var_subdomain_consistency(_mass_flux_vars); + this->check_var_subdomain_consistency(_temp_vars); + this->check_var_subdomain_consistency(_species_vars); + + + this->_ic_handler = new GenericICHandler( physics_name, input ); + } + + //Reading and setting the Thermodynamic Pressure + void ODPremixedFlame::read_input_options( const GetPot& input ) + { + // Read thermodynamic pressure info + MaterialsParsing::read_property( input, + "ThermodynamicPressure", + PhysicsNaming::od_premixed_flame(), + (*this), + _p0 ); + } + + + + void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) + { + for( unsigned int i = 0; i < this->_n_species; i++ ) + { + system->time_evolving( _species_vars.species(i), 1 ); + } + system->time_evolving(_temp_vars.T(), 1); + } + + + void ODPremixedFlame::init_context( AssemblyContext& context ) + { + // We should prerequest all the data + // we will need to build the linear system + // or evaluate a quantity of interest. + context.get_element_fe(_species_vars.species(0))->get_JxW(); + context.get_element_fe(_species_vars.species(0))->get_phi(); + context.get_element_fe(_species_vars.species(0))->get_dphi(); + context.get_element_fe(_species_vars.species(0))->get_xyz(); + + context.get_element_fe(_mass_flux_vars.var())->get_JxW(); + context.get_element_fe(_mass_flux_vars.var())->get_phi(); + context.get_element_fe(_mass_flux_vars.var())->get_dphi(); + context.get_element_fe(_mass_flux_vars.var())->get_xyz(); + + context.get_element_fe(_temp_vars.T())->get_JxW(); + context.get_element_fe(_temp_vars.T())->get_phi(); + context.get_element_fe(_temp_vars.T())->get_dphi(); + context.get_element_fe(_temp_vars.T())->get_xyz(); + + + // We also need the side shape functions, etc. + + context.get_side_fe(_mass_flux_vars.var())->get_JxW(); + context.get_side_fe(_mass_flux_vars.var())->get_phi(); + context.get_side_fe(_mass_flux_vars.var())->get_dphi(); + context.get_side_fe(_mass_flux_vars.var())->get_xyz(); + + context.get_side_fe(this->_temp_vars.T())->get_JxW(); + context.get_side_fe(this->_temp_vars.T())->get_phi(); + context.get_side_fe(this->_temp_vars.T())->get_dphi(); + context.get_side_fe(this->_temp_vars.T())->get_xyz(); + } + + + + template + void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, + PostProcessedQuantities& postprocessing ) + { + std::string section = "physics/"+PhysicsNaming::od_premixed_flame()+"/output_vars"; + + if( input.have_variable(section) ) + { + unsigned int n_vars = input.vector_variable_size(section); + + for( unsigned int v=0; v _rho_index = postprocessing.register_quantity( name ); + } + else if( name == std::string("k") ) + { + this->_k_index = postprocessing.register_quantity( name ); + } + else if( name == std::string("cp") ) + { + this->_cp_index = post.processing.register_quantity( name ); + } + else if( name == (std::string("u")) ) + { + this->_u_index = postprocessing.register_quantity( name ); + } + + //time for species specific values + + else if(name == std::string("mole_fractions") ) + { + this ->_mole_fractions_index.resize(this->n_species()); + + for(unsigned int s=0; s < this->n_species(); s++) + { + this->mole_fractions_index[s] = postprocessing.register_quantity("X_"+this->_gas_mixture->species_name(s) ); + } + } + else if(name == std::string("h_s") ) + { + this->_h_s_index.resize(this->n_species()); + + for(unsigned int s=0; s < this->n_species(); s++) + { + this->_h_s_index[s] = postprocessing.register_quantity( "h_"+this->_gas_mixture->species_name(s) ); + } + } + else if(name == std::string("omega_dot") ) + { + this->_omega_dot_index.resize(this->n_species()); + + for(unsigned int s=0; s < this->n_species(); s++) + { + this->_omega_dot_index[s] = postprocessing.register_quantity( "omega_dot_"+this->_gas_mixture->species_name(s) ); + } + } + else if( name == std::string("D_s") ) + { + this->_Ds_index.resize(this->n_species()); + + for(unsigned int s=0;s < this->n_species(); s++) + { + this->_Ds_index[s] = postprocessing.register_quantity( "D_"+this->_gas_mixture->species_name(s) ); + } + } + /* else if( name == std::string("cp_s") ) + { + this->_cp_s_index.resize(this->n_species()); + + for(unsigned int s=0;s < this->n_species(); s++) + { + this ->_cps_index[s] = postprocessing.register_quantity( "cp_"+this->_gas_mixture->species_name(s) ); + } + }*/ + else + { + std::cerr << "Error: Invalid output_vars value for ODPremixedFlame " << std::endl + << " Found " << name << std::endl + << " Acceptable values are: rho" << std::endl + << " D_s" << std::endl + << " k" << std::endl + << " h_s" << std::endl + << " cp" << std::endl + << " mole_fractions" << std::endl + << " omega_dot" << std::endl + << " u" << std::endl; + libmesh_error(); + } + } + } + + return; + } //end post processing vars + + + + template + void ODPremixedFlame::element_time_derivative +( bool compute_jacobian, AssemblyContext & context ) + { + if( compute_jacobian ) + libmesh_not_implemented(); + + //Convenience + const VariableIndex s0_var = this->_species_vars.species(0); + + // The number of local degrees of freedom in each variable //Variables are Species, Mass flux, and Temperature + const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); + const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); + const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); + + // Element Jacobian * quadrature weights for interior integration. + const std::vector& JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); + + //the species shape function at interior quadrature points. + const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); + + //the species shape function gradients at interior quadrature points. + const std::vector > & s_dphi = context.get_element_fe(s0_var)->get_dphi(); + + // The temperature shape functions at interior quadrature points. + const std::vector >& T_phi = + context.get_element_fe(this->_temp_vars.T())->get_phi(); + + // The temperature shape functions gradients at interior quadrature points. + const std::vector >& T_dphi = + context.get_element_fe(this->_temp_vars.T())->get_dphi(); + + + libMesh::DenseSubVector &FT = context.get_elem_residual(this->_temp_vars.T()); // R_{T} + + //species set in residual calculations since the need of a for loop + + unsigned int n_qpoints = context.get_element_qrule().n_points(); + for(unsigned int qp = 0;qp != n_qpoints;qp++) + { + libMesh::Real T, M_dot; + libMesh::Gradient Dx_T; + + libmesh::Real R, M, k, cp, rho, p0, mu; + + T = context.interior_value(this->_temp_vars_T(),qp); + Dx_T = context.interior_gradient(this->_temp_vars.T(), qp); + + M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); + + p0 = this->get_p0(); + + + std::vector mass_fractions, h, D, omega_dot; + std::vector Dx_mass_fractions; + + mass_fractions.resize(this->_n_species); + Dx_mass_fractions.resize(this->_n_species); + h.resize(this->_n_species); + + for (unsigned int s = 0; s < this->_n_species; s++) + { + mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); + Dx_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); + h[s] = gas_evaluator.h_s( T, s ); + } + M = gas_evaluator.M_mix( mass_fractions ); + + R = gas_evaluator.R_mix( mass_fractions ); + + rho = this->rho( T, p0, R ); + + cp = gas_evaluator.cp( T, p0, mass_fractions); + + D.resize(this->_n_species); + + gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, + mu, k, D ); + + omega_dot.resize(this->_n_species); + + gas_evaluator.omega_dot( T, rho, mass_fractions, omega_dot ); + + libMesh::Real jac = JxW[qp]; + + //Energy equation Residual + libMesh::Real chem_term = 0.0; + for ( unsigned int s=0; s< this->_n_species; s++ ) + { + chem_term +=h[s]*(this->_gas_mixture->M(s))*omega_dot[s]; + } + for (unsigned int i=0;i != n_T_dofs; i++ ) + { + FT(i) += ( ( -cp*M_dot *Dx_T - chem_term )*T_phi[i][qp] + -k*Dx_T*T_dphi[i][qp])*jac; + + } + + //Species equation Residuals + for (unsigned int s = 0; s < _n_species; s++) + { + libMesh::DenseSubVector &FS = + contest.get_elem_residual(this->_species_vars.species(s)); //R_{s} + + const libMesh::Real term1 = -M_dot*Dx_mass_fractions[s] + omega_dot[s]*(this->_gas_mixture->M(s)); + const libMesh::gradient term2 = -rho*D[s]*Dx_mass_fractions[s]; + + for (unsigned int i =0;i != n_s_dofs;i++) + { + FS(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp] )*jac; + } + } + } // end of quadrature loop + return; + } // end element time derivative + + + + template + void ODPremixedFlame::mass_residual + (bool compute_jacobian, AssemblyContext & context ) + { + const VariableIndex s0_var = this->_species_vars.species(0); + const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); + const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); + const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); + + + // Element Jacobian * quadrature weights for interior integration. + const std::vector& JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); + + //the species shape function at interior quadrature points. + const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); + + // The temperature shape functions at interior quadrature points. + const std::vector >& T_phi = + context.get_element_fe(this->_temp_vars.T())->get_phi(); + + //The subvectors and submatrices we need to fill: + libMesh::DenseSubVector &F_T = context.get_elem_residual(this->_temp_vars.T()); + + libMesh::DenseSubVector &F_M = context.get_elem_residual(this->_mass_flux_vars.var()); + + //Get the number of quadrature points + unsigned int n_qpoints = context.get_element_qrule().n_points(); + + for (unsigned int qp = 0; qp != n_qpoints; ++qp) + { + libMesh::Real T_dot; + context.interior_rate(this->_temp_vars.T(), qp, T_dot); + + libMesh::Real T = context.interior_value(this->_temp_vars.T(), qp); + + std::vector mass_fractions(this->n_species()); + for(unsigned int s=0; s < this->_n_species; s++ ) + mass_fractions[s] = context.interior_value(this->_species_vars.species(s), qp); + + Evaluator gas_evaluator(*(this-> _gas_mixture)); + const libMesh::Real R_mix = gas_evaluator.R_mix(mass_fractions); + const libMesh::Real p0 = this->get_p0(); + const libMesh::Real rho = this->rho(T, p0, R_mix); + const libMesh::Real cp = gas_evaluator.cp(T,p0,mass_fractions); + const libMesh::Real M = gas_evaluator.M_mix(mass_fractions); + + libMesh::Real jac = JxW[qp]; + + // Species residual + for(unsigned int s=0; s < this->n_species(); s++) + { + libMesh::DenseSubVector & F_s = + context.get_elem_residual(this->_species_vars.species(s)); + + libMesh::Real mass_fractions_dot; + context.interior_rate(this->_species_vars.species(s)); + + for (unsigned int i = 0; i != n_s_dofs; ++i) + { + F_s(i) -= rho*mass_fractions_dot*s_phi[i][qp]*jac; + } + } + + //Energy Residual + + for (unsigned int i = 0; i!= n_T_dofs) + { + F_T(i) = rho*cp*T_dot*T_phi[i][qp]*jac; + } + + if( compute_jacobian ) + libmesh_not_implemented(); + + + } // end Quadrature loop + } //end Mass Residual + + + + template + void ODPremixedFlame::element_constraint + ( bool compute_jacobian, + AssemblyContext & context ) + { + if(compute_jacobian) + libmesh_not_implemented(); + + const std::vector &JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); + + // The Mass Flux shape functions at interior quadrature points. + const std::vector >& M_phi = + context.get_element_fe(this->_Mass_flux_vars.var())->get_phi(); + + + + const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); + + libMesh::DenseSubVector &Fm = context.get_elem_residual(this->_Mass_flux_vars.var()); // R_{M} + + for(unsigned int qp=0; qp!=n_qpoints; qp++) + { + libmesh::Gradient Dx_M_dot = context.interior_gradient(this->_mass_flux_vars.var(), qp); + libMesh::Real jac = JxW[qp]; + for(unsigned int i=0;i != n_M_dofs; i++) + { + Fm(i) += Dx_M_dot*M_phi[i][qp]*jac; + } + } + } //end Element Constraint + + + + + + + + template + void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, + const Assembly Context& context, + const libMesh::Point& point, + libMesh::Real & value ) + { + Evaluator gas_evaluator( *(this->_gas_mixture) ); + + if( quantity_index == this->_rho_index ) + { + std::vector Y( this->_n_species ); + libMesh Real T = this->T(point,context); + libMesh::Real p0 = this->get_p0(); + this->mass_fractions( point, context, Y ); + + value = this->rho(T,p0, gas_evaluator.R_mix(Y) ); + } + else if( quantity_index == this->_k_index ) + { + std::vector Y(this->_n_species ); + + libMesh::Real T = this->T(point,context); + this->mass_fractions( point,context, Y); + libMesh::Real p0 = this->get_p0(); + + libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); + + libMesh::Real rho = this->rho(T, p0, gas_evaluator.R_mix(Y) ); + + libMesh::Real mu,k; + + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); + + value = k; + return; + } + else if( quantity_index == this->_cp_index ) + { + std::vector Y( this->_n_species ); + libMesh::Real T = this->T(point,context); + this->mass_fractions( point, context, Y); + libMesh::Real p0 = this0>get_p0(); + + value = gas_evaluator.cp( T, p0, Y ); + } + else if ( quantity_index == this->_u_index ) + { + libMesh::Real M_dot = this->M_dot(point,context); + + std::vector Y( this->_n_species ); + libMesh Real T = this->T(point,context); + libMesh::Real p0 = this->get_p0(); + this->mass_fractions( point, context, Y ); + rho = this->rho(T,p0,Y ); + + value = M_dot/rho; + + } + //now onto the species dependent stuff + + else + { + if( !this->_mole_fractions_index.empty() ) + { + libmesh_assert_equal_to( _mole_fractions_index.size(), this->n_species() ); + + for( unsigned int s = 0; s < this->n_species(); s++ ) + { + if( quantity_index == this->_mole_fractions_index[s] ) + { + std::vector Y( this->_n_species ); + this->mass_fractions( point, context, Y ); + + libMesh::Real M = gas_evaluator.M_mix(Y); + + value = gas_evaluator.X( s, M, Y[s]); + return; + } + } + } + + if( !this->_h_s_index.empty() ) + { + libmesh_assert_equal_to( _h_s_index.size(), this->n_species() ); + + for( unsigned int s=0; s < this->n_species(); s++) + { + if( quantity_index == this->_h_s_index[s] ) + { + libMesh::Real T = this->T(point,context); + + value = gas_evaluator.h_s( T, s ); + return; + } + } + } + + if( !this->_omega_dot_index.empty() ) + { + libmesh_assert_equal_to( _omega_dot_index.size(), this->n_species() ); + + for(unsigned int s=0; s < this->n_species(); s++) + { + if( quantity_index == this->_omega_dot_index[s] ) + { + std::vector Y( this->n_species() ); + this->mass_fractions( point, context, Y ); + + libMesh::Real T = this->T(point,context); + + libMesh::Real p0 = this->get_p0(); + + libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y) ); + + std::vector omega_dot( this->n_species() ); + gas_evaluator.omega_dot( T, rho, Y, omega_dot ); + + value = omega_dot[s] + return; + } + } + } + + if( !this->_Ds_index.empty() ) + { + libmesh_assert_equal_to( _Ds_index.size(), this->n_species() ); + + for( unsigned int s = 0; s < this->n_species(); s++ ) + { + if(qunatity_index == this->_Ds_index[s] ) + { + std::vector Y( this->_n_species ); + + libMesh::Real T = this->T(point,context); + this->mass_fractions(point,context, Y ); + libMesh::Real p0 = this->get_p0(); + + libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); + + libMesh::Real rho = this->rho( T, p0, gas_evaluator.R_mix(Y) ); + + libMesh::Real mu, k; + std::vector D( this->_n_species ); + + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); + + value = D[s]; + return; + } + } + } + }//if/else quantity_index + + return; + } //end Postproc + + +}//end Namespace Grins + + + + + + + + + From fce1fd530cc371a9a73ccac3de3e5e82f9931750 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 8 Jan 2018 14:28:56 -0500 Subject: [PATCH 02/41] Adding Files to the Makefile --- src/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 11e106ae3..60562c6fe 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -71,6 +71,7 @@ libgrins_la_SOURCES += physics/src/multiphysics_sys.C libgrins_la_SOURCES += physics/src/assembly_context.C libgrins_la_SOURCES += physics/src/physics.C libgrins_la_SOURCES += physics/src/stokes.C +libgrins_la_SOURCES += physics/src/od_premixed_flame.C libgrins_la_SOURCES += physics/src/inc_navier_stokes_base.C libgrins_la_SOURCES += physics/src/inc_navier_stokes.C libgrins_la_SOURCES += physics/src/inc_navier_stokes_stab_base.C @@ -350,6 +351,7 @@ include_HEADERS += physics/include/grins/assembly_context.h include_HEADERS += physics/include/grins/physics.h include_HEADERS += physics/include/grins/var_typedefs.h include_HEADERS += physics/include/grins/stokes.h +include_HEADERS += physics/include/grins/od_premixed_flame.h include_HEADERS += physics/include/grins/inc_navier_stokes_base.h include_HEADERS += physics/include/grins/inc_navier_stokes.h include_HEADERS += physics/include/grins/inc_navier_stokes_stab_base.h From cfba2bb236722819479e060b4ebc63ceff921e53 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 8 Jan 2018 14:36:18 -0500 Subject: [PATCH 03/41] added flame into physics naming and physics factory --- src/physics/include/grins/physics_naming.h | 3 +++ src/physics/src/physics_factory_reacting_flows.C | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/physics/include/grins/physics_naming.h b/src/physics/include/grins/physics_naming.h index b65f22868..b7f18e919 100644 --- a/src/physics/include/grins/physics_naming.h +++ b/src/physics/include/grins/physics_naming.h @@ -164,6 +164,9 @@ namespace GRINS static PhysicsName reacting_low_mach_navier_stokes_spgsm_stab() { return "ReactingLowMachNavierStokesSPGSMStabilization"+suffix(); } + static PhysicsName od_premixed_flame() + { return "ODPremixedFlame"+suffix(); } + static PhysicsName elastic_membrane() { return "ElasticMembrane"+suffix(); } diff --git a/src/physics/src/physics_factory_reacting_flows.C b/src/physics/src/physics_factory_reacting_flows.C index f74940675..e5c5041b1 100644 --- a/src/physics/src/physics_factory_reacting_flows.C +++ b/src/physics/src/physics_factory_reacting_flows.C @@ -187,6 +187,11 @@ namespace GRINS ReactingFlowsPhysicsFactoryInitializer::ReactingFlowsPhysicsFactoryInitializer() { + static PhysicsFactoryReactingFlows + grins_factory_rlmns + (PhysicsNaming::od_premixed_flame(), + PhysicsNaming::od_premixed_flame()); + static PhysicsFactoryReactingFlows grins_factory_rlmns (PhysicsNaming::reacting_low_mach_navier_stokes(), From 90b9ed9a58dc0c2a295290c0876ad4de9cd171ac Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 17 Jan 2018 11:25:01 -0500 Subject: [PATCH 04/41] Fixed Typos and Template Problems --- src/Makefile.am | 1 + src/physics/include/grins/od_premixed_flame.h | 139 +++++++++--------- src/physics/src/od_premixed_flame.C | 95 ++++++------ .../src/physics_factory_reacting_flows.C | 3 +- 4 files changed, 125 insertions(+), 113 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 60562c6fe..75a1f3467 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -72,6 +72,7 @@ libgrins_la_SOURCES += physics/src/assembly_context.C libgrins_la_SOURCES += physics/src/physics.C libgrins_la_SOURCES += physics/src/stokes.C libgrins_la_SOURCES += physics/src/od_premixed_flame.C +libgrins_la_SOURCES += physics/src/od_premixed_flame_instantiate.C libgrins_la_SOURCES += physics/src/inc_navier_stokes_base.C libgrins_la_SOURCES += physics/src/inc_navier_stokes.C libgrins_la_SOURCES += physics/src/inc_navier_stokes_stab_base.C diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index b397fafce..a6a3a16e3 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -10,15 +10,18 @@ #include "grins/single_variable.h" #include "grins/materials_parsing.h" +#include "grins/multi_component_vector_variable.h" +#include "grins/multicomponent_variable.h" namespace GRINS { - class ODPremixedFlame : public Physics + template< typename Mixture, typename Evaluator> + class ODPremixedFlame : public Physics { public: ODPremixedFlame(const PhysicsName& physics_name, const GetPot & input, - std::unique_ptr & gas_mix); + libMesh::UniquePtr & gas_mix); virtual ~ODPremixedFlame(){}; @@ -41,17 +44,15 @@ namespace GRINS libMesh::Real get_p0() const; - - - // - //Register postprocessing variables for OD Premixed Flame virtual void register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing); - + + virtual void register_parameter(const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) + const; // Context Initializations - virual void init_context( AssemblyContext& context ); + virtual void init_context( AssemblyContext& context ); //Time dependent part(s) // The Energy and species, and Mass equations will be included here, F(u,v) virtual void element_time_derivative( bool compute_jacobian, @@ -69,17 +70,8 @@ namespace GRINS const AssemblyContext& context, const libMesh::Point& point, libMesh::Real& value ); - //Ditched the Caching of the time derivatives - - - - - - - - - + const Mixture & gas_mixture() const; @@ -89,6 +81,8 @@ namespace GRINS SingleVariable& _mass_flux_vars; SpeciesMassFractionsVariable& _species_vars; + libMesh::UniquePtr _gas_mixture; + //! Number of species unsigned int _n_species; @@ -106,7 +100,7 @@ namespace GRINS //! Index from registering this quantity unsigned int _rho_index; - //! Index from registering this quantity //This is the coefficient of thermal conductivity, or lambda in my case + //! Index from registering this quantity unsigned int _k_index; //!Index from registering this quantity @@ -115,6 +109,9 @@ namespace GRINS //!Index from registering this quantity libMesh::Number _p0; + //! Index from registering this quantity. Each species will have it's own index. + std::vector _mole_fractions_index; + //! Index from registering this quantity. Each species will have it's own index. std::vector _h_s_index; @@ -135,60 +132,66 @@ namespace GRINS ODPremixedFlame(); }; //Class ODPremixedFlame - - - inline - unsigned int ODPremixedFlame::n_species() const - { return _n_species } - - - inline - libMesh::Real ODPremixedFlame::T( const libMesh::Point& p, - const AssemblyContext& c ) const - { return c.point_value(_temp_vars.T(),p); } - - - inline - libMesh::Real M_dot( const libMesh::Point& p, - const AssemblyContext& c ) const - { return c.point_value(_mass_flux_vars.M(),p); } - - inline - void ODPremixedFlame::mass_fractions( const libMesh::Point& p, - const AssemblyContext& c, - std::vector& mass_fracs ) const - { - libmesh_assert_equal_to(mass_fracs.size(), this->_n_species); + template< typename Mixture, typename Evaluator> + inline + unsigned int ODPremixedFlame::n_species() const + { return _n_species; } + + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::T( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_temp_vars.T(),p); } + + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::M_dot( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_mass_flux_vars.var(),p); } + + template< typename Mixture, typename Evaluator> + inline + void ODPremixedFlame::mass_fractions( const libMesh::Point& p, + const AssemblyContext& c, + std::vector& mass_fracs ) const + { + libmesh_assert_equal_to(mass_fracs.size(), this->_n_species); - for( unsigned int var = 0; var < this->_n_species; var++ ) - { - mass_fracs[var] = c.point_value(_species_vars.species(var),p); - } - } - + for( unsigned int var = 0; var < this->_n_species; var++ ) + { + mass_fracs[var] = c.point_value(_species_vars.species(var),p); + } + } + + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::rho( libMesh::Real T, + libMesh::Real p0, + libMesh::Real R_mix) const + { + libMesh::Real value = 0; + if( this->_fixed_density ) + value = this->_fixed_rho_value; + else + value = p0/(R_mix*T); + + return value; + } - inline - libMesh::Real ODPremixedFlame::rho( libMesh::Real T, - libMesh::Real p0, - libMesh::Real R_mix) const + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::get_p0() const + {return _p0;} + + template< typename Mixture, typename Evaluator> + inline + const Mixture & ODPremixedFlame::gas_mixture() const { - libMesh::Real value = 0; - if( this->_fixed_density ) - value = this->_fixed_rho_value; - else - value = p0/(R_mix*T); - - return value; + return *_gas_mixture; } - - - inline - libMesh::Real get_p0() const - {return _p0;} - - - + + } // namespace Grins diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 8ceac320d..0dfd11c5d 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -22,7 +22,7 @@ namespace GRINS { - template + template ODPremixedFlame::ODPremixedFlame(const std::string& physics_name, const GetPot& input, @@ -30,9 +30,9 @@ namespace GRINS : Physics(physics_name,input), _temp_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _species_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,physics_name,VariablesParsing::PHYSICS))), - _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariableParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _n_species(_species_vars.n_species()), - _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame+"/fixed_density", false ) ), + _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_density", false ) ), _fixed_rho_value(0.0), _gas_mixture(gas_mix.release()), _rho_index(0), @@ -41,7 +41,7 @@ namespace GRINS { this->set_parameter (_fixed_rho_value, input, - "Physics/"+PhysicsNaming::od_premixed_flame+"fixed_rho_value", 0.0 ); + "Physics/"+PhysicsNaming::od_premixed_flame()+"fixed_rho_value", 0.0 ); this->read_input_options(input); @@ -53,8 +53,9 @@ namespace GRINS this->_ic_handler = new GenericICHandler( physics_name, input ); } - //Reading and setting the Thermodynamic Pressure - void ODPremixedFlame::read_input_options( const GetPot& input ) + //Reading and setting the Thermodynamic Pressure + template + void ODPremixedFlame::read_input_options( const GetPot& input ) { // Read thermodynamic pressure info MaterialsParsing::read_property( input, @@ -64,9 +65,16 @@ namespace GRINS _p0 ); } - - - void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) + template + void ODPremixedFlame::register_parameter( const std::string & param_name, + libMesh::ParameterMultiAccessor & param_pointer ) const + { + ParameterUser::register_parameter(param_name, param_pointer); + _gas_mixture->register_parameter(param_name, param_pointer); + } + + template + void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) { for( unsigned int i = 0; i < this->_n_species; i++ ) { @@ -75,8 +83,8 @@ namespace GRINS system->time_evolving(_temp_vars.T(), 1); } - - void ODPremixedFlame::init_context( AssemblyContext& context ) + template + void ODPremixedFlame::init_context( AssemblyContext& context ) { // We should prerequest all the data // we will need to build the linear system @@ -110,8 +118,6 @@ namespace GRINS context.get_side_fe(this->_temp_vars.T())->get_xyz(); } - - template void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing ) @@ -136,7 +142,7 @@ namespace GRINS } else if( name == std::string("cp") ) { - this->_cp_index = post.processing.register_quantity( name ); + this->_cp_index = postprocessing.register_quantity( name ); } else if( name == (std::string("u")) ) { @@ -151,7 +157,7 @@ namespace GRINS for(unsigned int s=0; s < this->n_species(); s++) { - this->mole_fractions_index[s] = postprocessing.register_quantity("X_"+this->_gas_mixture->species_name(s) ); + this->_mole_fractions_index[s] = postprocessing.register_quantity("X_"+this->_gas_mixture->species_name(s) ); } } else if(name == std::string("h_s") ) @@ -254,12 +260,13 @@ namespace GRINS for(unsigned int qp = 0;qp != n_qpoints;qp++) { libMesh::Real T, M_dot; - libMesh::Gradient Dx_T; - - libmesh::Real R, M, k, cp, rho, p0, mu; - + libMesh::Gradient Grad_T; + + libMesh::Real R, M, k, cp, rho, p0, mu; + Evaluator gas_evaluator( *(this->_gas_mixture) ); + T = context.interior_value(this->_temp_vars_T(),qp); - Dx_T = context.interior_gradient(this->_temp_vars.T(), qp); + Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); @@ -267,16 +274,16 @@ namespace GRINS std::vector mass_fractions, h, D, omega_dot; - std::vector Dx_mass_fractions; + std::vector Grad_mass_fractions; mass_fractions.resize(this->_n_species); - Dx_mass_fractions.resize(this->_n_species); + Grad_mass_fractions.resize(this->_n_species); h.resize(this->_n_species); for (unsigned int s = 0; s < this->_n_species; s++) { mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); - Dx_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); + Grad_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); h[s] = gas_evaluator.h_s( T, s ); } M = gas_evaluator.M_mix( mass_fractions ); @@ -306,8 +313,8 @@ namespace GRINS } for (unsigned int i=0;i != n_T_dofs; i++ ) { - FT(i) += ( ( -cp*M_dot *Dx_T - chem_term )*T_phi[i][qp] - -k*Dx_T*T_dphi[i][qp])*jac; + FT(i) += ( ( -cp*M_dot *Grad_T(0)*5 - chem_term )*T_phi[i][qp] + -k*Grad_T(0)*T_dphi[i][qp](0))*jac; } @@ -315,14 +322,14 @@ namespace GRINS for (unsigned int s = 0; s < _n_species; s++) { libMesh::DenseSubVector &FS = - contest.get_elem_residual(this->_species_vars.species(s)); //R_{s} + context.get_elem_residual(this->_species_vars.species(s)); //R_{s} - const libMesh::Real term1 = -M_dot*Dx_mass_fractions[s] + omega_dot[s]*(this->_gas_mixture->M(s)); - const libMesh::gradient term2 = -rho*D[s]*Dx_mass_fractions[s]; + const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]*(this->_gas_mixture->M(s)); + const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0); for (unsigned int i =0;i != n_s_dofs;i++) { - FS(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp] )*jac; + FS(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp](0) )*jac; } } } // end of quadrature loop @@ -383,21 +390,21 @@ namespace GRINS // Species residual for(unsigned int s=0; s < this->n_species(); s++) { - libMesh::DenseSubVector & F_s = + libMesh::DenseSubVector &F_s = context.get_elem_residual(this->_species_vars.species(s)); libMesh::Real mass_fractions_dot; - context.interior_rate(this->_species_vars.species(s)); + context.interior_rate(this->_species_vars.species(s),qp,mass_fractions_dot); for (unsigned int i = 0; i != n_s_dofs; ++i) { - F_s(i) -= rho*mass_fractions_dot*s_phi[i][qp]*jac; + F_s(i) -= rho*mass_fractions_dot*s_phi[i][qp]*jac; } } //Energy Residual - for (unsigned int i = 0; i!= n_T_dofs) + for (unsigned int i = 0; i!= n_T_dofs; i++) { F_T(i) = rho*cp*T_dot*T_phi[i][qp]*jac; } @@ -431,14 +438,14 @@ namespace GRINS const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); libMesh::DenseSubVector &Fm = context.get_elem_residual(this->_Mass_flux_vars.var()); // R_{M} - + unsigned int n_qpoints = context.get_element_qrule().n_points(); for(unsigned int qp=0; qp!=n_qpoints; qp++) { - libmesh::Gradient Dx_M_dot = context.interior_gradient(this->_mass_flux_vars.var(), qp); + libMesh::Gradient Grad_M_dot = context.interior_gradient(this->_mass_flux_vars.var(), qp); libMesh::Real jac = JxW[qp]; for(unsigned int i=0;i != n_M_dofs; i++) { - Fm(i) += Dx_M_dot*M_phi[i][qp]*jac; + Fm(i) += Grad_M_dot(0)*M_phi[i][qp]*jac; } } } //end Element Constraint @@ -448,10 +455,9 @@ namespace GRINS - template void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, - const Assembly Context& context, + const AssemblyContext& context, const libMesh::Point& point, libMesh::Real & value ) { @@ -460,7 +466,7 @@ namespace GRINS if( quantity_index == this->_rho_index ) { std::vector Y( this->_n_species ); - libMesh Real T = this->T(point,context); + libMesh::Real T = this->T(point,context); libMesh::Real p0 = this->get_p0(); this->mass_fractions( point, context, Y ); @@ -480,6 +486,7 @@ namespace GRINS libMesh::Real mu,k; + std::vector D; gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); value = k; @@ -490,7 +497,7 @@ namespace GRINS std::vector Y( this->_n_species ); libMesh::Real T = this->T(point,context); this->mass_fractions( point, context, Y); - libMesh::Real p0 = this0>get_p0(); + libMesh::Real p0 = this>get_p0(); value = gas_evaluator.cp( T, p0, Y ); } @@ -499,7 +506,7 @@ namespace GRINS libMesh::Real M_dot = this->M_dot(point,context); std::vector Y( this->_n_species ); - libMesh Real T = this->T(point,context); + libMesh::Real T = this->T(point,context); libMesh::Real p0 = this->get_p0(); this->mass_fractions( point, context, Y ); rho = this->rho(T,p0,Y ); @@ -566,8 +573,8 @@ namespace GRINS std::vector omega_dot( this->n_species() ); gas_evaluator.omega_dot( T, rho, Y, omega_dot ); - value = omega_dot[s] - return; + value = omega_dot[s]; + return; } } } @@ -578,7 +585,7 @@ namespace GRINS for( unsigned int s = 0; s < this->n_species(); s++ ) { - if(qunatity_index == this->_Ds_index[s] ) + if(quantity_index == this->_Ds_index[s] ) { std::vector Y( this->_n_species ); diff --git a/src/physics/src/physics_factory_reacting_flows.C b/src/physics/src/physics_factory_reacting_flows.C index e5c5041b1..7090dfe9f 100644 --- a/src/physics/src/physics_factory_reacting_flows.C +++ b/src/physics/src/physics_factory_reacting_flows.C @@ -18,6 +18,7 @@ #endif // GRINS_HAVE_ANTIOCH // Physics whose factories we're instantiating +#include "grins/od_premixed_flame.h" #include "grins/reacting_low_mach_navier_stokes.h" #include "grins/reacting_low_mach_navier_stokes_spgsm_stab.h" @@ -188,7 +189,7 @@ namespace GRINS ReactingFlowsPhysicsFactoryInitializer::ReactingFlowsPhysicsFactoryInitializer() { static PhysicsFactoryReactingFlows - grins_factory_rlmns + grins_factory_odpf (PhysicsNaming::od_premixed_flame(), PhysicsNaming::od_premixed_flame()); From d5055256a47a953b419dbdeaa807c008e4f98abc Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 17 Jan 2018 11:25:34 -0500 Subject: [PATCH 05/41] adding the instantiating file --- .../src/od_premixed_flame_instantiate.C | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/physics/src/od_premixed_flame_instantiate.C diff --git a/src/physics/src/od_premixed_flame_instantiate.C b/src/physics/src/od_premixed_flame_instantiate.C new file mode 100644 index 000000000..a792b3cea --- /dev/null +++ b/src/physics/src/od_premixed_flame_instantiate.C @@ -0,0 +1,53 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// GRINS - General Reacting Incompressible Navier-Stokes +// +// Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner +// Copyright (C) 2010-2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + + +#include "grins_config.h" + +#include "grins/od_premixed_flame.h" +#include "od_premixed_flame.C" + +#ifdef GRINS_HAVE_CANTERA + +#include "grins/cantera_mixture.h" +#include "grins/cantera_evaluator.h" + + +template class GRINS::ODPremixedFlame; + +#endif // GRINS_HAVE_CANTERA + + +#ifdef GRINS_HAVE_ANTIOCH + +#include "grins/reacting_low_mach_navier_stokes_macro.h" + + +INSTANTIATE_REACTING_LOW_MACH_SUBCLASS_CONSTANT_MIXTURE_AND_CONSTANT_EVALUATOR(ODPremixedFlame); + + +INSTANTIATE_REACTING_LOW_MACH_SUBCLASS_MIXTURE_AND_EVALUATOR(ODPremixedFlame); + + +#endif //GRINS_HAVE_ANTIOCH From 82f75c405987b7982576bc278f0e59e7bdbb0fdb Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 22 Jan 2018 11:41:36 -0500 Subject: [PATCH 06/41] Fixed a few Capitilization mistakes and reordered the initialization --- src/physics/include/grins/od_premixed_flame.h | 33 +++++-------------- src/physics/src/od_premixed_flame.C | 30 ++++++++--------- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index a6a3a16e3..78501d681 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -25,44 +25,35 @@ namespace GRINS virtual ~ODPremixedFlame(){}; - - - //! Sets variables to be time-evolving virtual void set_time_evolving_vars( libMesh::FEMSystem* system ); unsigned int n_species() const; - libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; - libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; - void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, std::vector& mass_fracs ) const; libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; - libMesh::Real get_p0() const; //Register postprocessing variables for OD Premixed Flame virtual void register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing); - - virtual void register_parameter(const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) + virtual void register_parameter(const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) const; + // Context Initializations virtual void init_context( AssemblyContext& context ); - //Time dependent part(s) // The Energy and species, and Mass equations will be included here, F(u,v) + //Time dependent part(s) virtual void element_time_derivative( bool compute_jacobian, AssemblyContext & context); - - //Mass matrix part(s) //This would by my LHS of the species and energy, and mass residuals M(u,v) + //Mass matrix part(s) virtual void mass_residual( bool compute_jacobian, AssemblyContext & context ); - virtual void element_constraint(bool compute_jacobian, AssemblyContext & context ); @@ -73,25 +64,18 @@ namespace GRINS const Mixture & gas_mixture() const; - - protected: //Variables PrimitiveTempFEVariables& _temp_vars; - SingleVariable& _mass_flux_vars; SpeciesMassFractionsVariable& _species_vars; - - libMesh::UniquePtr _gas_mixture; - + SingleVariable& _mass_flux_vars; //! Number of species unsigned int _n_species; - - bool _fixed_density; libMesh::Real _fixed_rho_value; - + std::unique_ptr _gas_mixture; @@ -99,13 +83,12 @@ namespace GRINS //! Index from registering this quantity unsigned int _rho_index; - //! Index from registering this quantity unsigned int _k_index; - //!Index from registering this quantity unsigned int _cp_index; - + //!Index from registering this quantity + unsigned int _u_index; //!Index from registering this quantity libMesh::Number _p0; diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 0dfd11c5d..414a53ac4 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -19,6 +19,8 @@ #include "libmesh/quadrature.h" #include "libmesh/fem_system.h" + + namespace GRINS { @@ -37,7 +39,8 @@ namespace GRINS _gas_mixture(gas_mix.release()), _rho_index(0), _k_index(0), - _cp_index(0) + _cp_index(0), + _u_index(0) { this->set_parameter (_fixed_rho_value, input, @@ -59,6 +62,7 @@ namespace GRINS { // Read thermodynamic pressure info MaterialsParsing::read_property( input, + "hubbabaloo", "ThermodynamicPressure", PhysicsNaming::od_premixed_flame(), (*this), @@ -122,7 +126,7 @@ namespace GRINS void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing ) { - std::string section = "physics/"+PhysicsNaming::od_premixed_flame()+"/output_vars"; + std::string section = "Physics/"+PhysicsNaming::od_premixed_flame()+"/output_vars"; if( input.have_variable(section) ) { @@ -230,7 +234,6 @@ namespace GRINS // The number of local degrees of freedom in each variable //Variables are Species, Mass flux, and Temperature const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); - const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); // Element Jacobian * quadrature weights for interior integration. @@ -262,10 +265,10 @@ namespace GRINS libMesh::Real T, M_dot; libMesh::Gradient Grad_T; - libMesh::Real R, M, k, cp, rho, p0, mu; + libMesh::Real R, k, cp, rho, p0, mu; Evaluator gas_evaluator( *(this->_gas_mixture) ); - T = context.interior_value(this->_temp_vars_T(),qp); + T = context.interior_value(this->_temp_vars.T(),qp); Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); @@ -286,8 +289,7 @@ namespace GRINS Grad_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); h[s] = gas_evaluator.h_s( T, s ); } - M = gas_evaluator.M_mix( mass_fractions ); - + R = gas_evaluator.R_mix( mass_fractions ); rho = this->rho( T, p0, R ); @@ -313,7 +315,7 @@ namespace GRINS } for (unsigned int i=0;i != n_T_dofs; i++ ) { - FT(i) += ( ( -cp*M_dot *Grad_T(0)*5 - chem_term )*T_phi[i][qp] + FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term )*T_phi[i][qp] -k*Grad_T(0)*T_dphi[i][qp](0))*jac; } @@ -344,7 +346,6 @@ namespace GRINS { const VariableIndex s0_var = this->_species_vars.species(0); const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); - const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); @@ -362,8 +363,6 @@ namespace GRINS //The subvectors and submatrices we need to fill: libMesh::DenseSubVector &F_T = context.get_elem_residual(this->_temp_vars.T()); - libMesh::DenseSubVector &F_M = context.get_elem_residual(this->_mass_flux_vars.var()); - //Get the number of quadrature points unsigned int n_qpoints = context.get_element_qrule().n_points(); @@ -383,7 +382,6 @@ namespace GRINS const libMesh::Real p0 = this->get_p0(); const libMesh::Real rho = this->rho(T, p0, R_mix); const libMesh::Real cp = gas_evaluator.cp(T,p0,mass_fractions); - const libMesh::Real M = gas_evaluator.M_mix(mass_fractions); libMesh::Real jac = JxW[qp]; @@ -431,13 +429,13 @@ namespace GRINS // The Mass Flux shape functions at interior quadrature points. const std::vector >& M_phi = - context.get_element_fe(this->_Mass_flux_vars.var())->get_phi(); + context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); - libMesh::DenseSubVector &Fm = context.get_elem_residual(this->_Mass_flux_vars.var()); // R_{M} + libMesh::DenseSubVector &Fm = context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} unsigned int n_qpoints = context.get_element_qrule().n_points(); for(unsigned int qp=0; qp!=n_qpoints; qp++) { @@ -497,7 +495,7 @@ namespace GRINS std::vector Y( this->_n_species ); libMesh::Real T = this->T(point,context); this->mass_fractions( point, context, Y); - libMesh::Real p0 = this>get_p0(); + libMesh::Real p0 = this->get_p0(); value = gas_evaluator.cp( T, p0, Y ); } @@ -509,7 +507,7 @@ namespace GRINS libMesh::Real T = this->T(point,context); libMesh::Real p0 = this->get_p0(); this->mass_fractions( point, context, Y ); - rho = this->rho(T,p0,Y ); + libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y)); value = M_dot/rho; From 0e3c8d1fe5de4936df822e8936fe2a0851dcfcf6 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Tue, 30 Jan 2018 12:19:25 -0500 Subject: [PATCH 07/41] Added Brackets around a loop for visual eaze --- src/physics/src/od_premixed_flame.C | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 414a53ac4..7a0b8eeb0 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -62,9 +62,8 @@ namespace GRINS { // Read thermodynamic pressure info MaterialsParsing::read_property( input, - "hubbabaloo", "ThermodynamicPressure", - PhysicsNaming::od_premixed_flame(), + PhysicsNaming::od_premixed_flame(), (*this), _p0 ); } @@ -323,7 +322,7 @@ namespace GRINS //Species equation Residuals for (unsigned int s = 0; s < _n_species; s++) { - libMesh::DenseSubVector &FS = + libMesh::DenseSubVector &Fs = context.get_elem_residual(this->_species_vars.species(s)); //R_{s} const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]*(this->_gas_mixture->M(s)); @@ -331,7 +330,7 @@ namespace GRINS for (unsigned int i =0;i != n_s_dofs;i++) { - FS(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp](0) )*jac; + Fs(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp](0) )*jac; } } } // end of quadrature loop @@ -375,7 +374,9 @@ namespace GRINS std::vector mass_fractions(this->n_species()); for(unsigned int s=0; s < this->_n_species; s++ ) - mass_fractions[s] = context.interior_value(this->_species_vars.species(s), qp); + { + mass_fractions[s] = context.interior_value(this->_species_vars.species(s), qp); + } Evaluator gas_evaluator(*(this-> _gas_mixture)); const libMesh::Real R_mix = gas_evaluator.R_mix(mass_fractions); @@ -404,7 +405,7 @@ namespace GRINS for (unsigned int i = 0; i!= n_T_dofs; i++) { - F_T(i) = rho*cp*T_dot*T_phi[i][qp]*jac; + F_T(i) -= rho*cp*T_dot*T_phi[i][qp]*jac; } if( compute_jacobian ) From 05bd0a52f8a7cc5d3bbef03b32f9be885324d969 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Tue, 6 Mar 2018 16:31:12 -0500 Subject: [PATCH 08/41] adding an example for a one dimensional premixed laminar flame, it is not added in the makefile yet --- examples/OzoneOD/NewRun.sh | 23 +++ examples/OzoneOD/Rename | 5 + examples/OzoneOD/ozone_Data_Files/ozone.xml | 152 +++++++++++++++ .../ozone_Data_Files/ozone_cea_data.dat | 54 ++++++ .../ozone_Data_Files/ozone_species_data.dat | 14 ++ examples/OzoneOD/ozone_constraint.base | 171 +++++++++++++++++ examples/OzoneOD/ozone_constraint.in | 178 ++++++++++++++++++ examples/OzoneOD/run_constraint.in | 7 + 8 files changed, 604 insertions(+) create mode 100755 examples/OzoneOD/NewRun.sh create mode 100755 examples/OzoneOD/Rename create mode 100644 examples/OzoneOD/ozone_Data_Files/ozone.xml create mode 100644 examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat create mode 100644 examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat create mode 100644 examples/OzoneOD/ozone_constraint.base create mode 100644 examples/OzoneOD/ozone_constraint.in create mode 100755 examples/OzoneOD/run_constraint.in diff --git a/examples/OzoneOD/NewRun.sh b/examples/OzoneOD/NewRun.sh new file mode 100755 index 000000000..b10de72c5 --- /dev/null +++ b/examples/OzoneOD/NewRun.sh @@ -0,0 +1,23 @@ +#!/bin/sh +Dir=ConstraintRunYO2_0$1YO3_0$2Mdot_0$3 +mkdir $Dir +cd ./$Dir +echo "[RunVars]" >> ozone_constraint.in +echo " Tmax = '700'" >> ozone_constraint.in +echo " YO2_Val = '$1'" >> ozone_constraint.in +echo " YO3_Val = '$2'" >> ozone_constraint.in +echo " M_dot_Value = '$3'" >> ozone_constraint.in +echo "[]" >> ozone_constraint.in +cat ../ozone_constraint.base >> ozone_constraint.in + + + + +echo "#!/bin/sh" >> Run_Constraint.sh +echo "GRINS_RUN=\${GRINS_RUN:-\$LIBMESH_RUN}" >> Run_Constraint.sh +echo "DEFAULT_SOLVER_OPTIONS=\"-ksp_type gmeres -pc_type bjacobi -sub_pc_type lu -sub_pc_factor_shift_type nonzero\"" >> Run_Constraint.sh +echo "GRINS_SOLVER_OPTIONS=\${GRINS_SOLVER_OPTIONS:-\$LIBMESH_OPTIONS:\$DEFAULT_SOLVER_OPTIONS}" >> Run_Constraint.sh +echo "\$GRINS_RUN /zoidberg1/data/shared/klbudzin/WorkingGrins/OptBuild/bin/grins /zoidberg1/data/shared/klbudzin/Flames/OzoneOD/$Dir/ozone_constraint.in \$GRINS_SOLVER_OPTIONS" >> Run_Constraint.sh +chmod u+x Run_Constraint.sh + + diff --git a/examples/OzoneOD/Rename b/examples/OzoneOD/Rename new file mode 100755 index 000000000..fb004205f --- /dev/null +++ b/examples/OzoneOD/Rename @@ -0,0 +1,5 @@ +#!/bin/bash +for i in {1..1600..1} + do +mv output.$(($i * $1 - 1)).exo output.e-s.$(($i * $1 - 1)) + done diff --git a/examples/OzoneOD/ozone_Data_Files/ozone.xml b/examples/OzoneOD/ozone_Data_Files/ozone.xml new file mode 100644 index 000000000..fbb20105c --- /dev/null +++ b/examples/OzoneOD/ozone_Data_Files/ozone.xml @@ -0,0 +1,152 @@ + + + + + + + O + + O O2 O3 + + + + 300.0 + 101325.0 + + + + + + + + + + + + + O:1 + L 1/90 + + + + 3.168267100E+00, -3.279318840E-03, 6.643063960E-06, -6.128066240E-09, + 2.112659710E-12, 2.912225920E+04, 2.051933460E+00 + + + + 2.569420780E+00, -8.597411370E-05, 4.194845890E-08, -1.001777990E-11, + 1.228336910E-15, 2.921757910E+04, 4.784338640E+00 + + + + atom + 80.000 + 2.750 + 0.000 + 0.000 + 0.000 + + + + + +O:2 +TPIS89 + + + + 3.782456360E+00, -2.996734160E-03, 9.847302010E-06, -9.681295090E-09, + 3.243728370E-12, -1.063943560E+03, 3.657675730E+00 + + + + 3.282537840E+00, 1.483087540E-03, -7.579666690E-07, 2.094705550E-10, + -2.167177940E-14, -1.088457720E+03, 5.453231290E+00 + + + +linear +107.400 +3.460 +0.000 +1.600 +3.800 + + + + + + +O:3 +TPIS89 + + + + 2.46260900E+00, 9.58278100E-03, -7.08735900E-06, 1.36336800E-09, + 2.96964700E-13, 1.60615200E+04, 1.21418700E+01 + + + + 5.42937100E+00, 1.82038000E-03, -7.70560700E-07, 1.49929300E-10, + -1.07556300E-14, 1.52352700E+04, -3.26638700E+00 + + + +linear +180 +4.1 +0.000 +0 +2 + + + + + + + + + O + O [=] O2 + + + 2.9e+17 + -1.0 + 0.0 + + + + O:2.0 + O2:1.0 + + + + + O2 + O [=] O3 + + + 3.427e+13 + 0.0 + -4.234 + + + + O2:1.0 O:1.0 + O3:1.0 + + + + + O + O3 [=] O2 + O2 + + + 5.2e+12 + 0.0 + 17.38 + + + O:1.0 O3:1.0 + O2:2.0 + + + + diff --git a/examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat b/examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat new file mode 100644 index 000000000..b50c7bb59 --- /dev/null +++ b/examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat @@ -0,0 +1,54 @@ +#----------------------------------------------------------------------------- +# Cp, H, and S curve fit parameters from CEA program (1994) +# +# File Format: +# +# First line: +# +# Species Name +# Number of T intervals: [200-1000], [1000-6000], ([6000-20000]) +# Formation Enthalpy @ 298.15K +# +# Lines 2-4 (2-8): +# +# a0-a4; a5-a9 for each interval. +# +# +# Cp/R = a0*T^-2 + a1*T^-1 + a2 + a3*T + a4*T^2 + a5*T^3 + a6*T^4 +# H/RT = -a0*T^-2 + a1*T^-1*lnT + a2 + a3*T/2 + a4*T^2/3 + a5*T^3/4 + a6*T^4/5 + a8/T +# S/R = -a0*T^-2/2 - a1*T^-1 + a2*lnT + a3*T + a4*T^2/2 + a5*T^3/3 + a6*T^4/4 + a9 +# +# Note that a7 is always zero and is not used in the calculation of Cp,H, or S. +# The constant is included simply for compatibility with cea. +# +# +# Sources: +# +# All values come directly from cea400 program (05/98) +# Note that for monotomics in which the only non-zero parameter is a2, cea +# stores this value in the 1st position. This must be changed for FIN-S to +# work correctly. +# [PB]: HO2/H2O2 values taken from http://www.grc.nasa.gov/WWW/CEAWeb/ceaThermoBuild.htm +#------------------------------------------------------------------------------- + +O 3 249175.003 + -7.95361130e+03 1.60717779e+02 1.96622644e+00 1.01367031e-03 -1.11041542e-06 + 6.51750750e-10 -1.58477925e-13 0.00000000e+00 2.84036244e+04 8.40424182e+00 + 2.61902026e+05 -7.29872203e+02 3.31717727e+00 -4.28133436e-04 1.03610459e-07 + -9.43830433e-12 2.72503830e-16 0.00000000e+00 3.39242806e+04 -6.67958535e-01 + 1.77900426e+08 -1.08232826e+05 2.81077837e+01 -2.97523226e-03 1.85499753e-07 + -5.79623154e-12 7.19172016e-17 0.00000000e+00 8.89094263e+05 -2.18172815e+02 + +O2 3 0.000 + -3.42556269e+04 4.84699986e+02 1.11901159e+00 4.29388743e-03 -6.83627313e-07 + -2.02337478e-09 1.03904064e-12 0.00000000e+00 -3.39145434e+03 1.84969912e+01 + -1.03793994e+06 2.34483275e+03 1.81972949e+00 1.26784887e-03 -2.18807142e-07 + 2.05372411e-11 -8.19349062e-16 0.00000000e+00 -1.68901253e+04 1.73871835e+01 + 4.97515261e+08 -2.86602339e+05 6.69015464e+01 -6.16971869e-03 3.01623757e-07 + -7.42087888e-12 7.27744063e-17 0.00000000e+00 2.29348755e+06 -5.53044968e+02 + +O3 2 141800.000 + -1.282314507e+04 5.898216640e+02 -2.547496763e+00 2.690121526e-02 -3.528258340e-05 + 2.312290922e-08 -6.044893270e-12 0.000000000e+00 1.348368701e+04 3.852218580e+01 + -3.869662480e+07 1.023344994e+05 -8.961551600e+01 3.706144970e-02 -4.137638740e-06 + -2.725018591e-10 5.248188110e-14 0.000000000e+00 -6.517918180e+05 7.029109520e+02 diff --git a/examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat b/examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat new file mode 100644 index 000000000..7e8d8f3fa --- /dev/null +++ b/examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat @@ -0,0 +1,14 @@ +#=========================================================================== +# LEGEND +#=========================================================================== +# +# Species -- Species name +# Mol. Wt. -- Molecular weight (kg/kmol) +# Hform -- Formation enthalpy (J/kg @ 0K) +# cfs -- Nominal T-R Degrees of freedom (cv = cfs*k*T) +# zns -- Charge number +# +# Spec. Mol. Wt. Hform (0K), cfs, zns +O 16.00000 1.5420000000e7 1.5 0 +O2 32.00000 0.000000000000 2.5 0 +O3 48.00000 2.9729160000e7 3.0 0 diff --git a/examples/OzoneOD/ozone_constraint.base b/examples/OzoneOD/ozone_constraint.base new file mode 100644 index 000000000..6e45bc4a4 --- /dev/null +++ b/examples/OzoneOD/ozone_constraint.base @@ -0,0 +1,171 @@ + +[SolverOptions] + [./TimeStepping] + solver_type = 'libmesh_euler_solver' + delta_t = '1e-6' + n_timesteps = '25000' + theta = '1.0' +[] + +# Enabled Physics classes +[Physics] + + enabled_physics = 'ODPremixedFlame' + + [./ODPremixedFlame] + + material = 'OzoneGas' + + # Initial Conditions + ic_ids = '0' + ic_types = 'parsed' + ic_variables = 'Y_O2:Y_O3:T:M_dot' + ic_values = '{YO2:=${RunVars/YO2_Val};YO2}{YO3:=${RunVars/YO3_Val};YO3}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVars/M_dot_Value};M_dot_Value}' + + # ic_values = '{YO2_Val:=${RunVars/YO2_Val;YO2_Val}{YO3_Val:=${RunVariables/YO3_Val};YO3_Val}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVariables/M_dot_Value};M_dot_Value}' + + output_vars = 'mole_fractions omega_dot u rho' + [../] +[] + +[BoundaryConditions] + bc_ids = '0 1' + bc_id_name_map = 'Inlet Outlet' + + [./Inlet] + [./SingleVariable] + type = 'homogeneous_neumann' + [../] + + [./Temperature] + type = 'isothermal' + T = '300' + [../] + + [./SpeciesMassFractions] + type = 'parsed_dirichlet' + Y_O2 = '{YO2:=${RunVars/YO2_Val};YO2}' + Y_O3 = '{YO3:=${RunVars/YO3_Val};YO3}' + [../] + [../] + + [./Outlet] + [./SingleVariable] + type = 'homogeneous_neumann' + [../] + [./Temperature] + type = 'homogeneous_neumann' + [../] + [./SpeciesMassFractions] + type = 'homogeneous_neumann' + [../] + [../] +[] + + +# Mesh related options +[Mesh] + [./Generation] + dimension = '1' + element_type = 'EDGE2' + x_min = '0.0' + x_max = '0.02' + n_elems_x = '600' + + [../] + + #[./Read] + # filename = 'unif_ref_1.xda' +[] + +[Materials] + [./OzoneGas] + [./ThermodynamicPressure] + value = '1e5' #[Pa] + [../GasMixture] + thermochemistry_library = 'antioch' + species = 'O O2 O3' + kinetics_data = '../ozone_Data_Files/ozone.xml' + + [./Antioch] + transport_model = 'constant' + thermo_model = 'cea' + viscosity_model = 'constant' + thermal_conductivity_model = 'constant' + mass_diffusivity_model = 'constant_lewis' + cea_data = '../ozone_Data_Files/ozone_cea_data.dat' + species_data = '../ozone_Data_Files/ozone_species_data.dat' + + [../../Viscosity] + value = '1.0e-5' + [../ThermalConductivity] + value = '0.02' + [../LewisNumber] + value = '1.0' +[] + +[Variables] + [./Temperature] + names = 'T' + fe_family = 'LAGRANGE' + order = 'FIRST' + + [./ConstrainedPoints] + [./FirstEdgeNode] + constraint_location = '0.004' + constraint_rhs = '700' + [../] + [../] + + + [../SingleVariable] + names = 'M_dot' + fe_family = 'LAGRANGE' + order = 'FIRST' + + [../SpeciesMassFractions] + names = 'Y_' + fe_family = 'LAGRANGE' + order = 'FIRST' + material = 'OzoneGas' +[] + +#[restart-options] +# restart_file='./Run1DHeavy6/output.9999.xdr' +#[] + +#Linear and nonlinear solver options +[linear-nonlinear-solver] + continue_after_max_iterations = 'true' + max_nonlinear_iterations = '200' + max_linear_iterations = '2500' + minimum_linear_tolerance = '1.0e-10' + initial_linear_tolerance = '1.0e-10' + use_numerical_jacobians_only = 'true' + + relative_residual_tolerance = '1.0e-10' + relative_step_tolerance = '1.0e-6' +[] + +# Visualization options +[vis-options] + output_vis = 'true' + vis_output_file_prefix = './Output/output' + output_residual = 'false' + output_format = 'ExodusII xdr' + timesteps_per_vis = '25' +[] + +# Options for print info to the screen +[screen-options] + + system_name = 'Ozone' + + print_equation_system_info = 'true' + print_mesh_info = 'true' + print_log_info = 'true' + solver_verbose = 'true' + solver_quiet = 'false' + + print_element_jacobians = 'false' +[] \ No newline at end of file diff --git a/examples/OzoneOD/ozone_constraint.in b/examples/OzoneOD/ozone_constraint.in new file mode 100644 index 000000000..5431b0137 --- /dev/null +++ b/examples/OzoneOD/ozone_constraint.in @@ -0,0 +1,178 @@ +[RunVars] + Tmax = '700' + YO2_Val = '.8' + YO3_Val = '.2' + M_dot_Value = '.3' +[] + +[SolverOptions] + [./TimeStepping] + solver_type = 'libmesh_euler_solver' + delta_t = '1e-6' + n_timesteps = '25000' + theta = '1.0' +[] + +# Enabled Physics classes +[Physics] + + enabled_physics = 'ODPremixedFlame' + + [./ODPremixedFlame] + + material = 'OzoneGas' + + # Initial Conditions + ic_ids = '0' + ic_types = 'parsed' + ic_variables = 'Y_O2:Y_O3:T:M_dot' + ic_values = '{YO2:=${RunVars/YO2_Val};YO2}{YO3:=${RunVars/YO3_Val};YO3}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVars/M_dot_Value};M_dot_Value}' + + # ic_values = '{YO2_Val:=${RunVars/YO2_Val;YO2_Val}{YO3_Val:=${RunVariables/YO3_Val};YO3_Val}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVariables/M_dot_Value};M_dot_Value}' + + output_vars = 'mole_fractions omega_dot u rho' + [../] +[] + +[BoundaryConditions] + bc_ids = '0 1' + bc_id_name_map = 'Inlet Outlet' + + [./Inlet] + [./SingleVariable] + type = 'parsed_dirichlet' + M_dot = '{M_dot_Value:=${RunVars/M_dot_Value};M_dot_Value}' + [../] + + [./Temperature] + type = 'isothermal' + T = '300' + [../] + + [./SpeciesMassFractions] + type = 'parsed_dirichlet' + Y_O2 = '{YO2:=${RunVars/YO2_Val};YO2}' + Y_O3 = '{YO3:=${RunVars/YO3_Val};YO3}' + [../] + [../] + + [./Outlet] + [./SingleVariable] + type = 'homogeneous_neumann' + [../] + [./Temperature] + type = 'homogeneous_neumann' + [../] + [./SpeciesMassFractions] + type = 'homogeneous_neumann' + [../] + [../] +[] + + +# Mesh related options +[Mesh] + [./Generation] + dimension = '1' + element_type = 'EDGE2' + x_min = '0.0' + x_max = '0.02' + n_elems_x = '600' + + [../] + + #[./Read] + # filename = 'unif_ref_1.xda' +[] + +[Materials] + [./OzoneGas] + [./ThermodynamicPressure] + value = '1e5' #[Pa] + [../GasMixture] + thermochemistry_library = 'antioch' + species = 'O O2 O3' + kinetics_data = './ozone_Data_Files/ozone.xml' + + [./Antioch] + transport_model = 'constant' + thermo_model = 'cea' + viscosity_model = 'constant' + thermal_conductivity_model = 'constant' + mass_diffusivity_model = 'constant_lewis' + cea_data = './ozone_Data_Files/ozone_cea_data.dat' + species_data = './ozone_Data_Files/ozone_species_data.dat' + + [../../Viscosity] + value = '1.0e-5' + [../ThermalConductivity] + value = '0.02' + [../LewisNumber] + value = '1.0' +[] + +[Variables] + [./Temperature] + names = 'T' + fe_family = 'LAGRANGE' + order = 'FIRST' + + [./ConstrainedPoints] + [./FirstEdgeNode] + constraint_location = '0.004' + constraint_rhs = '700' + [../] + [../] + + + [../SingleVariable] + names = 'M_dot' + fe_family = 'LAGRANGE' + order = 'FIRST' + + [../SpeciesMassFractions] + names = 'Y_' + fe_family = 'LAGRANGE' + order = 'FIRST' + material = 'OzoneGas' +[] + +#[restart-options] +# restart_file='./Run1DHeavy6/output.9999.xdr' +#[] + +#Linear and nonlinear solver options +[linear-nonlinear-solver] + continue_after_max_iterations = 'true' + max_nonlinear_iterations = '200' + max_linear_iterations = '2500' + minimum_linear_tolerance = '1.0e-10' + initial_linear_tolerance = '1.0e-10' + use_numerical_jacobians_only = 'true' + + relative_residual_tolerance = '1.0e-10' + relative_step_tolerance = '1.0e-6' +[] + +# Visualization options +[vis-options] + output_vis = 'true' + vis_output_file_prefix = './Output/output' + output_residual = 'false' + output_format = 'ExodusII xdr' + timesteps_per_vis = '25' +[] + +# Options for print info to the screen +[screen-options] + + system_name = 'Ozone' + + print_equation_system_info = 'true' + print_mesh_info = 'true' + print_log_info = 'true' + solver_verbose = 'true' + solver_quiet = 'false' + + print_element_jacobians = 'false' +[] \ No newline at end of file diff --git a/examples/OzoneOD/run_constraint.in b/examples/OzoneOD/run_constraint.in new file mode 100755 index 000000000..954a1d799 --- /dev/null +++ b/examples/OzoneOD/run_constraint.in @@ -0,0 +1,7 @@ +#!/bin/sh + +GRINS_RUN=${GRINS_RUN:-$LIBMESH_RUN} +DEFAULT_SOLVER_OPTIONS="-ksp_type gmeres -pc_type bjacobi -sub_pc_type lu -sub_pc_factor_shift_type nonzero" +GRINS_SOLVER_OPTIONS=${GRINS_SOLVER_OPTIONS:-$LIBMESH_OPTIONS:$DEFAULT_SOLVER_OPTIONS} +$GRINS_RUN /zoidberg1/data/shared/klbudzin/WorkingGrins/OptBuild/bin/grins /zoidberg1/data/shared/klbudzin/WorkingGrins/grins/examples/OzoneOD/ozone_constraint.in $GRINS_SOLVER_OPTIONS + From b45e3feec24449452c5c7944fedb1939ca628686 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 19 Mar 2018 13:38:47 -0400 Subject: [PATCH 09/41] At some point the Fixing of units was undone and this corrects the equations again --- src/physics/src/od_premixed_flame.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 7a0b8eeb0..a766d5ea2 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -310,7 +310,7 @@ namespace GRINS libMesh::Real chem_term = 0.0; for ( unsigned int s=0; s< this->_n_species; s++ ) { - chem_term +=h[s]*(this->_gas_mixture->M(s))*omega_dot[s]; + chem_term +=h[s]*omega_dot[s]; } for (unsigned int i=0;i != n_T_dofs; i++ ) { @@ -325,7 +325,7 @@ namespace GRINS libMesh::DenseSubVector &Fs = context.get_elem_residual(this->_species_vars.species(s)); //R_{s} - const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]*(this->_gas_mixture->M(s)); + const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0); for (unsigned int i =0;i != n_s_dofs;i++) From e3248c3e087dd2d4393c164c2662f1ab5068db8b Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Tue, 1 May 2018 12:07:04 -0400 Subject: [PATCH 10/41] A Take On velocity being the third variable over mass flux --- src/physics/include/grins/od_premixed_flame.h | 10 +- .../include/grins/od_premixed_flameold | 181 +++++ src/physics/src/od_premixed_flame.C | 93 ++- src/physics/src/od_premixed_flameOrig.C | 624 ++++++++++++++++++ 4 files changed, 873 insertions(+), 35 deletions(-) create mode 100644 src/physics/include/grins/od_premixed_flameold create mode 100644 src/physics/src/od_premixed_flameOrig.C diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index 78501d681..73da75a1c 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -30,7 +30,7 @@ namespace GRINS unsigned int n_species() const; libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; - libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; + libMesh::Real U( const libMesh::Point& p, const AssemblyContext& c ) const; void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, std::vector& mass_fracs ) const; @@ -68,7 +68,7 @@ namespace GRINS //Variables PrimitiveTempFEVariables& _temp_vars; SpeciesMassFractionsVariable& _species_vars; - SingleVariable& _mass_flux_vars; + SingleVariable& _U_vars; //! Number of species unsigned int _n_species; @@ -88,7 +88,7 @@ namespace GRINS //!Index from registering this quantity unsigned int _cp_index; //!Index from registering this quantity - unsigned int _u_index; + unsigned int _M_index; //!Index from registering this quantity libMesh::Number _p0; @@ -129,9 +129,9 @@ namespace GRINS template< typename Mixture, typename Evaluator> inline - libMesh::Real ODPremixedFlame::M_dot( const libMesh::Point& p, + libMesh::Real ODPremixedFlame::U( const libMesh::Point& p, const AssemblyContext& c ) const - { return c.point_value(_mass_flux_vars.var(),p); } + { return c.point_value(_U_vars.var(),p); } template< typename Mixture, typename Evaluator> inline diff --git a/src/physics/include/grins/od_premixed_flameold b/src/physics/include/grins/od_premixed_flameold new file mode 100644 index 000000000..78501d681 --- /dev/null +++ b/src/physics/include/grins/od_premixed_flameold @@ -0,0 +1,181 @@ +#ifndef GRINS_OD_PREMIXED_FLAME_H +#define GRINS_OD_PREMIXED_FLAME_H + +// Grins items, can see not needing multi-component-vector variable but will leave in until i've written more of the code. +#include "grins_config.h" +#include "grins/grins_enums.h" +#include "grins/physics.h" +#include "grins/assembly_context.h" + + +#include "grins/single_variable.h" +#include "grins/materials_parsing.h" +#include "grins/multi_component_vector_variable.h" +#include "grins/multicomponent_variable.h" + +namespace GRINS +{ + template< typename Mixture, typename Evaluator> + class ODPremixedFlame : public Physics + { + public: + ODPremixedFlame(const PhysicsName& physics_name, + const GetPot & input, + libMesh::UniquePtr & gas_mix); + + virtual ~ODPremixedFlame(){}; + + //! Sets variables to be time-evolving + virtual void set_time_evolving_vars( libMesh::FEMSystem* system ); + + unsigned int n_species() const; + libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; + libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; + void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, + std::vector& mass_fracs ) const; + + libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; + libMesh::Real get_p0() const; + + + //Register postprocessing variables for OD Premixed Flame + virtual void register_postprocessing_vars( const GetPot& input, + PostProcessedQuantities& postprocessing); + virtual void register_parameter(const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) + const; + + // Context Initializations + virtual void init_context( AssemblyContext& context ); + + //Time dependent part(s) + virtual void element_time_derivative( bool compute_jacobian, + AssemblyContext & context); + + //Mass matrix part(s) + virtual void mass_residual( bool compute_jacobian, + AssemblyContext & context ); + virtual void element_constraint(bool compute_jacobian, + AssemblyContext & context ); + + virtual void compute_postprocessed_quantity( unsigned int quantity_index, + const AssemblyContext& context, + const libMesh::Point& point, + libMesh::Real& value ); + + const Mixture & gas_mixture() const; + + protected: + //Variables + PrimitiveTempFEVariables& _temp_vars; + SpeciesMassFractionsVariable& _species_vars; + SingleVariable& _mass_flux_vars; + + //! Number of species + unsigned int _n_species; + bool _fixed_density; + + libMesh::Real _fixed_rho_value; + std::unique_ptr _gas_mixture; + + + + + + //! Index from registering this quantity + unsigned int _rho_index; + //! Index from registering this quantity + unsigned int _k_index; + //!Index from registering this quantity + unsigned int _cp_index; + //!Index from registering this quantity + unsigned int _u_index; + //!Index from registering this quantity + libMesh::Number _p0; + + //! Index from registering this quantity. Each species will have it's own index. + std::vector _mole_fractions_index; + + //! Index from registering this quantity. Each species will have it's own index. + std::vector _h_s_index; + + //! Index from registering this quantity. Each species will have it's own index. + std::vector _omega_dot_index; + + //! Index from registering this quantity. Each species will have it's own index. + std::vector _Ds_index; + + /* //! Index from registering this quantity. Each species will have it's own index. + std::vector _cp_s_index;*/ + + + private: + + void read_input_options( const GetPot& input ); + + ODPremixedFlame(); + + }; //Class ODPremixedFlame + + template< typename Mixture, typename Evaluator> + inline + unsigned int ODPremixedFlame::n_species() const + { return _n_species; } + + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::T( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_temp_vars.T(),p); } + + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::M_dot( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_mass_flux_vars.var(),p); } + + template< typename Mixture, typename Evaluator> + inline + void ODPremixedFlame::mass_fractions( const libMesh::Point& p, + const AssemblyContext& c, + std::vector& mass_fracs ) const + { + libmesh_assert_equal_to(mass_fracs.size(), this->_n_species); + + for( unsigned int var = 0; var < this->_n_species; var++ ) + { + mass_fracs[var] = c.point_value(_species_vars.species(var),p); + } + } + + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::rho( libMesh::Real T, + libMesh::Real p0, + libMesh::Real R_mix) const + { + libMesh::Real value = 0; + if( this->_fixed_density ) + value = this->_fixed_rho_value; + else + value = p0/(R_mix*T); + + return value; + } + + template< typename Mixture, typename Evaluator> + inline + libMesh::Real ODPremixedFlame::get_p0() const + {return _p0;} + + template< typename Mixture, typename Evaluator> + inline + const Mixture & ODPremixedFlame::gas_mixture() const + { + return *_gas_mixture; + } + + +} // namespace Grins + + +#endif // OD_Premixed_Flame diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index a766d5ea2..d2ee39042 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -32,7 +32,7 @@ namespace GRINS : Physics(physics_name,input), _temp_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _species_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,physics_name,VariablesParsing::PHYSICS))), - _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _U_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _n_species(_species_vars.n_species()), _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_density", false ) ), _fixed_rho_value(0.0), @@ -40,7 +40,7 @@ namespace GRINS _rho_index(0), _k_index(0), _cp_index(0), - _u_index(0) + _M_index(0) { this->set_parameter (_fixed_rho_value, input, @@ -48,7 +48,7 @@ namespace GRINS this->read_input_options(input); - this->check_var_subdomain_consistency(_mass_flux_vars); + this->check_var_subdomain_consistency(_U_vars); this->check_var_subdomain_consistency(_temp_vars); this->check_var_subdomain_consistency(_species_vars); @@ -97,10 +97,10 @@ namespace GRINS context.get_element_fe(_species_vars.species(0))->get_dphi(); context.get_element_fe(_species_vars.species(0))->get_xyz(); - context.get_element_fe(_mass_flux_vars.var())->get_JxW(); - context.get_element_fe(_mass_flux_vars.var())->get_phi(); - context.get_element_fe(_mass_flux_vars.var())->get_dphi(); - context.get_element_fe(_mass_flux_vars.var())->get_xyz(); + context.get_element_fe(_U_vars.var())->get_JxW(); + context.get_element_fe(_U_vars.var())->get_phi(); + context.get_element_fe(_U_vars.var())->get_dphi(); + context.get_element_fe(_U_vars.var())->get_xyz(); context.get_element_fe(_temp_vars.T())->get_JxW(); context.get_element_fe(_temp_vars.T())->get_phi(); @@ -110,10 +110,10 @@ namespace GRINS // We also need the side shape functions, etc. - context.get_side_fe(_mass_flux_vars.var())->get_JxW(); - context.get_side_fe(_mass_flux_vars.var())->get_phi(); - context.get_side_fe(_mass_flux_vars.var())->get_dphi(); - context.get_side_fe(_mass_flux_vars.var())->get_xyz(); + context.get_side_fe(_U_vars.var())->get_JxW(); + context.get_side_fe(_U_vars.var())->get_phi(); + context.get_side_fe(_U_vars.var())->get_dphi(); + context.get_side_fe(_U_vars.var())->get_xyz(); context.get_side_fe(this->_temp_vars.T())->get_JxW(); context.get_side_fe(this->_temp_vars.T())->get_phi(); @@ -147,9 +147,9 @@ namespace GRINS { this->_cp_index = postprocessing.register_quantity( name ); } - else if( name == (std::string("u")) ) + else if( name == (std::string("M")) ) { - this->_u_index = postprocessing.register_quantity( name ); + this->_M_index = postprocessing.register_quantity( name ); } //time for species specific values @@ -261,7 +261,7 @@ namespace GRINS unsigned int n_qpoints = context.get_element_qrule().n_points(); for(unsigned int qp = 0;qp != n_qpoints;qp++) { - libMesh::Real T, M_dot; + libMesh::Real T, U; libMesh::Gradient Grad_T; libMesh::Real R, k, cp, rho, p0, mu; @@ -270,7 +270,7 @@ namespace GRINS T = context.interior_value(this->_temp_vars.T(),qp); Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); - M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); + U = context.interior_value(this->_U_vars.var(), qp); p0 = this->get_p0(); @@ -314,7 +314,7 @@ namespace GRINS } for (unsigned int i=0;i != n_T_dofs; i++ ) { - FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term )*T_phi[i][qp] + FT(i) += ( ( -cp*rho*U *Grad_T(0) - chem_term )*T_phi[i][qp] -k*Grad_T(0)*T_dphi[i][qp](0))*jac; } @@ -325,7 +325,7 @@ namespace GRINS libMesh::DenseSubVector &Fs = context.get_elem_residual(this->_species_vars.species(s)); //R_{s} - const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; + const libMesh::Real term1 = -rho*U*Grad_mass_fractions[s](0) + omega_dot[s]; const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0); for (unsigned int i =0;i != n_s_dofs;i++) @@ -429,24 +429,57 @@ namespace GRINS context.get_element_fe(this->_temp_vars.T())->get_JxW(); // The Mass Flux shape functions at interior quadrature points. - const std::vector >& M_phi = - context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); + const std::vector >& U_phi = + context.get_element_fe(this->_U_vars.var())->get_phi(); - + const unsigned int n_U_dofs = context.get_dof_indices(this->_U_vars.var()).size(); - const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); + libMesh::DenseSubVector &FU = context.get_elem_residual(this->_U_vars.var()); // R_{M} - libMesh::DenseSubVector &Fm = context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} unsigned int n_qpoints = context.get_element_qrule().n_points(); + for(unsigned int qp=0; qp!=n_qpoints; qp++) { - libMesh::Gradient Grad_M_dot = context.interior_gradient(this->_mass_flux_vars.var(), qp); + libMesh::Real T, U; + T = context.interior_value(this->_temp_vars.T(),qp); + + U = context.interior_value(this->_U_vars.var(), qp); + libMesh::Gradient Grad_U = context.interior_gradient(this->_U_vars.var(), qp); + libMesh::Gradient Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); libMesh::Real jac = JxW[qp]; - for(unsigned int i=0;i != n_M_dofs; i++) - { - Fm(i) += Grad_M_dot(0)*M_phi[i][qp]*jac; - } + + + libMesh::Real R, rho, p0; + Evaluator gas_evaluator( *(this->_gas_mixture) ); + + p0 = this->get_p0(); + + + std::vector mass_fractions; + std::vector Grad_mass_fractions; + mass_fractions.resize(this->_n_species); + Grad_mass_fractions.resize(this->_n_species); + + libMesh::Real R_Uni = 8.314459848; + libMesh::Real sum_term = 0; + for (unsigned int s = 0; s < this->_n_species; s++) + { + mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); + Grad_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); + sum_term += Grad_mass_fractions[s](0)/this->_gas_mixture->M(s); + } + + R = gas_evaluator.R_mix( mass_fractions ); + + rho = this->rho( T, p0, R ); + + + for(unsigned int i=0;i != n_U_dofs; i++) + { + FU(i) += (-(p0/(R*T*T*R))*(R*Grad_T(0)+T*R_Uni*sum_term)*U+rho*Grad_U(0))*U_phi[i][qp]*jac; + } } + } //end Element Constraint @@ -500,9 +533,9 @@ namespace GRINS value = gas_evaluator.cp( T, p0, Y ); } - else if ( quantity_index == this->_u_index ) + else if ( quantity_index == this->_M_index ) { - libMesh::Real M_dot = this->M_dot(point,context); + libMesh::Real U = this->U(point,context); std::vector Y( this->_n_species ); libMesh::Real T = this->T(point,context); @@ -510,7 +543,7 @@ namespace GRINS this->mass_fractions( point, context, Y ); libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y)); - value = M_dot/rho; + value = U*rho; } //now onto the species dependent stuff diff --git a/src/physics/src/od_premixed_flameOrig.C b/src/physics/src/od_premixed_flameOrig.C new file mode 100644 index 000000000..a766d5ea2 --- /dev/null +++ b/src/physics/src/od_premixed_flameOrig.C @@ -0,0 +1,624 @@ +// This class +#include "grins/od_premixed_flame.h" + +#include "grins_config.h" + +// GRINS +#include "grins/assembly_context.h" +#include "grins/cantera_mixture.h" +#include "grins/grins_enums.h" +#include "grins/antioch_mixture.h" +#include "grins/materials_parsing.h" +#include "grins/variables_parsing.h" +#include "grins/variable_warehouse.h" +#include "grins/generic_ic_handler.h" +#include "grins/postprocessed_quantities.h" + +// libMesh +#include "libmesh/string_to_enum.h" +#include "libmesh/quadrature.h" +#include "libmesh/fem_system.h" + + + +namespace GRINS +{ + + template + + ODPremixedFlame::ODPremixedFlame(const std::string& physics_name, + const GetPot& input, + std::unique_ptr & gas_mix) + : Physics(physics_name,input), + _temp_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _species_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _n_species(_species_vars.n_species()), + _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_density", false ) ), + _fixed_rho_value(0.0), + _gas_mixture(gas_mix.release()), + _rho_index(0), + _k_index(0), + _cp_index(0), + _u_index(0) + { + this->set_parameter + (_fixed_rho_value, input, + "Physics/"+PhysicsNaming::od_premixed_flame()+"fixed_rho_value", 0.0 ); + + this->read_input_options(input); + + this->check_var_subdomain_consistency(_mass_flux_vars); + this->check_var_subdomain_consistency(_temp_vars); + this->check_var_subdomain_consistency(_species_vars); + + + this->_ic_handler = new GenericICHandler( physics_name, input ); + } + + //Reading and setting the Thermodynamic Pressure + template + void ODPremixedFlame::read_input_options( const GetPot& input ) + { + // Read thermodynamic pressure info + MaterialsParsing::read_property( input, + "ThermodynamicPressure", + PhysicsNaming::od_premixed_flame(), + (*this), + _p0 ); + } + + template + void ODPremixedFlame::register_parameter( const std::string & param_name, + libMesh::ParameterMultiAccessor & param_pointer ) const + { + ParameterUser::register_parameter(param_name, param_pointer); + _gas_mixture->register_parameter(param_name, param_pointer); + } + + template + void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) + { + for( unsigned int i = 0; i < this->_n_species; i++ ) + { + system->time_evolving( _species_vars.species(i), 1 ); + } + system->time_evolving(_temp_vars.T(), 1); + } + + template + void ODPremixedFlame::init_context( AssemblyContext& context ) + { + // We should prerequest all the data + // we will need to build the linear system + // or evaluate a quantity of interest. + context.get_element_fe(_species_vars.species(0))->get_JxW(); + context.get_element_fe(_species_vars.species(0))->get_phi(); + context.get_element_fe(_species_vars.species(0))->get_dphi(); + context.get_element_fe(_species_vars.species(0))->get_xyz(); + + context.get_element_fe(_mass_flux_vars.var())->get_JxW(); + context.get_element_fe(_mass_flux_vars.var())->get_phi(); + context.get_element_fe(_mass_flux_vars.var())->get_dphi(); + context.get_element_fe(_mass_flux_vars.var())->get_xyz(); + + context.get_element_fe(_temp_vars.T())->get_JxW(); + context.get_element_fe(_temp_vars.T())->get_phi(); + context.get_element_fe(_temp_vars.T())->get_dphi(); + context.get_element_fe(_temp_vars.T())->get_xyz(); + + + // We also need the side shape functions, etc. + + context.get_side_fe(_mass_flux_vars.var())->get_JxW(); + context.get_side_fe(_mass_flux_vars.var())->get_phi(); + context.get_side_fe(_mass_flux_vars.var())->get_dphi(); + context.get_side_fe(_mass_flux_vars.var())->get_xyz(); + + context.get_side_fe(this->_temp_vars.T())->get_JxW(); + context.get_side_fe(this->_temp_vars.T())->get_phi(); + context.get_side_fe(this->_temp_vars.T())->get_dphi(); + context.get_side_fe(this->_temp_vars.T())->get_xyz(); + } + + template + void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, + PostProcessedQuantities& postprocessing ) + { + std::string section = "Physics/"+PhysicsNaming::od_premixed_flame()+"/output_vars"; + + if( input.have_variable(section) ) + { + unsigned int n_vars = input.vector_variable_size(section); + + for( unsigned int v=0; v _rho_index = postprocessing.register_quantity( name ); + } + else if( name == std::string("k") ) + { + this->_k_index = postprocessing.register_quantity( name ); + } + else if( name == std::string("cp") ) + { + this->_cp_index = postprocessing.register_quantity( name ); + } + else if( name == (std::string("u")) ) + { + this->_u_index = postprocessing.register_quantity( name ); + } + + //time for species specific values + + else if(name == std::string("mole_fractions") ) + { + this ->_mole_fractions_index.resize(this->n_species()); + + for(unsigned int s=0; s < this->n_species(); s++) + { + this->_mole_fractions_index[s] = postprocessing.register_quantity("X_"+this->_gas_mixture->species_name(s) ); + } + } + else if(name == std::string("h_s") ) + { + this->_h_s_index.resize(this->n_species()); + + for(unsigned int s=0; s < this->n_species(); s++) + { + this->_h_s_index[s] = postprocessing.register_quantity( "h_"+this->_gas_mixture->species_name(s) ); + } + } + else if(name == std::string("omega_dot") ) + { + this->_omega_dot_index.resize(this->n_species()); + + for(unsigned int s=0; s < this->n_species(); s++) + { + this->_omega_dot_index[s] = postprocessing.register_quantity( "omega_dot_"+this->_gas_mixture->species_name(s) ); + } + } + else if( name == std::string("D_s") ) + { + this->_Ds_index.resize(this->n_species()); + + for(unsigned int s=0;s < this->n_species(); s++) + { + this->_Ds_index[s] = postprocessing.register_quantity( "D_"+this->_gas_mixture->species_name(s) ); + } + } + /* else if( name == std::string("cp_s") ) + { + this->_cp_s_index.resize(this->n_species()); + + for(unsigned int s=0;s < this->n_species(); s++) + { + this ->_cps_index[s] = postprocessing.register_quantity( "cp_"+this->_gas_mixture->species_name(s) ); + } + }*/ + else + { + std::cerr << "Error: Invalid output_vars value for ODPremixedFlame " << std::endl + << " Found " << name << std::endl + << " Acceptable values are: rho" << std::endl + << " D_s" << std::endl + << " k" << std::endl + << " h_s" << std::endl + << " cp" << std::endl + << " mole_fractions" << std::endl + << " omega_dot" << std::endl + << " u" << std::endl; + libmesh_error(); + } + } + } + + return; + } //end post processing vars + + + + template + void ODPremixedFlame::element_time_derivative +( bool compute_jacobian, AssemblyContext & context ) + { + if( compute_jacobian ) + libmesh_not_implemented(); + + //Convenience + const VariableIndex s0_var = this->_species_vars.species(0); + + // The number of local degrees of freedom in each variable //Variables are Species, Mass flux, and Temperature + const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); + const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); + + // Element Jacobian * quadrature weights for interior integration. + const std::vector& JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); + + //the species shape function at interior quadrature points. + const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); + + //the species shape function gradients at interior quadrature points. + const std::vector > & s_dphi = context.get_element_fe(s0_var)->get_dphi(); + + // The temperature shape functions at interior quadrature points. + const std::vector >& T_phi = + context.get_element_fe(this->_temp_vars.T())->get_phi(); + + // The temperature shape functions gradients at interior quadrature points. + const std::vector >& T_dphi = + context.get_element_fe(this->_temp_vars.T())->get_dphi(); + + + libMesh::DenseSubVector &FT = context.get_elem_residual(this->_temp_vars.T()); // R_{T} + + //species set in residual calculations since the need of a for loop + + unsigned int n_qpoints = context.get_element_qrule().n_points(); + for(unsigned int qp = 0;qp != n_qpoints;qp++) + { + libMesh::Real T, M_dot; + libMesh::Gradient Grad_T; + + libMesh::Real R, k, cp, rho, p0, mu; + Evaluator gas_evaluator( *(this->_gas_mixture) ); + + T = context.interior_value(this->_temp_vars.T(),qp); + Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); + + M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); + + p0 = this->get_p0(); + + + std::vector mass_fractions, h, D, omega_dot; + std::vector Grad_mass_fractions; + + mass_fractions.resize(this->_n_species); + Grad_mass_fractions.resize(this->_n_species); + h.resize(this->_n_species); + + for (unsigned int s = 0; s < this->_n_species; s++) + { + mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); + Grad_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); + h[s] = gas_evaluator.h_s( T, s ); + } + + R = gas_evaluator.R_mix( mass_fractions ); + + rho = this->rho( T, p0, R ); + + cp = gas_evaluator.cp( T, p0, mass_fractions); + + D.resize(this->_n_species); + + gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, + mu, k, D ); + + omega_dot.resize(this->_n_species); + + gas_evaluator.omega_dot( T, rho, mass_fractions, omega_dot ); + + libMesh::Real jac = JxW[qp]; + + //Energy equation Residual + libMesh::Real chem_term = 0.0; + for ( unsigned int s=0; s< this->_n_species; s++ ) + { + chem_term +=h[s]*omega_dot[s]; + } + for (unsigned int i=0;i != n_T_dofs; i++ ) + { + FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term )*T_phi[i][qp] + -k*Grad_T(0)*T_dphi[i][qp](0))*jac; + + } + + //Species equation Residuals + for (unsigned int s = 0; s < _n_species; s++) + { + libMesh::DenseSubVector &Fs = + context.get_elem_residual(this->_species_vars.species(s)); //R_{s} + + const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; + const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0); + + for (unsigned int i =0;i != n_s_dofs;i++) + { + Fs(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp](0) )*jac; + } + } + } // end of quadrature loop + return; + } // end element time derivative + + + + template + void ODPremixedFlame::mass_residual + (bool compute_jacobian, AssemblyContext & context ) + { + const VariableIndex s0_var = this->_species_vars.species(0); + const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); + const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); + + + // Element Jacobian * quadrature weights for interior integration. + const std::vector& JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); + + //the species shape function at interior quadrature points. + const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); + + // The temperature shape functions at interior quadrature points. + const std::vector >& T_phi = + context.get_element_fe(this->_temp_vars.T())->get_phi(); + + //The subvectors and submatrices we need to fill: + libMesh::DenseSubVector &F_T = context.get_elem_residual(this->_temp_vars.T()); + + //Get the number of quadrature points + unsigned int n_qpoints = context.get_element_qrule().n_points(); + + for (unsigned int qp = 0; qp != n_qpoints; ++qp) + { + libMesh::Real T_dot; + context.interior_rate(this->_temp_vars.T(), qp, T_dot); + + libMesh::Real T = context.interior_value(this->_temp_vars.T(), qp); + + std::vector mass_fractions(this->n_species()); + for(unsigned int s=0; s < this->_n_species; s++ ) + { + mass_fractions[s] = context.interior_value(this->_species_vars.species(s), qp); + } + + Evaluator gas_evaluator(*(this-> _gas_mixture)); + const libMesh::Real R_mix = gas_evaluator.R_mix(mass_fractions); + const libMesh::Real p0 = this->get_p0(); + const libMesh::Real rho = this->rho(T, p0, R_mix); + const libMesh::Real cp = gas_evaluator.cp(T,p0,mass_fractions); + + libMesh::Real jac = JxW[qp]; + + // Species residual + for(unsigned int s=0; s < this->n_species(); s++) + { + libMesh::DenseSubVector &F_s = + context.get_elem_residual(this->_species_vars.species(s)); + + libMesh::Real mass_fractions_dot; + context.interior_rate(this->_species_vars.species(s),qp,mass_fractions_dot); + + for (unsigned int i = 0; i != n_s_dofs; ++i) + { + F_s(i) -= rho*mass_fractions_dot*s_phi[i][qp]*jac; + } + } + + //Energy Residual + + for (unsigned int i = 0; i!= n_T_dofs; i++) + { + F_T(i) -= rho*cp*T_dot*T_phi[i][qp]*jac; + } + + if( compute_jacobian ) + libmesh_not_implemented(); + + + } // end Quadrature loop + } //end Mass Residual + + + + template + void ODPremixedFlame::element_constraint + ( bool compute_jacobian, + AssemblyContext & context ) + { + if(compute_jacobian) + libmesh_not_implemented(); + + const std::vector &JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); + + // The Mass Flux shape functions at interior quadrature points. + const std::vector >& M_phi = + context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); + + + + const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); + + libMesh::DenseSubVector &Fm = context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} + unsigned int n_qpoints = context.get_element_qrule().n_points(); + for(unsigned int qp=0; qp!=n_qpoints; qp++) + { + libMesh::Gradient Grad_M_dot = context.interior_gradient(this->_mass_flux_vars.var(), qp); + libMesh::Real jac = JxW[qp]; + for(unsigned int i=0;i != n_M_dofs; i++) + { + Fm(i) += Grad_M_dot(0)*M_phi[i][qp]*jac; + } + } + } //end Element Constraint + + + + + + + template + void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, + const AssemblyContext& context, + const libMesh::Point& point, + libMesh::Real & value ) + { + Evaluator gas_evaluator( *(this->_gas_mixture) ); + + if( quantity_index == this->_rho_index ) + { + std::vector Y( this->_n_species ); + libMesh::Real T = this->T(point,context); + libMesh::Real p0 = this->get_p0(); + this->mass_fractions( point, context, Y ); + + value = this->rho(T,p0, gas_evaluator.R_mix(Y) ); + } + else if( quantity_index == this->_k_index ) + { + std::vector Y(this->_n_species ); + + libMesh::Real T = this->T(point,context); + this->mass_fractions( point,context, Y); + libMesh::Real p0 = this->get_p0(); + + libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); + + libMesh::Real rho = this->rho(T, p0, gas_evaluator.R_mix(Y) ); + + libMesh::Real mu,k; + + std::vector D; + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); + + value = k; + return; + } + else if( quantity_index == this->_cp_index ) + { + std::vector Y( this->_n_species ); + libMesh::Real T = this->T(point,context); + this->mass_fractions( point, context, Y); + libMesh::Real p0 = this->get_p0(); + + value = gas_evaluator.cp( T, p0, Y ); + } + else if ( quantity_index == this->_u_index ) + { + libMesh::Real M_dot = this->M_dot(point,context); + + std::vector Y( this->_n_species ); + libMesh::Real T = this->T(point,context); + libMesh::Real p0 = this->get_p0(); + this->mass_fractions( point, context, Y ); + libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y)); + + value = M_dot/rho; + + } + //now onto the species dependent stuff + + else + { + if( !this->_mole_fractions_index.empty() ) + { + libmesh_assert_equal_to( _mole_fractions_index.size(), this->n_species() ); + + for( unsigned int s = 0; s < this->n_species(); s++ ) + { + if( quantity_index == this->_mole_fractions_index[s] ) + { + std::vector Y( this->_n_species ); + this->mass_fractions( point, context, Y ); + + libMesh::Real M = gas_evaluator.M_mix(Y); + + value = gas_evaluator.X( s, M, Y[s]); + return; + } + } + } + + if( !this->_h_s_index.empty() ) + { + libmesh_assert_equal_to( _h_s_index.size(), this->n_species() ); + + for( unsigned int s=0; s < this->n_species(); s++) + { + if( quantity_index == this->_h_s_index[s] ) + { + libMesh::Real T = this->T(point,context); + + value = gas_evaluator.h_s( T, s ); + return; + } + } + } + + if( !this->_omega_dot_index.empty() ) + { + libmesh_assert_equal_to( _omega_dot_index.size(), this->n_species() ); + + for(unsigned int s=0; s < this->n_species(); s++) + { + if( quantity_index == this->_omega_dot_index[s] ) + { + std::vector Y( this->n_species() ); + this->mass_fractions( point, context, Y ); + + libMesh::Real T = this->T(point,context); + + libMesh::Real p0 = this->get_p0(); + + libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y) ); + + std::vector omega_dot( this->n_species() ); + gas_evaluator.omega_dot( T, rho, Y, omega_dot ); + + value = omega_dot[s]; + return; + } + } + } + + if( !this->_Ds_index.empty() ) + { + libmesh_assert_equal_to( _Ds_index.size(), this->n_species() ); + + for( unsigned int s = 0; s < this->n_species(); s++ ) + { + if(quantity_index == this->_Ds_index[s] ) + { + std::vector Y( this->_n_species ); + + libMesh::Real T = this->T(point,context); + this->mass_fractions(point,context, Y ); + libMesh::Real p0 = this->get_p0(); + + libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); + + libMesh::Real rho = this->rho( T, p0, gas_evaluator.R_mix(Y) ); + + libMesh::Real mu, k; + std::vector D( this->_n_species ); + + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); + + value = D[s]; + return; + } + } + } + }//if/else quantity_index + + return; + } //end Postproc + + +}//end Namespace Grins + + + + + + + + + From 064a1dd8a6212c492a4b619647dbb97ec59fb74a Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Sat, 19 May 2018 12:28:32 -0400 Subject: [PATCH 11/41] first attempt at a flame speed qoi --- src/physics/include/grins/od_premixed_flame.h | 14 +- .../include/grins/od_premixed_flameold | 181 ----- src/physics/src/od_premixed_flame.C | 139 ++-- src/physics/src/od_premixed_flameOrig.C | 624 ------------------ src/qoi/include/grins/flame_speed.h | 122 ++++ src/qoi/src/flame_speed.C | 160 +++++ 6 files changed, 355 insertions(+), 885 deletions(-) delete mode 100644 src/physics/include/grins/od_premixed_flameold delete mode 100644 src/physics/src/od_premixed_flameOrig.C create mode 100644 src/qoi/include/grins/flame_speed.h create mode 100644 src/qoi/src/flame_speed.C diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index 73da75a1c..d0a15877a 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -30,7 +30,7 @@ namespace GRINS unsigned int n_species() const; libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; - libMesh::Real U( const libMesh::Point& p, const AssemblyContext& c ) const; + libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, std::vector& mass_fracs ) const; @@ -68,7 +68,7 @@ namespace GRINS //Variables PrimitiveTempFEVariables& _temp_vars; SpeciesMassFractionsVariable& _species_vars; - SingleVariable& _U_vars; + SingleVariable& _mass_flux_vars; //! Number of species unsigned int _n_species; @@ -88,9 +88,13 @@ namespace GRINS //!Index from registering this quantity unsigned int _cp_index; //!Index from registering this quantity - unsigned int _M_index; + unsigned int _u_index; //!Index from registering this quantity + libMesh::Number _p0; + libMesh::Point _T_Fixed_Loc; + libMesh::Number _T_Fixed; + libMesh::Number _Penalty_Tol; //! Index from registering this quantity. Each species will have it's own index. std::vector _mole_fractions_index; @@ -129,9 +133,9 @@ namespace GRINS template< typename Mixture, typename Evaluator> inline - libMesh::Real ODPremixedFlame::U( const libMesh::Point& p, + libMesh::Real ODPremixedFlame::M_dot( const libMesh::Point& p, const AssemblyContext& c ) const - { return c.point_value(_U_vars.var(),p); } + { return c.point_value(_mass_flux_vars.var(),p); } template< typename Mixture, typename Evaluator> inline diff --git a/src/physics/include/grins/od_premixed_flameold b/src/physics/include/grins/od_premixed_flameold deleted file mode 100644 index 78501d681..000000000 --- a/src/physics/include/grins/od_premixed_flameold +++ /dev/null @@ -1,181 +0,0 @@ -#ifndef GRINS_OD_PREMIXED_FLAME_H -#define GRINS_OD_PREMIXED_FLAME_H - -// Grins items, can see not needing multi-component-vector variable but will leave in until i've written more of the code. -#include "grins_config.h" -#include "grins/grins_enums.h" -#include "grins/physics.h" -#include "grins/assembly_context.h" - - -#include "grins/single_variable.h" -#include "grins/materials_parsing.h" -#include "grins/multi_component_vector_variable.h" -#include "grins/multicomponent_variable.h" - -namespace GRINS -{ - template< typename Mixture, typename Evaluator> - class ODPremixedFlame : public Physics - { - public: - ODPremixedFlame(const PhysicsName& physics_name, - const GetPot & input, - libMesh::UniquePtr & gas_mix); - - virtual ~ODPremixedFlame(){}; - - //! Sets variables to be time-evolving - virtual void set_time_evolving_vars( libMesh::FEMSystem* system ); - - unsigned int n_species() const; - libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; - libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; - void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, - std::vector& mass_fracs ) const; - - libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; - libMesh::Real get_p0() const; - - - //Register postprocessing variables for OD Premixed Flame - virtual void register_postprocessing_vars( const GetPot& input, - PostProcessedQuantities& postprocessing); - virtual void register_parameter(const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) - const; - - // Context Initializations - virtual void init_context( AssemblyContext& context ); - - //Time dependent part(s) - virtual void element_time_derivative( bool compute_jacobian, - AssemblyContext & context); - - //Mass matrix part(s) - virtual void mass_residual( bool compute_jacobian, - AssemblyContext & context ); - virtual void element_constraint(bool compute_jacobian, - AssemblyContext & context ); - - virtual void compute_postprocessed_quantity( unsigned int quantity_index, - const AssemblyContext& context, - const libMesh::Point& point, - libMesh::Real& value ); - - const Mixture & gas_mixture() const; - - protected: - //Variables - PrimitiveTempFEVariables& _temp_vars; - SpeciesMassFractionsVariable& _species_vars; - SingleVariable& _mass_flux_vars; - - //! Number of species - unsigned int _n_species; - bool _fixed_density; - - libMesh::Real _fixed_rho_value; - std::unique_ptr _gas_mixture; - - - - - - //! Index from registering this quantity - unsigned int _rho_index; - //! Index from registering this quantity - unsigned int _k_index; - //!Index from registering this quantity - unsigned int _cp_index; - //!Index from registering this quantity - unsigned int _u_index; - //!Index from registering this quantity - libMesh::Number _p0; - - //! Index from registering this quantity. Each species will have it's own index. - std::vector _mole_fractions_index; - - //! Index from registering this quantity. Each species will have it's own index. - std::vector _h_s_index; - - //! Index from registering this quantity. Each species will have it's own index. - std::vector _omega_dot_index; - - //! Index from registering this quantity. Each species will have it's own index. - std::vector _Ds_index; - - /* //! Index from registering this quantity. Each species will have it's own index. - std::vector _cp_s_index;*/ - - - private: - - void read_input_options( const GetPot& input ); - - ODPremixedFlame(); - - }; //Class ODPremixedFlame - - template< typename Mixture, typename Evaluator> - inline - unsigned int ODPremixedFlame::n_species() const - { return _n_species; } - - template< typename Mixture, typename Evaluator> - inline - libMesh::Real ODPremixedFlame::T( const libMesh::Point& p, - const AssemblyContext& c ) const - { return c.point_value(_temp_vars.T(),p); } - - template< typename Mixture, typename Evaluator> - inline - libMesh::Real ODPremixedFlame::M_dot( const libMesh::Point& p, - const AssemblyContext& c ) const - { return c.point_value(_mass_flux_vars.var(),p); } - - template< typename Mixture, typename Evaluator> - inline - void ODPremixedFlame::mass_fractions( const libMesh::Point& p, - const AssemblyContext& c, - std::vector& mass_fracs ) const - { - libmesh_assert_equal_to(mass_fracs.size(), this->_n_species); - - for( unsigned int var = 0; var < this->_n_species; var++ ) - { - mass_fracs[var] = c.point_value(_species_vars.species(var),p); - } - } - - template< typename Mixture, typename Evaluator> - inline - libMesh::Real ODPremixedFlame::rho( libMesh::Real T, - libMesh::Real p0, - libMesh::Real R_mix) const - { - libMesh::Real value = 0; - if( this->_fixed_density ) - value = this->_fixed_rho_value; - else - value = p0/(R_mix*T); - - return value; - } - - template< typename Mixture, typename Evaluator> - inline - libMesh::Real ODPremixedFlame::get_p0() const - {return _p0;} - - template< typename Mixture, typename Evaluator> - inline - const Mixture & ODPremixedFlame::gas_mixture() const - { - return *_gas_mixture; - } - - -} // namespace Grins - - -#endif // OD_Premixed_Flame diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index d2ee39042..dca459698 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -18,6 +18,7 @@ #include "libmesh/string_to_enum.h" #include "libmesh/quadrature.h" #include "libmesh/fem_system.h" +#include "libmesh/elem.h" @@ -32,7 +33,7 @@ namespace GRINS : Physics(physics_name,input), _temp_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _species_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,physics_name,VariablesParsing::PHYSICS))), - _U_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), + _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _n_species(_species_vars.n_species()), _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_density", false ) ), _fixed_rho_value(0.0), @@ -40,15 +41,23 @@ namespace GRINS _rho_index(0), _k_index(0), _cp_index(0), - _M_index(0) + _u_index(0) { this->set_parameter (_fixed_rho_value, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"fixed_rho_value", 0.0 ); + "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); + + this->_T_Fixed_Loc = input("Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed_Loc", 0.0); + + this->set_parameter + (_T_Fixed,input,"Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed",0.0 ); + + this->set_parameter + (_Penalty_Tol,input,"Physics/"+PhysicsNaming::od_premixed_flame()+"/Penalty_Tol",1.0e-8 ); this->read_input_options(input); - this->check_var_subdomain_consistency(_U_vars); + this->check_var_subdomain_consistency(_mass_flux_vars); this->check_var_subdomain_consistency(_temp_vars); this->check_var_subdomain_consistency(_species_vars); @@ -97,10 +106,10 @@ namespace GRINS context.get_element_fe(_species_vars.species(0))->get_dphi(); context.get_element_fe(_species_vars.species(0))->get_xyz(); - context.get_element_fe(_U_vars.var())->get_JxW(); - context.get_element_fe(_U_vars.var())->get_phi(); - context.get_element_fe(_U_vars.var())->get_dphi(); - context.get_element_fe(_U_vars.var())->get_xyz(); + context.get_element_fe(_mass_flux_vars.var())->get_JxW(); + context.get_element_fe(_mass_flux_vars.var())->get_phi(); + context.get_element_fe(_mass_flux_vars.var())->get_dphi(); + context.get_element_fe(_mass_flux_vars.var())->get_xyz(); context.get_element_fe(_temp_vars.T())->get_JxW(); context.get_element_fe(_temp_vars.T())->get_phi(); @@ -110,10 +119,10 @@ namespace GRINS // We also need the side shape functions, etc. - context.get_side_fe(_U_vars.var())->get_JxW(); - context.get_side_fe(_U_vars.var())->get_phi(); - context.get_side_fe(_U_vars.var())->get_dphi(); - context.get_side_fe(_U_vars.var())->get_xyz(); + context.get_side_fe(_mass_flux_vars.var())->get_JxW(); + context.get_side_fe(_mass_flux_vars.var())->get_phi(); + context.get_side_fe(_mass_flux_vars.var())->get_dphi(); + context.get_side_fe(_mass_flux_vars.var())->get_xyz(); context.get_side_fe(this->_temp_vars.T())->get_JxW(); context.get_side_fe(this->_temp_vars.T())->get_phi(); @@ -147,9 +156,9 @@ namespace GRINS { this->_cp_index = postprocessing.register_quantity( name ); } - else if( name == (std::string("M")) ) + else if( name == (std::string("u")) ) { - this->_M_index = postprocessing.register_quantity( name ); + this->_u_index = postprocessing.register_quantity( name ); } //time for species specific values @@ -261,7 +270,7 @@ namespace GRINS unsigned int n_qpoints = context.get_element_qrule().n_points(); for(unsigned int qp = 0;qp != n_qpoints;qp++) { - libMesh::Real T, U; + libMesh::Real T, M_dot; libMesh::Gradient Grad_T; libMesh::Real R, k, cp, rho, p0, mu; @@ -270,7 +279,7 @@ namespace GRINS T = context.interior_value(this->_temp_vars.T(),qp); Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); - U = context.interior_value(this->_U_vars.var(), qp); + M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); p0 = this->get_p0(); @@ -314,7 +323,7 @@ namespace GRINS } for (unsigned int i=0;i != n_T_dofs; i++ ) { - FT(i) += ( ( -cp*rho*U *Grad_T(0) - chem_term )*T_phi[i][qp] + FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term )*T_phi[i][qp] -k*Grad_T(0)*T_dphi[i][qp](0))*jac; } @@ -325,7 +334,7 @@ namespace GRINS libMesh::DenseSubVector &Fs = context.get_elem_residual(this->_species_vars.species(s)); //R_{s} - const libMesh::Real term1 = -rho*U*Grad_mass_fractions[s](0) + omega_dot[s]; + const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0); for (unsigned int i =0;i != n_s_dofs;i++) @@ -418,69 +427,49 @@ namespace GRINS template - void ODPremixedFlame::element_constraint - ( bool compute_jacobian, - AssemblyContext & context ) - { - if(compute_jacobian) - libmesh_not_implemented(); + void ODPremixedFlame::element_constraint + ( bool compute_jacobian, AssemblyContext & context ) + { + if(compute_jacobian) + libmesh_not_implemented(); - const std::vector &JxW = - context.get_element_fe(this->_temp_vars.T())->get_JxW(); + const std::vector &JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); - // The Mass Flux shape functions at interior quadrature points. - const std::vector >& U_phi = - context.get_element_fe(this->_U_vars.var())->get_phi(); - - const unsigned int n_U_dofs = context.get_dof_indices(this->_U_vars.var()).size(); - - libMesh::DenseSubVector &FU = context.get_elem_residual(this->_U_vars.var()); // R_{M} - - unsigned int n_qpoints = context.get_element_qrule().n_points(); + // The Mass Flux shape functions at interior quadrature points. + const std::vector >& M_phi = + context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); - for(unsigned int qp=0; qp!=n_qpoints; qp++) - { - libMesh::Real T, U; - T = context.interior_value(this->_temp_vars.T(),qp); - - U = context.interior_value(this->_U_vars.var(), qp); - libMesh::Gradient Grad_U = context.interior_gradient(this->_U_vars.var(), qp); - libMesh::Gradient Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); - libMesh::Real jac = JxW[qp]; + const unsigned int n_M_dofs = + context.get_dof_indices(this->_mass_flux_vars.var()).size(); + + libMesh::DenseSubVector & Fm = + context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} + unsigned int n_qpoints = context.get_element_qrule().n_points(); - libMesh::Real R, rho, p0; - Evaluator gas_evaluator( *(this->_gas_mixture) ); + for(unsigned int qp=0; qp!=n_qpoints; qp++) + { + libMesh::Gradient dMdx = context.interior_gradient(this->_mass_flux_vars.var(), qp); + libMesh::Real jac = JxW[qp]; + + for(unsigned int i=0; i != n_M_dofs; i++) + Fm(i) += dMdx(0)*M_phi[i][qp]*jac; + } - p0 = this->get_p0(); - - - std::vector mass_fractions; - std::vector Grad_mass_fractions; - mass_fractions.resize(this->_n_species); - Grad_mass_fractions.resize(this->_n_species); - - libMesh::Real R_Uni = 8.314459848; - libMesh::Real sum_term = 0; - for (unsigned int s = 0; s < this->_n_species; s++) - { - mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); - Grad_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); - sum_term += Grad_mass_fractions[s](0)/this->_gas_mixture->M(s); - } - - R = gas_evaluator.R_mix( mass_fractions ); - - rho = this->rho( T, p0, R ); - - - for(unsigned int i=0;i != n_U_dofs; i++) + /*if( context.get_elem().contains_point(_T_Fixed_Loc) ) + { + libMesh::Real T = context.point_value(this->_temp_vars.T(),_T_Fixed_Loc); + for(unsigned int qp=0; qp!=n_qpoints; qp++) { - FU(i) += (-(p0/(R*T*T*R))*(R*Grad_T(0)+T*R_Uni*sum_term)*U+rho*Grad_U(0))*U_phi[i][qp]*jac; + libMesh::Real jac = JxW[qp]; + + for(unsigned int i=0; i != n_M_dofs; i++) + Fm(i) += 1/(this->_Penalty_Tol) * (T - this->_T_Fixed) * M_phi[i][qp]*jac; } - } + }*/ - } //end Element Constraint + } //end Element Constraint @@ -533,9 +522,9 @@ namespace GRINS value = gas_evaluator.cp( T, p0, Y ); } - else if ( quantity_index == this->_M_index ) + else if ( quantity_index == this->_u_index ) { - libMesh::Real U = this->U(point,context); + libMesh::Real M_dot = this->M_dot(point,context); std::vector Y( this->_n_species ); libMesh::Real T = this->T(point,context); @@ -543,7 +532,7 @@ namespace GRINS this->mass_fractions( point, context, Y ); libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y)); - value = U*rho; + value = M_dot/rho; } //now onto the species dependent stuff diff --git a/src/physics/src/od_premixed_flameOrig.C b/src/physics/src/od_premixed_flameOrig.C deleted file mode 100644 index a766d5ea2..000000000 --- a/src/physics/src/od_premixed_flameOrig.C +++ /dev/null @@ -1,624 +0,0 @@ -// This class -#include "grins/od_premixed_flame.h" - -#include "grins_config.h" - -// GRINS -#include "grins/assembly_context.h" -#include "grins/cantera_mixture.h" -#include "grins/grins_enums.h" -#include "grins/antioch_mixture.h" -#include "grins/materials_parsing.h" -#include "grins/variables_parsing.h" -#include "grins/variable_warehouse.h" -#include "grins/generic_ic_handler.h" -#include "grins/postprocessed_quantities.h" - -// libMesh -#include "libmesh/string_to_enum.h" -#include "libmesh/quadrature.h" -#include "libmesh/fem_system.h" - - - -namespace GRINS -{ - - template - - ODPremixedFlame::ODPremixedFlame(const std::string& physics_name, - const GetPot& input, - std::unique_ptr & gas_mix) - : Physics(physics_name,input), - _temp_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,physics_name,VariablesParsing::PHYSICS))), - _species_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,physics_name,VariablesParsing::PHYSICS))), - _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), - _n_species(_species_vars.n_species()), - _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_density", false ) ), - _fixed_rho_value(0.0), - _gas_mixture(gas_mix.release()), - _rho_index(0), - _k_index(0), - _cp_index(0), - _u_index(0) - { - this->set_parameter - (_fixed_rho_value, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"fixed_rho_value", 0.0 ); - - this->read_input_options(input); - - this->check_var_subdomain_consistency(_mass_flux_vars); - this->check_var_subdomain_consistency(_temp_vars); - this->check_var_subdomain_consistency(_species_vars); - - - this->_ic_handler = new GenericICHandler( physics_name, input ); - } - - //Reading and setting the Thermodynamic Pressure - template - void ODPremixedFlame::read_input_options( const GetPot& input ) - { - // Read thermodynamic pressure info - MaterialsParsing::read_property( input, - "ThermodynamicPressure", - PhysicsNaming::od_premixed_flame(), - (*this), - _p0 ); - } - - template - void ODPremixedFlame::register_parameter( const std::string & param_name, - libMesh::ParameterMultiAccessor & param_pointer ) const - { - ParameterUser::register_parameter(param_name, param_pointer); - _gas_mixture->register_parameter(param_name, param_pointer); - } - - template - void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) - { - for( unsigned int i = 0; i < this->_n_species; i++ ) - { - system->time_evolving( _species_vars.species(i), 1 ); - } - system->time_evolving(_temp_vars.T(), 1); - } - - template - void ODPremixedFlame::init_context( AssemblyContext& context ) - { - // We should prerequest all the data - // we will need to build the linear system - // or evaluate a quantity of interest. - context.get_element_fe(_species_vars.species(0))->get_JxW(); - context.get_element_fe(_species_vars.species(0))->get_phi(); - context.get_element_fe(_species_vars.species(0))->get_dphi(); - context.get_element_fe(_species_vars.species(0))->get_xyz(); - - context.get_element_fe(_mass_flux_vars.var())->get_JxW(); - context.get_element_fe(_mass_flux_vars.var())->get_phi(); - context.get_element_fe(_mass_flux_vars.var())->get_dphi(); - context.get_element_fe(_mass_flux_vars.var())->get_xyz(); - - context.get_element_fe(_temp_vars.T())->get_JxW(); - context.get_element_fe(_temp_vars.T())->get_phi(); - context.get_element_fe(_temp_vars.T())->get_dphi(); - context.get_element_fe(_temp_vars.T())->get_xyz(); - - - // We also need the side shape functions, etc. - - context.get_side_fe(_mass_flux_vars.var())->get_JxW(); - context.get_side_fe(_mass_flux_vars.var())->get_phi(); - context.get_side_fe(_mass_flux_vars.var())->get_dphi(); - context.get_side_fe(_mass_flux_vars.var())->get_xyz(); - - context.get_side_fe(this->_temp_vars.T())->get_JxW(); - context.get_side_fe(this->_temp_vars.T())->get_phi(); - context.get_side_fe(this->_temp_vars.T())->get_dphi(); - context.get_side_fe(this->_temp_vars.T())->get_xyz(); - } - - template - void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, - PostProcessedQuantities& postprocessing ) - { - std::string section = "Physics/"+PhysicsNaming::od_premixed_flame()+"/output_vars"; - - if( input.have_variable(section) ) - { - unsigned int n_vars = input.vector_variable_size(section); - - for( unsigned int v=0; v _rho_index = postprocessing.register_quantity( name ); - } - else if( name == std::string("k") ) - { - this->_k_index = postprocessing.register_quantity( name ); - } - else if( name == std::string("cp") ) - { - this->_cp_index = postprocessing.register_quantity( name ); - } - else if( name == (std::string("u")) ) - { - this->_u_index = postprocessing.register_quantity( name ); - } - - //time for species specific values - - else if(name == std::string("mole_fractions") ) - { - this ->_mole_fractions_index.resize(this->n_species()); - - for(unsigned int s=0; s < this->n_species(); s++) - { - this->_mole_fractions_index[s] = postprocessing.register_quantity("X_"+this->_gas_mixture->species_name(s) ); - } - } - else if(name == std::string("h_s") ) - { - this->_h_s_index.resize(this->n_species()); - - for(unsigned int s=0; s < this->n_species(); s++) - { - this->_h_s_index[s] = postprocessing.register_quantity( "h_"+this->_gas_mixture->species_name(s) ); - } - } - else if(name == std::string("omega_dot") ) - { - this->_omega_dot_index.resize(this->n_species()); - - for(unsigned int s=0; s < this->n_species(); s++) - { - this->_omega_dot_index[s] = postprocessing.register_quantity( "omega_dot_"+this->_gas_mixture->species_name(s) ); - } - } - else if( name == std::string("D_s") ) - { - this->_Ds_index.resize(this->n_species()); - - for(unsigned int s=0;s < this->n_species(); s++) - { - this->_Ds_index[s] = postprocessing.register_quantity( "D_"+this->_gas_mixture->species_name(s) ); - } - } - /* else if( name == std::string("cp_s") ) - { - this->_cp_s_index.resize(this->n_species()); - - for(unsigned int s=0;s < this->n_species(); s++) - { - this ->_cps_index[s] = postprocessing.register_quantity( "cp_"+this->_gas_mixture->species_name(s) ); - } - }*/ - else - { - std::cerr << "Error: Invalid output_vars value for ODPremixedFlame " << std::endl - << " Found " << name << std::endl - << " Acceptable values are: rho" << std::endl - << " D_s" << std::endl - << " k" << std::endl - << " h_s" << std::endl - << " cp" << std::endl - << " mole_fractions" << std::endl - << " omega_dot" << std::endl - << " u" << std::endl; - libmesh_error(); - } - } - } - - return; - } //end post processing vars - - - - template - void ODPremixedFlame::element_time_derivative -( bool compute_jacobian, AssemblyContext & context ) - { - if( compute_jacobian ) - libmesh_not_implemented(); - - //Convenience - const VariableIndex s0_var = this->_species_vars.species(0); - - // The number of local degrees of freedom in each variable //Variables are Species, Mass flux, and Temperature - const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); - const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); - - // Element Jacobian * quadrature weights for interior integration. - const std::vector& JxW = - context.get_element_fe(this->_temp_vars.T())->get_JxW(); - - //the species shape function at interior quadrature points. - const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); - - //the species shape function gradients at interior quadrature points. - const std::vector > & s_dphi = context.get_element_fe(s0_var)->get_dphi(); - - // The temperature shape functions at interior quadrature points. - const std::vector >& T_phi = - context.get_element_fe(this->_temp_vars.T())->get_phi(); - - // The temperature shape functions gradients at interior quadrature points. - const std::vector >& T_dphi = - context.get_element_fe(this->_temp_vars.T())->get_dphi(); - - - libMesh::DenseSubVector &FT = context.get_elem_residual(this->_temp_vars.T()); // R_{T} - - //species set in residual calculations since the need of a for loop - - unsigned int n_qpoints = context.get_element_qrule().n_points(); - for(unsigned int qp = 0;qp != n_qpoints;qp++) - { - libMesh::Real T, M_dot; - libMesh::Gradient Grad_T; - - libMesh::Real R, k, cp, rho, p0, mu; - Evaluator gas_evaluator( *(this->_gas_mixture) ); - - T = context.interior_value(this->_temp_vars.T(),qp); - Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); - - M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); - - p0 = this->get_p0(); - - - std::vector mass_fractions, h, D, omega_dot; - std::vector Grad_mass_fractions; - - mass_fractions.resize(this->_n_species); - Grad_mass_fractions.resize(this->_n_species); - h.resize(this->_n_species); - - for (unsigned int s = 0; s < this->_n_species; s++) - { - mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); - Grad_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); - h[s] = gas_evaluator.h_s( T, s ); - } - - R = gas_evaluator.R_mix( mass_fractions ); - - rho = this->rho( T, p0, R ); - - cp = gas_evaluator.cp( T, p0, mass_fractions); - - D.resize(this->_n_species); - - gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, - mu, k, D ); - - omega_dot.resize(this->_n_species); - - gas_evaluator.omega_dot( T, rho, mass_fractions, omega_dot ); - - libMesh::Real jac = JxW[qp]; - - //Energy equation Residual - libMesh::Real chem_term = 0.0; - for ( unsigned int s=0; s< this->_n_species; s++ ) - { - chem_term +=h[s]*omega_dot[s]; - } - for (unsigned int i=0;i != n_T_dofs; i++ ) - { - FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term )*T_phi[i][qp] - -k*Grad_T(0)*T_dphi[i][qp](0))*jac; - - } - - //Species equation Residuals - for (unsigned int s = 0; s < _n_species; s++) - { - libMesh::DenseSubVector &Fs = - context.get_elem_residual(this->_species_vars.species(s)); //R_{s} - - const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; - const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0); - - for (unsigned int i =0;i != n_s_dofs;i++) - { - Fs(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp](0) )*jac; - } - } - } // end of quadrature loop - return; - } // end element time derivative - - - - template - void ODPremixedFlame::mass_residual - (bool compute_jacobian, AssemblyContext & context ) - { - const VariableIndex s0_var = this->_species_vars.species(0); - const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); - const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); - - - // Element Jacobian * quadrature weights for interior integration. - const std::vector& JxW = - context.get_element_fe(this->_temp_vars.T())->get_JxW(); - - //the species shape function at interior quadrature points. - const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); - - // The temperature shape functions at interior quadrature points. - const std::vector >& T_phi = - context.get_element_fe(this->_temp_vars.T())->get_phi(); - - //The subvectors and submatrices we need to fill: - libMesh::DenseSubVector &F_T = context.get_elem_residual(this->_temp_vars.T()); - - //Get the number of quadrature points - unsigned int n_qpoints = context.get_element_qrule().n_points(); - - for (unsigned int qp = 0; qp != n_qpoints; ++qp) - { - libMesh::Real T_dot; - context.interior_rate(this->_temp_vars.T(), qp, T_dot); - - libMesh::Real T = context.interior_value(this->_temp_vars.T(), qp); - - std::vector mass_fractions(this->n_species()); - for(unsigned int s=0; s < this->_n_species; s++ ) - { - mass_fractions[s] = context.interior_value(this->_species_vars.species(s), qp); - } - - Evaluator gas_evaluator(*(this-> _gas_mixture)); - const libMesh::Real R_mix = gas_evaluator.R_mix(mass_fractions); - const libMesh::Real p0 = this->get_p0(); - const libMesh::Real rho = this->rho(T, p0, R_mix); - const libMesh::Real cp = gas_evaluator.cp(T,p0,mass_fractions); - - libMesh::Real jac = JxW[qp]; - - // Species residual - for(unsigned int s=0; s < this->n_species(); s++) - { - libMesh::DenseSubVector &F_s = - context.get_elem_residual(this->_species_vars.species(s)); - - libMesh::Real mass_fractions_dot; - context.interior_rate(this->_species_vars.species(s),qp,mass_fractions_dot); - - for (unsigned int i = 0; i != n_s_dofs; ++i) - { - F_s(i) -= rho*mass_fractions_dot*s_phi[i][qp]*jac; - } - } - - //Energy Residual - - for (unsigned int i = 0; i!= n_T_dofs; i++) - { - F_T(i) -= rho*cp*T_dot*T_phi[i][qp]*jac; - } - - if( compute_jacobian ) - libmesh_not_implemented(); - - - } // end Quadrature loop - } //end Mass Residual - - - - template - void ODPremixedFlame::element_constraint - ( bool compute_jacobian, - AssemblyContext & context ) - { - if(compute_jacobian) - libmesh_not_implemented(); - - const std::vector &JxW = - context.get_element_fe(this->_temp_vars.T())->get_JxW(); - - // The Mass Flux shape functions at interior quadrature points. - const std::vector >& M_phi = - context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); - - - - const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); - - libMesh::DenseSubVector &Fm = context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} - unsigned int n_qpoints = context.get_element_qrule().n_points(); - for(unsigned int qp=0; qp!=n_qpoints; qp++) - { - libMesh::Gradient Grad_M_dot = context.interior_gradient(this->_mass_flux_vars.var(), qp); - libMesh::Real jac = JxW[qp]; - for(unsigned int i=0;i != n_M_dofs; i++) - { - Fm(i) += Grad_M_dot(0)*M_phi[i][qp]*jac; - } - } - } //end Element Constraint - - - - - - - template - void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, - const AssemblyContext& context, - const libMesh::Point& point, - libMesh::Real & value ) - { - Evaluator gas_evaluator( *(this->_gas_mixture) ); - - if( quantity_index == this->_rho_index ) - { - std::vector Y( this->_n_species ); - libMesh::Real T = this->T(point,context); - libMesh::Real p0 = this->get_p0(); - this->mass_fractions( point, context, Y ); - - value = this->rho(T,p0, gas_evaluator.R_mix(Y) ); - } - else if( quantity_index == this->_k_index ) - { - std::vector Y(this->_n_species ); - - libMesh::Real T = this->T(point,context); - this->mass_fractions( point,context, Y); - libMesh::Real p0 = this->get_p0(); - - libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); - - libMesh::Real rho = this->rho(T, p0, gas_evaluator.R_mix(Y) ); - - libMesh::Real mu,k; - - std::vector D; - gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); - - value = k; - return; - } - else if( quantity_index == this->_cp_index ) - { - std::vector Y( this->_n_species ); - libMesh::Real T = this->T(point,context); - this->mass_fractions( point, context, Y); - libMesh::Real p0 = this->get_p0(); - - value = gas_evaluator.cp( T, p0, Y ); - } - else if ( quantity_index == this->_u_index ) - { - libMesh::Real M_dot = this->M_dot(point,context); - - std::vector Y( this->_n_species ); - libMesh::Real T = this->T(point,context); - libMesh::Real p0 = this->get_p0(); - this->mass_fractions( point, context, Y ); - libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y)); - - value = M_dot/rho; - - } - //now onto the species dependent stuff - - else - { - if( !this->_mole_fractions_index.empty() ) - { - libmesh_assert_equal_to( _mole_fractions_index.size(), this->n_species() ); - - for( unsigned int s = 0; s < this->n_species(); s++ ) - { - if( quantity_index == this->_mole_fractions_index[s] ) - { - std::vector Y( this->_n_species ); - this->mass_fractions( point, context, Y ); - - libMesh::Real M = gas_evaluator.M_mix(Y); - - value = gas_evaluator.X( s, M, Y[s]); - return; - } - } - } - - if( !this->_h_s_index.empty() ) - { - libmesh_assert_equal_to( _h_s_index.size(), this->n_species() ); - - for( unsigned int s=0; s < this->n_species(); s++) - { - if( quantity_index == this->_h_s_index[s] ) - { - libMesh::Real T = this->T(point,context); - - value = gas_evaluator.h_s( T, s ); - return; - } - } - } - - if( !this->_omega_dot_index.empty() ) - { - libmesh_assert_equal_to( _omega_dot_index.size(), this->n_species() ); - - for(unsigned int s=0; s < this->n_species(); s++) - { - if( quantity_index == this->_omega_dot_index[s] ) - { - std::vector Y( this->n_species() ); - this->mass_fractions( point, context, Y ); - - libMesh::Real T = this->T(point,context); - - libMesh::Real p0 = this->get_p0(); - - libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y) ); - - std::vector omega_dot( this->n_species() ); - gas_evaluator.omega_dot( T, rho, Y, omega_dot ); - - value = omega_dot[s]; - return; - } - } - } - - if( !this->_Ds_index.empty() ) - { - libmesh_assert_equal_to( _Ds_index.size(), this->n_species() ); - - for( unsigned int s = 0; s < this->n_species(); s++ ) - { - if(quantity_index == this->_Ds_index[s] ) - { - std::vector Y( this->_n_species ); - - libMesh::Real T = this->T(point,context); - this->mass_fractions(point,context, Y ); - libMesh::Real p0 = this->get_p0(); - - libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); - - libMesh::Real rho = this->rho( T, p0, gas_evaluator.R_mix(Y) ); - - libMesh::Real mu, k; - std::vector D( this->_n_species ); - - gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); - - value = D[s]; - return; - } - } - } - }//if/else quantity_index - - return; - } //end Postproc - - -}//end Namespace Grins - - - - - - - - - diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h new file mode 100644 index 000000000..b795b8328 --- /dev/null +++ b/src/qoi/include/grins/flame_speed.h @@ -0,0 +1,122 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// GRINS - General Reacting Incompressible Navier-Stokes +// +// Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner +// Copyright (C) 2010-2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + + +#ifndef GRINS_FLAME_SPEED_H +#define GRINS_FLAME_SPEED_H + +// GRINS +#include "grins/qoi_base.h" +#include "grins/variable_name_defaults.h" + +namespace GRINS +{ + class PrimitiveTempFEVariables; + + class FlameSpeed : public QoiBase + { + public: + + FlameSpeed(const std::string& qoi_name); + + virtual ~FlameSpeed(); + + virtual QoIBase* clone() const; + + virtual bool assemble_on_interior() const; + + virtual bool assemble_on_sides() const; + + virtual void side_qoi( AssemblyContext& context, + const unsigned int qoi_index ); + + virtual void init( const GetPot& input, + const MultiphysicsSystem& system, + unsigned int qoi_num ); + + virtual void init_context( AssemblyContext& context ); + + libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; + libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; + + const Mixture & gas_mixture() const; + + protected: + + const PrimitiveTempFEVariables * _temp_vars; + const SpeciesMassFractionsVariable * _species_vars; + const SingleVariable * _mass_flux_vars; + + void parse_Pressure( const GetPot& input) + + const PrimitiveTempFEVariables * _temp_vars; + + //! List of boundary ids for which we want to compute this QoI + libMesh::boundary_id_type _bc_ids; + + //! Scaling constant + libMesh::Real _P0 + + private: + + FlameSpeed(); + + }; + + + + inline + libMesh::Real FlameSpeed::rho( libMesh::Real T, + libMesh::Real p0, + libMesh::Real R_mix) const + { + libMesh::Real value = 0; + value = p0/(R_mix*T); + return value; + } + + inline + libMesh::Real FlameSpeed::M_dot( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_mass_flux_vars.var(),p); } + + inline + libMesh::Real FlameSpeed::T( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_temp_vars.T(),p); } + + inline + bool FlameSpeed::assemble_on_interior() const + { + return false; + } + + inline + bool FlameSpeed::assemble_on_sides() const + { + return true; + } + +} +#endif //GRINS_Flame_Speed_H diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C new file mode 100644 index 000000000..68020bae1 --- /dev/null +++ b/src/qoi/src/flame_speed.C @@ -0,0 +1,160 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// GRINS - General Reacting Incompressible Navier-Stokes +// +// Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner +// Copyright (C) 2010-2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + + +// This class +#include "grins/average_nusselt_number.h" + +// GRINS +#include "grins/multiphysics_sys.h" +#include "grins/assembly_context.h" +#include "grins/materials_parsing.h" +#include "grins/variable_warehouse.h" +#include "grins/variables_parsing.h" +#include "grins/single_variable.h" + +// libMesh +#include "libmesh/getpot.h" +#include "libmesh/fem_system.h" +#include "libmesh/quadrature.h" + +namespace GRINS +{ + FlameSpeed::FlameSpeed( const std::string& qoi_name ) + : QoIBase(qoi_name) + { + return; + } + + FlameSpeed::~FlameSpeed() + { + return; + } + + QoIBase* FlameSpeed::clone() const + { + return new FlameSpeed( *this); + } + + + + void FlameSpeed::init + (const GetPot& input, + const MultiphysicsSystem& /*system*/, + unsigned int /*qoi_num*/ ) + { + //grab the pressure value + this->parse_Pressure(input); + + // Read boundary ids for which we want to compute, and make sure they are specified + int num_bcs = input.vector_variable_size("QoI/FlameSpeed/bc_ids"); + + if( num_bcs <= 0 ) + { + std::cerr << "Error: Must specify at least one boundary id to compute" + << " average Nusselt number." << std::endl + << "Found: " << num_bcs << std::endl; + libmesh_error(); + } + //insert the boundary id specified + for( int i = 0; i < num_bcs; i++ ) + { + _bc_ids.insert( input("QoI/FlameSpeed/bc_ids", -1, i ) ); + } + + //Set our Vaiables and number of species + _temp_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); + _species_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); + _mass_flux_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); + // #### might only need to use once, no need to set it _n_species = _species_vars.n_species(); + } + + + + + + + ///Probaly NEED CHANGING OF SOME KIND + void FlameSpeed::init_context( AssemblyContext& context ) + { + libMesh::FEBase* T_fe; + + context.get_side_fe(this->_temp_vars->T(), T_fe); + + T_fe->get_dphi(); + T_fe->get_JxW(); + + return; + } + + + + + + void FlameSpeed::side_qoi( AssemblyContext& context, + const unsigned int qoi_index ) + { + bool on_correct_side = false; + + for (std::set::const_iterator id = + _bc_ids.begin(); id != _bc_ids.end(); id++ ) + if( context.has_side_boundary_id( (*id) ) ) + { + on_correct_side = true; + break; + } + + if (!on_correct_side) + return; + + libMesh::Number& qoi = context.get_qois()[qoi_index]; + libMesh::Real T = this->T(point,context); + libMesh::Real p0 = this->_P0(); + libMesh::Real Mdot = this->M_dot(point,context); + qoi += Mdot/(this->rho(T,p0, 500)); + } // quadrature loop + } + + + + + + + + + void FlameSpeed::parse_Pressure( const GetPot& input ) + { + //grab where the value is located in input file + std::string material = input("QoI/FlameSpeed/material", "NoMaterial!"); + + if( input.have_variable("Materials/"+material+"/ThermodynamicPressure/value") ) + { + this->set_parameter + ( _P0, input, "Materials/"+material+"/ThermodynamicPressure/value", -1.0 ); + } + else + libmesh_error_msg("ERROR: Could not find valid thermodynamicPressure value!"); + } + +} //namespace GRINS From b91d2d1fae6ce917a468777159983e516e36eaaf Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Sun, 20 May 2018 16:14:20 -0400 Subject: [PATCH 12/41] Working Flame speed QOI with a hard coded Mixture Molecular Weight --- src/Makefile.am | 3 ++- src/qoi/include/grins/flame_speed.h | 40 +++++++++++++++++++++-------- src/qoi/include/grins/qoi_names.h | 1 + src/qoi/src/flame_speed.C | 38 +++++++++++++-------------- src/qoi/src/qoi_factory.C | 8 +++++- 5 files changed, 58 insertions(+), 32 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 75a1f3467..4dd48f2d5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -199,6 +199,7 @@ libgrins_la_SOURCES += qoi/src/qoi_output.C libgrins_la_SOURCES += qoi/src/hitran.C libgrins_la_SOURCES += qoi/src/absorption_coeff.C libgrins_la_SOURCES += qoi/src/spectroscopic_absorption.C +libgrins_la_SOURCES += qoi/src/flame_speed.C # src/solver files libgrins_la_SOURCES += solver/src/solver.C @@ -503,7 +504,7 @@ include_HEADERS += qoi/include/grins/hitran.h include_HEADERS += qoi/include/grins/absorption_coeff.h include_HEADERS += qoi/include/grins/spectroscopic_absorption.h include_HEADERS += qoi/include/grins/fem_function_and_derivative_base.h - +include_HEADERS += qoi/include/grins/flame_speed.h # src/solver headers include_HEADERS += solver/include/grins/solver.h include_HEADERS += solver/include/grins/mesh_builder.h diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h index b795b8328..a3c3b9de0 100644 --- a/src/qoi/include/grins/flame_speed.h +++ b/src/qoi/include/grins/flame_speed.h @@ -29,12 +29,29 @@ // GRINS #include "grins/qoi_base.h" #include "grins/variable_name_defaults.h" +#include "grins_config.h" +#include "grins/grins_enums.h" + +#include "grins/multiphysics_sys.h" +#include "grins/assembly_context.h" +#include "grins/materials_parsing.h" +#include "grins/variable_warehouse.h" +#include "grins/variables_parsing.h" +#include "grins/single_variable.h" +#include "grins/multi_component_vector_variable.h" +#include "grins/multicomponent_variable.h" + +// libMesh +#include "libmesh/string_to_enum.h" +#include "libmesh/getpot.h" +#include "libmesh/fem_system.h" +#include "libmesh/quadrature.h" namespace GRINS { class PrimitiveTempFEVariables; - class FlameSpeed : public QoiBase + class FlameSpeed : public QoIBase { public: @@ -51,6 +68,8 @@ namespace GRINS virtual void side_qoi( AssemblyContext& context, const unsigned int qoi_index ); + + virtual void init( const GetPot& input, const MultiphysicsSystem& system, unsigned int qoi_num ); @@ -60,23 +79,22 @@ namespace GRINS libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; - const Mixture & gas_mixture() const; protected: - const PrimitiveTempFEVariables * _temp_vars; - const SpeciesMassFractionsVariable * _species_vars; - const SingleVariable * _mass_flux_vars; - - void parse_Pressure( const GetPot& input) + void parse_Pressure( const GetPot& input); const PrimitiveTempFEVariables * _temp_vars; + const SingleVariable * _mass_flux_vars; + + libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; + //! List of boundary ids for which we want to compute this QoI - libMesh::boundary_id_type _bc_ids; + std::set _bc_ids; //! Scaling constant - libMesh::Real _P0 + libMesh::Real _P0; private: @@ -99,12 +117,12 @@ namespace GRINS inline libMesh::Real FlameSpeed::M_dot( const libMesh::Point& p, const AssemblyContext& c ) const - { return c.point_value(_mass_flux_vars.var(),p); } + { return c.point_value(_mass_flux_vars->var(),p); } inline libMesh::Real FlameSpeed::T( const libMesh::Point& p, const AssemblyContext& c ) const - { return c.point_value(_temp_vars.T(),p); } + { return c.point_value(_temp_vars->T(),p); } inline bool FlameSpeed::assemble_on_interior() const diff --git a/src/qoi/include/grins/qoi_names.h b/src/qoi/include/grins/qoi_names.h index 8e20cbcc5..91bbced8a 100644 --- a/src/qoi/include/grins/qoi_names.h +++ b/src/qoi/include/grins/qoi_names.h @@ -34,5 +34,6 @@ namespace GRINS const std::string weighted_flux = "weighted_flux"; const std::string integrated_function = "integrated_function"; const std::string spectroscopic_absorption = "spectroscopic_absorption"; + const std::string flame_speed = "flame_speed"; } #endif //GRINS_QOI_NAMES_H diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C index 68020bae1..cfb297b94 100644 --- a/src/qoi/src/flame_speed.C +++ b/src/qoi/src/flame_speed.C @@ -24,24 +24,30 @@ // This class -#include "grins/average_nusselt_number.h" +#include "grins/flame_speed.h" // GRINS +#include "grins_config.h" +#include "grins/grins_enums.h" + #include "grins/multiphysics_sys.h" #include "grins/assembly_context.h" #include "grins/materials_parsing.h" #include "grins/variable_warehouse.h" #include "grins/variables_parsing.h" #include "grins/single_variable.h" +#include "grins/multi_component_vector_variable.h" +#include "grins/multicomponent_variable.h" // libMesh +#include "libmesh/string_to_enum.h" #include "libmesh/getpot.h" #include "libmesh/fem_system.h" #include "libmesh/quadrature.h" namespace GRINS { - FlameSpeed::FlameSpeed( const std::string& qoi_name ) + FlameSpeed::FlameSpeed( const std::string& qoi_name) : QoIBase(qoi_name) { return; @@ -85,7 +91,6 @@ namespace GRINS //Set our Vaiables and number of species _temp_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); - _species_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); _mass_flux_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); // #### might only need to use once, no need to set it _n_species = _species_vars.n_species(); } @@ -109,7 +114,7 @@ namespace GRINS } - + //############################################################################################################### void FlameSpeed::side_qoi( AssemblyContext& context, @@ -127,27 +132,22 @@ namespace GRINS if (!on_correct_side) return; - + libMesh::Number& qoi = context.get_qois()[qoi_index]; - libMesh::Real T = this->T(point,context); - libMesh::Real p0 = this->_P0(); - libMesh::Real Mdot = this->M_dot(point,context); - qoi += Mdot/(this->rho(T,p0, 500)); - } // quadrature loop - } - - + libMesh::Real T = context.side_value(this->_temp_vars->T(),0); + libMesh::Real p0 = this->_P0; + libMesh::Real Mdot = context.side_value(this->_mass_flux_vars->var(),0); + qoi = Mdot/(this->rho(T,p0, 694)); + } //end side_qoi + //########################################################################################################### - - - - void FlameSpeed::parse_Pressure( const GetPot& input ) + void FlameSpeed::parse_Pressure( const GetPot& input) { //grab where the value is located in input file std::string material = input("QoI/FlameSpeed/material", "NoMaterial!"); - + if( input.have_variable("Materials/"+material+"/ThermodynamicPressure/value") ) { this->set_parameter @@ -155,6 +155,6 @@ namespace GRINS } else libmesh_error_msg("ERROR: Could not find valid thermodynamicPressure value!"); - } + }//end parse pressure } //namespace GRINS diff --git a/src/qoi/src/qoi_factory.C b/src/qoi/src/qoi_factory.C index bc8552629..cbe3cfd45 100644 --- a/src/qoi/src/qoi_factory.C +++ b/src/qoi/src/qoi_factory.C @@ -39,6 +39,7 @@ #include "grins/absorption_coeff.h" #include "grins/spectroscopic_absorption.h" #include "grins/chemistry_builder.h" +#include "grins/flame_speed.h" #if GRINS_HAVE_ANTIOCH #include "grins/antioch_chemistry.h" @@ -104,6 +105,11 @@ namespace GRINS qoi = new AverageNusseltNumber( avg_nusselt ); } + else if ( qoi_name == flame_speed ) + { + qoi = new FlameSpeed( flame_speed ); + } + else if( qoi_name == parsed_boundary ) { qoi = new ParsedBoundaryQoI( parsed_boundary ); @@ -159,7 +165,7 @@ namespace GRINS T_max = input(partition_temp_var, 0.0, 1); T_step = input(partition_temp_var, 0.0, 2); } - else + else libmesh_error_msg("ERROR: Could not find tenmperature range specification for partition functions: "+partition_temp_var+" 'T_min T_max T_step'"); std::shared_ptr hitran( new HITRAN(hitran_data,hitran_partition,T_min,T_max,T_step) ); From c603e40e8f8184644e480bea1d16732e05efa660 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 28 May 2018 10:17:35 -0400 Subject: [PATCH 13/41] adding in mass fraction to the calculation --- src/qoi/include/grins/flame_speed.h | 22 +++++++++++++--------- src/qoi/src/flame_speed.C | 14 +++++++++++++- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h index a3c3b9de0..8a22dbc5d 100644 --- a/src/qoi/include/grins/flame_speed.h +++ b/src/qoi/include/grins/flame_speed.h @@ -51,23 +51,23 @@ namespace GRINS { class PrimitiveTempFEVariables; - class FlameSpeed : public QoIBase + class FlameSpeed : public QoIBase { public: FlameSpeed(const std::string& qoi_name); - + virtual ~FlameSpeed(); - + virtual QoIBase* clone() const; - + virtual bool assemble_on_interior() const; - + virtual bool assemble_on_sides() const; - + virtual void side_qoi( AssemblyContext& context, const unsigned int qoi_index ); - + virtual void init( const GetPot& input, @@ -78,6 +78,9 @@ namespace GRINS libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; + void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, + std::vector& mass_fracs ) const; + protected: @@ -85,8 +88,8 @@ namespace GRINS void parse_Pressure( const GetPot& input); const PrimitiveTempFEVariables * _temp_vars; - const SingleVariable * _mass_flux_vars; + const SpeciesMassFractionsVariable * _species_vars; libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; @@ -103,7 +106,6 @@ namespace GRINS }; - inline libMesh::Real FlameSpeed::rho( libMesh::Real T, libMesh::Real p0, @@ -114,11 +116,13 @@ namespace GRINS return value; } + inline libMesh::Real FlameSpeed::M_dot( const libMesh::Point& p, const AssemblyContext& c ) const { return c.point_value(_mass_flux_vars->var(),p); } + inline libMesh::Real FlameSpeed::T( const libMesh::Point& p, const AssemblyContext& c ) const diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C index cfb297b94..43bf6bdec 100644 --- a/src/qoi/src/flame_speed.C +++ b/src/qoi/src/flame_speed.C @@ -47,6 +47,7 @@ namespace GRINS { + FlameSpeed::FlameSpeed( const std::string& qoi_name) : QoIBase(qoi_name) { @@ -92,6 +93,7 @@ namespace GRINS //Set our Vaiables and number of species _temp_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); _mass_flux_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); + _species_vars= &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); // #### might only need to use once, no need to set it _n_species = _species_vars.n_species(); } @@ -137,7 +139,17 @@ namespace GRINS libMesh::Real T = context.side_value(this->_temp_vars->T(),0); libMesh::Real p0 = this->_P0; libMesh::Real Mdot = context.side_value(this->_mass_flux_vars->var(),0); - qoi = Mdot/(this->rho(T,p0, 694)); + + std::vector mass_fractions; + mass_fractions.resize(this->_species_vars->n_species()); + for (unsigned int s=0; s < this->_species_vars->n_species(); s++) + { + mass_fractions[s] = context.side_value(this->_species_vars->species(s),0); + } + libMesh::Real R = 8314.459848; + libMesh::Real Rmix =R/(1/(mass_fractions[0]/2.01588 + mass_fractions[3]/2/15.999)); + + qoi += Mdot/(this->rho(T,p0, Rmix)); } //end side_qoi From 1070e67edfd0c6423f628c9b860ef9256ffbb10f Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Tue, 29 May 2018 10:22:21 -0400 Subject: [PATCH 14/41] First attempt at both antioch and cantera chemistry --- src/qoi/include/grins/flame_speed.h | 57 +++++++++++++++-------------- src/qoi/src/flame_speed.C | 33 +++++++++-------- src/qoi/src/qoi_factory.C | 32 +++++++++++++--- 3 files changed, 75 insertions(+), 47 deletions(-) diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h index 8a22dbc5d..636b75667 100644 --- a/src/qoi/include/grins/flame_speed.h +++ b/src/qoi/include/grins/flame_speed.h @@ -50,12 +50,12 @@ namespace GRINS { class PrimitiveTempFEVariables; - + template class FlameSpeed : public QoIBase { public: - FlameSpeed(const std::string& qoi_name); + FlameSpeed(const std::string& qoi_name, std::unique_ptr & chem); virtual ~FlameSpeed(); @@ -96,7 +96,9 @@ namespace GRINS //! List of boundary ids for which we want to compute this QoI std::set _bc_ids; - //! Scaling constant + + std::unique_ptr _chemistry; + libMesh::Real _P0; private: @@ -105,9 +107,9 @@ namespace GRINS }; - - inline - libMesh::Real FlameSpeed::rho( libMesh::Real T, + template< typename Chemistry> + inline + libMesh::Real FlameSpeed::rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const { @@ -116,29 +118,30 @@ namespace GRINS return value; } - - inline - libMesh::Real FlameSpeed::M_dot( const libMesh::Point& p, - const AssemblyContext& c ) const - { return c.point_value(_mass_flux_vars->var(),p); } - - - inline - libMesh::Real FlameSpeed::T( const libMesh::Point& p, - const AssemblyContext& c ) const - { return c.point_value(_temp_vars->T(),p); } - - inline - bool FlameSpeed::assemble_on_interior() const - { - return false; - } + template< typename Chemistry> + inline + libMesh::Real FlameSpeed::M_dot( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_mass_flux_vars->var(),p); } + template< typename Chemistry> + inline + libMesh::Real FlameSpeed::T( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_temp_vars->T(),p); } + template< typename Chemistry> + inline + bool FlameSpeed::assemble_on_interior() const + { + return false; + } + template< typename Chemistry> inline - bool FlameSpeed::assemble_on_sides() const - { - return true; - } + bool FlameSpeed::assemble_on_sides() const + { + return true; + } + } #endif //GRINS_Flame_Speed_H diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C index 43bf6bdec..a42529751 100644 --- a/src/qoi/src/flame_speed.C +++ b/src/qoi/src/flame_speed.C @@ -47,26 +47,29 @@ namespace GRINS { - - FlameSpeed::FlameSpeed( const std::string& qoi_name) - : QoIBase(qoi_name) + template< typename Chemistry> + FlameSpeed::FlameSpeed( const std::string& qoi_name, std::unique_ptr & chem) + : QoIBase(qoi_name), + _chemistry(chem.release()) { return; } - FlameSpeed::~FlameSpeed() + template< typename Chemistry> + FlameSpeed::~FlameSpeed() { return; } - QoIBase* FlameSpeed::clone() const + template< typename Chemistry> + QoIBase* FlameSpeed::clone() const { - return new FlameSpeed( *this); + libmesh_not_implemented() ; } - - void FlameSpeed::init + template< typename Chemistry> + void FlameSpeed::init (const GetPot& input, const MultiphysicsSystem& /*system*/, unsigned int /*qoi_num*/ ) @@ -103,7 +106,8 @@ namespace GRINS ///Probaly NEED CHANGING OF SOME KIND - void FlameSpeed::init_context( AssemblyContext& context ) + template< typename Chemistry> + void FlameSpeed::init_context( AssemblyContext& context ) { libMesh::FEBase* T_fe; @@ -118,8 +122,8 @@ namespace GRINS //############################################################################################################### - - void FlameSpeed::side_qoi( AssemblyContext& context, + template< typename Chemistry> + void FlameSpeed::side_qoi( AssemblyContext& context, const unsigned int qoi_index ) { bool on_correct_side = false; @@ -146,16 +150,15 @@ namespace GRINS { mass_fractions[s] = context.side_value(this->_species_vars->species(s),0); } - libMesh::Real R = 8314.459848; - libMesh::Real Rmix =R/(1/(mass_fractions[0]/2.01588 + mass_fractions[3]/2/15.999)); + libMesh::Real Rmix = _chemistry->R_mix(mass_fractions); qoi += Mdot/(this->rho(T,p0, Rmix)); } //end side_qoi //########################################################################################################### - - void FlameSpeed::parse_Pressure( const GetPot& input) + template< typename Chemistry> + void FlameSpeed::parse_Pressure( const GetPot& input) { //grab where the value is located in input file std::string material = input("QoI/FlameSpeed/material", "NoMaterial!"); diff --git a/src/qoi/src/qoi_factory.C b/src/qoi/src/qoi_factory.C index cbe3cfd45..0bdc12a57 100644 --- a/src/qoi/src/qoi_factory.C +++ b/src/qoi/src/qoi_factory.C @@ -105,11 +105,7 @@ namespace GRINS qoi = new AverageNusseltNumber( avg_nusselt ); } - else if ( qoi_name == flame_speed ) - { - qoi = new FlameSpeed( flame_speed ); - } - + else if( qoi_name == parsed_boundary ) { qoi = new ParsedBoundaryQoI( parsed_boundary ); @@ -130,6 +126,32 @@ namespace GRINS qoi = new WeightedFluxQoI( weighted_flux ); } + else if ( qoi_name == flame_speed ) + { + std::string material; + + this->get_var_value(input,material,"QoI/FlameSpeed/material","NoMaterial!"); + + ChemistryBuilder chem_builder; + +#if GRINS_HAVE_ANTIOCH + std::unique_ptr chem_ptr; + chem_builder.build_chemistry(input,material,chem_ptr); + + + qoi = new FlameSpeed(qoi_name ,chem_ptr); + +#elif GRINS_HAVE_CANTERA + std::unique_ptr chem_ptr; + chem_builder.build_chemistry(input,material,chem_ptr); + + + qoi = new FlameSpeed(qoi_name,chem_ptr); +#else + libmesh_error_msg("ERROR: GRINS must be built with either Antioch or Cantera to use the SpectroscopicAbsorption QoI"); +#endif + } + else if( qoi_name == integrated_function ) { std::string function; From 7f8b928ec572ce96d9d00cafad4ef81b0d61991e Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 30 May 2018 10:38:37 -0400 Subject: [PATCH 15/41] More general flame speed qoi, for any material and chemistry. Still need to adjust how i construct the chemistry as it is done in a deprecated manner atm. --- src/qoi/include/grins/flame_speed.h | 18 ++-------- src/qoi/src/flame_speed.C | 51 ++++++++++++++++++----------- src/qoi/src/qoi_factory.C | 18 ++-------- 3 files changed, 35 insertions(+), 52 deletions(-) diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h index 636b75667..85dc3886d 100644 --- a/src/qoi/include/grins/flame_speed.h +++ b/src/qoi/include/grins/flame_speed.h @@ -28,25 +28,11 @@ // GRINS #include "grins/qoi_base.h" -#include "grins/variable_name_defaults.h" -#include "grins_config.h" -#include "grins/grins_enums.h" #include "grins/multiphysics_sys.h" -#include "grins/assembly_context.h" -#include "grins/materials_parsing.h" -#include "grins/variable_warehouse.h" -#include "grins/variables_parsing.h" #include "grins/single_variable.h" -#include "grins/multi_component_vector_variable.h" #include "grins/multicomponent_variable.h" -// libMesh -#include "libmesh/string_to_enum.h" -#include "libmesh/getpot.h" -#include "libmesh/fem_system.h" -#include "libmesh/quadrature.h" - namespace GRINS { class PrimitiveTempFEVariables; @@ -55,7 +41,7 @@ namespace GRINS { public: - FlameSpeed(const std::string& qoi_name, std::unique_ptr & chem); + FlameSpeed(const std::string& qoi_name); virtual ~FlameSpeed(); @@ -97,7 +83,7 @@ namespace GRINS std::set _bc_ids; - std::unique_ptr _chemistry; + std::shared_ptr _chemistry; libMesh::Real _P0; diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C index a42529751..7337ffe2b 100644 --- a/src/qoi/src/flame_speed.C +++ b/src/qoi/src/flame_speed.C @@ -27,30 +27,22 @@ #include "grins/flame_speed.h" // GRINS -#include "grins_config.h" -#include "grins/grins_enums.h" - -#include "grins/multiphysics_sys.h" -#include "grins/assembly_context.h" -#include "grins/materials_parsing.h" #include "grins/variable_warehouse.h" -#include "grins/variables_parsing.h" -#include "grins/single_variable.h" -#include "grins/multi_component_vector_variable.h" -#include "grins/multicomponent_variable.h" +#include "grins/chemistry_builder.h" + +#if GRINS_HAVE_ANTIOCH +#include "grins/antioch_chemistry.h" +#endif -// libMesh -#include "libmesh/string_to_enum.h" -#include "libmesh/getpot.h" -#include "libmesh/fem_system.h" -#include "libmesh/quadrature.h" +#if GRINS_HAVE_CANTERA +#include "grins/cantera_mixture.h" +#endif namespace GRINS { template< typename Chemistry> - FlameSpeed::FlameSpeed( const std::string& qoi_name, std::unique_ptr & chem) - : QoIBase(qoi_name), - _chemistry(chem.release()) + FlameSpeed::FlameSpeed( const std::string& qoi_name) + : QoIBase(qoi_name) { return; } @@ -64,7 +56,8 @@ namespace GRINS template< typename Chemistry> QoIBase* FlameSpeed::clone() const { - libmesh_not_implemented() ; + //libmesh_not_implemented(); + return new FlameSpeed(*this); } @@ -77,6 +70,11 @@ namespace GRINS //grab the pressure value this->parse_Pressure(input); + //figure out the chemistry + std::string material = input("QoI/FlameSpeed/material","DIE!"); + _chemistry.reset( new Chemistry(input,material)); + + // Read boundary ids for which we want to compute, and make sure they are specified int num_bcs = input.vector_variable_size("QoI/FlameSpeed/bc_ids"); @@ -97,7 +95,6 @@ namespace GRINS _temp_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); _mass_flux_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); _species_vars= &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); - // #### might only need to use once, no need to set it _n_species = _species_vars.n_species(); } @@ -157,6 +154,9 @@ namespace GRINS //########################################################################################################### + + + template< typename Chemistry> void FlameSpeed::parse_Pressure( const GetPot& input) { @@ -172,4 +172,15 @@ namespace GRINS libmesh_error_msg("ERROR: Could not find valid thermodynamicPressure value!"); }//end parse pressure + + + + + #if GRINS_HAVE_ANTIOCH + template class FlameSpeed; +#endif + +#if GRINS_HAVE_CANTERA + template class FlameSpeed; + #endif } //namespace GRINS diff --git a/src/qoi/src/qoi_factory.C b/src/qoi/src/qoi_factory.C index 0bdc12a57..ceb5c66a2 100644 --- a/src/qoi/src/qoi_factory.C +++ b/src/qoi/src/qoi_factory.C @@ -128,25 +128,11 @@ namespace GRINS else if ( qoi_name == flame_speed ) { - std::string material; - - this->get_var_value(input,material,"QoI/FlameSpeed/material","NoMaterial!"); - - ChemistryBuilder chem_builder; #if GRINS_HAVE_ANTIOCH - std::unique_ptr chem_ptr; - chem_builder.build_chemistry(input,material,chem_ptr); - - - qoi = new FlameSpeed(qoi_name ,chem_ptr); - + qoi = new FlameSpeed( flame_speed); #elif GRINS_HAVE_CANTERA - std::unique_ptr chem_ptr; - chem_builder.build_chemistry(input,material,chem_ptr); - - - qoi = new FlameSpeed(qoi_name,chem_ptr); + qoi = new FlameSpeed(flame_speed); #else libmesh_error_msg("ERROR: GRINS must be built with either Antioch or Cantera to use the SpectroscopicAbsorption QoI"); #endif From 696d3347257bb407b619bac9ae78dd4e1dcaf50f Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Fri, 1 Jun 2018 10:06:11 -0400 Subject: [PATCH 16/41] Setting up variable initialization for side time derivative --- src/physics/include/grins/od_premixed_flame.h | 24 ++++++++++++------ src/physics/src/od_premixed_flame.C | 25 ++++++++++++++++--- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index d0a15877a..758990dbf 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -28,11 +28,15 @@ namespace GRINS //! Sets variables to be time-evolving virtual void set_time_evolving_vars( libMesh::FEMSystem* system ); - unsigned int n_species() const; libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; + void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, std::vector& mass_fracs ) const; + unsigned int n_species() const; + + const Mixture & gas_mixture() const; + libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; libMesh::Real get_p0() const; @@ -50,19 +54,20 @@ namespace GRINS //Time dependent part(s) virtual void element_time_derivative( bool compute_jacobian, AssemblyContext & context); - //Mass matrix part(s) virtual void mass_residual( bool compute_jacobian, AssemblyContext & context ); virtual void element_constraint(bool compute_jacobian, AssemblyContext & context ); + // virtual void side_time_derivative(bool compute_jacobian, + // AssemblyContext & context ); + virtual void compute_postprocessed_quantity( unsigned int quantity_index, const AssemblyContext& context, const libMesh::Point& point, libMesh::Real& value ); - const Mixture & gas_mixture() const; protected: //Variables @@ -70,13 +75,15 @@ namespace GRINS SpeciesMassFractionsVariable& _species_vars; SingleVariable& _mass_flux_vars; + std::vector _Inflow_Species; + //! Number of species unsigned int _n_species; bool _fixed_density; libMesh::Real _fixed_rho_value; std::unique_ptr _gas_mixture; - + @@ -92,9 +99,12 @@ namespace GRINS //!Index from registering this quantity libMesh::Number _p0; - libMesh::Point _T_Fixed_Loc; - libMesh::Number _T_Fixed; - libMesh::Number _Penalty_Tol; + libMesh::Number _Ti; + libMesh::Number _Tu; + + //libMesh::Point _T_Fixed_Loc; + //libMesh::Number _T_Fixed; + //libMesh::Number _Penalty_Tol; //! Index from registering this quantity. Each species will have it's own index. std::vector _mole_fractions_index; diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index dca459698..f01f4f3c6 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -47,14 +47,26 @@ namespace GRINS (_fixed_rho_value, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); - this->_T_Fixed_Loc = input("Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed_Loc", 0.0); + this->set_parameter(_Ti, input, + "Physics/"+PhysicsNaming::od_premixed_flame()+"/Inlet_Temperature", 0.0); + + this->set_parameter(_Tu, input, + "Physics/"+PhysicsNaming::od_premixed_flame()+"/Unburnt_Temperature", 0.0); + for (unsigned int s = 0; s < this->_n_species; s++) + { + this->set_parameter(_Inflow_Species[s], input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/" + +_species_vars->_var_names[1], 0.0); + } + + + /*this->_T_Fixed_Loc = input("Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed_Loc", 0.0); this->set_parameter (_T_Fixed,input,"Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed",0.0 ); this->set_parameter (_Penalty_Tol,input,"Physics/"+PhysicsNaming::od_premixed_flame()+"/Penalty_Tol",1.0e-8 ); - + */ this->read_input_options(input); this->check_var_subdomain_consistency(_mass_flux_vars); @@ -228,7 +240,7 @@ namespace GRINS return; } //end post processing vars - + /*************************************************************************************************************/ template void ODPremixedFlame::element_time_derivative @@ -472,6 +484,13 @@ namespace GRINS } //end Element Constraint + template + void ODPremixedFlame::side_time_derivative + ( bool compute_jacobian, AssemblyContext & context) + { if(compute_jacobian) + libmesh_not_implemented(); + + } From cd672bc0557706aa568118cdae1c81d841aff136 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 4 Jun 2018 12:05:25 -0400 Subject: [PATCH 17/41] work done today, mostly failures --- src/physics/include/grins/od_premixed_flame.h | 6 +- src/physics/src/multiphysics_sys.C | 13 +-- src/physics/src/od_premixed_flame.C | 106 +++++++++++++++--- 3 files changed, 98 insertions(+), 27 deletions(-) diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index 758990dbf..e79ab465b 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -59,8 +59,8 @@ namespace GRINS AssemblyContext & context ); virtual void element_constraint(bool compute_jacobian, AssemblyContext & context ); - // virtual void side_time_derivative(bool compute_jacobian, - // AssemblyContext & context ); + virtual void side_time_derivative(bool compute_jacobian, + AssemblyContext & context ); virtual void compute_postprocessed_quantity( unsigned int quantity_index, @@ -75,7 +75,7 @@ namespace GRINS SpeciesMassFractionsVariable& _species_vars; SingleVariable& _mass_flux_vars; - std::vector _Inflow_Species; + std::vector _Inflow_Species; //! Number of species unsigned int _n_species; diff --git a/src/physics/src/multiphysics_sys.C b/src/physics/src/multiphysics_sys.C index 52d0d6719..6d56d9351 100644 --- a/src/physics/src/multiphysics_sys.C +++ b/src/physics/src/multiphysics_sys.C @@ -340,17 +340,16 @@ namespace GRINS bool MultiphysicsSystem::side_time_derivative( bool request_jacobian, libMesh::DiffContext& context ) { - bool jacobian_computed = this->apply_neumann_bcs(request_jacobian, - context); - - jacobian_computed = jacobian_computed && - this->_general_residual + + bool jacobian_computed2 = this->apply_neumann_bcs(request_jacobian, + context); + bool jacobian_computed = this->_general_residual (request_jacobian, context, &GRINS::Physics::side_time_derivative, &GRINS::Physics::compute_side_time_derivative_cache); - - return jacobian_computed; + + return (jacobian_computed && jacobian_computed2); } bool MultiphysicsSystem::nonlocal_time_derivative( bool request_jacobian, diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index f01f4f3c6..cedf9780c 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -45,17 +45,20 @@ namespace GRINS { this->set_parameter (_fixed_rho_value, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); + "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); + //Parsing the Temperature at the Inflow this->set_parameter(_Ti, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/Inlet_Temperature", 0.0); - + //Parsing the Unburnt Temperature this->set_parameter(_Tu, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/Unburnt_Temperature", 0.0); + //Initial Inflow Equivalence ration + _Inflow_Species.resize(this->_n_species); for (unsigned int s = 0; s < this->_n_species; s++) { this->set_parameter(_Inflow_Species[s], input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/" - +_species_vars->_var_names[1], 0.0); + +_gas_mixture->species_name(s), 0.0); } @@ -76,7 +79,7 @@ namespace GRINS this->_ic_handler = new GenericICHandler( physics_name, input ); } - + /****************************************************************************************************/ //Reading and setting the Thermodynamic Pressure template void ODPremixedFlame::read_input_options( const GetPot& input ) @@ -88,7 +91,7 @@ namespace GRINS (*this), _p0 ); } - + /****************************************************************************************************/ template void ODPremixedFlame::register_parameter( const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) const @@ -96,7 +99,7 @@ namespace GRINS ParameterUser::register_parameter(param_name, param_pointer); _gas_mixture->register_parameter(param_name, param_pointer); } - + /****************************************************************************************************/ template void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) { @@ -106,7 +109,7 @@ namespace GRINS } system->time_evolving(_temp_vars.T(), 1); } - + /****************************************************************************************************/ template void ODPremixedFlame::init_context( AssemblyContext& context ) { @@ -141,7 +144,7 @@ namespace GRINS context.get_side_fe(this->_temp_vars.T())->get_dphi(); context.get_side_fe(this->_temp_vars.T())->get_xyz(); } - + /****************************************************************************************************/ template void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing ) @@ -358,8 +361,8 @@ namespace GRINS return; } // end element time derivative - - + /****************************************************************************************************/ + /****************************************************************************************************/ template void ODPremixedFlame::mass_residual (bool compute_jacobian, AssemblyContext & context ) @@ -436,8 +439,8 @@ namespace GRINS } // end Quadrature loop } //end Mass Residual - - + /****************************************************************************************************/ + /****************************************************************************************************/ template void ODPremixedFlame::element_constraint ( bool compute_jacobian, AssemblyContext & context ) @@ -482,18 +485,87 @@ namespace GRINS }*/ } //end Element Constraint - - + /****************************************************************************************************/ + /****************************************************************************************************/ template - void ODPremixedFlame::side_time_derivative - ( bool compute_jacobian, AssemblyContext & context) + void ODPremixedFlame::side_time_derivative( bool compute_jacobian, AssemblyContext & context) { if(compute_jacobian) libmesh_not_implemented(); + + if( context.has_side_boundary_id( 0 )) + { - } + const std::vector &JxW = + context.get_element_fe(this->_temp_vars.T())->get_JxW(); + + // The Mass Flux shape functions at interior quadrature points. + const std::vector >& M_phi = + context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); + unsigned int n_qpoints = context.get_element_qrule().n_points(); + const unsigned int n_M_dofs = + context.get_dof_indices(this->_mass_flux_vars.var()).size(); + + libMesh::DenseSubVector & Fm = + context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} + + for(unsigned int qp=0; qp!=n_qpoints; qp++) + { + + libMesh::Real T, M_dot; + libMesh::Gradient Grad_T; + + libMesh::Real R, k, cp, rho, p0, mu; + Evaluator gas_evaluator( *(this->_gas_mixture) ); + + T = context.interior_value(this->_temp_vars.T(),qp); + Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); + + M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); + + p0 = this->get_p0(); + + std::vector mass_fractions, h_i, h_u, D; + + mass_fractions.resize(this->_n_species); + h_i.resize(this->_n_species); + h_u.resize(this->_n_species); + + + + for (unsigned int s = 0; s < this->_n_species; s++) + { + mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); + h_i[s] = gas_evaluator.h_s( this->_Ti, s ); + h_u[s] = gas_evaluator.h_s( this->_Tu, s ); + } + + R = gas_evaluator.R_mix( mass_fractions ); + rho = this->rho( T, p0, R ); + cp = gas_evaluator.cp( T, p0, mass_fractions); + D.resize(this->_n_species); + gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, + mu, k, D ); + libMesh::Real Enth_Diff = 0; + for(unsigned int s=0; s < this->n_species(); s++) + { + Enth_Diff += _Inflow_Species[s]*(h_i[s]-h_u[s]); + } + for(unsigned int i=0; i != n_M_dofs; i++) + { + libMesh::Real jac = JxW[qp]; + Fm(i) += (M_dot*Enth_Diff - k*Grad_T(0))*M_phi[i][qp]*jac; + } + } + } + } + + + + /****************************************************************************************************/ + /****************************************************************************************************/ template void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, From 38dfb70164626d2a7bb5d5f7faf4d9e96166e4fd Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 6 Jun 2018 11:32:45 -0400 Subject: [PATCH 18/41] added some checks to make sure and unburnt and initial temperature are given --- src/physics/src/od_premixed_flame.C | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index cedf9780c..dd4424f6d 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -49,10 +49,22 @@ namespace GRINS "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); //Parsing the Temperature at the Inflow this->set_parameter(_Ti, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"/Inlet_Temperature", 0.0); + "Physics/"+PhysicsNaming::od_premixed_flame()+"/Inlet_Temperature", 0.0); + if(_Ti == 0) + { + std::cout << "Initial Boundary Temperature not set in the input!!" << std::endl; + libmesh_not_implemented(); + } + //Parsing the Unburnt Temperature this->set_parameter(_Tu, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/Unburnt_Temperature", 0.0); + if(_Tu ==0) + { + std::cout << "Unburnt gas Temperature not set in the input!!" << std::endl; + libmesh_not_implemented(); + } + //Initial Inflow Equivalence ration _Inflow_Species.resize(this->_n_species); for (unsigned int s = 0; s < this->_n_species; s++) From c8247b6c82776e7ac6a3a4d370709b21a0498a14 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 6 Jun 2018 13:27:49 -0400 Subject: [PATCH 19/41] Cleaning up a few unnessecary things --- src/physics/src/od_premixed_flame.C | 45 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index dd4424f6d..8b222efbe 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -47,7 +47,7 @@ namespace GRINS (_fixed_rho_value, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); - //Parsing the Temperature at the Inflow + //Parsing the Temperature at the Inflow, can probably make a better error message, or just initialize the value as something else this->set_parameter(_Ti, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/Inlet_Temperature", 0.0); if(_Ti == 0) @@ -73,7 +73,7 @@ namespace GRINS +_gas_mixture->species_name(s), 0.0); } - + //Remenants of failed attempts /*this->_T_Fixed_Loc = input("Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed_Loc", 0.0); this->set_parameter @@ -91,7 +91,7 @@ namespace GRINS this->_ic_handler = new GenericICHandler( physics_name, input ); } - /****************************************************************************************************/ + //Reading and setting the Thermodynamic Pressure template void ODPremixedFlame::read_input_options( const GetPot& input ) @@ -103,7 +103,7 @@ namespace GRINS (*this), _p0 ); } - /****************************************************************************************************/ + template void ODPremixedFlame::register_parameter( const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) const @@ -111,7 +111,7 @@ namespace GRINS ParameterUser::register_parameter(param_name, param_pointer); _gas_mixture->register_parameter(param_name, param_pointer); } - /****************************************************************************************************/ + template void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) { @@ -121,7 +121,7 @@ namespace GRINS } system->time_evolving(_temp_vars.T(), 1); } - /****************************************************************************************************/ + template void ODPremixedFlame::init_context( AssemblyContext& context ) { @@ -156,7 +156,7 @@ namespace GRINS context.get_side_fe(this->_temp_vars.T())->get_dphi(); context.get_side_fe(this->_temp_vars.T())->get_xyz(); } - /****************************************************************************************************/ + template void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing ) @@ -255,7 +255,6 @@ namespace GRINS return; } //end post processing vars - /*************************************************************************************************************/ template void ODPremixedFlame::element_time_derivative @@ -373,8 +372,9 @@ namespace GRINS return; } // end element time derivative - /****************************************************************************************************/ - /****************************************************************************************************/ + + + template void ODPremixedFlame::mass_residual (bool compute_jacobian, AssemblyContext & context ) @@ -451,8 +451,8 @@ namespace GRINS } // end Quadrature loop } //end Mass Residual - /****************************************************************************************************/ - /****************************************************************************************************/ + + template void ODPremixedFlame::element_constraint ( bool compute_jacobian, AssemblyContext & context ) @@ -497,16 +497,19 @@ namespace GRINS }*/ } //end Element Constraint - /****************************************************************************************************/ - /****************************************************************************************************/ + + + template void ODPremixedFlame::side_time_derivative( bool compute_jacobian, AssemblyContext & context) { if(compute_jacobian) libmesh_not_implemented(); + //Check if were on the right boundary, + //TODO:: make this specified in input file probably if( context.has_side_boundary_id( 0 )) { - + //Still integrating, can probably just get rid of this stuff. const std::vector &JxW = context.get_element_fe(this->_temp_vars.T())->get_JxW(); @@ -519,12 +522,13 @@ namespace GRINS const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); + //grabbing the element Mass Residual libMesh::DenseSubVector & Fm = context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} for(unsigned int qp=0; qp!=n_qpoints; qp++) { - + //Defining and grabbing all the variables we'll need libMesh::Real T, M_dot; libMesh::Gradient Grad_T; @@ -552,18 +556,21 @@ namespace GRINS h_i[s] = gas_evaluator.h_s( this->_Ti, s ); h_u[s] = gas_evaluator.h_s( this->_Tu, s ); } - + //proccess to calculate k R = gas_evaluator.R_mix( mass_fractions ); rho = this->rho( T, p0, R ); cp = gas_evaluator.cp( T, p0, mass_fractions); D.resize(this->_n_species); gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, mu, k, D ); + + //Solve our loop over species libMesh::Real Enth_Diff = 0; for(unsigned int s=0; s < this->n_species(); s++) { Enth_Diff += _Inflow_Species[s]*(h_i[s]-h_u[s]); } + for(unsigned int i=0; i != n_M_dofs; i++) { libMesh::Real jac = JxW[qp]; @@ -574,10 +581,6 @@ namespace GRINS } - - - /****************************************************************************************************/ - /****************************************************************************************************/ template void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, From d0a20a832986c10931e8eb97a837c7f9c8b21814 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 2 Jul 2018 11:33:23 -0400 Subject: [PATCH 20/41] adding my chemistry comparison script between antioch and cantera for a certain reaction type, still needs more automation to just read everything from the xml, and require less input between checks --- src/apps/chemistry_comparison.C | 209 ++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 src/apps/chemistry_comparison.C diff --git a/src/apps/chemistry_comparison.C b/src/apps/chemistry_comparison.C new file mode 100644 index 000000000..835e3e83c --- /dev/null +++ b/src/apps/chemistry_comparison.C @@ -0,0 +1,209 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// GRINS - General Reacting Incompressible Navier-Stokes +// +// Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner +// Copyright (C) 2010-2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + +// GRINS +#include "grins_config.h" + +#ifdef GRINS_HAVE_ANTIOCH + +// C++ +#include +#include +#include + +// libMesh +#include "libmesh/getpot.h" + +// GRINS +#include "grins/antioch_constant_transport_mixture.h" +#include "grins/antioch_kinetics.h" +#include "grins/materials_parsing.h" +#include "grins/physics_naming.h" +#include "grins/antioch_constant_transport_evaluator.h" + +#ifdef GRINS_HAVE_CANTERA +#include "grins/cantera_mixture.h" +#include "grins/cantera_kinetics.h" +#include "grins/cantera_evaluator.h" + +libMesh::Real rhof(libMesh::Real P,libMesh::Real Rmix,libMesh::Real T) { + libMesh::Real value = 0; + value = P/(Rmix*T); + return value; +} + +int main(int argc, char* argv[]) +{ + if( argc < 2 ) + { + // TODO: Need more consistent error handling. + std::cerr << "Error: Must specify input file." << std::endl; + exit(1); + } + GetPot input( argv[1] ); + + //Antioch Mixture and kinetics Initialization *************************************************************** + GRINS::AntiochConstantTransportMixture, GRINS::ConstantConductivity > + antioch_mixture(input,"HydrogenGas"); + + const unsigned int n_species = antioch_mixture.n_species(); + + GRINS::AntiochConstantTransportEvaluator , Antioch::IdealGasMicroThermo >, libMesh::Real>, GRINS::ConstantConductivity > antioch_evaluator( antioch_mixture); + + //Cantera Mixture and kinetics Initialization *************************************************************** + GRINS::CanteraMixture cantera_mixture(input, "Hydrogen"); + GRINS::CanteraEvaluator cantera_evaluator(cantera_mixture); + + if(n_species != cantera_mixture.n_species()) + { + std::cerr<< "Error: Cantera and Antioch Reading different number of species" << std::endl; + exit(1); + } + + //Temperature and Mass Fractions Setting ******************************************************************** + std::vector Temperature_Dist(100,300); + for(unsigned int i=0;i Mass_Fractions(n_species); + for( unsigned int s = 0; s < n_species; s++ ) + { + Mass_Fractions[s] = input( "Conditions/"+antioch_evaluator.species_name(s), 0.00); + } + + libMesh::Real p0 = 100000; //pascals + + //Antioch Kinetic Parameters Calculations ****************************************************************** + libMesh::Real R_mix_antioch = antioch_evaluator.R_mix(Mass_Fractions); + libMesh::Real M_mix_antioch = antioch_evaluator.M_mix(Mass_Fractions); + std::vector rhoa(Temperature_Dist.size()); + + std::vector > omega_dot_antioch(Temperature_Dist.size()); + for(unsigned int i=0;i rhoc(Temperature_Dist.size()); + + std::vector > omega_dot_cantera(Temperature_Dist.size()); + for(unsigned int i=0; i < Temperature_Dist.size();i++) + { + rhoc[i] = rhof(p0,R_mix_cantera,Temperature_Dist[i]); + omega_dot_cantera[i].resize(n_species,4); + cantera_evaluator.omega_dot(Temperature_Dist[i],rhoc[i],Mass_Fractions,omega_dot_cantera[i]); + } + + + + + + + //Printing out What we want and saving data to our files + + std::ofstream output; + output.open("omega_dot_antioch.dat", std::ios::trunc ); + for(unsigned int s =0; s < n_species; s++) + { + output << antioch_mixture.species_name(s) << " "; + for(unsigned int i = 0; i < Temperature_Dist.size();i++) + { + output << omega_dot_antioch[i][s] << " "; + } + output << std::endl; + } + output.close(); + + output.open("omega_dot_cantera.dat",std::ios::trunc ); + for(unsigned int s =0; s cpa(Temperature_Dist.size()),cpc(Temperature_Dist.size()); + //Time to compare their cp calculations at different temperatures + output.open("cp_data.dat"); + for(unsigned int i=0; i < Temperature_Dist.size();i++) + { + cpa[i] = antioch_evaluator.cp( Temperature_Dist[i], rhoa[i], Mass_Fractions); + cpc[i] = cantera_evaluator.cp( Temperature_Dist[i], rhoc[i], Mass_Fractions); + output < amu,ak, cmu,ck; + std::vector< std::vector > aD(Temperature_Dist.size()); + std::vector< std::vector > cD(Temperature_Dist.size()); + amu.resize(Temperature_Dist.size()); + cmu.resize(Temperature_Dist.size()); + ak.resize(Temperature_Dist.size()); + ck.resize(Temperature_Dist.size()); + for(unsigned int i =0; i < Temperature_Dist.size();i++) + { + aD[i].resize(n_species); + cD[i].resize(n_species); + antioch_evaluator.mu_and_k_and_D(Temperature_Dist[i], rhoa[i], cpa[i], Mass_Fractions, amu[i], ak[i], aD[i]); + cantera_evaluator.mu_and_k_and_D(Temperature_Dist[i], rhoc[i], cpc[i], Mass_Fractions, cmu[i], ck[i], cD[i]); + } + + output.open("mu_k_and_d.dat"); + for(unsigned int i=0; i < Temperature_Dist.size();i++) + output << amu[i] <<" " << ak[i] << " " << aD[i][3] << " " << cmu[i] << " " << ck[i] << " " << cD[i][3] << std::endl; + output.close(); + std::ofstream output1; + + + return 0; +} +#endif //GRINS_HAVE_CANTERA +#endif //GRINS_HAVE_ANTIOCH From 49320deae79ac8eff7cc7d07e362d3e2b373d9d8 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 2 Jul 2018 14:40:26 -0400 Subject: [PATCH 21/41] First attempt at adding species specific, specific heats. Will need to rethink how Im calculating them, might be best to return all as a vector, since you will usually use them all when needed, and cantera calculates the vector every call anyways --- src/Makefile.am | 10 +++++++ src/apps/chemistry_comparison.C | 29 +++++++++++++++++++ .../include/grins/antioch_evaluator.h | 1 + .../include/grins/cantera_evaluator.h | 13 +++++++++ src/properties/include/grins/cantera_thermo.h | 2 ++ src/properties/src/antioch_evaluator.C | 21 ++++++++++++++ src/properties/src/cantera_thermo.C | 26 +++++++++++++++++ 7 files changed, 102 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 4dd48f2d5..fda8687e1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,6 +16,9 @@ if ANTIOCH_ENABLED bin_PROGRAMS += antioch_thermo_tables bin_PROGRAMS += antioch_kinetic_rates bin_PROGRAMS += antioch_transport_values +if CANTERA_ENABLED + bin_PROGRAMS += chemistry_comparison +endif endif #---------------------------------------------- @@ -619,6 +622,13 @@ if ANTIOCH_ENABLED antioch_transport_values_LDADD = libgrins.la endif +if ANTIOCH_ENABLED +if CANTERA_ENABLED + chemistry_comparison_SOURCES = apps/chemistry_comparison.C + chemistry_comparison_LDADD = libgrins.la +endif +endif + #-------------------------------------- #Local Directories to include for build #-------------------------------------- diff --git a/src/apps/chemistry_comparison.C b/src/apps/chemistry_comparison.C index 835e3e83c..102f209d4 100644 --- a/src/apps/chemistry_comparison.C +++ b/src/apps/chemistry_comparison.C @@ -202,6 +202,35 @@ int main(int argc, char* argv[]) output.close(); std::ofstream output1; + //Testing my take at species specific heat capacities + output.open("Antioch_Species_Specific_Specific_Heats.dat"); + output << "Temperature " << " Antioch Species " << std::endl; + for(unsigned int Temp_iter = 0; Temp_iter < Temperature_Dist.size();Temp_iter++) + { + output << Temperature_Dist[Temp_iter] << " "; + for(unsigned int species =0; species& Y ); + libMesh::Real cp_s( const libMesh::Real& T, const libMesh::Real P, const libMesh::Real& species ); libMesh::Real cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); diff --git a/src/properties/include/grins/cantera_evaluator.h b/src/properties/include/grins/cantera_evaluator.h index 0e038d079..c254d70cd 100644 --- a/src/properties/include/grins/cantera_evaluator.h +++ b/src/properties/include/grins/cantera_evaluator.h @@ -72,6 +72,8 @@ namespace GRINS // Thermo libMesh::Real cp( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); + + libMesh::Real cp_s( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y, const libMesh::Real species); libMesh::Real cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); @@ -172,6 +174,15 @@ namespace GRINS return _thermo.cp(T,P,Y); } + inline + libMesh::Real CanteraEvaluator::cp_s( const libMesh::Real& T, + const libMesh::Real P, + const std::vector& Y, + const libMesh::Real species) + { + return _thermo.cp_s(T,P,Y,species); + } + inline libMesh::Real CanteraEvaluator::cv( const libMesh::Real& T, const libMesh::Real P, @@ -231,6 +242,8 @@ namespace GRINS _kinetics.omega_dot(T,rho,mass_fractions,omega_dot); } + + } // end namespace GRINS #endif // GRINS_HAVE_CANTERA diff --git a/src/properties/include/grins/cantera_thermo.h b/src/properties/include/grins/cantera_thermo.h index 3ed78863b..f87ab1990 100644 --- a/src/properties/include/grins/cantera_thermo.h +++ b/src/properties/include/grins/cantera_thermo.h @@ -66,6 +66,8 @@ namespace GRINS ~CanteraThermodynamics(){}; libMesh::Real cp( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); + + libMesh::Real cp_s(const libMesh::Real& T,const libMesh::Real P, const std::vector& Y , const libMesh::Real& species); libMesh::Real cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); diff --git a/src/properties/src/antioch_evaluator.C b/src/properties/src/antioch_evaluator.C index e865ad1cb..c1f21a5ed 100644 --- a/src/properties/src/antioch_evaluator.C +++ b/src/properties/src/antioch_evaluator.C @@ -72,6 +72,17 @@ namespace GRINS return this->_nasa_evaluator->cp( *(_temp_cache.get()), Y ); } + template<> + libMesh::Real + AntiochEvaluator,Antioch::IdealGasMicroThermo >, libMesh::Real> >:: + cp_s( const libMesh::Real& T, + const libMesh::Real /*P*/, + const libMesh::Real& species ) + { + this->check_and_reset_temp_cache(T); + return this->_nasa_evaluator->cp( *(_temp_cache.get()), species ); + } + template<> libMesh::Real AntiochEvaluator,Antioch::IdealGasMicroThermo >, libMesh::Real> >:: cv( const libMesh::Real& T, @@ -99,6 +110,16 @@ namespace GRINS return this->_thermo->cp( T, T, Y ); } + template<> + libMesh::Real AntiochEvaluator,Antioch::StatMechThermodynamics >::cp_s( const libMesh::Real& T, + const libMesh::Real /*P*/, + const libMesh::Real& species ) + { + //will need to figure out before pushing + return _thermo->cv(species, T, T) + this->R(species); + } + + template<> libMesh::Real AntiochEvaluator,Antioch::StatMechThermodynamics >::cv( const libMesh::Real& T, const libMesh::Real /*P*/, diff --git a/src/properties/src/cantera_thermo.C b/src/properties/src/cantera_thermo.C index 83a94fd70..6bfeca974 100644 --- a/src/properties/src/cantera_thermo.C +++ b/src/properties/src/cantera_thermo.C @@ -75,6 +75,32 @@ namespace GRINS return cp; } + libMesh::Real CanteraThermodynamics::cp_s( const libMesh::Real& T, + const libMesh::Real P, + const std::vector& Y, + const libMesh::Real &species) + { + libMesh::Real cp = 0.0; + std::vector Molar_cp(Y.size()); + { + libMesh::Threads::spin_mutex::scoped_lock lock(cantera_mutex); + + try + { + _cantera_gas.setState_TPY( T, P, &Y[0]); + _cantera_gas.getPartialMolarCp(&Molar_cp[0]); + cp = Molar_cp[species]/_cantera_gas.molecularWeight(species); + } + catch(Cantera::CanteraError) + { + Cantera::showErrors(std::cerr); + libmesh_error(); + } + } + + return cp; + } + libMesh::Real CanteraThermodynamics::cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ) From 4211e065558accf3bc4a5a01a2fc6bcfde25850d Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 2 Jul 2018 14:53:09 -0400 Subject: [PATCH 22/41] Making it so Antioch and Cantera evaluators have the same inputs for templating --- src/apps/chemistry_comparison.C | 2 +- src/properties/include/grins/antioch_evaluator.h | 2 +- src/properties/src/antioch_evaluator.C | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/apps/chemistry_comparison.C b/src/apps/chemistry_comparison.C index 102f209d4..29c9d5bd5 100644 --- a/src/apps/chemistry_comparison.C +++ b/src/apps/chemistry_comparison.C @@ -211,7 +211,7 @@ int main(int argc, char* argv[]) for(unsigned int species =0; species& Y ); - libMesh::Real cp_s( const libMesh::Real& T, const libMesh::Real P, const libMesh::Real& species ); + libMesh::Real cp_s( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y, const libMesh::Real& species ); libMesh::Real cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); diff --git a/src/properties/src/antioch_evaluator.C b/src/properties/src/antioch_evaluator.C index c1f21a5ed..0b19faf08 100644 --- a/src/properties/src/antioch_evaluator.C +++ b/src/properties/src/antioch_evaluator.C @@ -76,8 +76,9 @@ namespace GRINS libMesh::Real AntiochEvaluator,Antioch::IdealGasMicroThermo >, libMesh::Real> >:: cp_s( const libMesh::Real& T, - const libMesh::Real /*P*/, - const libMesh::Real& species ) + const libMesh::Real /*P*/, + const std::vector& Y, + const libMesh::Real& species ) { this->check_and_reset_temp_cache(T); return this->_nasa_evaluator->cp( *(_temp_cache.get()), species ); @@ -113,6 +114,7 @@ namespace GRINS template<> libMesh::Real AntiochEvaluator,Antioch::StatMechThermodynamics >::cp_s( const libMesh::Real& T, const libMesh::Real /*P*/, + const std::vector& Y, const libMesh::Real& species ) { //will need to figure out before pushing From 6000ef0a779338cda91e76147856b162131b0568 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Tue, 3 Jul 2018 10:47:17 -0400 Subject: [PATCH 23/41] Rework of current species specific heat to return them as a vector instead of individually --- src/apps/chemistry_comparison.C | 14 ++++++++---- src/physics/src/od_premixed_flame.C | 7 ++++-- .../include/grins/antioch_evaluator.h | 3 ++- .../include/grins/cantera_evaluator.h | 13 ++++++----- src/properties/include/grins/cantera_thermo.h | 2 +- src/properties/src/antioch_evaluator.C | 22 +++++++++++-------- src/properties/src/cantera_thermo.C | 18 +++++++-------- 7 files changed, 47 insertions(+), 32 deletions(-) diff --git a/src/apps/chemistry_comparison.C b/src/apps/chemistry_comparison.C index 29c9d5bd5..13c31b5d7 100644 --- a/src/apps/chemistry_comparison.C +++ b/src/apps/chemistry_comparison.C @@ -204,34 +204,40 @@ int main(int argc, char* argv[]) //Testing my take at species specific heat capacities output.open("Antioch_Species_Specific_Specific_Heats.dat"); + std::vector > cp_sA(Temperature_Dist.size()); output << "Temperature " << " Antioch Species " << std::endl; for(unsigned int Temp_iter = 0; Temp_iter < Temperature_Dist.size();Temp_iter++) { + cp_sA[Temp_iter].resize(n_species); + antioch_evaluator.cp_s(Temperature_Dist[Temp_iter],p0,Mass_Fractions,cp_sA[Temp_iter]); output << Temperature_Dist[Temp_iter] << " "; for(unsigned int species =0; species > cp_sC(Temperature_Dist.size()); output << "Temperature " << " Cantera Species " << std::endl; for(unsigned int Temp_iter = 0; Temp_iter < Temperature_Dist.size();Temp_iter++) { output << Temperature_Dist[Temp_iter] << " "; + cp_sC[Temp_iter].resize(n_species); + cantera_evaluator.cp_s(Temperature_Dist[Temp_iter],p0,Mass_Fractions,cp_sC[Temp_iter]); for(unsigned int species =0; speciesget_p0(); - std::vector mass_fractions, h, D, omega_dot; + std::vector mass_fractions, h, D, omega_dot, cp_s; std::vector Grad_mass_fractions; mass_fractions.resize(this->_n_species); @@ -339,17 +339,20 @@ namespace GRINS gas_evaluator.omega_dot( T, rho, mass_fractions, omega_dot ); + gas_evaluator.cp_s(T, p0, mass_fractions, cp_s); libMesh::Real jac = JxW[qp]; //Energy equation Residual libMesh::Real chem_term = 0.0; + libMesh::Real Sum = 0.0; for ( unsigned int s=0; s< this->_n_species; s++ ) { chem_term +=h[s]*omega_dot[s]; + Sum += rho*D[s]*Grad_mass_fractions[s](0)*Grad_T(0)*cp_s[s]; } for (unsigned int i=0;i != n_T_dofs; i++ ) { - FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term )*T_phi[i][qp] + FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term + Sum )*T_phi[i][qp] -k*Grad_T(0)*T_dphi[i][qp](0))*jac; } diff --git a/src/properties/include/grins/antioch_evaluator.h b/src/properties/include/grins/antioch_evaluator.h index 62e70ea9d..0e34fd8bc 100644 --- a/src/properties/include/grins/antioch_evaluator.h +++ b/src/properties/include/grins/antioch_evaluator.h @@ -81,7 +81,8 @@ namespace GRINS // Thermo libMesh::Real cp( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); - libMesh::Real cp_s( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y, const libMesh::Real& species ); + + void cp_s( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y, std::vector& Cp_s ); libMesh::Real cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); diff --git a/src/properties/include/grins/cantera_evaluator.h b/src/properties/include/grins/cantera_evaluator.h index c254d70cd..779268e09 100644 --- a/src/properties/include/grins/cantera_evaluator.h +++ b/src/properties/include/grins/cantera_evaluator.h @@ -73,7 +73,7 @@ namespace GRINS // Thermo libMesh::Real cp( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); - libMesh::Real cp_s( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y, const libMesh::Real species); + void cp_s( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y, std::vector& Cp_s); libMesh::Real cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); @@ -175,12 +175,13 @@ namespace GRINS } inline - libMesh::Real CanteraEvaluator::cp_s( const libMesh::Real& T, - const libMesh::Real P, - const std::vector& Y, - const libMesh::Real species) + void CanteraEvaluator::cp_s( const libMesh::Real& T, + const libMesh::Real P, + const std::vector& Y, + std::vector& Cp_s) { - return _thermo.cp_s(T,P,Y,species); + _thermo.cp_s(T,P,Y,Cp_s); + return; } inline diff --git a/src/properties/include/grins/cantera_thermo.h b/src/properties/include/grins/cantera_thermo.h index f87ab1990..77a489b27 100644 --- a/src/properties/include/grins/cantera_thermo.h +++ b/src/properties/include/grins/cantera_thermo.h @@ -67,7 +67,7 @@ namespace GRINS libMesh::Real cp( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); - libMesh::Real cp_s(const libMesh::Real& T,const libMesh::Real P, const std::vector& Y , const libMesh::Real& species); + void cp_s(const libMesh::Real& T,const libMesh::Real P, const std::vector& Y , std::vector& Cp_s); libMesh::Real cv( const libMesh::Real& T, const libMesh::Real P, const std::vector& Y ); diff --git a/src/properties/src/antioch_evaluator.C b/src/properties/src/antioch_evaluator.C index 0b19faf08..9462262a1 100644 --- a/src/properties/src/antioch_evaluator.C +++ b/src/properties/src/antioch_evaluator.C @@ -73,15 +73,17 @@ namespace GRINS } template<> - libMesh::Real - AntiochEvaluator,Antioch::IdealGasMicroThermo >, libMesh::Real> >:: + void AntiochEvaluator,Antioch::IdealGasMicroThermo >, libMesh::Real> >:: cp_s( const libMesh::Real& T, const libMesh::Real /*P*/, const std::vector& Y, - const libMesh::Real& species ) + std::vector& Cp_s ) { + libmesh_assert_equal_to(Y.size(), Cp_s.size()); this->check_and_reset_temp_cache(T); - return this->_nasa_evaluator->cp( *(_temp_cache.get()), species ); + for(unsigned int species = 0;species < Y.size();species++) + Cp_s[species] = _nasa_evaluator->cp( *(_temp_cache.get()), species ); + return; } template<> @@ -112,13 +114,15 @@ namespace GRINS } template<> - libMesh::Real AntiochEvaluator,Antioch::StatMechThermodynamics >::cp_s( const libMesh::Real& T, - const libMesh::Real /*P*/, - const std::vector& Y, - const libMesh::Real& species ) + void AntiochEvaluator,Antioch::StatMechThermodynamics >::cp_s( const libMesh::Real& T, + const libMesh::Real /*P*/, + const std::vector& Y, + std::vector& Cp_s) { //will need to figure out before pushing - return _thermo->cv(species, T, T) + this->R(species); + for(unsigned int species = 0;species< Y.size();species++) + Cp_s[species] = _thermo->cv(species, T, T) + this->R(species); + return; } diff --git a/src/properties/src/cantera_thermo.C b/src/properties/src/cantera_thermo.C index 6bfeca974..c95c633e4 100644 --- a/src/properties/src/cantera_thermo.C +++ b/src/properties/src/cantera_thermo.C @@ -75,21 +75,21 @@ namespace GRINS return cp; } - libMesh::Real CanteraThermodynamics::cp_s( const libMesh::Real& T, - const libMesh::Real P, - const std::vector& Y, - const libMesh::Real &species) + void CanteraThermodynamics::cp_s( const libMesh::Real& T, + const libMesh::Real P, + const std::vector& Y, + std::vector &Cp_s) { - libMesh::Real cp = 0.0; - std::vector Molar_cp(Y.size()); + libmesh_assert_equal_to( Cp_s.size(), _cantera_gas.nSpecies() ); { libMesh::Threads::spin_mutex::scoped_lock lock(cantera_mutex); try { _cantera_gas.setState_TPY( T, P, &Y[0]); - _cantera_gas.getPartialMolarCp(&Molar_cp[0]); - cp = Molar_cp[species]/_cantera_gas.molecularWeight(species); + _cantera_gas.getPartialMolarCp(&Cp_s[0]); + for(unsigned int species = 0; species < _cantera_gas.nSpecies(); species++) + Cp_s[species] = Cp_s[species]/_cantera_gas.molecularWeight(species); } catch(Cantera::CanteraError) { @@ -98,7 +98,7 @@ namespace GRINS } } - return cp; + return; } libMesh::Real CanteraThermodynamics::cv( const libMesh::Real& T, From f1e16366c14f52da8b7992598de759e7bf824ee5 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 4 Jul 2018 09:55:29 -0400 Subject: [PATCH 24/41] quick work around for clipping temperatures and density in cantera --- src/apps/chemistry_comparison.C | 2 +- src/physics/src/od_premixed_flame.C | 2 +- .../include/grins/cantera_evaluator.h | 42 ++++++++++++++----- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/apps/chemistry_comparison.C b/src/apps/chemistry_comparison.C index 13c31b5d7..21da1872c 100644 --- a/src/apps/chemistry_comparison.C +++ b/src/apps/chemistry_comparison.C @@ -162,7 +162,7 @@ int main(int argc, char* argv[]) output.close(); //print out the species mass fractions and molecular weights to use in my matlab program: - output.open("Cantera_evaluated_species_fractions:"); + output.open("Cantera_evaluated_species_fractions.dat"); for(unsigned int s=0;s_n_species); Grad_mass_fractions.resize(this->_n_species); h.resize(this->_n_species); - + cp_s.resize(this->_n_species); for (unsigned int s = 0; s < this->_n_species; s++) { mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); diff --git a/src/properties/include/grins/cantera_evaluator.h b/src/properties/include/grins/cantera_evaluator.h index 779268e09..5034f2033 100644 --- a/src/properties/include/grins/cantera_evaluator.h +++ b/src/properties/include/grins/cantera_evaluator.h @@ -98,6 +98,9 @@ namespace GRINS void omega_dot( const libMesh::Real& T, libMesh::Real rho, const std::vector mass_fractions, std::vector& omega_dot ); + + libMesh::Real clip_T(const libMesh::Real&T) const; + libMesh::Real clip_rho(const libMesh::Real&rho) const; protected: @@ -117,11 +120,28 @@ namespace GRINS /* ------------------------- Inline Functions -------------------------*/ inline - libMesh::Real CanteraEvaluator::M( unsigned int species ) const + libMesh::Real CanteraEvaluator::clip_T( const libMesh::Real& T ) const + { + if (T>200) + return T; + return 200; + } + + inline + libMesh::Real CanteraEvaluator::clip_rho(const libMesh::Real& rho ) const + { + if(rho > 1e-6) + return rho; + return 1e-6; + } + + inline + libMesh::Real CanteraEvaluator::M( unsigned int species ) const { return _chem.M(species); } + inline libMesh::Real CanteraEvaluator::M_mix( const std::vector& mass_fractions ) const { @@ -171,7 +191,7 @@ namespace GRINS const libMesh::Real P, const std::vector& Y ) { - return _thermo.cp(T,P,Y); + return _thermo.cp(this->clip_T(T),P,Y); } inline @@ -180,7 +200,7 @@ namespace GRINS const std::vector& Y, std::vector& Cp_s) { - _thermo.cp_s(T,P,Y,Cp_s); + _thermo.cp_s(this->clip_T(T),P,Y,Cp_s); return; } @@ -189,13 +209,13 @@ namespace GRINS const libMesh::Real P, const std::vector& Y ) { - return _thermo.cv(T,P,Y); + return _thermo.cv(this->clip_T(T),P,Y); } inline libMesh::Real CanteraEvaluator::h_s( const libMesh::Real& T, unsigned int species ) { - return _thermo.h(T,species); + return _thermo.h(this->clip_T(T),species); } inline @@ -203,7 +223,7 @@ namespace GRINS const libMesh::Real P, const std::vector& Y ) { - return _transport.mu(T,P,Y); + return _transport.mu(this->clip_T(T),P,Y); } inline @@ -211,7 +231,7 @@ namespace GRINS const libMesh::Real P, const std::vector& Y ) { - return _transport.k(T,P,Y); + return _transport.k(this->clip_T(T),P,Y); } inline @@ -220,8 +240,8 @@ namespace GRINS const std::vector& Y, libMesh::Real& mu, libMesh::Real& k ) { - mu = _transport.mu(T,P,Y); - k = _transport.k(T,P,Y); + mu = _transport.mu(this->clip_T(T),P,Y); + k = _transport.k(this->clip_T(T),P,Y); } inline @@ -232,7 +252,7 @@ namespace GRINS libMesh::Real& mu, libMesh::Real& k, std::vector& D ) { - _transport.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); + _transport.mu_and_k_and_D( this->clip_T(T), this->clip_rho(rho), cp, Y, mu, k, D ); } inline @@ -240,7 +260,7 @@ namespace GRINS const std::vector mass_fractions, std::vector& omega_dot ) { - _kinetics.omega_dot(T,rho,mass_fractions,omega_dot); + _kinetics.omega_dot(this->clip_T(T),this->clip_rho(rho),mass_fractions,omega_dot); } From 48a9dea29da2ca1efa11cd5ab45bb9c7676476c2 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Tue, 24 Jul 2018 11:48:12 -0400 Subject: [PATCH 25/41] first attempt at hirschfield approx, keeps mixed mass fractions at 1 so far --- src/physics/src/od_premixed_flame.C | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index b76c9dc47..e148200f5 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -299,7 +299,7 @@ namespace GRINS libMesh::Real T, M_dot; libMesh::Gradient Grad_T; - libMesh::Real R, k, cp, rho, p0, mu; + libMesh::Real R, k, cp, rho, p0, mu, M_mix; Evaluator gas_evaluator( *(this->_gas_mixture) ); T = context.interior_value(this->_temp_vars.T(),qp); @@ -336,7 +336,9 @@ namespace GRINS mu, k, D ); omega_dot.resize(this->_n_species); - + + M_mix = gas_evaluator.M_mix(mass_fractions); + gas_evaluator.omega_dot( T, rho, mass_fractions, omega_dot ); gas_evaluator.cp_s(T, p0, mass_fractions, cp_s); @@ -345,11 +347,22 @@ namespace GRINS //Energy equation Residual libMesh::Real chem_term = 0.0; libMesh::Real Sum = 0.0; + libMesh::Real SpeciesGradSum = 0.0; + libMesh::Real SpeciesSum = 0.0; for ( unsigned int s=0; s< this->_n_species; s++ ) { + SpeciesGradSum += Grad_mass_fractions[s](0)/gas_evaluator.M(s); chem_term +=h[s]*omega_dot[s]; Sum += rho*D[s]*Grad_mass_fractions[s](0)*Grad_T(0)*cp_s[s]; } + + for (unsigned int s =0; s < this->_n_species;s++) + { + SpeciesSum+= D[s]*Grad_mass_fractions[s](0); + SpeciesSum-=M_mix*mass_fractions[s]*D[s]*SpeciesGradSum; + } + + for (unsigned int i=0;i != n_T_dofs; i++ ) { FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term + Sum )*T_phi[i][qp] @@ -364,7 +377,7 @@ namespace GRINS context.get_elem_residual(this->_species_vars.species(s)); //R_{s} const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; - const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0); + const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0)+M_mix*rho*D[s]*SpeciesGradSum*mass_fractions[s]+rho*mass_fractions[s]*SpeciesSum; for (unsigned int i =0;i != n_s_dofs;i++) { From c01b208eb0ac8d13f1b0bab1a57b5a2e80d15824 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Fri, 27 Jul 2018 11:18:37 -0400 Subject: [PATCH 26/41] fixing something here i cant remember today --- src/qoi/src/flame_speed.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C index 7337ffe2b..978c38c67 100644 --- a/src/qoi/src/flame_speed.C +++ b/src/qoi/src/flame_speed.C @@ -69,7 +69,8 @@ namespace GRINS { //grab the pressure value this->parse_Pressure(input); - + this->set_parameter + ( _T_unburnt, input,"QoI/FlameSpeed/Unburnt_Temperature" , -1.0 ); //figure out the chemistry std::string material = input("QoI/FlameSpeed/material","DIE!"); _chemistry.reset( new Chemistry(input,material)); @@ -81,7 +82,7 @@ namespace GRINS if( num_bcs <= 0 ) { std::cerr << "Error: Must specify at least one boundary id to compute" - << " average Nusselt number." << std::endl + << " Flame Speed" << std::endl << "Found: " << num_bcs << std::endl; libmesh_error(); } @@ -137,7 +138,6 @@ namespace GRINS return; libMesh::Number& qoi = context.get_qois()[qoi_index]; - libMesh::Real T = context.side_value(this->_temp_vars->T(),0); libMesh::Real p0 = this->_P0; libMesh::Real Mdot = context.side_value(this->_mass_flux_vars->var(),0); @@ -149,7 +149,7 @@ namespace GRINS } libMesh::Real Rmix = _chemistry->R_mix(mass_fractions); - qoi += Mdot/(this->rho(T,p0, Rmix)); + qoi += Mdot/(this->rho(_T_unburnt,p0, Rmix)); } //end side_qoi From bd38c2c067ab446fd7be5c133294a6370a6e0318 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Fri, 27 Jul 2018 11:18:57 -0400 Subject: [PATCH 27/41] forgot the header --- src/qoi/include/grins/flame_speed.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h index 85dc3886d..0b0cbb163 100644 --- a/src/qoi/include/grins/flame_speed.h +++ b/src/qoi/include/grins/flame_speed.h @@ -62,7 +62,6 @@ namespace GRINS virtual void init_context( AssemblyContext& context ); - libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, std::vector& mass_fracs ) const; @@ -86,6 +85,7 @@ namespace GRINS std::shared_ptr _chemistry; libMesh::Real _P0; + libMesh::Real _T_unburnt; private: @@ -110,11 +110,7 @@ namespace GRINS const AssemblyContext& c ) const { return c.point_value(_mass_flux_vars->var(),p); } - template< typename Chemistry> - inline - libMesh::Real FlameSpeed::T( const libMesh::Point& p, - const AssemblyContext& c ) const - { return c.point_value(_temp_vars->T(),p); } + template< typename Chemistry> inline bool FlameSpeed::assemble_on_interior() const From 722dc994956390cb2ad2e83b069c53ead182aba5 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Fri, 27 Jul 2018 14:33:37 -0400 Subject: [PATCH 28/41] Fixed a looming problem with the boundary condition implementation where I wasnt pulling in the values from the side of the element --- src/physics/src/od_premixed_flame.C | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index e148200f5..5dcd2ee35 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -525,15 +525,14 @@ namespace GRINS //TODO:: make this specified in input file probably if( context.has_side_boundary_id( 0 )) { - //Still integrating, can probably just get rid of this stuff. const std::vector &JxW = - context.get_element_fe(this->_temp_vars.T())->get_JxW(); + context.get_side_fe(this->_temp_vars.T())->get_JxW(); // The Mass Flux shape functions at interior quadrature points. const std::vector >& M_phi = - context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); + context.get_side_fe(this->_mass_flux_vars.var())->get_phi(); - unsigned int n_qpoints = context.get_element_qrule().n_points(); + unsigned int n_qpoints = context.get_side_qrule().n_points(); const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); @@ -544,6 +543,8 @@ namespace GRINS for(unsigned int qp=0; qp!=n_qpoints; qp++) { + libMesh::Real jac = JxW[qp]; + //Defining and grabbing all the variables we'll need libMesh::Real T, M_dot; libMesh::Gradient Grad_T; @@ -551,10 +552,10 @@ namespace GRINS libMesh::Real R, k, cp, rho, p0, mu; Evaluator gas_evaluator( *(this->_gas_mixture) ); - T = context.interior_value(this->_temp_vars.T(),qp); - Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); + T = context.side_value(this->_temp_vars.T(),qp); + Grad_T = context.side_gradient(this->_temp_vars.T(), qp); - M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); + M_dot = context.side_value(this->_mass_flux_vars.var(), qp); p0 = this->get_p0(); @@ -568,7 +569,7 @@ namespace GRINS for (unsigned int s = 0; s < this->_n_species; s++) { - mass_fractions[s] = std::max( context.interior_value(this->_species_vars.species(s),qp),0.0); + mass_fractions[s] = std::max( context.side_value(this->_species_vars.species(s),qp),0.0); h_i[s] = gas_evaluator.h_s( this->_Ti, s ); h_u[s] = gas_evaluator.h_s( this->_Tu, s ); } @@ -589,7 +590,7 @@ namespace GRINS for(unsigned int i=0; i != n_M_dofs; i++) { - libMesh::Real jac = JxW[qp]; + Fm(i) += (M_dot*Enth_Diff - k*Grad_T(0))*M_phi[i][qp]*jac; } } From 354a17ccb14af9cdd6f170e559b5a055c2d76a1b Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 30 Jul 2018 13:27:32 -0400 Subject: [PATCH 29/41] Fixing some looming merging issues --- src/Makefile.am | 10 - src/apps/chemistry_comparison.C | 244 ------------------ .../include/grins/cantera_evaluator.h | 11 +- 3 files changed, 1 insertion(+), 264 deletions(-) delete mode 100644 src/apps/chemistry_comparison.C diff --git a/src/Makefile.am b/src/Makefile.am index a6be3ce89..92700eb31 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,9 +16,6 @@ if ANTIOCH_ENABLED bin_PROGRAMS += antioch_thermo_tables bin_PROGRAMS += antioch_kinetic_rates bin_PROGRAMS += antioch_transport_values -if CANTERA_ENABLED - bin_PROGRAMS += chemistry_comparison -endif endif #---------------------------------------------- @@ -624,13 +621,6 @@ if ANTIOCH_ENABLED antioch_transport_values_LDADD = libgrins.la endif -if ANTIOCH_ENABLED -if CANTERA_ENABLED - chemistry_comparison_SOURCES = apps/chemistry_comparison.C - chemistry_comparison_LDADD = libgrins.la -endif -endif - #-------------------------------------- #Local Directories to include for build #-------------------------------------- diff --git a/src/apps/chemistry_comparison.C b/src/apps/chemistry_comparison.C deleted file mode 100644 index 21da1872c..000000000 --- a/src/apps/chemistry_comparison.C +++ /dev/null @@ -1,244 +0,0 @@ -//-----------------------------------------------------------------------bl- -//-------------------------------------------------------------------------- -// -// GRINS - General Reacting Incompressible Navier-Stokes -// -// Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner -// Copyright (C) 2010-2013 The PECOS Development Team -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the Version 2.1 GNU Lesser General -// Public License as published by the Free Software Foundation. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc. 51 Franklin Street, Fifth Floor, -// Boston, MA 02110-1301 USA -// -//-----------------------------------------------------------------------el- - -// GRINS -#include "grins_config.h" - -#ifdef GRINS_HAVE_ANTIOCH - -// C++ -#include -#include -#include - -// libMesh -#include "libmesh/getpot.h" - -// GRINS -#include "grins/antioch_constant_transport_mixture.h" -#include "grins/antioch_kinetics.h" -#include "grins/materials_parsing.h" -#include "grins/physics_naming.h" -#include "grins/antioch_constant_transport_evaluator.h" - -#ifdef GRINS_HAVE_CANTERA -#include "grins/cantera_mixture.h" -#include "grins/cantera_kinetics.h" -#include "grins/cantera_evaluator.h" - -libMesh::Real rhof(libMesh::Real P,libMesh::Real Rmix,libMesh::Real T) { - libMesh::Real value = 0; - value = P/(Rmix*T); - return value; -} - -int main(int argc, char* argv[]) -{ - if( argc < 2 ) - { - // TODO: Need more consistent error handling. - std::cerr << "Error: Must specify input file." << std::endl; - exit(1); - } - GetPot input( argv[1] ); - - //Antioch Mixture and kinetics Initialization *************************************************************** - GRINS::AntiochConstantTransportMixture, GRINS::ConstantConductivity > - antioch_mixture(input,"HydrogenGas"); - - const unsigned int n_species = antioch_mixture.n_species(); - - GRINS::AntiochConstantTransportEvaluator , Antioch::IdealGasMicroThermo >, libMesh::Real>, GRINS::ConstantConductivity > antioch_evaluator( antioch_mixture); - - //Cantera Mixture and kinetics Initialization *************************************************************** - GRINS::CanteraMixture cantera_mixture(input, "Hydrogen"); - GRINS::CanteraEvaluator cantera_evaluator(cantera_mixture); - - if(n_species != cantera_mixture.n_species()) - { - std::cerr<< "Error: Cantera and Antioch Reading different number of species" << std::endl; - exit(1); - } - - //Temperature and Mass Fractions Setting ******************************************************************** - std::vector Temperature_Dist(100,300); - for(unsigned int i=0;i Mass_Fractions(n_species); - for( unsigned int s = 0; s < n_species; s++ ) - { - Mass_Fractions[s] = input( "Conditions/"+antioch_evaluator.species_name(s), 0.00); - } - - libMesh::Real p0 = 100000; //pascals - - //Antioch Kinetic Parameters Calculations ****************************************************************** - libMesh::Real R_mix_antioch = antioch_evaluator.R_mix(Mass_Fractions); - libMesh::Real M_mix_antioch = antioch_evaluator.M_mix(Mass_Fractions); - std::vector rhoa(Temperature_Dist.size()); - - std::vector > omega_dot_antioch(Temperature_Dist.size()); - for(unsigned int i=0;i rhoc(Temperature_Dist.size()); - - std::vector > omega_dot_cantera(Temperature_Dist.size()); - for(unsigned int i=0; i < Temperature_Dist.size();i++) - { - rhoc[i] = rhof(p0,R_mix_cantera,Temperature_Dist[i]); - omega_dot_cantera[i].resize(n_species,4); - cantera_evaluator.omega_dot(Temperature_Dist[i],rhoc[i],Mass_Fractions,omega_dot_cantera[i]); - } - - - - - - - //Printing out What we want and saving data to our files - - std::ofstream output; - output.open("omega_dot_antioch.dat", std::ios::trunc ); - for(unsigned int s =0; s < n_species; s++) - { - output << antioch_mixture.species_name(s) << " "; - for(unsigned int i = 0; i < Temperature_Dist.size();i++) - { - output << omega_dot_antioch[i][s] << " "; - } - output << std::endl; - } - output.close(); - - output.open("omega_dot_cantera.dat",std::ios::trunc ); - for(unsigned int s =0; s cpa(Temperature_Dist.size()),cpc(Temperature_Dist.size()); - //Time to compare their cp calculations at different temperatures - output.open("cp_data.dat"); - for(unsigned int i=0; i < Temperature_Dist.size();i++) - { - cpa[i] = antioch_evaluator.cp( Temperature_Dist[i], rhoa[i], Mass_Fractions); - cpc[i] = cantera_evaluator.cp( Temperature_Dist[i], rhoc[i], Mass_Fractions); - output < amu,ak, cmu,ck; - std::vector< std::vector > aD(Temperature_Dist.size()); - std::vector< std::vector > cD(Temperature_Dist.size()); - amu.resize(Temperature_Dist.size()); - cmu.resize(Temperature_Dist.size()); - ak.resize(Temperature_Dist.size()); - ck.resize(Temperature_Dist.size()); - for(unsigned int i =0; i < Temperature_Dist.size();i++) - { - aD[i].resize(n_species); - cD[i].resize(n_species); - antioch_evaluator.mu_and_k_and_D(Temperature_Dist[i], rhoa[i], cpa[i], Mass_Fractions, amu[i], ak[i], aD[i]); - cantera_evaluator.mu_and_k_and_D(Temperature_Dist[i], rhoc[i], cpc[i], Mass_Fractions, cmu[i], ck[i], cD[i]); - } - - output.open("mu_k_and_d.dat"); - for(unsigned int i=0; i < Temperature_Dist.size();i++) - output << amu[i] <<" " << ak[i] << " " << aD[i][3] << " " << cmu[i] << " " << ck[i] << " " << cD[i][3] << std::endl; - output.close(); - std::ofstream output1; - - //Testing my take at species specific heat capacities - output.open("Antioch_Species_Specific_Specific_Heats.dat"); - std::vector > cp_sA(Temperature_Dist.size()); - output << "Temperature " << " Antioch Species " << std::endl; - for(unsigned int Temp_iter = 0; Temp_iter < Temperature_Dist.size();Temp_iter++) - { - cp_sA[Temp_iter].resize(n_species); - antioch_evaluator.cp_s(Temperature_Dist[Temp_iter],p0,Mass_Fractions,cp_sA[Temp_iter]); - output << Temperature_Dist[Temp_iter] << " "; - for(unsigned int species =0; species > cp_sC(Temperature_Dist.size()); - output << "Temperature " << " Cantera Species " << std::endl; - for(unsigned int Temp_iter = 0; Temp_iter < Temperature_Dist.size();Temp_iter++) - { - output << Temperature_Dist[Temp_iter] << " "; - cp_sC[Temp_iter].resize(n_species); - cantera_evaluator.cp_s(Temperature_Dist[Temp_iter],p0,Mass_Fractions,cp_sC[Temp_iter]); - for(unsigned int species =0; species& Y, - std::vector& Cp_s) - { - _thermo.cp_s(T,P,Y,Cp_s); - return; - } - + inline libMesh::Real CanteraEvaluator::cv( const libMesh::Real& T, const libMesh::Real P, From cd62e8a05c11f1022d9f3861431f74d4e06e943d Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Fri, 3 Aug 2018 14:58:10 -0400 Subject: [PATCH 30/41] Never included mu as a registered property --- src/physics/include/grins/od_premixed_flame.h | 3 +- src/physics/src/od_premixed_flame.C | 33 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index e79ab465b..ba622ceca 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -97,7 +97,8 @@ namespace GRINS //!Index from registering this quantity unsigned int _u_index; //!Index from registering this quantity - + unsigned int _mu_index; + libMesh::Number _p0; libMesh::Number _Ti; libMesh::Number _Tu; diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 5dcd2ee35..d3fb9497a 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -187,7 +187,10 @@ namespace GRINS { this->_u_index = postprocessing.register_quantity( name ); } - + else if(name == std::string("mu") ) + { + this->_mu_index = postprocessing.register_quantity( name); + } //time for species specific values else if(name == std::string("mole_fractions") ) @@ -226,6 +229,7 @@ namespace GRINS this->_Ds_index[s] = postprocessing.register_quantity( "D_"+this->_gas_mixture->species_name(s) ); } } + /* else if( name == std::string("cp_s") ) { this->_cp_s_index.resize(this->n_species()); @@ -246,7 +250,8 @@ namespace GRINS << " cp" << std::endl << " mole_fractions" << std::endl << " omega_dot" << std::endl - << " u" << std::endl; + << " u" << std::endl + << " mu" << std::endl; libmesh_error(); } } @@ -658,6 +663,30 @@ namespace GRINS value = M_dot/rho; } + else if ( quantity_index == this->_mu_index ) + { + + std::vector Y( this->_n_species ); + + libMesh::Real T = this->T(point,context); + + this->mass_fractions(point,context, Y ); + + libMesh::Real p0 = this->get_p0(); + + libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); + + libMesh::Real rho = this->rho( T, p0, gas_evaluator.R_mix(Y) ); + + libMesh::Real mu, k; + std::vector D( this->_n_species ); + + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); + + value = mu; + return; + } + //now onto the species dependent stuff else From 01da4dd7d846aaae219e9ed914ad25d48699fe13 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Thu, 9 Aug 2018 11:10:07 -0400 Subject: [PATCH 31/41] At somepoint I lost the initializer for my Diffusion vector when calculating a postprocessed value --- src/physics/src/od_premixed_flame.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index d3fb9497a..7d5bb4916 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -624,7 +624,6 @@ namespace GRINS else if( quantity_index == this->_k_index ) { std::vector Y(this->_n_species ); - libMesh::Real T = this->T(point,context); this->mass_fractions( point,context, Y); libMesh::Real p0 = this->get_p0(); @@ -632,10 +631,11 @@ namespace GRINS libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); libMesh::Real rho = this->rho(T, p0, gas_evaluator.R_mix(Y) ); + std::vector D(this->_n_species); libMesh::Real mu,k; - std::vector D; + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); value = k; From cbeab7ee07d4bde5b21691d44507cb7122f7cb25 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Fri, 24 Aug 2018 09:43:59 -0400 Subject: [PATCH 32/41] reworking a few things to remove some unneeded things --- src/physics/include/grins/od_premixed_flame.h | 25 +-- src/physics/src/od_premixed_flame.C | 195 ++++++++++-------- 2 files changed, 119 insertions(+), 101 deletions(-) diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index ba622ceca..0521b8625 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -33,13 +33,12 @@ namespace GRINS void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, std::vector& mass_fracs ) const; + unsigned int n_species() const; const Mixture & gas_mixture() const; - libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; - libMesh::Real get_p0() const; //Register postprocessing variables for OD Premixed Flame @@ -100,13 +99,8 @@ namespace GRINS unsigned int _mu_index; libMesh::Number _p0; - libMesh::Number _Ti; libMesh::Number _Tu; - //libMesh::Point _T_Fixed_Loc; - //libMesh::Number _T_Fixed; - //libMesh::Number _Penalty_Tol; - //! Index from registering this quantity. Each species will have it's own index. std::vector _mole_fractions_index; @@ -119,8 +113,8 @@ namespace GRINS //! Index from registering this quantity. Each species will have it's own index. std::vector _Ds_index; - /* //! Index from registering this quantity. Each species will have it's own index. - std::vector _cp_s_index;*/ + //! Index from registering this quantity. Each species will have it's own index. + std::vector _cp_s_index; private: @@ -177,18 +171,13 @@ namespace GRINS return value; } - template< typename Mixture, typename Evaluator> - inline - libMesh::Real ODPremixedFlame::get_p0() const - {return _p0;} - template< typename Mixture, typename Evaluator> inline const Mixture & ODPremixedFlame::gas_mixture() const - { - return *_gas_mixture; - } - + { + return *_gas_mixture; + } + } // namespace Grins diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 7d5bb4916..00184be09 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -41,20 +41,13 @@ namespace GRINS _rho_index(0), _k_index(0), _cp_index(0), - _u_index(0) + _u_index(0), + _mu_index(0) { this->set_parameter (_fixed_rho_value, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); - //Parsing the Temperature at the Inflow, can probably make a better error message, or just initialize the value as something else - this->set_parameter(_Ti, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"/Inlet_Temperature", 0.0); - if(_Ti == 0) - { - std::cout << "Initial Boundary Temperature not set in the input!!" << std::endl; - libmesh_not_implemented(); - } + //Parsing the Unburnt Temperature this->set_parameter(_Tu, input, @@ -65,7 +58,7 @@ namespace GRINS libmesh_not_implemented(); } - //Initial Inflow Equivalence ration + //Initial Inflow Equivalence ratio _Inflow_Species.resize(this->_n_species); for (unsigned int s = 0; s < this->_n_species; s++) { @@ -73,22 +66,12 @@ namespace GRINS +_gas_mixture->species_name(s), 0.0); } - //Remenants of failed attempts - /*this->_T_Fixed_Loc = input("Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed_Loc", 0.0); - - this->set_parameter - (_T_Fixed,input,"Physics/"+PhysicsNaming::od_premixed_flame()+"/T_Fixed",0.0 ); - - this->set_parameter - (_Penalty_Tol,input,"Physics/"+PhysicsNaming::od_premixed_flame()+"/Penalty_Tol",1.0e-8 ); - */ this->read_input_options(input); this->check_var_subdomain_consistency(_mass_flux_vars); this->check_var_subdomain_consistency(_temp_vars); this->check_var_subdomain_consistency(_species_vars); - this->_ic_handler = new GenericICHandler( physics_name, input ); } @@ -230,37 +213,43 @@ namespace GRINS } } - /* else if( name == std::string("cp_s") ) + else if( name == std::string("cp_s") ) { this->_cp_s_index.resize(this->n_species()); for(unsigned int s=0;s < this->n_species(); s++) { - this ->_cps_index[s] = postprocessing.register_quantity( "cp_"+this->_gas_mixture->species_name(s) ); + this ->_cp_s_index[s] = postprocessing.register_quantity( "cp_"+this->_gas_mixture->species_name(s) ); } - }*/ + } else { std::cerr << "Error: Invalid output_vars value for ODPremixedFlame " << std::endl - << " Found " << name << std::endl - << " Acceptable values are: rho" << std::endl - << " D_s" << std::endl - << " k" << std::endl + << " Found " << name << std::endl + << " Acceptable values are: rho" << std::endl + << " D_s" << std::endl + << " k" << std::endl << " h_s" << std::endl - << " cp" << std::endl - << " mole_fractions" << std::endl - << " omega_dot" << std::endl + << " cp" << std::endl + << " mole_fractions" << std::endl + << " omega_dot" << std::endl << " u" << std::endl - << " mu" << std::endl; + << " mu" << std::endl + << " cp_s" << std::endl; libmesh_error(); } } } return; - } //end post processing vars + } //end post processing vars + + + + + template void ODPremixedFlame::element_time_derivative ( bool compute_jacobian, AssemblyContext & context ) @@ -271,7 +260,7 @@ namespace GRINS //Convenience const VariableIndex s0_var = this->_species_vars.species(0); - // The number of local degrees of freedom in each variable //Variables are Species, Mass flux, and Temperature + // The number of local degrees of freedom in each variable const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); @@ -299,12 +288,13 @@ namespace GRINS //species set in residual calculations since the need of a for loop unsigned int n_qpoints = context.get_element_qrule().n_points(); + for(unsigned int qp = 0;qp != n_qpoints;qp++) { libMesh::Real T, M_dot; libMesh::Gradient Grad_T; - libMesh::Real R, k, cp, rho, p0, mu, M_mix; + libMesh::Real R, k, cp, rho, p0, mu; Evaluator gas_evaluator( *(this->_gas_mixture) ); T = context.interior_value(this->_temp_vars.T(),qp); @@ -312,7 +302,7 @@ namespace GRINS M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); - p0 = this->get_p0(); + p0 = this->_p0; std::vector mass_fractions, h, D, omega_dot, cp_s; @@ -342,36 +332,31 @@ namespace GRINS omega_dot.resize(this->_n_species); - M_mix = gas_evaluator.M_mix(mass_fractions); - gas_evaluator.omega_dot( T, rho, mass_fractions, omega_dot ); gas_evaluator.cp_s(T, p0, mass_fractions, cp_s); libMesh::Real jac = JxW[qp]; - //Energy equation Residual + libMesh::Real chem_term = 0.0; - libMesh::Real Sum = 0.0; - libMesh::Real SpeciesGradSum = 0.0; - libMesh::Real SpeciesSum = 0.0; + libMesh::Real Velocity_Correction_Sum = 0.0; + libMesh::Real Energy_Species_velocity_Sum=0.0; for ( unsigned int s=0; s< this->_n_species; s++ ) { - SpeciesGradSum += Grad_mass_fractions[s](0)/gas_evaluator.M(s); chem_term +=h[s]*omega_dot[s]; - Sum += rho*D[s]*Grad_mass_fractions[s](0)*Grad_T(0)*cp_s[s]; + Velocity_Correction_Sum += D[s]*Grad_mass_fractions[s](0); } for (unsigned int s =0; s < this->_n_species;s++) { - SpeciesSum+= D[s]*Grad_mass_fractions[s](0); - SpeciesSum-=M_mix*mass_fractions[s]*D[s]*SpeciesGradSum; + Energy_Species_velocity_Sum +=cp_s[s]*(Grad_mass_fractions[s](0)*D[s] - mass_fractions[s]*Velocity_Correction_Sum); } - + //Energy equation Residual for (unsigned int i=0;i != n_T_dofs; i++ ) { - FT(i) += ( ( -cp*M_dot *Grad_T(0) - chem_term + Sum )*T_phi[i][qp] - -k*Grad_T(0)*T_dphi[i][qp](0))*jac; + FT(i) += ( ( -cp * M_dot * Grad_T(0) - chem_term - rho * Grad_T(0) * Energy_Species_velocity_Sum ) * T_phi[i][qp] + - k * Grad_T(0) * T_dphi[i][qp](0))*jac; } @@ -381,12 +366,12 @@ namespace GRINS libMesh::DenseSubVector &Fs = context.get_elem_residual(this->_species_vars.species(s)); //R_{s} - const libMesh::Real term1 = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; - const libMesh::Real term2 = -rho*D[s]*Grad_mass_fractions[s](0)+M_mix*rho*D[s]*SpeciesGradSum*mass_fractions[s]+rho*mass_fractions[s]*SpeciesSum; + const libMesh::Real Normal_Term = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; + const libMesh::Real Weakend_Term = -rho*D[s]*Grad_mass_fractions[s](0)+rho*mass_fractions[s]*Velocity_Correction_Sum; for (unsigned int i =0;i != n_s_dofs;i++) { - Fs(i) += ( term1 * s_phi[i][qp] + term2 * s_dphi[i][qp](0) )*jac; + Fs(i) += ( Normal_Term * s_phi[i][qp] + Weakend_Term * s_dphi[i][qp](0) )*jac; } } } // end of quadrature loop @@ -396,10 +381,19 @@ namespace GRINS + + + + + + template void ODPremixedFlame::mass_residual (bool compute_jacobian, AssemblyContext & context ) { + if( compute_jacobian ) + libmesh_not_implemented(); + const VariableIndex s0_var = this->_species_vars.species(0); const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); @@ -432,12 +426,12 @@ namespace GRINS std::vector mass_fractions(this->n_species()); for(unsigned int s=0; s < this->_n_species; s++ ) { - mass_fractions[s] = context.interior_value(this->_species_vars.species(s), qp); + mass_fractions[s] = context.interior_value(this->_species_vars.species(s), qp); } Evaluator gas_evaluator(*(this-> _gas_mixture)); const libMesh::Real R_mix = gas_evaluator.R_mix(mass_fractions); - const libMesh::Real p0 = this->get_p0(); + const libMesh::Real p0 = this->_p0; const libMesh::Real rho = this->rho(T, p0, R_mix); const libMesh::Real cp = gas_evaluator.cp(T,p0,mass_fractions); @@ -464,13 +458,14 @@ namespace GRINS { F_T(i) -= rho*cp*T_dot*T_phi[i][qp]*jac; } - - if( compute_jacobian ) - libmesh_not_implemented(); - } // end Quadrature loop - } //end Mass Residual + } // end Mass Residual + + + + + @@ -505,25 +500,19 @@ namespace GRINS Fm(i) += dMdx(0)*M_phi[i][qp]*jac; } - /*if( context.get_elem().contains_point(_T_Fixed_Loc) ) - { - libMesh::Real T = context.point_value(this->_temp_vars.T(),_T_Fixed_Loc); - for(unsigned int qp=0; qp!=n_qpoints; qp++) - { - libMesh::Real jac = JxW[qp]; - - for(unsigned int i=0; i != n_M_dofs; i++) - Fm(i) += 1/(this->_Penalty_Tol) * (T - this->_T_Fixed) * M_phi[i][qp]*jac; - } - }*/ - } //end Element Constraint + + + + + template void ODPremixedFlame::side_time_derivative( bool compute_jacobian, AssemblyContext & context) - { if(compute_jacobian) + { + if(compute_jacobian) libmesh_not_implemented(); //Check if were on the right boundary, @@ -546,6 +535,14 @@ namespace GRINS libMesh::DenseSubVector & Fm = context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} + + + libMesh::DenseSubVector & Ft = context.get_elem_residual(this->_temp_vars.T()); + const unsigned int n_T_dofs = + context.get_dof_indices(this->_temp_vars.T()).size(); + const std::vector >& T_phi = + context.get_side_fe(this->_temp_vars.T())->get_phi(); + for(unsigned int qp=0; qp!=n_qpoints; qp++) { libMesh::Real jac = JxW[qp]; @@ -562,7 +559,7 @@ namespace GRINS M_dot = context.side_value(this->_mass_flux_vars.var(), qp); - p0 = this->get_p0(); + p0 = this->_p0; std::vector mass_fractions, h_i, h_u, D; @@ -575,7 +572,7 @@ namespace GRINS for (unsigned int s = 0; s < this->_n_species; s++) { mass_fractions[s] = std::max( context.side_value(this->_species_vars.species(s),qp),0.0); - h_i[s] = gas_evaluator.h_s( this->_Ti, s ); + h_i[s] = gas_evaluator.h_s( T, s ); h_u[s] = gas_evaluator.h_s( this->_Tu, s ); } //proccess to calculate k @@ -595,15 +592,28 @@ namespace GRINS for(unsigned int i=0; i != n_M_dofs; i++) { - + Fm(i) += (M_dot*Enth_Diff - k*Grad_T(0))*M_phi[i][qp]*jac; } + + /* for(unsigned int i =0; i !=n_T_dofs;i++) + { + Ft(i) -= M_dot*Enth_Diff*T_phi[i][qp]*jac; + }*/ } } } + + + + + + + + template void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, const AssemblyContext& context, @@ -616,7 +626,7 @@ namespace GRINS { std::vector Y( this->_n_species ); libMesh::Real T = this->T(point,context); - libMesh::Real p0 = this->get_p0(); + libMesh::Real p0 = this->_p0; this->mass_fractions( point, context, Y ); value = this->rho(T,p0, gas_evaluator.R_mix(Y) ); @@ -626,7 +636,7 @@ namespace GRINS std::vector Y(this->_n_species ); libMesh::Real T = this->T(point,context); this->mass_fractions( point,context, Y); - libMesh::Real p0 = this->get_p0(); + libMesh::Real p0 = this->_p0; libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); @@ -646,7 +656,7 @@ namespace GRINS std::vector Y( this->_n_species ); libMesh::Real T = this->T(point,context); this->mass_fractions( point, context, Y); - libMesh::Real p0 = this->get_p0(); + libMesh::Real p0 = this->_p0; value = gas_evaluator.cp( T, p0, Y ); } @@ -656,7 +666,7 @@ namespace GRINS std::vector Y( this->_n_species ); libMesh::Real T = this->T(point,context); - libMesh::Real p0 = this->get_p0(); + libMesh::Real p0 = this->_p0; this->mass_fractions( point, context, Y ); libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y)); @@ -672,7 +682,7 @@ namespace GRINS this->mass_fractions(point,context, Y ); - libMesh::Real p0 = this->get_p0(); + libMesh::Real p0 = this->_p0; libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); @@ -739,7 +749,7 @@ namespace GRINS libMesh::Real T = this->T(point,context); - libMesh::Real p0 = this->get_p0(); + libMesh::Real p0 = this->_p0; libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y) ); @@ -754,7 +764,7 @@ namespace GRINS if( !this->_Ds_index.empty() ) { - libmesh_assert_equal_to( _Ds_index.size(), this->n_species() ); + libmesh_assert_equal_to( _Ds_index.size(), this->_n_species ); for( unsigned int s = 0; s < this->n_species(); s++ ) { @@ -764,7 +774,7 @@ namespace GRINS libMesh::Real T = this->T(point,context); this->mass_fractions(point,context, Y ); - libMesh::Real p0 = this->get_p0(); + libMesh::Real p0 = this->_p0; libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); @@ -780,6 +790,25 @@ namespace GRINS } } } + if(!this-> _cp_s_index.empty() ) + { + libmesh_assert_equal_to( _cp_s_index.size(), this->n_species() ); + + for( unsigned int s =0; s< n_species(); s++) + { + if(quantity_index == this->_Ds_index[s] ) + { + std::vector cp_s(this->_n_species); + std::vector Y(this->_n_species); + libMesh::Real P = this->_p0; + libMesh::Real T = this->T(point,context); + this->mass_fractions(point,context, Y); + gas_evaluator.cp_s(T,P,Y,cp_s); + value = cp_s[s]; + return; + } + } + } }//if/else quantity_index return; From 04158ccabe8939fb86b3f4beecf4ffd96651e10b Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Fri, 24 Aug 2018 11:50:43 -0400 Subject: [PATCH 33/41] Copied and paster postprocessing procedure for cp_s and forgot to change the name, this fixes that --- src/physics/src/od_premixed_flame.C | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 00184be09..22a66d3a3 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -590,16 +590,12 @@ namespace GRINS Enth_Diff += _Inflow_Species[s]*(h_i[s]-h_u[s]); } - for(unsigned int i=0; i != n_M_dofs; i++) + for(unsigned int i=0; i != n_M_dofs; i++) { Fm(i) += (M_dot*Enth_Diff - k*Grad_T(0))*M_phi[i][qp]*jac; - } + } - /* for(unsigned int i =0; i !=n_T_dofs;i++) - { - Ft(i) -= M_dot*Enth_Diff*T_phi[i][qp]*jac; - }*/ } } } @@ -796,7 +792,7 @@ namespace GRINS for( unsigned int s =0; s< n_species(); s++) { - if(quantity_index == this->_Ds_index[s] ) + if(quantity_index == this->_cp_s_index[s] ) { std::vector cp_s(this->_n_species); std::vector Y(this->_n_species); From 3bbed642f97a69d7aa021b34d7bc28ac5bf973aa Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Thu, 27 Sep 2018 13:50:58 -0400 Subject: [PATCH 34/41] Reworking of the Flames speed to pull M at a specific point, will be changed later to have it be inputted --- src/qoi/include/grins/flame_speed.h | 46 ++++++-------- src/qoi/src/flame_speed.C | 99 ++++++++++++----------------- src/qoi/src/qoi_factory.C | 19 +++--- 3 files changed, 68 insertions(+), 96 deletions(-) diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h index 0b0cbb163..9fd82e01a 100644 --- a/src/qoi/include/grins/flame_speed.h +++ b/src/qoi/include/grins/flame_speed.h @@ -42,19 +42,19 @@ namespace GRINS public: FlameSpeed(const std::string& qoi_name); - + virtual ~FlameSpeed(); - + virtual QoIBase* clone() const; - + virtual bool assemble_on_interior() const; - + virtual bool assemble_on_sides() const; - - virtual void side_qoi( AssemblyContext& context, - const unsigned int qoi_index ); - - + + virtual void element_qoi( AssemblyContext& context, + const unsigned int qoi_index); + + virtual void init( const GetPot& input, const MultiphysicsSystem& system, @@ -63,25 +63,17 @@ namespace GRINS virtual void init_context( AssemblyContext& context ); libMesh::Real M_dot( const libMesh::Point& p, const AssemblyContext& c ) const; - void mass_fractions( const libMesh::Point& p, const AssemblyContext& c, - std::vector& mass_fracs ) const; - - protected: void parse_Pressure( const GetPot& input); - const PrimitiveTempFEVariables * _temp_vars; const SingleVariable * _mass_flux_vars; - const SpeciesMassFractionsVariable * _species_vars; - - libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; - //! List of boundary ids for which we want to compute this QoI - std::set _bc_ids; + std::vector Mass_Fractions; + + libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; - std::shared_ptr _chemistry; libMesh::Real _P0; @@ -103,27 +95,27 @@ namespace GRINS value = p0/(R_mix*T); return value; } - + template< typename Chemistry> inline libMesh::Real FlameSpeed::M_dot( const libMesh::Point& p, const AssemblyContext& c ) const { return c.point_value(_mass_flux_vars->var(),p); } - - + + template< typename Chemistry> inline bool FlameSpeed::assemble_on_interior() const { - return false; + return true; } template< typename Chemistry> inline bool FlameSpeed::assemble_on_sides() const { - return true; + return false; } - - + + } #endif //GRINS_Flame_Speed_H diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C index 978c38c67..e577c4baf 100644 --- a/src/qoi/src/flame_speed.C +++ b/src/qoi/src/flame_speed.C @@ -26,9 +26,17 @@ // This class #include "grins/flame_speed.h" + // GRINS #include "grins/variable_warehouse.h" #include "grins/chemistry_builder.h" +#include "grins/physics.h" + +// libMesh +#include "libmesh/string_to_enum.h" +#include "libmesh/quadrature.h" +#include "libmesh/fem_system.h" +#include "libmesh/elem.h" #if GRINS_HAVE_ANTIOCH #include "grins/antioch_chemistry.h" @@ -42,7 +50,7 @@ namespace GRINS { template< typename Chemistry> FlameSpeed::FlameSpeed( const std::string& qoi_name) - : QoIBase(qoi_name) + : QoIBase(qoi_name) { return; } @@ -56,7 +64,6 @@ namespace GRINS template< typename Chemistry> QoIBase* FlameSpeed::clone() const { - //libmesh_not_implemented(); return new FlameSpeed(*this); } @@ -69,36 +76,29 @@ namespace GRINS { //grab the pressure value this->parse_Pressure(input); + //grab the unburnt temperature value this->set_parameter ( _T_unburnt, input,"QoI/FlameSpeed/Unburnt_Temperature" , -1.0 ); + + + //figure out the chemistry std::string material = input("QoI/FlameSpeed/material","DIE!"); _chemistry.reset( new Chemistry(input,material)); - - // Read boundary ids for which we want to compute, and make sure they are specified - int num_bcs = input.vector_variable_size("QoI/FlameSpeed/bc_ids"); - - if( num_bcs <= 0 ) - { - std::cerr << "Error: Must specify at least one boundary id to compute" - << " Flame Speed" << std::endl - << "Found: " << num_bcs << std::endl; - libmesh_error(); - } - //insert the boundary id specified - for( int i = 0; i < num_bcs; i++ ) - { - _bc_ids.insert( input("QoI/FlameSpeed/bc_ids", -1, i ) ); - } + //For a one dimensional premixed flame, the unburnt species values have to already be + //specified for the physics, grabbing those values. + Mass_Fractions.resize(this->_chemistry->n_species()); + for (unsigned int s = 0; s < this->_chemistry->n_species(); s++) + { + this->set_parameter(Mass_Fractions[s], input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/" + +_chemistry->species_name(s), 0.0); + } - //Set our Vaiables and number of species - _temp_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); + //Set our Vaiables _mass_flux_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); - _species_vars= &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); - } - + } @@ -107,62 +107,41 @@ namespace GRINS template< typename Chemistry> void FlameSpeed::init_context( AssemblyContext& context ) { - libMesh::FEBase* T_fe; + libMesh::FEBase* M_fe; - context.get_side_fe(this->_temp_vars->T(), T_fe); + context.get_element_fe(this->_mass_flux_vars->var(), M_fe); - T_fe->get_dphi(); - T_fe->get_JxW(); + M_fe->get_dphi(); + M_fe->get_JxW(); + M_fe->get_xyz(); return; } - - //############################################################################################################### - template< typename Chemistry> - void FlameSpeed::side_qoi( AssemblyContext& context, - const unsigned int qoi_index ) + void FlameSpeed::element_qoi( AssemblyContext & context, + const unsigned qoi_index) { - bool on_correct_side = false; - - for (std::set::const_iterator id = - _bc_ids.begin(); id != _bc_ids.end(); id++ ) - if( context.has_side_boundary_id( (*id) ) ) - { - on_correct_side = true; - break; - } - - if (!on_correct_side) - return; - - libMesh::Number& qoi = context.get_qois()[qoi_index]; - libMesh::Real p0 = this->_P0; - libMesh::Real Mdot = context.side_value(this->_mass_flux_vars->var(),0); - - std::vector mass_fractions; - mass_fractions.resize(this->_species_vars->n_species()); - for (unsigned int s=0; s < this->_species_vars->n_species(); s++) + if(context.get_elem().contains_point(0.01) ) //if were at 1 cm off the boundary { - mass_fractions[s] = context.side_value(this->_species_vars->species(s),0); - } - libMesh::Real Rmix = _chemistry->R_mix(mass_fractions); - - qoi += Mdot/(this->rho(_T_unburnt,p0, Rmix)); - } //end side_qoi + libMesh::Number& qoi = context.get_qois()[qoi_index]; + libMesh::Real p0 = this->_P0; + libMesh::Real Mdot = context.point_value(this->_mass_flux_vars->var(),0.01); - //########################################################################################################### + libMesh::Real Rmix = _chemistry->R_mix(Mass_Fractions); + qoi += Mdot/(this->rho(_T_unburnt,p0, Rmix)); + } + } template< typename Chemistry> void FlameSpeed::parse_Pressure( const GetPot& input) { //grab where the value is located in input file std::string material = input("QoI/FlameSpeed/material", "NoMaterial!"); - + if( input.have_variable("Materials/"+material+"/ThermodynamicPressure/value") ) { this->set_parameter diff --git a/src/qoi/src/qoi_factory.C b/src/qoi/src/qoi_factory.C index ceb5c66a2..a9c270f5f 100644 --- a/src/qoi/src/qoi_factory.C +++ b/src/qoi/src/qoi_factory.C @@ -105,7 +105,7 @@ namespace GRINS qoi = new AverageNusseltNumber( avg_nusselt ); } - + else if( qoi_name == parsed_boundary ) { qoi = new ParsedBoundaryQoI( parsed_boundary ); @@ -128,16 +128,17 @@ namespace GRINS else if ( qoi_name == flame_speed ) { + std::string material = input("QoI/FlameSpeed/material","NONE"); + std::string ChemistryModel = input("Materials/" + material + "/GasMixture/thermochemistry_library", "none" ); + if(ChemistryModel == "antioch") + qoi = new FlameSpeed( flame_speed); + else if(ChemistryModel == "cantera") + qoi = new FlameSpeed(flame_speed); -#if GRINS_HAVE_ANTIOCH - qoi = new FlameSpeed( flame_speed); -#elif GRINS_HAVE_CANTERA - qoi = new FlameSpeed(flame_speed); -#else - libmesh_error_msg("ERROR: GRINS must be built with either Antioch or Cantera to use the SpectroscopicAbsorption QoI"); -#endif + else + libmesh_error_msg("ERROR: Must Specify material name in the flamespeed qoi section, and make sure the thermochemistry_library is either: 'cantera' or 'antioch'."); } - + else if( qoi_name == integrated_function ) { std::string function; From c88f902eba7af5b30e7790059f1b82011d6f14a5 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Thu, 14 Mar 2019 10:03:59 -0400 Subject: [PATCH 35/41] Adding a quick flame temperature qoi --- src/Makefile.am | 2 + .../grins/adiabiatic_flame_temperature.h | 95 ++++++++++++++++++ src/qoi/include/grins/qoi_names.h | 1 + src/qoi/src/adiabiatic_flame_temperature.C | 99 +++++++++++++++++++ src/qoi/src/qoi_factory.C | 6 +- 5 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 src/qoi/include/grins/adiabiatic_flame_temperature.h create mode 100644 src/qoi/src/adiabiatic_flame_temperature.C diff --git a/src/Makefile.am b/src/Makefile.am index 92700eb31..c691952b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -201,6 +201,7 @@ libgrins_la_SOURCES += qoi/src/hitran.C libgrins_la_SOURCES += qoi/src/absorption_coeff.C libgrins_la_SOURCES += qoi/src/spectroscopic_absorption.C libgrins_la_SOURCES += qoi/src/flame_speed.C +libgrins_la_SOURCES += qoi/src/adiabiatic_flame_temperature.C # src/solver files libgrins_la_SOURCES += solver/src/solver.C @@ -507,6 +508,7 @@ include_HEADERS += qoi/include/grins/absorption_coeff.h include_HEADERS += qoi/include/grins/spectroscopic_absorption.h include_HEADERS += qoi/include/grins/fem_function_and_derivative_base.h include_HEADERS += qoi/include/grins/flame_speed.h +include_HEADERS += qoi/include/grins/adiabiatic_flame_temperature.h # src/solver headers include_HEADERS += solver/include/grins/solver.h include_HEADERS += solver/include/grins/mesh_builder.h diff --git a/src/qoi/include/grins/adiabiatic_flame_temperature.h b/src/qoi/include/grins/adiabiatic_flame_temperature.h new file mode 100644 index 000000000..c9ce38453 --- /dev/null +++ b/src/qoi/include/grins/adiabiatic_flame_temperature.h @@ -0,0 +1,95 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// GRINS - General Reacting Incompressible Navier-Stokes +// +// Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner +// Copyright (C) 2010-2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + + +#ifndef ADIABIATIC_FLAME_TEMPERATURE_H +#define ADIABIATIC_FLAME_TEMPERATURE_H + +// GRINS +#include "grins/qoi_base.h" + +#include "grins/multiphysics_sys.h" +#include "grins/single_variable.h" +#include "grins/multicomponent_variable.h" + +namespace GRINS +{ + class PrimitiveTempFEVariables; + class AdiabiaticFlameTemperature : public QoIBase + { + public: + + AdiabiaticFlameTemperature(const std::string& qoi_name); + + virtual ~AdiabiaticFlameTemperature(); + + virtual QoIBase* clone() const; + + virtual bool assemble_on_interior() const; + + virtual bool assemble_on_sides() const; + + virtual void element_qoi( AssemblyContext& context, + const unsigned int qoi_index); + + + + virtual void init( const GetPot& input, + const MultiphysicsSystem& system, + unsigned int qoi_num ); + + virtual void init_context( AssemblyContext& context ); + + libMesh::Real T( const libMesh::Point& p, const AssemblyContext& c ) const; + protected: + const PrimitiveTempFEVariables * _temp_vars; + + private: + + AdiabiaticFlameTemperature(); + + }; + + inline + libMesh::Real AdiabiaticFlameTemperature::T( const libMesh::Point& p, + const AssemblyContext& c ) const + { return c.point_value(_temp_vars->var(),p); } + + + + inline + bool AdiabiaticFlameTemperature::assemble_on_interior() const + { + return true; + } + + inline + bool AdiabiaticFlameTemperature::assemble_on_sides() const + { + return false; + } + + +} +#endif //GRINS_ADIABIATIC_FLAME_TEMPERATURE_H diff --git a/src/qoi/include/grins/qoi_names.h b/src/qoi/include/grins/qoi_names.h index 91bbced8a..11d8c2e68 100644 --- a/src/qoi/include/grins/qoi_names.h +++ b/src/qoi/include/grins/qoi_names.h @@ -35,5 +35,6 @@ namespace GRINS const std::string integrated_function = "integrated_function"; const std::string spectroscopic_absorption = "spectroscopic_absorption"; const std::string flame_speed = "flame_speed"; + const std::string adiabiatic_flame_temperature = "adiabiatic_flame_temperature"; } #endif //GRINS_QOI_NAMES_H diff --git a/src/qoi/src/adiabiatic_flame_temperature.C b/src/qoi/src/adiabiatic_flame_temperature.C new file mode 100644 index 000000000..3949a8895 --- /dev/null +++ b/src/qoi/src/adiabiatic_flame_temperature.C @@ -0,0 +1,99 @@ +//-----------------------------------------------------------------------bl- +//-------------------------------------------------------------------------- +// +// GRINS - General Reacting Incompressible Navier-Stokes +// +// Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner +// Copyright (C) 2010-2013 The PECOS Development Team +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the Version 2.1 GNU Lesser General +// Public License as published by the Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc. 51 Franklin Street, Fifth Floor, +// Boston, MA 02110-1301 USA +// +//-----------------------------------------------------------------------el- + + +// This class +#include "grins/adiabiatic_flame_temperature.h" + + +// GRINS +#include "grins/variable_warehouse.h" +#include "grins/chemistry_builder.h" +#include "grins/physics.h" + +// libMesh +#include "libmesh/string_to_enum.h" +#include "libmesh/quadrature.h" +#include "libmesh/fem_system.h" +#include "libmesh/elem.h" + + +namespace GRINS +{ + AdiabiaticFlameTemperature::AdiabiaticFlameTemperature( const std::string& qoi_name) + : QoIBase(qoi_name) + { + return; + } + + AdiabiaticFlameTemperature::~AdiabiaticFlameTemperature() + { + return; + } + + QoIBase* AdiabiaticFlameTemperature::clone() const + { + return new AdiabiaticFlameTemperature(*this); + } + + + void AdiabiaticFlameTemperature::init + (const GetPot& input, + const MultiphysicsSystem& /*system*/, + unsigned int /*qoi_num*/ ) + { + _temp_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,std::string("AdiabiaticFlameTemperature"),VariablesParsing::QOI)); + } + + + + + ///Probaly NEED CHANGING OF SOME KIND + void AdiabiaticFlameTemperature::init_context( AssemblyContext& context ) + { + libMesh::FEBase* T_fe; + + context.get_element_fe(this->_temp_vars->var(), T_fe); + + T_fe->get_dphi(); + T_fe->get_JxW(); + T_fe->get_xyz(); + + return; + } + + void AdiabiaticFlameTemperature::element_qoi( AssemblyContext & context, + const unsigned qoi_index) + { + if(context.get_elem().contains_point(0.01) ) //if were at 1 cm off the boundary + { + + libMesh::Number& qoi = context.get_qois()[qoi_index]; + libMesh::Real T = context.point_value(this->_temp_vars->var(),0.01); + qoi += T; + } + } + + +} //namespace GRINS diff --git a/src/qoi/src/qoi_factory.C b/src/qoi/src/qoi_factory.C index a9c270f5f..e5ee66b35 100644 --- a/src/qoi/src/qoi_factory.C +++ b/src/qoi/src/qoi_factory.C @@ -40,6 +40,7 @@ #include "grins/spectroscopic_absorption.h" #include "grins/chemistry_builder.h" #include "grins/flame_speed.h" +#include "grins/adiabiatic_flame_temperature.h" #if GRINS_HAVE_ANTIOCH #include "grins/antioch_chemistry.h" @@ -134,11 +135,14 @@ namespace GRINS qoi = new FlameSpeed( flame_speed); else if(ChemistryModel == "cantera") qoi = new FlameSpeed(flame_speed); - else libmesh_error_msg("ERROR: Must Specify material name in the flamespeed qoi section, and make sure the thermochemistry_library is either: 'cantera' or 'antioch'."); } + else if ( qoi_name == adiabiatic_flame_temperature ) + { + qoi = new AdiabiaticFlameTemperature(adiabiatic_flame_temperature); + } else if( qoi_name == integrated_function ) { std::string function; From bfbd5a24dcb9582b65efc55c434e33730fbcd833 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Mon, 1 Apr 2019 12:05:25 -0400 Subject: [PATCH 36/41] adding a ease of life output, to make sure the unburnt conditions were reading right, and be able to be able to read during runtime if you were inputting the wrong species in the input file --- src/physics/src/od_premixed_flame.C | 303 ++++++++++++++-------------- 1 file changed, 150 insertions(+), 153 deletions(-) diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 22a66d3a3..3c0e02668 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -39,19 +39,19 @@ namespace GRINS _fixed_rho_value(0.0), _gas_mixture(gas_mix.release()), _rho_index(0), - _k_index(0), + _k_index(0), _cp_index(0), _u_index(0), _mu_index(0) { - this->set_parameter + this->set_parameter (_fixed_rho_value, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); //Parsing the Unburnt Temperature - this->set_parameter(_Tu, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"/Unburnt_Temperature", 0.0); + this->set_parameter(_Tu, input, + "Physics/"+PhysicsNaming::od_premixed_flame()+"/Unburnt_Temperature", 0.0); if(_Tu ==0) { std::cout << "Unburnt gas Temperature not set in the input!!" << std::endl; @@ -60,14 +60,16 @@ namespace GRINS //Initial Inflow Equivalence ratio _Inflow_Species.resize(this->_n_species); + std::cout << std::endl; for (unsigned int s = 0; s < this->_n_species; s++) { this->set_parameter(_Inflow_Species[s], input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/" - +_gas_mixture->species_name(s), 0.0); + +_gas_mixture->species_name(s), 0.0); + std::cout << "Y_" + _gas_mixture->species_name(s) + " = " << _Inflow_Species[s] << " \n"; } - + this->read_input_options(input); - + this->check_var_subdomain_consistency(_mass_flux_vars); this->check_var_subdomain_consistency(_temp_vars); this->check_var_subdomain_consistency(_species_vars); @@ -75,7 +77,7 @@ namespace GRINS this->_ic_handler = new GenericICHandler( physics_name, input ); } - //Reading and setting the Thermodynamic Pressure + //Reading and setting the Thermodynamic Pressure template void ODPremixedFlame::read_input_options( const GetPot& input ) { @@ -97,7 +99,7 @@ namespace GRINS template void ODPremixedFlame::set_time_evolving_vars( libMesh::FEMSystem* system ) - { + { for( unsigned int i = 0; i < this->_n_species; i++ ) { system->time_evolving( _species_vars.species(i), 1 ); @@ -106,7 +108,7 @@ namespace GRINS } template - void ODPremixedFlame::init_context( AssemblyContext& context ) + void ODPremixedFlame::init_context( AssemblyContext& context ) { // We should prerequest all the data // we will need to build the linear system @@ -120,7 +122,7 @@ namespace GRINS context.get_element_fe(_mass_flux_vars.var())->get_phi(); context.get_element_fe(_mass_flux_vars.var())->get_dphi(); context.get_element_fe(_mass_flux_vars.var())->get_xyz(); - + context.get_element_fe(_temp_vars.T())->get_JxW(); context.get_element_fe(_temp_vars.T())->get_phi(); context.get_element_fe(_temp_vars.T())->get_dphi(); @@ -138,14 +140,14 @@ namespace GRINS context.get_side_fe(this->_temp_vars.T())->get_phi(); context.get_side_fe(this->_temp_vars.T())->get_dphi(); context.get_side_fe(this->_temp_vars.T())->get_xyz(); - } + } template void ODPremixedFlame::register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing ) { std::string section = "Physics/"+PhysicsNaming::od_premixed_flame()+"/output_vars"; - + if( input.have_variable(section) ) { unsigned int n_vars = input.vector_variable_size(section); @@ -153,12 +155,12 @@ namespace GRINS for( unsigned int v=0; v _rho_index = postprocessing.register_quantity( name ); } - else if( name == std::string("k") ) + else if( name == std::string("k") ) { this->_k_index = postprocessing.register_quantity( name ); } @@ -179,7 +181,7 @@ namespace GRINS else if(name == std::string("mole_fractions") ) { this ->_mole_fractions_index.resize(this->n_species()); - + for(unsigned int s=0; s < this->n_species(); s++) { this->_mole_fractions_index[s] = postprocessing.register_quantity("X_"+this->_gas_mixture->species_name(s) ); @@ -188,7 +190,7 @@ namespace GRINS else if(name == std::string("h_s") ) { this->_h_s_index.resize(this->n_species()); - + for(unsigned int s=0; s < this->n_species(); s++) { this->_h_s_index[s] = postprocessing.register_quantity( "h_"+this->_gas_mixture->species_name(s) ); @@ -197,7 +199,7 @@ namespace GRINS else if(name == std::string("omega_dot") ) { this->_omega_dot_index.resize(this->n_species()); - + for(unsigned int s=0; s < this->n_species(); s++) { this->_omega_dot_index[s] = postprocessing.register_quantity( "omega_dot_"+this->_gas_mixture->species_name(s) ); @@ -206,17 +208,17 @@ namespace GRINS else if( name == std::string("D_s") ) { this->_Ds_index.resize(this->n_species()); - + for(unsigned int s=0;s < this->n_species(); s++) { this->_Ds_index[s] = postprocessing.register_quantity( "D_"+this->_gas_mixture->species_name(s) ); } } - + else if( name == std::string("cp_s") ) { this->_cp_s_index.resize(this->n_species()); - + for(unsigned int s=0;s < this->n_species(); s++) { this ->_cp_s_index[s] = postprocessing.register_quantity( "cp_"+this->_gas_mixture->species_name(s) ); @@ -240,10 +242,10 @@ namespace GRINS } } } - + return; } //end post processing vars - + @@ -253,42 +255,42 @@ namespace GRINS template void ODPremixedFlame::element_time_derivative ( bool compute_jacobian, AssemblyContext & context ) - { + { if( compute_jacobian ) libmesh_not_implemented(); - + //Convenience const VariableIndex s0_var = this->_species_vars.species(0); - - // The number of local degrees of freedom in each variable + + // The number of local degrees of freedom in each variable const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); - + // Element Jacobian * quadrature weights for interior integration. const std::vector& JxW = context.get_element_fe(this->_temp_vars.T())->get_JxW(); - + //the species shape function at interior quadrature points. const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); - + //the species shape function gradients at interior quadrature points. const std::vector > & s_dphi = context.get_element_fe(s0_var)->get_dphi(); - + // The temperature shape functions at interior quadrature points. const std::vector >& T_phi = context.get_element_fe(this->_temp_vars.T())->get_phi(); - + // The temperature shape functions gradients at interior quadrature points. const std::vector >& T_dphi = - context.get_element_fe(this->_temp_vars.T())->get_dphi(); - - + context.get_element_fe(this->_temp_vars.T())->get_dphi(); + + libMesh::DenseSubVector &FT = context.get_elem_residual(this->_temp_vars.T()); // R_{T} - + //species set in residual calculations since the need of a for loop - + unsigned int n_qpoints = context.get_element_qrule().n_points(); - + for(unsigned int qp = 0;qp != n_qpoints;qp++) { libMesh::Real T, M_dot; @@ -299,15 +301,15 @@ namespace GRINS T = context.interior_value(this->_temp_vars.T(),qp); Grad_T = context.interior_gradient(this->_temp_vars.T(), qp); - + M_dot = context.interior_value(this->_mass_flux_vars.var(), qp); - + p0 = this->_p0; - - + + std::vector mass_fractions, h, D, omega_dot, cp_s; std::vector Grad_mass_fractions; - + mass_fractions.resize(this->_n_species); Grad_mass_fractions.resize(this->_n_species); h.resize(this->_n_species); @@ -318,62 +320,64 @@ namespace GRINS Grad_mass_fractions[s] = context.interior_gradient(this->_species_vars.species(s),qp); h[s] = gas_evaluator.h_s( T, s ); } - + R = gas_evaluator.R_mix( mass_fractions ); - + rho = this->rho( T, p0, R ); - + cp = gas_evaluator.cp( T, p0, mass_fractions); - + D.resize(this->_n_species); - - gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, + + gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, mu, k, D ); - + omega_dot.resize(this->_n_species); gas_evaluator.omega_dot( T, rho, mass_fractions, omega_dot ); - + gas_evaluator.cp_s(T, p0, mass_fractions, cp_s); libMesh::Real jac = JxW[qp]; - + libMesh::Real chem_term = 0.0; - libMesh::Real Velocity_Correction_Sum = 0.0; - libMesh::Real Energy_Species_velocity_Sum=0.0; + + libMesh::Real Velocity_Correction_Sum = 0.0; + libMesh::Real Energy_Diffusive_Flux_Sum = 0.0; for ( unsigned int s=0; s< this->_n_species; s++ ) { chem_term +=h[s]*omega_dot[s]; - Velocity_Correction_Sum += D[s]*Grad_mass_fractions[s](0); + Velocity_Correction_Sum +=Grad_mass_fractions[s](0)*D[s]; } - for (unsigned int s =0; s < this->_n_species;s++) - { - Energy_Species_velocity_Sum +=cp_s[s]*(Grad_mass_fractions[s](0)*D[s] - mass_fractions[s]*Velocity_Correction_Sum); - } - - //Energy equation Residual - for (unsigned int i=0;i != n_T_dofs; i++ ) - { - FT(i) += ( ( -cp * M_dot * Grad_T(0) - chem_term - rho * Grad_T(0) * Energy_Species_velocity_Sum ) * T_phi[i][qp] - - k * Grad_T(0) * T_dphi[i][qp](0))*jac; - - } - + std::vector< libMesh::Real > Diffusive_Flux; + Diffusive_Flux.resize(this->_n_species); + //Species equation Residuals for (unsigned int s = 0; s < _n_species; s++) { libMesh::DenseSubVector &Fs = context.get_elem_residual(this->_species_vars.species(s)); //R_{s} - + const libMesh::Real Normal_Term = -M_dot*Grad_mass_fractions[s](0) + omega_dot[s]; - const libMesh::Real Weakend_Term = -rho*D[s]*Grad_mass_fractions[s](0)+rho*mass_fractions[s]*Velocity_Correction_Sum; - + + //Need diffusive velocities to be summed over for the energy equation + Diffusive_Flux[s] = rho*(mass_fractions[s]*Velocity_Correction_Sum -D[s]*Grad_mass_fractions[s](0)); + Energy_Diffusive_Flux_Sum += cp_s[s]*Diffusive_Flux[s]; for (unsigned int i =0;i != n_s_dofs;i++) { - Fs(i) += ( Normal_Term * s_phi[i][qp] + Weakend_Term * s_dphi[i][qp](0) )*jac; + Fs(i) += ( Normal_Term * s_phi[i][qp] + Diffusive_Flux[s] * s_dphi[i][qp](0) )*jac; } } + + //Energy equation Residual + for (unsigned int i=0 ;i != n_T_dofs; i++ ) + { + FT(i) += ( ( -cp * M_dot * Grad_T(0) - chem_term - Grad_T(0) * Energy_Diffusive_Flux_Sum ) * T_phi[i][qp] + - k * Grad_T(0) * T_dphi[i][qp](0))*jac; + + } + } // end of quadrature loop return; } // end element time derivative @@ -391,36 +395,36 @@ namespace GRINS void ODPremixedFlame::mass_residual (bool compute_jacobian, AssemblyContext & context ) { - if( compute_jacobian ) + if( compute_jacobian ) libmesh_not_implemented(); - + const VariableIndex s0_var = this->_species_vars.species(0); const unsigned int n_s_dofs = context.get_dof_indices(s0_var).size(); const unsigned int n_T_dofs = context.get_dof_indices(this->_temp_vars.T()).size(); - - + + // Element Jacobian * quadrature weights for interior integration. const std::vector& JxW = context.get_element_fe(this->_temp_vars.T())->get_JxW(); - + //the species shape function at interior quadrature points. const std::vector > & s_phi = context.get_element_fe(s0_var)->get_phi(); - + // The temperature shape functions at interior quadrature points. const std::vector >& T_phi = context.get_element_fe(this->_temp_vars.T())->get_phi(); - + //The subvectors and submatrices we need to fill: libMesh::DenseSubVector &F_T = context.get_elem_residual(this->_temp_vars.T()); //Get the number of quadrature points unsigned int n_qpoints = context.get_element_qrule().n_points(); - + for (unsigned int qp = 0; qp != n_qpoints; ++qp) { libMesh::Real T_dot; context.interior_rate(this->_temp_vars.T(), qp, T_dot); - + libMesh::Real T = context.interior_value(this->_temp_vars.T(), qp); std::vector mass_fractions(this->n_species()); @@ -436,7 +440,7 @@ namespace GRINS const libMesh::Real cp = gas_evaluator.cp(T,p0,mass_fractions); libMesh::Real jac = JxW[qp]; - + // Species residual for(unsigned int s=0; s < this->n_species(); s++) { @@ -451,9 +455,9 @@ namespace GRINS F_s(i) -= rho*mass_fractions_dot*s_phi[i][qp]*jac; } } - + //Energy Residual - + for (unsigned int i = 0; i!= n_T_dofs; i++) { F_T(i) -= rho*cp*T_dot*T_phi[i][qp]*jac; @@ -475,17 +479,17 @@ namespace GRINS { if(compute_jacobian) libmesh_not_implemented(); - + const std::vector &JxW = context.get_element_fe(this->_temp_vars.T())->get_JxW(); - + // The Mass Flux shape functions at interior quadrature points. const std::vector >& M_phi = context.get_element_fe(this->_mass_flux_vars.var())->get_phi(); const unsigned int n_M_dofs = context.get_dof_indices(this->_mass_flux_vars.var()).size(); - + libMesh::DenseSubVector & Fm = context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} @@ -495,8 +499,8 @@ namespace GRINS { libMesh::Gradient dMdx = context.interior_gradient(this->_mass_flux_vars.var(), qp); libMesh::Real jac = JxW[qp]; - - for(unsigned int i=0; i != n_M_dofs; i++) + + for(unsigned int i=0; i != n_M_dofs; i++) Fm(i) += dMdx(0)*M_phi[i][qp]*jac; } @@ -511,17 +515,17 @@ namespace GRINS template void ODPremixedFlame::side_time_derivative( bool compute_jacobian, AssemblyContext & context) - { + { if(compute_jacobian) libmesh_not_implemented(); - + //Check if were on the right boundary, //TODO:: make this specified in input file probably if( context.has_side_boundary_id( 0 )) { const std::vector &JxW = context.get_side_fe(this->_temp_vars.T())->get_JxW(); - + // The Mass Flux shape functions at interior quadrature points. const std::vector >& M_phi = context.get_side_fe(this->_mass_flux_vars.var())->get_phi(); @@ -536,13 +540,6 @@ namespace GRINS context.get_elem_residual(this->_mass_flux_vars.var()); // R_{M} - - libMesh::DenseSubVector & Ft = context.get_elem_residual(this->_temp_vars.T()); - const unsigned int n_T_dofs = - context.get_dof_indices(this->_temp_vars.T()).size(); - const std::vector >& T_phi = - context.get_side_fe(this->_temp_vars.T())->get_phi(); - for(unsigned int qp=0; qp!=n_qpoints; qp++) { libMesh::Real jac = JxW[qp]; @@ -550,25 +547,25 @@ namespace GRINS //Defining and grabbing all the variables we'll need libMesh::Real T, M_dot; libMesh::Gradient Grad_T; - + libMesh::Real R, k, cp, rho, p0, mu; Evaluator gas_evaluator( *(this->_gas_mixture) ); - + T = context.side_value(this->_temp_vars.T(),qp); Grad_T = context.side_gradient(this->_temp_vars.T(), qp); - + M_dot = context.side_value(this->_mass_flux_vars.var(), qp); - + p0 = this->_p0; - + std::vector mass_fractions, h_i, h_u, D; - + mass_fractions.resize(this->_n_species); h_i.resize(this->_n_species); h_u.resize(this->_n_species); - - - + + + for (unsigned int s = 0; s < this->_n_species; s++) { mass_fractions[s] = std::max( context.side_value(this->_species_vars.species(s),qp),0.0); @@ -580,7 +577,7 @@ namespace GRINS rho = this->rho( T, p0, R ); cp = gas_evaluator.cp( T, p0, mass_fractions); D.resize(this->_n_species); - gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, + gas_evaluator.mu_and_k_and_D( T, rho, cp, mass_fractions, mu, k, D ); //Solve our loop over species @@ -589,10 +586,10 @@ namespace GRINS { Enth_Diff += _Inflow_Species[s]*(h_i[s]-h_u[s]); } - + for(unsigned int i=0; i != n_M_dofs; i++) { - + Fm(i) += (M_dot*Enth_Diff - k*Grad_T(0))*M_phi[i][qp]*jac; } @@ -600,7 +597,7 @@ namespace GRINS } } - + @@ -611,7 +608,7 @@ namespace GRINS template - void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, + void ODPremixedFlame::compute_postprocessed_quantity( unsigned int quantity_index, const AssemblyContext& context, const libMesh::Point& point, libMesh::Real & value ) @@ -624,7 +621,7 @@ namespace GRINS libMesh::Real T = this->T(point,context); libMesh::Real p0 = this->_p0; this->mass_fractions( point, context, Y ); - + value = this->rho(T,p0, gas_evaluator.R_mix(Y) ); } else if( quantity_index == this->_k_index ) @@ -633,14 +630,14 @@ namespace GRINS libMesh::Real T = this->T(point,context); this->mass_fractions( point,context, Y); libMesh::Real p0 = this->_p0; - + libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); - + libMesh::Real rho = this->rho(T, p0, gas_evaluator.R_mix(Y) ); std::vector D(this->_n_species); libMesh::Real mu,k; - + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); @@ -653,7 +650,7 @@ namespace GRINS libMesh::Real T = this->T(point,context); this->mass_fractions( point, context, Y); libMesh::Real p0 = this->_p0; - + value = gas_evaluator.cp( T, p0, Y ); } else if ( quantity_index == this->_u_index ) @@ -667,59 +664,59 @@ namespace GRINS libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y)); value = M_dot/rho; - + } else if ( quantity_index == this->_mu_index ) { - + std::vector Y( this->_n_species ); - + libMesh::Real T = this->T(point,context); - + this->mass_fractions(point,context, Y ); - + libMesh::Real p0 = this->_p0; - + libMesh::Real cp = gas_evaluator.cp( T, p0, Y ); - + libMesh::Real rho = this->rho( T, p0, gas_evaluator.R_mix(Y) ); - + libMesh::Real mu, k; std::vector D( this->_n_species ); - + gas_evaluator.mu_and_k_and_D( T, rho, cp, Y, mu, k, D ); - + value = mu; return; } - + //now onto the species dependent stuff - - else + + else { if( !this->_mole_fractions_index.empty() ) { libmesh_assert_equal_to( _mole_fractions_index.size(), this->n_species() ); - + for( unsigned int s = 0; s < this->n_species(); s++ ) { if( quantity_index == this->_mole_fractions_index[s] ) { std::vector Y( this->_n_species ); this->mass_fractions( point, context, Y ); - + libMesh::Real M = gas_evaluator.M_mix(Y); - + value = gas_evaluator.X( s, M, Y[s]); return; } } } - + if( !this->_h_s_index.empty() ) { libmesh_assert_equal_to( _h_s_index.size(), this->n_species() ); - + for( unsigned int s=0; s < this->n_species(); s++) { if( quantity_index == this->_h_s_index[s] ) @@ -731,7 +728,7 @@ namespace GRINS } } } - + if( !this->_omega_dot_index.empty() ) { libmesh_assert_equal_to( _omega_dot_index.size(), this->n_species() ); @@ -742,16 +739,16 @@ namespace GRINS { std::vector Y( this->n_species() ); this->mass_fractions( point, context, Y ); - + libMesh::Real T = this->T(point,context); - + libMesh::Real p0 = this->_p0; - + libMesh::Real rho = this->rho(T,p0, gas_evaluator.R_mix(Y) ); - + std::vector omega_dot( this->n_species() ); gas_evaluator.omega_dot( T, rho, Y, omega_dot ); - + value = omega_dot[s]; return; } @@ -767,7 +764,7 @@ namespace GRINS if(quantity_index == this->_Ds_index[s] ) { std::vector Y( this->_n_species ); - + libMesh::Real T = this->T(point,context); this->mass_fractions(point,context, Y ); libMesh::Real p0 = this->_p0; @@ -806,18 +803,18 @@ namespace GRINS } } }//if/else quantity_index - + return; } //end Postproc }//end Namespace Grins - - - - - - - - - + + + + + + + + + From 0a547f08d8db16988a86fe314d7925d4ab3b4952 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 29 May 2019 11:24:44 -0400 Subject: [PATCH 37/41] Cleaning up a few things, and adding the option to pick the point the temperature is evaluated and returned. --- src/qoi/include/grins/adiabiatic_flame_temperature.h | 2 ++ src/qoi/src/adiabiatic_flame_temperature.C | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qoi/include/grins/adiabiatic_flame_temperature.h b/src/qoi/include/grins/adiabiatic_flame_temperature.h index c9ce38453..b44178156 100644 --- a/src/qoi/include/grins/adiabiatic_flame_temperature.h +++ b/src/qoi/include/grins/adiabiatic_flame_temperature.h @@ -65,6 +65,8 @@ namespace GRINS protected: const PrimitiveTempFEVariables * _temp_vars; + libMesh::Real _T_point; + private: AdiabiaticFlameTemperature(); diff --git a/src/qoi/src/adiabiatic_flame_temperature.C b/src/qoi/src/adiabiatic_flame_temperature.C index 3949a8895..2a17845ab 100644 --- a/src/qoi/src/adiabiatic_flame_temperature.C +++ b/src/qoi/src/adiabiatic_flame_temperature.C @@ -64,6 +64,8 @@ namespace GRINS unsigned int /*qoi_num*/ ) { _temp_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::temp_variable_name(input,std::string("AdiabiaticFlameTemperature"),VariablesParsing::QOI)); + this->set_parameter + ( _T_point, input, "QoI/AdiabiaticFlameTemperature/point", .01 ); } @@ -86,7 +88,7 @@ namespace GRINS void AdiabiaticFlameTemperature::element_qoi( AssemblyContext & context, const unsigned qoi_index) { - if(context.get_elem().contains_point(0.01) ) //if were at 1 cm off the boundary + if(context.get_elem().contains_point(this->_T_point) ) //if were at 1 cm off the boundary { libMesh::Number& qoi = context.get_qois()[qoi_index]; From a6a0b0082e7c250ba65c1424078c317aec058b6a Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 29 May 2019 11:25:40 -0400 Subject: [PATCH 38/41] Cleaning up a few things that were not necessarily needed --- src/physics/include/grins/od_premixed_flame.h | 61 +++++++++---------- src/physics/src/od_premixed_flame.C | 49 +++++++-------- 2 files changed, 51 insertions(+), 59 deletions(-) diff --git a/src/physics/include/grins/od_premixed_flame.h b/src/physics/include/grins/od_premixed_flame.h index 0521b8625..6ddcb7702 100644 --- a/src/physics/include/grins/od_premixed_flame.h +++ b/src/physics/include/grins/od_premixed_flame.h @@ -1,7 +1,6 @@ #ifndef GRINS_OD_PREMIXED_FLAME_H #define GRINS_OD_PREMIXED_FLAME_H -// Grins items, can see not needing multi-component-vector variable but will leave in until i've written more of the code. #include "grins_config.h" #include "grins/grins_enums.h" #include "grins/physics.h" @@ -22,7 +21,7 @@ namespace GRINS ODPremixedFlame(const PhysicsName& physics_name, const GetPot & input, libMesh::UniquePtr & gas_mix); - + virtual ~ODPremixedFlame(){}; //! Sets variables to be time-evolving @@ -40,20 +39,21 @@ namespace GRINS libMesh::Real rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const; - - //Register postprocessing variables for OD Premixed Flame + + //Register postprocessing variables for OD Premixed Flame virtual void register_postprocessing_vars( const GetPot& input, PostProcessedQuantities& postprocessing); - virtual void register_parameter(const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) + + virtual void register_parameter(const std::string & param_name, libMesh::ParameterMultiAccessor & param_pointer ) const; // Context Initializations virtual void init_context( AssemblyContext& context ); - //Time dependent part(s) + //Time dependent part(s) virtual void element_time_derivative( bool compute_jacobian, AssemblyContext & context); - //Mass matrix part(s) + //Mass matrix part(s) virtual void mass_residual( bool compute_jacobian, AssemblyContext & context ); virtual void element_constraint(bool compute_jacobian, @@ -62,34 +62,33 @@ namespace GRINS AssemblyContext & context ); - virtual void compute_postprocessed_quantity( unsigned int quantity_index, + virtual void compute_postprocessed_quantity( unsigned int quantity_index, const AssemblyContext& context, const libMesh::Point& point, libMesh::Real& value ); protected: - //Variables + //Variables PrimitiveTempFEVariables& _temp_vars; SpeciesMassFractionsVariable& _species_vars; SingleVariable& _mass_flux_vars; + //Vector to keep track of the mass fractions of the mixture stream. std::vector _Inflow_Species; //! Number of species unsigned int _n_species; - bool _fixed_density; - libMesh::Real _fixed_rho_value; std::unique_ptr _gas_mixture; - + + //! Index from registering this quantity + unsigned int _rho_index; //! Index from registering this quantity - unsigned int _rho_index; - //! Index from registering this quantity unsigned int _k_index; //!Index from registering this quantity unsigned int _cp_index; @@ -98,12 +97,14 @@ namespace GRINS //!Index from registering this quantity unsigned int _mu_index; + //Pressure Value libMesh::Number _p0; + //Temperature of the unburnt mixture. libMesh::Number _Tu; //! Index from registering this quantity. Each species will have it's own index. std::vector _mole_fractions_index; - + //! Index from registering this quantity. Each species will have it's own index. std::vector _h_s_index; @@ -114,9 +115,9 @@ namespace GRINS std::vector _Ds_index; //! Index from registering this quantity. Each species will have it's own index. - std::vector _cp_s_index; + std::vector _cp_s_index; + - private: void read_input_options( const GetPot& input ); @@ -124,24 +125,24 @@ namespace GRINS ODPremixedFlame(); }; //Class ODPremixedFlame - + template< typename Mixture, typename Evaluator> inline unsigned int ODPremixedFlame::n_species() const { return _n_species; } - + template< typename Mixture, typename Evaluator> inline libMesh::Real ODPremixedFlame::T( const libMesh::Point& p, const AssemblyContext& c ) const { return c.point_value(_temp_vars.T(),p); } - + template< typename Mixture, typename Evaluator> inline libMesh::Real ODPremixedFlame::M_dot( const libMesh::Point& p, const AssemblyContext& c ) const { return c.point_value(_mass_flux_vars.var(),p); } - + template< typename Mixture, typename Evaluator> inline void ODPremixedFlame::mass_fractions( const libMesh::Point& p, @@ -149,36 +150,32 @@ namespace GRINS std::vector& mass_fracs ) const { libmesh_assert_equal_to(mass_fracs.size(), this->_n_species); - + for( unsigned int var = 0; var < this->_n_species; var++ ) { mass_fracs[var] = c.point_value(_species_vars.species(var),p); } } - + template< typename Mixture, typename Evaluator> inline libMesh::Real ODPremixedFlame::rho( libMesh::Real T, libMesh::Real p0, libMesh::Real R_mix) const { - libMesh::Real value = 0; - if( this->_fixed_density ) - value = this->_fixed_rho_value; - else - value = p0/(R_mix*T); - + libMesh::Real value = p0/(R_mix*T); + return value; } - + template< typename Mixture, typename Evaluator> inline const Mixture & ODPremixedFlame::gas_mixture() const { return *_gas_mixture; } - - + + } // namespace Grins diff --git a/src/physics/src/od_premixed_flame.C b/src/physics/src/od_premixed_flame.C index 3c0e02668..2030a7918 100644 --- a/src/physics/src/od_premixed_flame.C +++ b/src/physics/src/od_premixed_flame.C @@ -35,8 +35,6 @@ namespace GRINS _species_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::species_mass_frac_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _mass_flux_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,physics_name,VariablesParsing::PHYSICS))), _n_species(_species_vars.n_species()), - _fixed_density( input("Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_density", false ) ), - _fixed_rho_value(0.0), _gas_mixture(gas_mix.release()), _rho_index(0), _k_index(0), @@ -44,23 +42,34 @@ namespace GRINS _u_index(0), _mu_index(0) { - this->set_parameter - (_fixed_rho_value, input, - "Physics/"+PhysicsNaming::od_premixed_flame()+"/fixed_rho_value", 0.0 ); + + this->read_input_options(input); + + this->check_var_subdomain_consistency(_mass_flux_vars); + this->check_var_subdomain_consistency(_temp_vars); + this->check_var_subdomain_consistency(_species_vars); + + this->_ic_handler = new GenericICHandler( physics_name, input ); + } - //Parsing the Unburnt Temperature + template + void ODPremixedFlame::read_input_options( const GetPot& input ) + { + + //Parsing the Unburnt Temperature. this->set_parameter(_Tu, input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/Unburnt_Temperature", 0.0); - if(_Tu ==0) + if(_Tu == 0) { - std::cout << "Unburnt gas Temperature not set in the input!!" << std::endl; + std::cout << "Unburnt gas Temperature not set in the input!" << std::endl; libmesh_not_implemented(); } - //Initial Inflow Equivalence ratio + //Setting the inflow mixture mass fractions. + //Currently Always outputting the values read. TODO:: add this as an input option. _Inflow_Species.resize(this->_n_species); - std::cout << std::endl; + std::cout <<"Unburnt Mixture Mass Fractions:" << std::endl; for (unsigned int s = 0; s < this->_n_species; s++) { this->set_parameter(_Inflow_Species[s], input, "Physics/"+PhysicsNaming::od_premixed_flame()+"/" @@ -68,19 +77,6 @@ namespace GRINS std::cout << "Y_" + _gas_mixture->species_name(s) + " = " << _Inflow_Species[s] << " \n"; } - this->read_input_options(input); - - this->check_var_subdomain_consistency(_mass_flux_vars); - this->check_var_subdomain_consistency(_temp_vars); - this->check_var_subdomain_consistency(_species_vars); - - this->_ic_handler = new GenericICHandler( physics_name, input ); - } - - //Reading and setting the Thermodynamic Pressure - template - void ODPremixedFlame::read_input_options( const GetPot& input ) - { // Read thermodynamic pressure info MaterialsParsing::read_property( input, "ThermodynamicPressure", @@ -510,9 +506,8 @@ namespace GRINS - - - + //Currently use side_time_derivative to evaluate the mass flux value due to boundary values of the temperature, + //temperature gradient and unburnt conditions. template void ODPremixedFlame::side_time_derivative( bool compute_jacobian, AssemblyContext & context) { @@ -520,7 +515,7 @@ namespace GRINS libmesh_not_implemented(); //Check if were on the right boundary, - //TODO:: make this specified in input file probably + //TODO:: make this specified in input file if( context.has_side_boundary_id( 0 )) { const std::vector &JxW = From a86fa5c063e4f95e9de72500c62e1136ce412649 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 29 May 2019 11:27:06 -0400 Subject: [PATCH 39/41] Changed the mass flux back to being evaluated at the boundary since it does not matter where it is evaluated at --- src/qoi/include/grins/flame_speed.h | 15 +++++-------- src/qoi/src/flame_speed.C | 35 +++++++++++++---------------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/src/qoi/include/grins/flame_speed.h b/src/qoi/include/grins/flame_speed.h index 9fd82e01a..ff95feaa7 100644 --- a/src/qoi/include/grins/flame_speed.h +++ b/src/qoi/include/grins/flame_speed.h @@ -51,11 +51,9 @@ namespace GRINS virtual bool assemble_on_sides() const; - virtual void element_qoi( AssemblyContext& context, + virtual void side_qoi( AssemblyContext& context, const unsigned int qoi_index); - - virtual void init( const GetPot& input, const MultiphysicsSystem& system, unsigned int qoi_num ); @@ -77,6 +75,7 @@ namespace GRINS std::shared_ptr _chemistry; libMesh::Real _P0; + libMesh::Real _T_unburnt; private: @@ -91,8 +90,7 @@ namespace GRINS libMesh::Real p0, libMesh::Real R_mix) const { - libMesh::Real value = 0; - value = p0/(R_mix*T); + libMesh::Real value = p0/(R_mix*T); return value; } @@ -102,20 +100,17 @@ namespace GRINS const AssemblyContext& c ) const { return c.point_value(_mass_flux_vars->var(),p); } - template< typename Chemistry> inline bool FlameSpeed::assemble_on_interior() const { - return true; + return false; } template< typename Chemistry> inline bool FlameSpeed::assemble_on_sides() const { - return false; + return true; } - - } #endif //GRINS_Flame_Speed_H diff --git a/src/qoi/src/flame_speed.C b/src/qoi/src/flame_speed.C index e577c4baf..2b333f732 100644 --- a/src/qoi/src/flame_speed.C +++ b/src/qoi/src/flame_speed.C @@ -76,13 +76,12 @@ namespace GRINS { //grab the pressure value this->parse_Pressure(input); + //grab the unburnt temperature value this->set_parameter ( _T_unburnt, input,"QoI/FlameSpeed/Unburnt_Temperature" , -1.0 ); - - - //figure out the chemistry + //Parse the chemistry std::string material = input("QoI/FlameSpeed/material","DIE!"); _chemistry.reset( new Chemistry(input,material)); @@ -95,15 +94,11 @@ namespace GRINS +_chemistry->species_name(s), 0.0); } - //Set our Vaiables _mass_flux_vars = &GRINSPrivate::VariableWarehouse::get_variable_subclass(VariablesParsing::single_variable_name(input,std::string("FlameSpeed"),VariablesParsing::QOI)); } - - - ///Probaly NEED CHANGING OF SOME KIND template< typename Chemistry> void FlameSpeed::init_context( AssemblyContext& context ) { @@ -119,22 +114,22 @@ namespace GRINS } template< typename Chemistry> - void FlameSpeed::element_qoi( AssemblyContext & context, - const unsigned qoi_index) + void FlameSpeed::side_qoi( AssemblyContext & context, + const unsigned qoi_index) { - if(context.get_elem().contains_point(0.01) ) //if were at 1 cm off the boundary - { + if( context.has_side_boundary_id( 0 ) ) + { - libMesh::Number& qoi = context.get_qois()[qoi_index]; - libMesh::Real p0 = this->_P0; - libMesh::Real Mdot = context.point_value(this->_mass_flux_vars->var(),0.01); + libMesh::Number& qoi = context.get_qois()[qoi_index]; + libMesh::Real p0 = this->_P0; + libMesh::Real Mdot = context.side_value(this->_mass_flux_vars->var(),0); + libMesh::Real Rmix = _chemistry->R_mix(Mass_Fractions); - libMesh::Real Rmix = _chemistry->R_mix(Mass_Fractions); + qoi += Mdot/(this->rho(_T_unburnt,p0, Rmix)); + } - qoi += Mdot/(this->rho(_T_unburnt,p0, Rmix)); - } - } + } //end side_qoi template< typename Chemistry> void FlameSpeed::parse_Pressure( const GetPot& input) @@ -155,11 +150,11 @@ namespace GRINS - #if GRINS_HAVE_ANTIOCH +#if GRINS_HAVE_ANTIOCH template class FlameSpeed; #endif #if GRINS_HAVE_CANTERA template class FlameSpeed; - #endif +#endif } //namespace GRINS From aa8e882a26799b3acd6dc29a2f7772a3660243d5 Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Wed, 29 May 2019 16:48:50 -0400 Subject: [PATCH 40/41] Adding in a One dimensional methane flame example. --- configure.ac | 1 + examples/Makefile.am | 16 + examples/OzoneOD/NewRun.sh | 23 - examples/OzoneOD/Rename | 5 - examples/OzoneOD/ozone_Data_Files/ozone.xml | 152 - .../ozone_Data_Files/ozone_cea_data.dat | 54 - .../ozone_Data_Files/ozone_species_data.dat | 14 - examples/OzoneOD/ozone_constraint.base | 171 - examples/OzoneOD/ozone_constraint.in | 178 - examples/OzoneOD/run_constraint.in | 7 - examples/od_methane_flame/README | 17 + examples/od_methane_flame/continue.in | 22 + examples/od_methane_flame/gri30.xml | 6217 +++++++++++++++++ .../gri30_chemical_mixture.dat | 108 + examples/od_methane_flame/initial.in | 24 + examples/od_methane_flame/run.sh.in | 22 + examples/od_methane_flame/similar.in | 148 + examples/od_methane_flame/steady.in | 30 + 18 files changed, 6605 insertions(+), 604 deletions(-) delete mode 100755 examples/OzoneOD/NewRun.sh delete mode 100755 examples/OzoneOD/Rename delete mode 100644 examples/OzoneOD/ozone_Data_Files/ozone.xml delete mode 100644 examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat delete mode 100644 examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat delete mode 100644 examples/OzoneOD/ozone_constraint.base delete mode 100644 examples/OzoneOD/ozone_constraint.in delete mode 100755 examples/OzoneOD/run_constraint.in create mode 100644 examples/od_methane_flame/README create mode 100644 examples/od_methane_flame/continue.in create mode 100644 examples/od_methane_flame/gri30.xml create mode 100644 examples/od_methane_flame/gri30_chemical_mixture.dat create mode 100644 examples/od_methane_flame/initial.in create mode 100755 examples/od_methane_flame/run.sh.in create mode 100644 examples/od_methane_flame/similar.in create mode 100644 examples/od_methane_flame/steady.in diff --git a/configure.ac b/configure.ac index 01c5ee63c..aef6ee159 100644 --- a/configure.ac +++ b/configure.ac @@ -394,6 +394,7 @@ AC_CONFIG_FILES(examples/transient_amr/run.sh, [chmod +x examples/transient_am AC_CONFIG_FILES(examples/ozone_flame/run.sh, [chmod +x examples/ozone_flame/run.sh]) AC_CONFIG_FILES(examples/ozone_flame/crun.sh, [chmod +x examples/ozone_flame/crun.sh]) AC_CONFIG_FILES(examples/spectroscopy/run.sh, [chmod +x examples/spectroscopy/run.sh]) +AC_CONFIG_FILES(examples/od_methane_flame/run.sh, [chmod +x examples/od_methane_flame/run.sh]) dnl----------------------------------------------- dnl Generate header files diff --git a/examples/Makefile.am b/examples/Makefile.am index f19aedff5..2d66814c4 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -244,6 +244,22 @@ spec_SOURCES = spectroscopy/spectroscopy.C spec_LDADD = $(LIBGRINS_LIBS) +#======================================================================= +# One Dimensional Flame Example +#======================================================================= +methanedir = $(prefix)/examples/od_methane_flame +methane_DATA = $(top_srcdir)/examples/od_methane_flame/similar.in +methane_DATA += $(top_srcdir)/examples/od_methane_flame/initial.in +methane_DATA += $(top_srcdir)/examples/od_methane_flame/continue.in +methane_DATA += $(top_srcdir)/examples/od_methane_flame/steady.in +methane_DATA += $(top_srcdir)/examples/od_methane_flame/gri30.xml +methane_DATA += $(top_srcdir)/examples/od_methane_flame/gri30_chemical_mixture.dat +methane_DATA += $(top_srcdir)/examples/od_methane_flame/README +methane_SCRIPTS = $(top_builddir)/examples/od_methane_flame/run.sh + +EXTRA_DIST += $(methane_DATA) + + MAINTAINERCLEANFILES = Makefile.in MOSTLYCLEANFILES = *.gcno diff --git a/examples/OzoneOD/NewRun.sh b/examples/OzoneOD/NewRun.sh deleted file mode 100755 index b10de72c5..000000000 --- a/examples/OzoneOD/NewRun.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -Dir=ConstraintRunYO2_0$1YO3_0$2Mdot_0$3 -mkdir $Dir -cd ./$Dir -echo "[RunVars]" >> ozone_constraint.in -echo " Tmax = '700'" >> ozone_constraint.in -echo " YO2_Val = '$1'" >> ozone_constraint.in -echo " YO3_Val = '$2'" >> ozone_constraint.in -echo " M_dot_Value = '$3'" >> ozone_constraint.in -echo "[]" >> ozone_constraint.in -cat ../ozone_constraint.base >> ozone_constraint.in - - - - -echo "#!/bin/sh" >> Run_Constraint.sh -echo "GRINS_RUN=\${GRINS_RUN:-\$LIBMESH_RUN}" >> Run_Constraint.sh -echo "DEFAULT_SOLVER_OPTIONS=\"-ksp_type gmeres -pc_type bjacobi -sub_pc_type lu -sub_pc_factor_shift_type nonzero\"" >> Run_Constraint.sh -echo "GRINS_SOLVER_OPTIONS=\${GRINS_SOLVER_OPTIONS:-\$LIBMESH_OPTIONS:\$DEFAULT_SOLVER_OPTIONS}" >> Run_Constraint.sh -echo "\$GRINS_RUN /zoidberg1/data/shared/klbudzin/WorkingGrins/OptBuild/bin/grins /zoidberg1/data/shared/klbudzin/Flames/OzoneOD/$Dir/ozone_constraint.in \$GRINS_SOLVER_OPTIONS" >> Run_Constraint.sh -chmod u+x Run_Constraint.sh - - diff --git a/examples/OzoneOD/Rename b/examples/OzoneOD/Rename deleted file mode 100755 index fb004205f..000000000 --- a/examples/OzoneOD/Rename +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -for i in {1..1600..1} - do -mv output.$(($i * $1 - 1)).exo output.e-s.$(($i * $1 - 1)) - done diff --git a/examples/OzoneOD/ozone_Data_Files/ozone.xml b/examples/OzoneOD/ozone_Data_Files/ozone.xml deleted file mode 100644 index fbb20105c..000000000 --- a/examples/OzoneOD/ozone_Data_Files/ozone.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - O - - O O2 O3 - - - - 300.0 - 101325.0 - - - - - - - - - - - - - O:1 - L 1/90 - - - - 3.168267100E+00, -3.279318840E-03, 6.643063960E-06, -6.128066240E-09, - 2.112659710E-12, 2.912225920E+04, 2.051933460E+00 - - - - 2.569420780E+00, -8.597411370E-05, 4.194845890E-08, -1.001777990E-11, - 1.228336910E-15, 2.921757910E+04, 4.784338640E+00 - - - - atom - 80.000 - 2.750 - 0.000 - 0.000 - 0.000 - - - - - -O:2 -TPIS89 - - - - 3.782456360E+00, -2.996734160E-03, 9.847302010E-06, -9.681295090E-09, - 3.243728370E-12, -1.063943560E+03, 3.657675730E+00 - - - - 3.282537840E+00, 1.483087540E-03, -7.579666690E-07, 2.094705550E-10, - -2.167177940E-14, -1.088457720E+03, 5.453231290E+00 - - - -linear -107.400 -3.460 -0.000 -1.600 -3.800 - - - - - - -O:3 -TPIS89 - - - - 2.46260900E+00, 9.58278100E-03, -7.08735900E-06, 1.36336800E-09, - 2.96964700E-13, 1.60615200E+04, 1.21418700E+01 - - - - 5.42937100E+00, 1.82038000E-03, -7.70560700E-07, 1.49929300E-10, - -1.07556300E-14, 1.52352700E+04, -3.26638700E+00 - - - -linear -180 -4.1 -0.000 -0 -2 - - - - - - - - - O + O [=] O2 - - - 2.9e+17 - -1.0 - 0.0 - - - - O:2.0 - O2:1.0 - - - - - O2 + O [=] O3 - - - 3.427e+13 - 0.0 - -4.234 - - - - O2:1.0 O:1.0 - O3:1.0 - - - - - O + O3 [=] O2 + O2 - - - 5.2e+12 - 0.0 - 17.38 - - - O:1.0 O3:1.0 - O2:2.0 - - - - diff --git a/examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat b/examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat deleted file mode 100644 index b50c7bb59..000000000 --- a/examples/OzoneOD/ozone_Data_Files/ozone_cea_data.dat +++ /dev/null @@ -1,54 +0,0 @@ -#----------------------------------------------------------------------------- -# Cp, H, and S curve fit parameters from CEA program (1994) -# -# File Format: -# -# First line: -# -# Species Name -# Number of T intervals: [200-1000], [1000-6000], ([6000-20000]) -# Formation Enthalpy @ 298.15K -# -# Lines 2-4 (2-8): -# -# a0-a4; a5-a9 for each interval. -# -# -# Cp/R = a0*T^-2 + a1*T^-1 + a2 + a3*T + a4*T^2 + a5*T^3 + a6*T^4 -# H/RT = -a0*T^-2 + a1*T^-1*lnT + a2 + a3*T/2 + a4*T^2/3 + a5*T^3/4 + a6*T^4/5 + a8/T -# S/R = -a0*T^-2/2 - a1*T^-1 + a2*lnT + a3*T + a4*T^2/2 + a5*T^3/3 + a6*T^4/4 + a9 -# -# Note that a7 is always zero and is not used in the calculation of Cp,H, or S. -# The constant is included simply for compatibility with cea. -# -# -# Sources: -# -# All values come directly from cea400 program (05/98) -# Note that for monotomics in which the only non-zero parameter is a2, cea -# stores this value in the 1st position. This must be changed for FIN-S to -# work correctly. -# [PB]: HO2/H2O2 values taken from http://www.grc.nasa.gov/WWW/CEAWeb/ceaThermoBuild.htm -#------------------------------------------------------------------------------- - -O 3 249175.003 - -7.95361130e+03 1.60717779e+02 1.96622644e+00 1.01367031e-03 -1.11041542e-06 - 6.51750750e-10 -1.58477925e-13 0.00000000e+00 2.84036244e+04 8.40424182e+00 - 2.61902026e+05 -7.29872203e+02 3.31717727e+00 -4.28133436e-04 1.03610459e-07 - -9.43830433e-12 2.72503830e-16 0.00000000e+00 3.39242806e+04 -6.67958535e-01 - 1.77900426e+08 -1.08232826e+05 2.81077837e+01 -2.97523226e-03 1.85499753e-07 - -5.79623154e-12 7.19172016e-17 0.00000000e+00 8.89094263e+05 -2.18172815e+02 - -O2 3 0.000 - -3.42556269e+04 4.84699986e+02 1.11901159e+00 4.29388743e-03 -6.83627313e-07 - -2.02337478e-09 1.03904064e-12 0.00000000e+00 -3.39145434e+03 1.84969912e+01 - -1.03793994e+06 2.34483275e+03 1.81972949e+00 1.26784887e-03 -2.18807142e-07 - 2.05372411e-11 -8.19349062e-16 0.00000000e+00 -1.68901253e+04 1.73871835e+01 - 4.97515261e+08 -2.86602339e+05 6.69015464e+01 -6.16971869e-03 3.01623757e-07 - -7.42087888e-12 7.27744063e-17 0.00000000e+00 2.29348755e+06 -5.53044968e+02 - -O3 2 141800.000 - -1.282314507e+04 5.898216640e+02 -2.547496763e+00 2.690121526e-02 -3.528258340e-05 - 2.312290922e-08 -6.044893270e-12 0.000000000e+00 1.348368701e+04 3.852218580e+01 - -3.869662480e+07 1.023344994e+05 -8.961551600e+01 3.706144970e-02 -4.137638740e-06 - -2.725018591e-10 5.248188110e-14 0.000000000e+00 -6.517918180e+05 7.029109520e+02 diff --git a/examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat b/examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat deleted file mode 100644 index 7e8d8f3fa..000000000 --- a/examples/OzoneOD/ozone_Data_Files/ozone_species_data.dat +++ /dev/null @@ -1,14 +0,0 @@ -#=========================================================================== -# LEGEND -#=========================================================================== -# -# Species -- Species name -# Mol. Wt. -- Molecular weight (kg/kmol) -# Hform -- Formation enthalpy (J/kg @ 0K) -# cfs -- Nominal T-R Degrees of freedom (cv = cfs*k*T) -# zns -- Charge number -# -# Spec. Mol. Wt. Hform (0K), cfs, zns -O 16.00000 1.5420000000e7 1.5 0 -O2 32.00000 0.000000000000 2.5 0 -O3 48.00000 2.9729160000e7 3.0 0 diff --git a/examples/OzoneOD/ozone_constraint.base b/examples/OzoneOD/ozone_constraint.base deleted file mode 100644 index 6e45bc4a4..000000000 --- a/examples/OzoneOD/ozone_constraint.base +++ /dev/null @@ -1,171 +0,0 @@ - -[SolverOptions] - [./TimeStepping] - solver_type = 'libmesh_euler_solver' - delta_t = '1e-6' - n_timesteps = '25000' - theta = '1.0' -[] - -# Enabled Physics classes -[Physics] - - enabled_physics = 'ODPremixedFlame' - - [./ODPremixedFlame] - - material = 'OzoneGas' - - # Initial Conditions - ic_ids = '0' - ic_types = 'parsed' - ic_variables = 'Y_O2:Y_O3:T:M_dot' - ic_values = '{YO2:=${RunVars/YO2_Val};YO2}{YO3:=${RunVars/YO3_Val};YO3}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVars/M_dot_Value};M_dot_Value}' - - # ic_values = '{YO2_Val:=${RunVars/YO2_Val;YO2_Val}{YO3_Val:=${RunVariables/YO3_Val};YO3_Val}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVariables/M_dot_Value};M_dot_Value}' - - output_vars = 'mole_fractions omega_dot u rho' - [../] -[] - -[BoundaryConditions] - bc_ids = '0 1' - bc_id_name_map = 'Inlet Outlet' - - [./Inlet] - [./SingleVariable] - type = 'homogeneous_neumann' - [../] - - [./Temperature] - type = 'isothermal' - T = '300' - [../] - - [./SpeciesMassFractions] - type = 'parsed_dirichlet' - Y_O2 = '{YO2:=${RunVars/YO2_Val};YO2}' - Y_O3 = '{YO3:=${RunVars/YO3_Val};YO3}' - [../] - [../] - - [./Outlet] - [./SingleVariable] - type = 'homogeneous_neumann' - [../] - [./Temperature] - type = 'homogeneous_neumann' - [../] - [./SpeciesMassFractions] - type = 'homogeneous_neumann' - [../] - [../] -[] - - -# Mesh related options -[Mesh] - [./Generation] - dimension = '1' - element_type = 'EDGE2' - x_min = '0.0' - x_max = '0.02' - n_elems_x = '600' - - [../] - - #[./Read] - # filename = 'unif_ref_1.xda' -[] - -[Materials] - [./OzoneGas] - [./ThermodynamicPressure] - value = '1e5' #[Pa] - [../GasMixture] - thermochemistry_library = 'antioch' - species = 'O O2 O3' - kinetics_data = '../ozone_Data_Files/ozone.xml' - - [./Antioch] - transport_model = 'constant' - thermo_model = 'cea' - viscosity_model = 'constant' - thermal_conductivity_model = 'constant' - mass_diffusivity_model = 'constant_lewis' - cea_data = '../ozone_Data_Files/ozone_cea_data.dat' - species_data = '../ozone_Data_Files/ozone_species_data.dat' - - [../../Viscosity] - value = '1.0e-5' - [../ThermalConductivity] - value = '0.02' - [../LewisNumber] - value = '1.0' -[] - -[Variables] - [./Temperature] - names = 'T' - fe_family = 'LAGRANGE' - order = 'FIRST' - - [./ConstrainedPoints] - [./FirstEdgeNode] - constraint_location = '0.004' - constraint_rhs = '700' - [../] - [../] - - - [../SingleVariable] - names = 'M_dot' - fe_family = 'LAGRANGE' - order = 'FIRST' - - [../SpeciesMassFractions] - names = 'Y_' - fe_family = 'LAGRANGE' - order = 'FIRST' - material = 'OzoneGas' -[] - -#[restart-options] -# restart_file='./Run1DHeavy6/output.9999.xdr' -#[] - -#Linear and nonlinear solver options -[linear-nonlinear-solver] - continue_after_max_iterations = 'true' - max_nonlinear_iterations = '200' - max_linear_iterations = '2500' - minimum_linear_tolerance = '1.0e-10' - initial_linear_tolerance = '1.0e-10' - use_numerical_jacobians_only = 'true' - - relative_residual_tolerance = '1.0e-10' - relative_step_tolerance = '1.0e-6' -[] - -# Visualization options -[vis-options] - output_vis = 'true' - vis_output_file_prefix = './Output/output' - output_residual = 'false' - output_format = 'ExodusII xdr' - timesteps_per_vis = '25' -[] - -# Options for print info to the screen -[screen-options] - - system_name = 'Ozone' - - print_equation_system_info = 'true' - print_mesh_info = 'true' - print_log_info = 'true' - solver_verbose = 'true' - solver_quiet = 'false' - - print_element_jacobians = 'false' -[] \ No newline at end of file diff --git a/examples/OzoneOD/ozone_constraint.in b/examples/OzoneOD/ozone_constraint.in deleted file mode 100644 index 5431b0137..000000000 --- a/examples/OzoneOD/ozone_constraint.in +++ /dev/null @@ -1,178 +0,0 @@ -[RunVars] - Tmax = '700' - YO2_Val = '.8' - YO3_Val = '.2' - M_dot_Value = '.3' -[] - -[SolverOptions] - [./TimeStepping] - solver_type = 'libmesh_euler_solver' - delta_t = '1e-6' - n_timesteps = '25000' - theta = '1.0' -[] - -# Enabled Physics classes -[Physics] - - enabled_physics = 'ODPremixedFlame' - - [./ODPremixedFlame] - - material = 'OzoneGas' - - # Initial Conditions - ic_ids = '0' - ic_types = 'parsed' - ic_variables = 'Y_O2:Y_O3:T:M_dot' - ic_values = '{YO2:=${RunVars/YO2_Val};YO2}{YO3:=${RunVars/YO3_Val};YO3}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVars/M_dot_Value};M_dot_Value}' - - # ic_values = '{YO2_Val:=${RunVars/YO2_Val;YO2_Val}{YO3_Val:=${RunVariables/YO3_Val};YO3_Val}{Tmax:=${RunVars/Tmax};300+(x<=0.005)*(x>0.002)*((x-0.002)*(Tmax-300)/(0.005-0.002))+(x<0.008)*(x>0.005)*((0.008-x)*(Tmax-300)/(0.008-0.005))}{M_dot_Value:=${RunVariables/M_dot_Value};M_dot_Value}' - - output_vars = 'mole_fractions omega_dot u rho' - [../] -[] - -[BoundaryConditions] - bc_ids = '0 1' - bc_id_name_map = 'Inlet Outlet' - - [./Inlet] - [./SingleVariable] - type = 'parsed_dirichlet' - M_dot = '{M_dot_Value:=${RunVars/M_dot_Value};M_dot_Value}' - [../] - - [./Temperature] - type = 'isothermal' - T = '300' - [../] - - [./SpeciesMassFractions] - type = 'parsed_dirichlet' - Y_O2 = '{YO2:=${RunVars/YO2_Val};YO2}' - Y_O3 = '{YO3:=${RunVars/YO3_Val};YO3}' - [../] - [../] - - [./Outlet] - [./SingleVariable] - type = 'homogeneous_neumann' - [../] - [./Temperature] - type = 'homogeneous_neumann' - [../] - [./SpeciesMassFractions] - type = 'homogeneous_neumann' - [../] - [../] -[] - - -# Mesh related options -[Mesh] - [./Generation] - dimension = '1' - element_type = 'EDGE2' - x_min = '0.0' - x_max = '0.02' - n_elems_x = '600' - - [../] - - #[./Read] - # filename = 'unif_ref_1.xda' -[] - -[Materials] - [./OzoneGas] - [./ThermodynamicPressure] - value = '1e5' #[Pa] - [../GasMixture] - thermochemistry_library = 'antioch' - species = 'O O2 O3' - kinetics_data = './ozone_Data_Files/ozone.xml' - - [./Antioch] - transport_model = 'constant' - thermo_model = 'cea' - viscosity_model = 'constant' - thermal_conductivity_model = 'constant' - mass_diffusivity_model = 'constant_lewis' - cea_data = './ozone_Data_Files/ozone_cea_data.dat' - species_data = './ozone_Data_Files/ozone_species_data.dat' - - [../../Viscosity] - value = '1.0e-5' - [../ThermalConductivity] - value = '0.02' - [../LewisNumber] - value = '1.0' -[] - -[Variables] - [./Temperature] - names = 'T' - fe_family = 'LAGRANGE' - order = 'FIRST' - - [./ConstrainedPoints] - [./FirstEdgeNode] - constraint_location = '0.004' - constraint_rhs = '700' - [../] - [../] - - - [../SingleVariable] - names = 'M_dot' - fe_family = 'LAGRANGE' - order = 'FIRST' - - [../SpeciesMassFractions] - names = 'Y_' - fe_family = 'LAGRANGE' - order = 'FIRST' - material = 'OzoneGas' -[] - -#[restart-options] -# restart_file='./Run1DHeavy6/output.9999.xdr' -#[] - -#Linear and nonlinear solver options -[linear-nonlinear-solver] - continue_after_max_iterations = 'true' - max_nonlinear_iterations = '200' - max_linear_iterations = '2500' - minimum_linear_tolerance = '1.0e-10' - initial_linear_tolerance = '1.0e-10' - use_numerical_jacobians_only = 'true' - - relative_residual_tolerance = '1.0e-10' - relative_step_tolerance = '1.0e-6' -[] - -# Visualization options -[vis-options] - output_vis = 'true' - vis_output_file_prefix = './Output/output' - output_residual = 'false' - output_format = 'ExodusII xdr' - timesteps_per_vis = '25' -[] - -# Options for print info to the screen -[screen-options] - - system_name = 'Ozone' - - print_equation_system_info = 'true' - print_mesh_info = 'true' - print_log_info = 'true' - solver_verbose = 'true' - solver_quiet = 'false' - - print_element_jacobians = 'false' -[] \ No newline at end of file diff --git a/examples/OzoneOD/run_constraint.in b/examples/OzoneOD/run_constraint.in deleted file mode 100755 index 954a1d799..000000000 --- a/examples/OzoneOD/run_constraint.in +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -GRINS_RUN=${GRINS_RUN:-$LIBMESH_RUN} -DEFAULT_SOLVER_OPTIONS="-ksp_type gmeres -pc_type bjacobi -sub_pc_type lu -sub_pc_factor_shift_type nonzero" -GRINS_SOLVER_OPTIONS=${GRINS_SOLVER_OPTIONS:-$LIBMESH_OPTIONS:$DEFAULT_SOLVER_OPTIONS} -$GRINS_RUN /zoidberg1/data/shared/klbudzin/WorkingGrins/OptBuild/bin/grins /zoidberg1/data/shared/klbudzin/WorkingGrins/grins/examples/OzoneOD/ozone_constraint.in $GRINS_SOLVER_OPTIONS - diff --git a/examples/od_methane_flame/README b/examples/od_methane_flame/README new file mode 100644 index 000000000..9c6bfbd21 --- /dev/null +++ b/examples/od_methane_flame/README @@ -0,0 +1,17 @@ +This example the progression to steady state for a one dimensional methane flame using the freely propogating OdPremixedFlame physics. Here there are three input files used. The initial.in file contains options for the first time step and generates a one dimensional mesh that contains 100 elements going from 0 to 1.5 centimeters. This mesh is then redistributed quadratically towards the inlet(left) boundary, which is where the flame will be balance on. For the inital guess a cubic was used to estimate the change in the temperature, fuel, oxidizer, and water over the flame front. The specific values of these fits are given through the RunVars section of the input file, where: +TmaxCubic : The end point value of the cubic fit to the flame front of the temperature profile. +TmaxLinear : The end point value of the linear extrapolation of the end of the cubic fit of the temperature to the end of the domain. +Tinit : The boundary value of the temperature, and should be the same as that set in the boundary condition section. +YOxidizer_Start : Unburnt mass fraction of the oxidizer (in this case O2). +YOxidizer_MaxCubic : The end point value of the cubic fit to the flame front of the oxidizer profile. +YOxidizer_MaxLinear: The end point value of the linear extrapolation of the end of the cubic fit of the oxidizer to the end of the domain. +YFuel_Start : Unburnt mass fraction of the fuel (in this case CH4). +YDilute_Start : Unburnt mass fraction of the dilutent (in this case N2). +xstart : Starting point for the flame front cubic fit, this should almost always be at the start of the domain, as that is where the flame will burn to. +xend : Ending point for the flame front cubic fit, this value should depend on the starting point and estimated width of the flame front. + +The other two files are for restarting the example from a previous simulation, and for solving the steady state problem (continue.in and steady.in respectively). The similar.in input file contains all the input fields that were similar between the three input files, and the reason for doing this can be seen if wishing to change the chemistry model. +This example is configured to using cantera as the thermochemistry library with mixed transport. This can be seen in the similar input file. To change to a different mode of transport with cantera, alter the gas_mixture field value to the appropriate phase in the xml file using a different model for transport. To switch to Antioch with mixed tranpsort, uncomment the Antioch section in the input file, and comment the Cantera Section. + +This example currently runs with the GRI-Mech 3.0 reaction mechanism. This can be changed by altering the gas_mixture fields in the similar.in file to a different xml file. +The Run script will run this example from the initial state to its appropriate steady state solution and output the speed of the flame as well as the temperature 1 cm into the domain. \ No newline at end of file diff --git a/examples/od_methane_flame/continue.in b/examples/od_methane_flame/continue.in new file mode 100644 index 000000000..b6204925e --- /dev/null +++ b/examples/od_methane_flame/continue.in @@ -0,0 +1,22 @@ +# Mesh related options +[Mesh] + [./Read] + filename= './restart.exo' +[] + +# Restart file option +[restart-options] + restart_file = '' +[] + +# Solver Options +[SolverOptions] + [./TimeStepping] + solver_type = 'libmesh_euler_solver' + delta_t = '5.0e-6' + n_timesteps = '100' + theta = '1.0' +[] + +# Include things similar between steady/unsteady and continued runs. +[include similar.in] diff --git a/examples/od_methane_flame/gri30.xml b/examples/od_methane_flame/gri30.xml new file mode 100644 index 000000000..59a79b45b --- /dev/null +++ b/examples/od_methane_flame/gri30.xml @@ -0,0 +1,6217 @@ + + + + + + + O H C N Ar + + H2 H O O2 OH H2O HO2 H2O2 C CH + CH2 CH2Q CH3 CH4 CO CO2 HCO CH2O CH2OH CH3O + CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH + N NH NH2 NH3 NNH NO NO2 N2O HNO CN + HCN H2CN HCNN HCNO HOCN HNCO NCO N2 AR C3H7 + C3H8 CH2CHO CH3CHO + + + + 300.0 + 101325.0 + + + + + + + + + O H C N Ar + + H2 H O O2 OH H2O HO2 H2O2 C CH + CH2 CH2Q CH3 CH4 CO CO2 HCO CH2O CH2OH CH3O + CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH + N NH NH2 NH3 NNH NO NO2 N2O HNO CN + HCN H2CN HCNN HCNO HOCN HNCO NCO N2 AR C3H7 + C3H8 CH2CHO CH3CHO + + + 300.0 + 101325.0 + + + + + + + + + O H C N Ar + + H2 H O O2 OH H2O HO2 H2O2 C CH + CH2 CH2Q CH3 CH4 CO CO2 HCO CH2O CH2OH CH3O + CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH + N NH NH2 NH3 NNH NO NO2 N2O HNO CN + HCN H2CN HCNN HCNO HOCN HNCO NCO N2 AR C3H7 + C3H8 CH2CHO CH3CHO + + + 300.0 + 101325.0 + + + + + + + + + + + + H:2 + TPIS78 + + + + 2.344331120E+00, 7.980520750E-03, -1.947815100E-05, 2.015720940E-08, + -7.376117610E-12, -9.179351730E+02, 6.830102380E-01 + + + + 3.337279200E+00, -4.940247310E-05, 4.994567780E-07, -1.795663940E-10, + 2.002553760E-14, -9.501589220E+02, -3.205023310E+00 + + + + linear + 38.000 + 2.920 + 0.000 + 0.790 + 280.000 + + + + + + H:1 + L 7/88 + + + + 2.500000000E+00, 7.053328190E-13, -1.995919640E-15, 2.300816320E-18, + -9.277323320E-22, 2.547365990E+04, -4.466828530E-01 + + + + 2.500000010E+00, -2.308429730E-11, 1.615619480E-14, -4.735152350E-18, + 4.981973570E-22, 2.547365990E+04, -4.466829140E-01 + + + + atom + 145.000 + 2.050 + 0.000 + 0.000 + 0.000 + + + + + + O:1 + L 1/90 + + + + 3.168267100E+00, -3.279318840E-03, 6.643063960E-06, -6.128066240E-09, + 2.112659710E-12, 2.912225920E+04, 2.051933460E+00 + + + + 2.569420780E+00, -8.597411370E-05, 4.194845890E-08, -1.001777990E-11, + 1.228336910E-15, 2.921757910E+04, 4.784338640E+00 + + + + atom + 80.000 + 2.750 + 0.000 + 0.000 + 0.000 + + + + + + O:2 + TPIS89 + + + + 3.782456360E+00, -2.996734160E-03, 9.847302010E-06, -9.681295090E-09, + 3.243728370E-12, -1.063943560E+03, 3.657675730E+00 + + + + 3.282537840E+00, 1.483087540E-03, -7.579666690E-07, 2.094705550E-10, + -2.167177940E-14, -1.088457720E+03, 5.453231290E+00 + + + + linear + 107.400 + 3.460 + 0.000 + 1.600 + 3.800 + + + + + + H:1 O:1 + RUS 78 + + + + 3.992015430E+00, -2.401317520E-03, 4.617938410E-06, -3.881133330E-09, + 1.364114700E-12, 3.615080560E+03, -1.039254580E-01 + + + + 3.092887670E+00, 5.484297160E-04, 1.265052280E-07, -8.794615560E-11, + 1.174123760E-14, 3.858657000E+03, 4.476696100E+00 + + + + linear + 80.000 + 2.750 + 0.000 + 0.000 + 0.000 + + + + + + H:2 O:1 + L 8/89 + + + + 4.198640560E+00, -2.036434100E-03, 6.520402110E-06, -5.487970620E-09, + 1.771978170E-12, -3.029372670E+04, -8.490322080E-01 + + + + 3.033992490E+00, 2.176918040E-03, -1.640725180E-07, -9.704198700E-11, + 1.682009920E-14, -3.000429710E+04, 4.966770100E+00 + + + + nonlinear + 572.400 + 2.600 + 1.840 + 0.000 + 4.000 + + + + + + H:1 O:2 + L 5/89 + + + + 4.301798010E+00, -4.749120510E-03, 2.115828910E-05, -2.427638940E-08, + 9.292251240E-12, 2.948080400E+02, 3.716662450E+00 + + + + 4.017210900E+00, 2.239820130E-03, -6.336581500E-07, 1.142463700E-10, + -1.079085350E-14, 1.118567130E+02, 3.785102150E+00 + + + + nonlinear + 107.400 + 3.460 + 0.000 + 0.000 + 1.000 + + + + + + H:2 O:2 + L 7/88 + + + + 4.276112690E+00, -5.428224170E-04, 1.673357010E-05, -2.157708130E-08, + 8.624543630E-12, -1.770258210E+04, 3.435050740E+00 + + + + 4.165002850E+00, 4.908316940E-03, -1.901392250E-06, 3.711859860E-10, + -2.879083050E-14, -1.786178770E+04, 2.916156620E+00 + + + + nonlinear + 107.400 + 3.460 + 0.000 + 0.000 + 3.800 + + + + + + C:1 + L11/88 + + + + 2.554239550E+00, -3.215377240E-04, 7.337922450E-07, -7.322348890E-10, + 2.665214460E-13, 8.544388320E+04, 4.531308480E+00 + + + + 2.492668880E+00, 4.798892840E-05, -7.243350200E-08, 3.742910290E-11, + -4.872778930E-15, 8.545129530E+04, 4.801503730E+00 + + + + atom + 71.400 + 3.300 + 0.000 + 0.000 + 0.000 + + + + + + H:1 C:1 + TPIS79 + + + + 3.489816650E+00, 3.238355410E-04, -1.688990650E-06, 3.162173270E-09, + -1.406090670E-12, 7.079729340E+04, 2.084011080E+00 + + + + 2.878464730E+00, 9.709136810E-04, 1.444456550E-07, -1.306878490E-10, + 1.760793830E-14, 7.101243640E+04, 5.484979990E+00 + + + + linear + 80.000 + 2.750 + 0.000 + 0.000 + 0.000 + + + + + + H:2 C:1 + L S/93 + + + + 3.762678670E+00, 9.688721430E-04, 2.794898410E-06, -3.850911530E-09, + 1.687417190E-12, 4.600404010E+04, 1.562531850E+00 + + + + 2.874101130E+00, 3.656392920E-03, -1.408945970E-06, 2.601795490E-10, + -1.877275670E-14, 4.626360400E+04, 6.171193240E+00 + + + + linear + 144.000 + 3.800 + 0.000 + 0.000 + 0.000 + + + + + + H:2 C:1 + L S/93 + + + + 4.198604110E+00, -2.366614190E-03, 8.232962200E-06, -6.688159810E-09, + 1.943147370E-12, 5.049681630E+04, -7.691189670E-01 + + + + 2.292038420E+00, 4.655886370E-03, -2.011919470E-06, 4.179060000E-10, + -3.397163650E-14, 5.092599970E+04, 8.626501690E+00 + + + + linear + 144.000 + 3.800 + 0.000 + 0.000 + 0.000 + + + + + + H:3 C:1 + L11/89 + + + + 3.673590400E+00, 2.010951750E-03, 5.730218560E-06, -6.871174250E-09, + 2.543857340E-12, 1.644499880E+04, 1.604564330E+00 + + + + 2.285717720E+00, 7.239900370E-03, -2.987143480E-06, 5.956846440E-10, + -4.671543940E-14, 1.677558430E+04, 8.480071790E+00 + + + + linear + 144.000 + 3.800 + 0.000 + 0.000 + 0.000 + + + + + + H:4 C:1 + L 8/88 + + + + 5.149876130E+00, -1.367097880E-02, 4.918005990E-05, -4.847430260E-08, + 1.666939560E-11, -1.024664760E+04, -4.641303760E+00 + + + + 7.485149500E-02, 1.339094670E-02, -5.732858090E-06, 1.222925350E-09, + -1.018152300E-13, -9.468344590E+03, 1.843731800E+01 + + + + nonlinear + 141.400 + 3.750 + 0.000 + 2.600 + 13.000 + + + + + + C:1 O:1 + TPIS79 + + + + 3.579533470E+00, -6.103536800E-04, 1.016814330E-06, 9.070058840E-10, + -9.044244990E-13, -1.434408600E+04, 3.508409280E+00 + + + + 2.715185610E+00, 2.062527430E-03, -9.988257710E-07, 2.300530080E-10, + -2.036477160E-14, -1.415187240E+04, 7.818687720E+00 + + + + linear + 98.100 + 3.650 + 0.000 + 1.950 + 1.800 + + + + + + C:1 O:2 + L 7/88 + + + + 2.356773520E+00, 8.984596770E-03, -7.123562690E-06, 2.459190220E-09, + -1.436995480E-13, -4.837196970E+04, 9.901052220E+00 + + + + 3.857460290E+00, 4.414370260E-03, -2.214814040E-06, 5.234901880E-10, + -4.720841640E-14, -4.875916600E+04, 2.271638060E+00 + + + + linear + 244.000 + 3.760 + 0.000 + 2.650 + 2.100 + + + + + + H:1 C:1 O:1 + L12/89 + + + + 4.221185840E+00, -3.243925320E-03, 1.377994460E-05, -1.331440930E-08, + 4.337688650E-12, 3.839564960E+03, 3.394372430E+00 + + + + 2.772174380E+00, 4.956955260E-03, -2.484456130E-06, 5.891617780E-10, + -5.335087110E-14, 4.011918150E+03, 9.798344920E+00 + + + + nonlinear + 498.000 + 3.590 + 0.000 + 0.000 + 0.000 + + + + + + H:2 C:1 O:1 + L 8/88 + + + + 4.793723150E+00, -9.908333690E-03, 3.732200080E-05, -3.792852610E-08, + 1.317726520E-11, -1.430895670E+04, 6.028129000E-01 + + + + 1.760690080E+00, 9.200000820E-03, -4.422588130E-06, 1.006412120E-09, + -8.838556400E-14, -1.399583230E+04, 1.365632300E+01 + + + + nonlinear + 498.000 + 3.590 + 0.000 + 0.000 + 2.000 + + + + + + H:3 C:1 O:1 + GUNL93 + + + + 3.863889180E+00, 5.596723040E-03, 5.932717910E-06, -1.045320120E-08, + 4.369672780E-12, -3.193913670E+03, 5.473022430E+00 + + + + 3.692665690E+00, 8.645767970E-03, -3.751011200E-06, 7.872346360E-10, + -6.485542010E-14, -3.242506270E+03, 5.810432150E+00 + + + + nonlinear + 417.000 + 3.690 + 1.700 + 0.000 + 2.000 + + + + + + H:3 C:1 O:1 + 121686 + + + + 2.106204000E+00, 7.216595000E-03, 5.338472000E-06, -7.377636000E-09, + 2.075610000E-12, 9.786011000E+02, 1.315217700E+01 + + + + 3.770799000E+00, 7.871497000E-03, -2.656384000E-06, 3.944431000E-10, + -2.112616000E-14, 1.278325200E+02, 2.929575000E+00 + + + + nonlinear + 417.000 + 3.690 + 1.700 + 0.000 + 2.000 + + + + + + H:4 C:1 O:1 + L 8/88 + + + + 5.715395820E+00, -1.523091290E-02, 6.524411550E-05, -7.108068890E-08, + 2.613526980E-11, -2.564276560E+04, -1.504098230E+00 + + + + 1.789707910E+00, 1.409382920E-02, -6.365008350E-06, 1.381710850E-09, + -1.170602200E-13, -2.537487470E+04, 1.450236230E+01 + + + + nonlinear + 481.800 + 3.630 + 0.000 + 0.000 + 1.000 + + + + + + H:1 C:2 + L 1/91 + + + + 2.889657330E+00, 1.340996110E-02, -2.847695010E-05, 2.947910450E-08, + -1.093315110E-11, 6.683939320E+04, 6.222964380E+00 + + + + 3.167806520E+00, 4.752219020E-03, -1.837870770E-06, 3.041902520E-10, + -1.772327700E-14, 6.712106500E+04, 6.635894750E+00 + + + + linear + 209.000 + 4.100 + 0.000 + 0.000 + 2.500 + + + + + + H:2 C:2 + L 1/91 + + + + 8.086810940E-01, 2.336156290E-02, -3.551718150E-05, 2.801524370E-08, + -8.500729740E-12, 2.642898070E+04, 1.393970510E+01 + + + + 4.147569640E+00, 5.961666640E-03, -2.372948520E-06, 4.674121710E-10, + -3.612352130E-14, 2.593599920E+04, -1.230281210E+00 + + + + linear + 209.000 + 4.100 + 0.000 + 0.000 + 2.500 + + + + + + H:3 C:2 + L 2/92 + + + + 3.212466450E+00, 1.514791620E-03, 2.592094120E-05, -3.576578470E-08, + 1.471508730E-11, 3.485984680E+04, 8.510540250E+00 + + + + 3.016724000E+00, 1.033022920E-02, -4.680823490E-06, 1.017632880E-09, + -8.626070410E-14, 3.461287390E+04, 7.787323780E+00 + + + + nonlinear + 209.000 + 4.100 + 0.000 + 0.000 + 1.000 + + + + + + H:4 C:2 + L 1/91 + + + + 3.959201480E+00, -7.570522470E-03, 5.709902920E-05, -6.915887530E-08, + 2.698843730E-11, 5.089775930E+03, 4.097330960E+00 + + + + 2.036111160E+00, 1.464541510E-02, -6.710779150E-06, 1.472229230E-09, + -1.257060610E-13, 4.939886140E+03, 1.030536930E+01 + + + + nonlinear + 280.800 + 3.970 + 0.000 + 0.000 + 1.500 + + + + + + H:5 C:2 + L12/92 + + + + 4.306465680E+00, -4.186588920E-03, 4.971428070E-05, -5.991266060E-08, + 2.305090040E-11, 1.284162650E+04, 4.707209240E+00 + + + + 1.954656420E+00, 1.739727220E-02, -7.982066680E-06, 1.752176890E-09, + -1.496415760E-13, 1.285752000E+04, 1.346243430E+01 + + + + nonlinear + 252.300 + 4.300 + 0.000 + 0.000 + 1.500 + + + + + + H:6 C:2 + L 8/88 + + + + 4.291424920E+00, -5.501542700E-03, 5.994382880E-05, -7.084662850E-08, + 2.686857710E-11, -1.152220550E+04, 2.666823160E+00 + + + + 1.071881500E+00, 2.168526770E-02, -1.002560670E-05, 2.214120010E-09, + -1.900028900E-13, -1.142639320E+04, 1.511561070E+01 + + + + nonlinear + 252.300 + 4.300 + 0.000 + 0.000 + 1.500 + + + + + + H:1 C:2 O:1 + SRIC91 + + + + 2.251721400E+00, 1.765502100E-02, -2.372910100E-05, 1.727575900E-08, + -5.066481100E-12, 2.005944900E+04, 1.249041700E+01 + + + + 5.628205800E+00, 4.085340100E-03, -1.593454700E-06, 2.862605200E-10, + -1.940783200E-14, 1.932721500E+04, -3.930259500E+00 + + + + nonlinear + 150.000 + 2.500 + 0.000 + 0.000 + 1.000 + + + + + + H:2 C:2 O:1 + L 5/90 + + + + 2.135836300E+00, 1.811887210E-02, -1.739474740E-05, 9.343975680E-09, + -2.014576150E-12, -7.042918040E+03, 1.221564800E+01 + + + + 4.511297320E+00, 9.003597450E-03, -4.169396350E-06, 9.233458820E-10, + -7.948382010E-14, -7.551053110E+03, 6.322472050E-01 + + + + nonlinear + 436.000 + 3.970 + 0.000 + 0.000 + 2.000 + + + + + + H:2 C:2 O:1 + SRI91 + + + + 1.242373300E+00, 3.107220100E-02, -5.086686400E-05, 4.313713100E-08, + -1.401459400E-11, 8.031614300E+03, 1.387431900E+01 + + + + 5.923829100E+00, 6.792360000E-03, -2.565856400E-06, 4.498784100E-10, + -2.994010100E-14, 7.264626000E+03, -7.601774200E+00 + + + + nonlinear + 436.000 + 3.970 + 0.000 + 0.000 + 2.000 + + + + + + N:1 + L 6/88 + + + + 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, + 0.000000000E+00, 5.610463700E+04, 4.193908700E+00 + + + + 2.415942900E+00, 1.748906500E-04, -1.190236900E-07, 3.022624500E-11, + -2.036098200E-15, 5.613377300E+04, 4.649609600E+00 + + + + atom + 71.400 + 3.300 + 0.000 + 0.000 + 0.000 + + + + + + H:1 N:1 + And94 + + + + 3.492908500E+00, 3.117919800E-04, -1.489048400E-06, 2.481644200E-09, + -1.035696700E-12, 4.188062900E+04, 1.848327800E+00 + + + + 2.783692800E+00, 1.329843000E-03, -4.247804700E-07, 7.834850100E-11, + -5.504447000E-15, 4.212084800E+04, 5.740779900E+00 + + + + linear + 80.000 + 2.650 + 0.000 + 0.000 + 4.000 + + + + + + H:2 N:1 + And89 + + + + 4.204002900E+00, -2.106138500E-03, 7.106834800E-06, -5.611519700E-09, + 1.644071700E-12, 2.188591000E+04, -1.418424800E-01 + + + + 2.834742100E+00, 3.207308200E-03, -9.339080400E-07, 1.370295300E-10, + -7.920614400E-15, 2.217195700E+04, 6.520416300E+00 + + + + nonlinear + 80.000 + 2.650 + 0.000 + 2.260 + 4.000 + + + + + + H:3 N:1 + J 6/77 + + + + 4.286027400E+00, -4.660523000E-03, 2.171851300E-05, -2.280888700E-08, + 8.263804600E-12, -6.741728500E+03, -6.253727700E-01 + + + + 2.634452100E+00, 5.666256000E-03, -1.727867600E-06, 2.386716100E-10, + -1.257878600E-14, -6.544695800E+03, 6.566292800E+00 + + + + nonlinear + 481.000 + 2.920 + 1.470 + 0.000 + 10.000 + + + + + + H:1 N:2 + T07/93 + + + + 4.344692700E+00, -4.849707200E-03, 2.005945900E-05, -2.172646400E-08, + 7.946953900E-12, 2.879197300E+04, 2.977941000E+00 + + + + 3.766754400E+00, 2.891508200E-03, -1.041662000E-06, 1.684259400E-10, + -1.009189600E-14, 2.865069700E+04, 4.470506700E+00 + + + + nonlinear + 71.400 + 3.800 + 0.000 + 0.000 + 1.000 + + + + + + O:1 N:1 + RUS 78 + + + + 4.218476300E+00, -4.638976000E-03, 1.104102200E-05, -9.336135400E-09, + 2.803577000E-12, 9.844623000E+03, 2.280846400E+00 + + + + 3.260605600E+00, 1.191104300E-03, -4.291704800E-07, 6.945766900E-11, + -4.033609900E-15, 9.920974600E+03, 6.369302700E+00 + + + + linear + 97.530 + 3.620 + 0.000 + 1.760 + 4.000 + + + + + + O:2 N:1 + L 7/88 + + + + 3.944031200E+00, -1.585429000E-03, 1.665781200E-05, -2.047542600E-08, + 7.835056400E-12, 2.896617900E+03, 6.311991700E+00 + + + + 4.884754200E+00, 2.172395600E-03, -8.280690600E-07, 1.574751000E-10, + -1.051089500E-14, 2.316498300E+03, -1.174169500E-01 + + + + nonlinear + 200.000 + 3.500 + 0.000 + 0.000 + 1.000 + + + + + + O:1 N:2 + L 7/88 + + + + 2.257150200E+00, 1.130472800E-02, -1.367131900E-05, 9.681980600E-09, + -2.930718200E-12, 8.741774400E+03, 1.075799200E+01 + + + + 4.823072900E+00, 2.627025100E-03, -9.585087400E-07, 1.600071200E-10, + -9.775230300E-15, 8.073404800E+03, -2.201720700E+00 + + + + linear + 232.400 + 3.830 + 0.000 + 0.000 + 1.000 + + + + + + H:1 O:1 N:1 + And93 + + + + 4.533491600E+00, -5.669617100E-03, 1.847320700E-05, -1.713709400E-08, + 5.545457300E-12, 1.154829700E+04, 1.749841700E+00 + + + + 2.979250900E+00, 3.494405900E-03, -7.854977800E-07, 5.747959400E-11, + -1.933591600E-16, 1.175058200E+04, 8.606372800E+00 + + + + nonlinear + 116.700 + 3.490 + 0.000 + 0.000 + 1.000 + + + + + + C:1 N:1 + HBH92 + + + + 3.612935100E+00, -9.555132700E-04, 2.144297700E-06, -3.151632300E-10, + -4.643035600E-13, 5.170834000E+04, 3.980499500E+00 + + + + 3.745980500E+00, 4.345077500E-05, 2.970598400E-07, -6.865180600E-11, + 4.413417300E-15, 5.153618800E+04, 2.786760100E+00 + + + + linear + 75.000 + 3.860 + 0.000 + 0.000 + 1.000 + + + + + + H:1 C:1 N:1 + GRI/98 + + + + 2.258988600E+00, 1.005117000E-02, -1.335176300E-05, 1.009234900E-08, + -3.008902800E-12, 1.471263300E+04, 8.916441900E+00 + + + + 3.802239200E+00, 3.146422800E-03, -1.063218500E-06, 1.661975700E-10, + -9.799757000E-15, 1.440729200E+04, 1.575460100E+00 + + + + linear + 569.000 + 3.630 + 0.000 + 0.000 + 1.000 + + + + + + H:2 C:1 N:1 + 41687 + + + + 2.851661000E+00, 5.695233100E-03, 1.071140000E-06, -1.622612000E-09, + -2.351108100E-13, 2.863782000E+04, 8.992751100E+00 + + + + 5.209703000E+00, 2.969291100E-03, -2.855589100E-07, -1.635550000E-10, + 3.043258900E-14, 2.767710900E+04, -4.444478000E+00 + + + + linear + 569.000 + 3.630 + 0.000 + 0.000 + 1.000 + + + + + + H:1 C:1 N:2 + SRI/94 + + + + 2.524319400E+00, 1.596061900E-02, -1.881635400E-05, 1.212554000E-08, + -3.235737800E-12, 5.426198400E+04, 1.167587000E+01 + + + + 5.894636200E+00, 3.989595900E-03, -1.598238000E-06, 2.924939500E-10, + -2.009468600E-14, 5.345294100E+04, -5.103050200E+00 + + + + nonlinear + 150.000 + 2.500 + 0.000 + 0.000 + 1.000 + + + + + + H:1 C:1 O:1 N:1 + BDEA94 + + + + 2.647279890E+00, 1.275053420E-02, -1.047942360E-05, 4.414328360E-09, + -7.575214660E-13, 1.929902520E+04, 1.073329720E+01 + + + + 6.598604560E+00, 3.027786260E-03, -1.077043460E-06, 1.716665280E-10, + -1.014393910E-14, 1.796613390E+04, -1.033065990E+01 + + + + nonlinear + 232.400 + 3.830 + 0.000 + 0.000 + 1.000 + + + + + + H:1 C:1 O:1 N:1 + BDEA94 + + + + 3.786049520E+00, 6.886679220E-03, -3.214878640E-06, 5.171957670E-10, + 1.193607880E-14, -2.826984000E+03, 5.632921620E+00 + + + + 5.897848850E+00, 3.167893930E-03, -1.118010640E-06, 1.772431440E-10, + -1.043391770E-14, -3.706533310E+03, -6.181678250E+00 + + + + nonlinear + 232.400 + 3.830 + 0.000 + 0.000 + 1.000 + + + + + + H:1 C:1 O:1 N:1 + BDEA94 + + + + 3.630963170E+00, 7.302823570E-03, -2.280500030E-06, -6.612712980E-10, + 3.622357520E-13, -1.558736360E+04, 6.194577270E+00 + + + + 6.223951340E+00, 3.178640040E-03, -1.093787550E-06, 1.707351630E-10, + -9.950219550E-15, -1.665993440E+04, -8.382247410E+00 + + + + nonlinear + 232.400 + 3.830 + 0.000 + 0.000 + 1.000 + + + + + + C:1 O:1 N:1 + EA 93 + + + + 2.826930800E+00, 8.805168800E-03, -8.386613400E-06, 4.801696400E-09, + -1.331359500E-12, 1.468247700E+04, 9.550464600E+00 + + + + 5.152184500E+00, 2.305176100E-03, -8.803315300E-07, 1.478909800E-10, + -9.097799600E-15, 1.400412300E+04, -2.544266000E+00 + + + + linear + 232.400 + 3.830 + 0.000 + 0.000 + 1.000 + + + + + + N:2 + 121286 + + + + 3.298677000E+00, 1.408240400E-03, -3.963222000E-06, 5.641515000E-09, + -2.444854000E-12, -1.020899900E+03, 3.950372000E+00 + + + + 2.926640000E+00, 1.487976800E-03, -5.684760000E-07, 1.009703800E-10, + -6.753351000E-15, -9.227977000E+02, 5.980528000E+00 + + + + linear + 97.530 + 3.620 + 0.000 + 1.760 + 4.000 + + + + + + Ar:1 + 120186 + + + + 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, + 0.000000000E+00, -7.453750000E+02, 4.366000000E+00 + + + + 2.500000000E+00, 0.000000000E+00, 0.000000000E+00, 0.000000000E+00, + 0.000000000E+00, -7.453750000E+02, 4.366000000E+00 + + + + atom + 136.500 + 3.330 + 0.000 + 0.000 + 0.000 + + + + + + H:7 C:3 + L 9/84 + + + + 1.051551800E+00, 2.599198000E-02, 2.380054000E-06, -1.960956900E-08, + 9.373247000E-12, 1.063186300E+04, 2.112255900E+01 + + + + 7.702698700E+00, 1.604420300E-02, -5.283322000E-06, 7.629859000E-10, + -3.939228400E-14, 8.298433600E+03, -1.548018000E+01 + + + + nonlinear + 266.800 + 4.980 + 0.000 + 0.000 + 1.000 + + + + + + H:8 C:3 + L 4/85 + + + + 9.335538100E-01, 2.642457900E-02, 6.105972700E-06, -2.197749900E-08, + 9.514925300E-12, -1.395852000E+04, 1.920169100E+01 + + + + 7.534136800E+00, 1.887223900E-02, -6.271849100E-06, 9.147564900E-10, + -4.783806900E-14, -1.646751600E+04, -1.789234900E+01 + + + + nonlinear + 266.800 + 4.980 + 0.000 + 0.000 + 1.000 + + + + + + H:3 C:2 O:1 + SAND86 + + + + 3.409062000E+00, 1.073857400E-02, 1.891492000E-06, -7.158583000E-09, + 2.867385000E-12, 1.521476600E+03, 9.558290000E+00 + + + + 5.975670000E+00, 8.130591000E-03, -2.743624000E-06, 4.070304000E-10, + -2.176017000E-14, 4.903218000E+02, -5.045251000E+00 + + + + nonlinear + 436.000 + 3.970 + 0.000 + 0.000 + 2.000 + + + + + + H:4 C:2 O:1 + L 8/88 + + + + 4.729459500E+00, -3.193285800E-03, 4.753492100E-05, -5.745861100E-08, + 2.193111200E-11, -2.157287800E+04, 4.103015900E+00 + + + + 5.404110800E+00, 1.172305900E-02, -4.226313700E-06, 6.837245100E-10, + -4.098486300E-14, -2.259312200E+04, -3.480791700E+00 + + + + nonlinear + 436.000 + 3.970 + 0.000 + 0.000 + 2.000 + + + + + + + + + + + 2 O + M [=] O2 + M + + + 1.200000E+11 + -1 + 0.000000 + + AR:0.83 C2H6:3 CH4:2 CO:1.75 CO2:3.6 H2:2.4 H2O:15.4 + + O:2.0 + O2:1.0 + + + + + O + H + M [=] OH + M + + + 5.000000E+11 + -1 + 0.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + H:1 O:1.0 + OH:1.0 + + + + + O + H2 [=] H + OH + + + 3.870000E+01 + 2.7000000000000002 + 6260.000000 + + + H2:1 O:1.0 + H:1.0 OH:1 + + + + + O + HO2 [=] OH + O2 + + + 2.000000E+10 + 0 + 0.000000 + + + HO2:1 O:1.0 + O2:1 OH:1.0 + + + + + O + H2O2 [=] OH + HO2 + + + 9.630000E+03 + 2 + 4000.000000 + + + H2O2:1 O:1.0 + HO2:1 OH:1.0 + + + + + O + CH [=] H + CO + + + 5.700000E+10 + 0 + 0.000000 + + + CH:1 O:1.0 + H:1.0 CO:1 + + + + + O + CH2 [=] H + HCO + + + 8.000000E+10 + 0 + 0.000000 + + + CH2:1 O:1.0 + H:1.0 HCO:1 + + + + + O + CH2Q [=] H2 + CO + + + 1.500000E+10 + 0 + 0.000000 + + + CH2Q:1 O:1.0 + H2:1.0 CO:1 + + + + + O + CH2Q [=] H + HCO + + + 1.500000E+10 + 0 + 0.000000 + + + CH2Q:1 O:1.0 + H:1.0 HCO:1 + + + + + O + CH3 [=] H + CH2O + + + 5.060000E+10 + 0 + 0.000000 + + + CH3:1 O:1.0 + CH2O:1 H:1.0 + + + + + O + CH4 [=] OH + CH3 + + + 1.020000E+06 + 1.5 + 8600.000000 + + + CH4:1 O:1.0 + CH3:1 OH:1.0 + + + + + O + CO (+ M) [=] CO2 (+ M) + + + 1.800000E+07 + 0 + 2385.000000 + + + 6.020000E+08 + 0 + 3000.000000 + + AR:0.5 C2H6:3 CH4:2 CO:1.5 CO2:3.5 H2:2 H2O:6 O2:6 + + + CO:1 O:1.0 + CO2:1.0 + + + + + O + HCO [=] OH + CO + + + 3.000000E+10 + 0 + 0.000000 + + + HCO:1 O:1.0 + CO:1 OH:1.0 + + + + + O + HCO [=] H + CO2 + + + 3.000000E+10 + 0 + 0.000000 + + + HCO:1 O:1.0 + H:1.0 CO2:1 + + + + + O + CH2O [=] OH + HCO + + + 3.900000E+10 + 0 + 3540.000000 + + + CH2O:1 O:1.0 + HCO:1 OH:1.0 + + + + + O + CH2OH [=] OH + CH2O + + + 1.000000E+10 + 0 + 0.000000 + + + CH2OH:1 O:1.0 + CH2O:1 OH:1.0 + + + + + O + CH3O [=] OH + CH2O + + + 1.000000E+10 + 0 + 0.000000 + + + CH3O:1 O:1.0 + CH2O:1 OH:1.0 + + + + + O + CH3OH [=] OH + CH2OH + + + 3.880000E+02 + 2.5 + 3100.000000 + + + CH3OH:1 O:1.0 + CH2OH:1 OH:1.0 + + + + + O + CH3OH [=] OH + CH3O + + + 1.300000E+02 + 2.5 + 5000.000000 + + + CH3OH:1 O:1.0 + CH3O:1 OH:1.0 + + + + + O + C2H [=] CH + CO + + + 5.000000E+10 + 0 + 0.000000 + + + C2H:1 O:1.0 + CH:1.0 CO:1 + + + + + O + C2H2 [=] H + HCCO + + + 1.350000E+04 + 2 + 1900.000000 + + + C2H2:1 O:1.0 + H:1.0 HCCO:1 + + + + + O + C2H2 [=] OH + C2H + + + 4.600000E+16 + -1.4099999999999999 + 28950.000000 + + + C2H2:1 O:1.0 + C2H:1 OH:1.0 + + + + + O + C2H2 [=] CO + CH2 + + + 6.940000E+03 + 2 + 1900.000000 + + + C2H2:1 O:1.0 + CH2:1 CO:1.0 + + + + + O + C2H3 [=] H + CH2CO + + + 3.000000E+10 + 0 + 0.000000 + + + C2H3:1 O:1.0 + H:1.0 CH2CO:1 + + + + + O + C2H4 [=] CH3 + HCO + + + 1.250000E+04 + 1.8300000000000001 + 220.000000 + + + C2H4:1 O:1.0 + CH3:1.0 HCO:1 + + + + + O + C2H5 [=] CH3 + CH2O + + + 2.240000E+10 + 0 + 0.000000 + + + C2H5:1 O:1.0 + CH2O:1 CH3:1.0 + + + + + O + C2H6 [=] OH + C2H5 + + + 8.980000E+04 + 1.9199999999999999 + 5690.000000 + + + C2H6:1 O:1.0 + C2H5:1 OH:1.0 + + + + + O + HCCO [=] H + 2 CO + + + 1.000000E+11 + 0 + 0.000000 + + + HCCO:1 O:1.0 + H:1.0 CO:2.0 + + + + + O + CH2CO [=] OH + HCCO + + + 1.000000E+10 + 0 + 8000.000000 + + + CH2CO:1 O:1.0 + HCCO:1 OH:1.0 + + + + + O + CH2CO [=] CH2 + CO2 + + + 1.750000E+09 + 0 + 1350.000000 + + + CH2CO:1 O:1.0 + CH2:1.0 CO2:1 + + + + + O2 + CO [=] O + CO2 + + + 2.500000E+09 + 0 + 47800.000000 + + + CO:1 O2:1.0 + CO2:1 O:1.0 + + + + + O2 + CH2O [=] HO2 + HCO + + + 1.000000E+11 + 0 + 40000.000000 + + + CH2O:1 O2:1.0 + HO2:1.0 HCO:1 + + + + + H + O2 + M [=] HO2 + M + + + 2.800000E+12 + -0.85999999999999999 + 0.000000 + + AR:0 C2H6:1.5 CO:0.75 CO2:1.5 H2O:0 N2:0 O2:0 + + H:1.0 O2:1 + HO2:1.0 + + + + + H + 2 O2 [=] HO2 + O2 + + + 2.080000E+13 + -1.24 + 0.000000 + + + H:1.0 O2:2.0 + HO2:1.0 O2:1 + + + + + H + O2 + H2O [=] HO2 + H2O + + + 1.126000E+13 + -0.76000000000000001 + 0.000000 + + + H:1.0 H2O:1 O2:1 + H2O:1 HO2:1.0 + + + + + H + O2 + N2 [=] HO2 + N2 + + + 2.600000E+13 + -1.24 + 0.000000 + + + H:1.0 N2:1 O2:1 + N2:1 HO2:1.0 + + + + + H + O2 + AR [=] HO2 + AR + + + 7.000000E+11 + -0.80000000000000004 + 0.000000 + + + H:1.0 AR:1 O2:1 + AR:1 HO2:1.0 + + + + + H + O2 [=] O + OH + + + 2.650000E+13 + -0.67069999999999996 + 17041.000000 + + + H:1.0 O2:1 + O:1.0 OH:1 + + + + + 2 H + M [=] H2 + M + + + 1.000000E+12 + -1 + 0.000000 + + AR:0.63 C2H6:3 CH4:2 CO2:0 H2:0 H2O:0 + + H:2.0 + H2:1.0 + + + + + 2 H + H2 [=] 2 H2 + + + 9.000000E+10 + -0.59999999999999998 + 0.000000 + + + H2:1 H:2.0 + H2:2.0 + + + + + 2 H + H2O [=] H2 + H2O + + + 6.000000E+13 + -1.25 + 0.000000 + + + H:2.0 H2O:1 + H2:1.0 H2O:1 + + + + + 2 H + CO2 [=] H2 + CO2 + + + 5.500000E+14 + -2 + 0.000000 + + + H:2.0 CO2:1 + H2:1.0 CO2:1 + + + + + H + OH + M [=] H2O + M + + + 2.200000E+16 + -2 + 0.000000 + + AR:0.38 C2H6:3 CH4:2 H2:0.73 H2O:3.65 + + H:1.0 OH:1 + H2O:1.0 + + + + + H + HO2 [=] O + H2O + + + 3.970000E+09 + 0 + 671.000000 + + + H:1.0 HO2:1 + H2O:1 O:1.0 + + + + + H + HO2 [=] O2 + H2 + + + 4.480000E+10 + 0 + 1068.000000 + + + H:1.0 HO2:1 + H2:1 O2:1.0 + + + + + H + HO2 [=] 2 OH + + + 8.400000E+10 + 0 + 635.000000 + + + H:1.0 HO2:1 + OH:2.0 + + + + + H + H2O2 [=] HO2 + H2 + + + 1.210000E+04 + 2 + 5200.000000 + + + H:1.0 H2O2:1 + H2:1 HO2:1.0 + + + + + H + H2O2 [=] OH + H2O + + + 1.000000E+10 + 0 + 3600.000000 + + + H:1.0 H2O2:1 + H2O:1 OH:1.0 + + + + + H + CH [=] C + H2 + + + 1.650000E+11 + 0 + 0.000000 + + + H:1.0 CH:1 + H2:1 C:1.0 + + + + + H + CH2 (+ M) [=] CH3 (+ M) + + + 6.000000E+11 + 0 + 0.000000 + + + 1.040000E+20 + -2.7599999999999998 + 1600.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.562 91 5836 8552 + + H:1.0 CH2:1 + CH3:1.0 + + + + + H + CH2Q [=] CH + H2 + + + 3.000000E+10 + 0 + 0.000000 + + + H:1.0 CH2Q:1 + H2:1 CH:1.0 + + + + + H + CH3 (+ M) [=] CH4 (+ M) + + + 1.390000E+13 + -0.53400000000000003 + 536.000000 + + + 2.620000E+27 + -4.7599999999999998 + 2440.000000 + + AR:0.7 C2H6:3 CH4:3 CO:1.5 CO2:2 H2:2 H2O:6 + 0.783 74 2941 6964 + + H:1.0 CH3:1 + CH4:1.0 + + + + + H + CH4 [=] CH3 + H2 + + + 6.600000E+05 + 1.6200000000000001 + 10840.000000 + + + H:1.0 CH4:1 + H2:1 CH3:1.0 + + + + + H + HCO (+ M) [=] CH2O (+ M) + + + 1.090000E+09 + 0.47999999999999998 + -260.000000 + + + 2.470000E+18 + -2.5699999999999998 + 425.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.7824 271 2755 6570 + + H:1.0 HCO:1 + CH2O:1.0 + + + + + H + HCO [=] H2 + CO + + + 7.340000E+10 + 0 + 0.000000 + + + H:1.0 HCO:1 + H2:1.0 CO:1 + + + + + H + CH2O (+ M) [=] CH2OH (+ M) + + + 5.400000E+08 + 0.45400000000000001 + 3600.000000 + + + 1.270000E+26 + -4.8200000000000003 + 6530.000000 + + C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.7187 103 1291 4160 + + CH2O:1 H:1.0 + CH2OH:1.0 + + + + + H + CH2O (+ M) [=] CH3O (+ M) + + + 5.400000E+08 + 0.45400000000000001 + 2600.000000 + + + 2.200000E+24 + -4.7999999999999998 + 5560.000000 + + C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.758 94 1555 4200 + + CH2O:1 H:1.0 + CH3O:1.0 + + + + + H + CH2O [=] HCO + H2 + + + 5.740000E+04 + 1.8999999999999999 + 2742.000000 + + + CH2O:1 H:1.0 + H2:1 HCO:1.0 + + + + + H + CH2OH (+ M) [=] CH3OH (+ M) + + + 1.055000E+09 + 0.5 + 86.000000 + + + 4.360000E+25 + -4.6500000000000004 + 5080.000000 + + C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.6 100 90000 10000 + + H:1.0 CH2OH:1 + CH3OH:1.0 + + + + + H + CH2OH [=] H2 + CH2O + + + 2.000000E+10 + 0 + 0.000000 + + + H:1.0 CH2OH:1 + H2:1.0 CH2O:1 + + + + + H + CH2OH [=] OH + CH3 + + + 1.650000E+08 + 0.65000000000000002 + -284.000000 + + + H:1.0 CH2OH:1 + CH3:1 OH:1.0 + + + + + H + CH2OH [=] CH2Q + H2O + + + 3.280000E+10 + -0.089999999999999997 + 610.000000 + + + H:1.0 CH2OH:1 + CH2Q:1.0 H2O:1 + + + + + H + CH3O (+ M) [=] CH3OH (+ M) + + + 2.430000E+09 + 0.51500000000000001 + 50.000000 + + + 4.660000E+35 + -7.4400000000000004 + 14080.000000 + + C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.7 100 90000 10000 + + H:1.0 CH3O:1 + CH3OH:1.0 + + + + + H + CH3O [=] H + CH2OH + + + 4.150000E+04 + 1.6299999999999999 + 1924.000000 + + + H:1.0 CH3O:1 + H:1.0 CH2OH:1 + + + + + H + CH3O [=] H2 + CH2O + + + 2.000000E+10 + 0 + 0.000000 + + + H:1.0 CH3O:1 + H2:1.0 CH2O:1 + + + + + H + CH3O [=] OH + CH3 + + + 1.500000E+09 + 0.5 + -110.000000 + + + H:1.0 CH3O:1 + CH3:1 OH:1.0 + + + + + H + CH3O [=] CH2Q + H2O + + + 2.620000E+11 + -0.23000000000000001 + 1070.000000 + + + H:1.0 CH3O:1 + CH2Q:1.0 H2O:1 + + + + + H + CH3OH [=] CH2OH + H2 + + + 1.700000E+04 + 2.1000000000000001 + 4870.000000 + + + CH3OH:1 H:1.0 + H2:1 CH2OH:1.0 + + + + + H + CH3OH [=] CH3O + H2 + + + 4.200000E+03 + 2.1000000000000001 + 4870.000000 + + + CH3OH:1 H:1.0 + H2:1 CH3O:1.0 + + + + + H + C2H (+ M) [=] C2H2 (+ M) + + + 1.000000E+14 + -1 + 0.000000 + + + 3.750000E+27 + -4.7999999999999998 + 1900.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.6464 132 1315 5566 + + H:1.0 C2H:1 + C2H2:1.0 + + + + + H + C2H2 (+ M) [=] C2H3 (+ M) + + + 5.600000E+09 + 0 + 2400.000000 + + + 3.800000E+34 + -7.2699999999999996 + 7220.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.7507 98.5 1302 4167 + + H:1.0 C2H2:1 + C2H3:1.0 + + + + + H + C2H3 (+ M) [=] C2H4 (+ M) + + + 6.080000E+09 + 0.27000000000000002 + 280.000000 + + + 1.400000E+24 + -3.8599999999999999 + 3320.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.782 207.5 2663 6095 + + H:1.0 C2H3:1 + C2H4:1.0 + + + + + H + C2H3 [=] H2 + C2H2 + + + 3.000000E+10 + 0 + 0.000000 + + + H:1.0 C2H3:1 + H2:1.0 C2H2:1 + + + + + H + C2H4 (+ M) [=] C2H5 (+ M) + + + 5.400000E+08 + 0.45400000000000001 + 1820.000000 + + + 6.000000E+35 + -7.6200000000000001 + 6970.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.9753 210 984 4374 + + H:1.0 C2H4:1 + C2H5:1.0 + + + + + H + C2H4 [=] C2H3 + H2 + + + 1.325000E+03 + 2.5299999999999998 + 12240.000000 + + + H:1.0 C2H4:1 + H2:1 C2H3:1.0 + + + + + H + C2H5 (+ M) [=] C2H6 (+ M) + + + 5.210000E+14 + -0.98999999999999999 + 1580.000000 + + + 1.990000E+35 + -7.0800000000000001 + 6685.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.8422 125 2219 6882 + + H:1.0 C2H5:1 + C2H6:1.0 + + + + + H + C2H5 [=] H2 + C2H4 + + + 2.000000E+09 + 0 + 0.000000 + + + H:1.0 C2H5:1 + H2:1.0 C2H4:1 + + + + + H + C2H6 [=] C2H5 + H2 + + + 1.150000E+05 + 1.8999999999999999 + 7530.000000 + + + H:1.0 C2H6:1 + H2:1 C2H5:1.0 + + + + + H + HCCO [=] CH2Q + CO + + + 1.000000E+11 + 0 + 0.000000 + + + H:1.0 HCCO:1 + CH2Q:1.0 CO:1 + + + + + H + CH2CO [=] HCCO + H2 + + + 5.000000E+10 + 0 + 8000.000000 + + + H:1.0 CH2CO:1 + H2:1 HCCO:1.0 + + + + + H + CH2CO [=] CH3 + CO + + + 1.130000E+10 + 0 + 3428.000000 + + + H:1.0 CH2CO:1 + CH3:1.0 CO:1 + + + + + H + HCCOH [=] H + CH2CO + + + 1.000000E+10 + 0 + 0.000000 + + + H:1.0 HCCOH:1 + H:1.0 CH2CO:1 + + + + + H2 + CO (+ M) [=] CH2O (+ M) + + + 4.300000E+04 + 1.5 + 79600.000000 + + + 5.070000E+21 + -3.4199999999999999 + 84350.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.932 197 1540 10300 + + H2:1.0 CO:1 + CH2O:1.0 + + + + + OH + H2 [=] H + H2O + + + 2.160000E+05 + 1.51 + 3430.000000 + + + H2:1 OH:1.0 + H:1.0 H2O:1 + + + + + 2 OH (+ M) [=] H2O2 (+ M) + + + 7.400000E+10 + -0.37 + 0.000000 + + + 2.300000E+12 + -0.90000000000000002 + -1700.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.7346 94 1756 5182 + + OH:2.0 + H2O2:1.0 + + + + + 2 OH [=] O + H2O + + + 3.570000E+01 + 2.3999999999999999 + -2110.000000 + + + OH:2.0 + H2O:1 O:1.0 + + + + + OH + HO2 [=] O2 + H2O + + + 1.450000E+10 + 0 + -500.000000 + + + HO2:1 OH:1.0 + H2O:1 O2:1.0 + + + + + OH + H2O2 [=] HO2 + H2O + + + 2.000000E+09 + 0 + 427.000000 + + + H2O2:1 OH:1.0 + H2O:1 HO2:1.0 + + + + + OH + H2O2 [=] HO2 + H2O + + + 1.700000E+15 + 0 + 29410.000000 + + + H2O2:1 OH:1.0 + H2O:1 HO2:1.0 + + + + + OH + C [=] H + CO + + + 5.000000E+10 + 0 + 0.000000 + + + C:1 OH:1.0 + H:1.0 CO:1 + + + + + OH + CH [=] H + HCO + + + 3.000000E+10 + 0 + 0.000000 + + + CH:1 OH:1.0 + H:1.0 HCO:1 + + + + + OH + CH2 [=] H + CH2O + + + 2.000000E+10 + 0 + 0.000000 + + + CH2:1 OH:1.0 + CH2O:1 H:1.0 + + + + + OH + CH2 [=] CH + H2O + + + 1.130000E+04 + 2 + 3000.000000 + + + CH2:1 OH:1.0 + H2O:1 CH:1.0 + + + + + OH + CH2Q [=] H + CH2O + + + 3.000000E+10 + 0 + 0.000000 + + + CH2Q:1 OH:1.0 + CH2O:1 H:1.0 + + + + + OH + CH3 (+ M) [=] CH3OH (+ M) + + + 2.790000E+15 + -1.4299999999999999 + 1330.000000 + + + 4.000000E+30 + -5.9199999999999999 + 3140.000000 + + C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.412 195 5900 6394 + + CH3:1 OH:1.0 + CH3OH:1.0 + + + + + OH + CH3 [=] CH2 + H2O + + + 5.600000E+04 + 1.6000000000000001 + 5420.000000 + + + CH3:1 OH:1.0 + CH2:1.0 H2O:1 + + + + + OH + CH3 [=] CH2Q + H2O + + + 6.440000E+14 + -1.3400000000000001 + 1417.000000 + + + CH3:1 OH:1.0 + CH2Q:1.0 H2O:1 + + + + + OH + CH4 [=] CH3 + H2O + + + 1.000000E+05 + 1.6000000000000001 + 3120.000000 + + + CH4:1 OH:1.0 + H2O:1 CH3:1.0 + + + + + OH + CO [=] H + CO2 + + + 4.760000E+04 + 1.228 + 70.000000 + + + CO:1 OH:1.0 + H:1.0 CO2:1 + + + + + OH + HCO [=] H2O + CO + + + 5.000000E+10 + 0 + 0.000000 + + + HCO:1 OH:1.0 + H2O:1.0 CO:1 + + + + + OH + CH2O [=] HCO + H2O + + + 3.430000E+06 + 1.1799999999999999 + -447.000000 + + + CH2O:1 OH:1.0 + H2O:1 HCO:1.0 + + + + + OH + CH2OH [=] H2O + CH2O + + + 5.000000E+09 + 0 + 0.000000 + + + CH2OH:1 OH:1.0 + CH2O:1 H2O:1.0 + + + + + OH + CH3O [=] H2O + CH2O + + + 5.000000E+09 + 0 + 0.000000 + + + CH3O:1 OH:1.0 + CH2O:1 H2O:1.0 + + + + + OH + CH3OH [=] CH2OH + H2O + + + 1.440000E+03 + 2 + -840.000000 + + + CH3OH:1 OH:1.0 + CH2OH:1.0 H2O:1 + + + + + OH + CH3OH [=] CH3O + H2O + + + 6.300000E+03 + 2 + 1500.000000 + + + CH3OH:1 OH:1.0 + H2O:1 CH3O:1.0 + + + + + OH + C2H [=] H + HCCO + + + 2.000000E+10 + 0 + 0.000000 + + + C2H:1 OH:1.0 + H:1.0 HCCO:1 + + + + + OH + C2H2 [=] H + CH2CO + + + 2.180000E-07 + 4.5 + -1000.000000 + + + C2H2:1 OH:1.0 + H:1.0 CH2CO:1 + + + + + OH + C2H2 [=] H + HCCOH + + + 5.040000E+02 + 2.2999999999999998 + 13500.000000 + + + C2H2:1 OH:1.0 + H:1.0 HCCOH:1 + + + + + OH + C2H2 [=] C2H + H2O + + + 3.370000E+04 + 2 + 14000.000000 + + + C2H2:1 OH:1.0 + C2H:1.0 H2O:1 + + + + + OH + C2H2 [=] CH3 + CO + + + 4.830000E-07 + 4 + -2000.000000 + + + C2H2:1 OH:1.0 + CH3:1.0 CO:1 + + + + + OH + C2H3 [=] H2O + C2H2 + + + 5.000000E+09 + 0 + 0.000000 + + + C2H3:1 OH:1.0 + H2O:1.0 C2H2:1 + + + + + OH + C2H4 [=] C2H3 + H2O + + + 3.600000E+03 + 2 + 2500.000000 + + + C2H4:1 OH:1.0 + H2O:1 C2H3:1.0 + + + + + OH + C2H6 [=] C2H5 + H2O + + + 3.540000E+03 + 2.1200000000000001 + 870.000000 + + + C2H6:1 OH:1.0 + C2H5:1.0 H2O:1 + + + + + OH + CH2CO [=] HCCO + H2O + + + 7.500000E+09 + 0 + 2000.000000 + + + CH2CO:1 OH:1.0 + H2O:1 HCCO:1.0 + + + + + 2 HO2 [=] O2 + H2O2 + + + 1.300000E+08 + 0 + -1630.000000 + + + HO2:2.0 + O2:1.0 H2O2:1 + + + + + 2 HO2 [=] O2 + H2O2 + + + 4.200000E+11 + 0 + 12000.000000 + + + HO2:2.0 + O2:1.0 H2O2:1 + + + + + HO2 + CH2 [=] OH + CH2O + + + 2.000000E+10 + 0 + 0.000000 + + + CH2:1 HO2:1.0 + CH2O:1 OH:1.0 + + + + + HO2 + CH3 [=] O2 + CH4 + + + 1.000000E+09 + 0 + 0.000000 + + + CH3:1 HO2:1.0 + CH4:1 O2:1.0 + + + + + HO2 + CH3 [=] OH + CH3O + + + 3.780000E+10 + 0 + 0.000000 + + + CH3:1 HO2:1.0 + CH3O:1 OH:1.0 + + + + + HO2 + CO [=] OH + CO2 + + + 1.500000E+11 + 0 + 23600.000000 + + + CO:1 HO2:1.0 + CO2:1 OH:1.0 + + + + + HO2 + CH2O [=] HCO + H2O2 + + + 5.600000E+03 + 2 + 12000.000000 + + + CH2O:1 HO2:1.0 + HCO:1.0 H2O2:1 + + + + + C + O2 [=] O + CO + + + 5.800000E+10 + 0 + 576.000000 + + + C:1.0 O2:1 + CO:1 O:1.0 + + + + + C + CH2 [=] H + C2H + + + 5.000000E+10 + 0 + 0.000000 + + + C:1.0 CH2:1 + H:1.0 C2H:1 + + + + + C + CH3 [=] H + C2H2 + + + 5.000000E+10 + 0 + 0.000000 + + + C:1.0 CH3:1 + H:1.0 C2H2:1 + + + + + CH + O2 [=] O + HCO + + + 6.710000E+10 + 0 + 0.000000 + + + CH:1.0 O2:1 + HCO:1 O:1.0 + + + + + CH + H2 [=] H + CH2 + + + 1.080000E+11 + 0 + 3110.000000 + + + H2:1 CH:1.0 + H:1.0 CH2:1 + + + + + CH + H2O [=] H + CH2O + + + 5.710000E+09 + 0 + -755.000000 + + + H2O:1 CH:1.0 + CH2O:1 H:1.0 + + + + + CH + CH2 [=] H + C2H2 + + + 4.000000E+10 + 0 + 0.000000 + + + CH2:1 CH:1.0 + H:1.0 C2H2:1 + + + + + CH + CH3 [=] H + C2H3 + + + 3.000000E+10 + 0 + 0.000000 + + + CH3:1 CH:1.0 + H:1.0 C2H3:1 + + + + + CH + CH4 [=] H + C2H4 + + + 6.000000E+10 + 0 + 0.000000 + + + CH:1.0 CH4:1 + H:1.0 C2H4:1 + + + + + CH + CO (+ M) [=] HCCO (+ M) + + + 5.000000E+10 + 0 + 0.000000 + + + 2.690000E+22 + -3.7400000000000002 + 1936.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.5757 237 1652 5069 + + CH:1.0 CO:1 + HCCO:1.0 + + + + + CH + CO2 [=] HCO + CO + + + 1.900000E+11 + 0 + 15792.000000 + + + CH:1.0 CO2:1 + CO:1 HCO:1.0 + + + + + CH + CH2O [=] H + CH2CO + + + 9.460000E+10 + 0 + -515.000000 + + + CH2O:1 CH:1.0 + H:1.0 CH2CO:1 + + + + + CH + HCCO [=] CO + C2H2 + + + 5.000000E+10 + 0 + 0.000000 + + + CH:1.0 HCCO:1 + CO:1.0 C2H2:1 + + + + + CH2 + O2 [=] OH + H + CO + + + 5.000000E+09 + 0 + 1500.000000 + + + CH2:1.0 O2:1 + H:1 CO:1 OH:1.0 + + + + + CH2 + H2 [=] H + CH3 + + + 5.000000E+02 + 2 + 7230.000000 + + + H2:1 CH2:1.0 + H:1.0 CH3:1 + + + + + 2 CH2 [=] H2 + C2H2 + + + 1.600000E+12 + 0 + 11944.000000 + + + CH2:2.0 + H2:1.0 C2H2:1 + + + + + CH2 + CH3 [=] H + C2H4 + + + 4.000000E+10 + 0 + 0.000000 + + + CH2:1.0 CH3:1 + H:1.0 C2H4:1 + + + + + CH2 + CH4 [=] 2 CH3 + + + 2.460000E+03 + 2 + 8270.000000 + + + CH2:1.0 CH4:1 + CH3:2.0 + + + + + CH2 + CO (+ M) [=] CH2CO (+ M) + + + 8.100000E+08 + 0.5 + 4510.000000 + + + 2.690000E+27 + -5.1100000000000003 + 7095.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.5907 275 1226 5185 + + CH2:1.0 CO:1 + CH2CO:1.0 + + + + + CH2 + HCCO [=] C2H3 + CO + + + 3.000000E+10 + 0 + 0.000000 + + + CH2:1.0 HCCO:1 + CO:1 C2H3:1.0 + + + + + CH2Q + N2 [=] CH2 + N2 + + + 1.500000E+10 + 0 + 600.000000 + + + CH2Q:1.0 N2:1 + CH2:1.0 N2:1 + + + + + CH2Q + AR [=] CH2 + AR + + + 9.000000E+09 + 0 + 600.000000 + + + CH2Q:1.0 AR:1 + CH2:1.0 AR:1 + + + + + CH2Q + O2 [=] H + OH + CO + + + 2.800000E+10 + 0 + 0.000000 + + + CH2Q:1.0 O2:1 + H:1.0 CO:1 OH:1 + + + + + CH2Q + O2 [=] CO + H2O + + + 1.200000E+10 + 0 + 0.000000 + + + CH2Q:1.0 O2:1 + H2O:1 CO:1.0 + + + + + CH2Q + H2 [=] CH3 + H + + + 7.000000E+10 + 0 + 0.000000 + + + H2:1 CH2Q:1.0 + H:1 CH3:1.0 + + + + + CH2Q + H2O (+ M) [=] CH3OH (+ M) + + + 4.820000E+14 + -1.1599999999999999 + 1145.000000 + + + 1.880000E+32 + -6.3600000000000003 + 5040.000000 + + C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.6027 208 3922 10180 + + CH2Q:1.0 H2O:1 + CH3OH:1.0 + + + + + CH2Q + H2O [=] CH2 + H2O + + + 3.000000E+10 + 0 + 0.000000 + + + CH2Q:1.0 H2O:1 + CH2:1.0 H2O:1 + + + + + CH2Q + CH3 [=] H + C2H4 + + + 1.200000E+10 + 0 + -570.000000 + + + CH2Q:1.0 CH3:1 + H:1.0 C2H4:1 + + + + + CH2Q + CH4 [=] 2 CH3 + + + 1.600000E+10 + 0 + -570.000000 + + + CH2Q:1.0 CH4:1 + CH3:2.0 + + + + + CH2Q + CO [=] CH2 + CO + + + 9.000000E+09 + 0 + 0.000000 + + + CH2Q:1.0 CO:1 + CH2:1.0 CO:1 + + + + + CH2Q + CO2 [=] CH2 + CO2 + + + 7.000000E+09 + 0 + 0.000000 + + + CH2Q:1.0 CO2:1 + CH2:1.0 CO2:1 + + + + + CH2Q + CO2 [=] CO + CH2O + + + 1.400000E+10 + 0 + 0.000000 + + + CH2Q:1.0 CO2:1 + CH2O:1 CO:1.0 + + + + + CH2Q + C2H6 [=] CH3 + C2H5 + + + 4.000000E+10 + 0 + -550.000000 + + + CH2Q:1.0 C2H6:1 + C2H5:1 CH3:1.0 + + + + + CH3 + O2 [=] O + CH3O + + + 3.560000E+10 + 0 + 30480.000000 + + + CH3:1.0 O2:1 + CH3O:1 O:1.0 + + + + + CH3 + O2 [=] OH + CH2O + + + 2.310000E+09 + 0 + 20315.000000 + + + CH3:1.0 O2:1 + CH2O:1 OH:1.0 + + + + + CH3 + H2O2 [=] HO2 + CH4 + + + 2.450000E+01 + 2.4700000000000002 + 5180.000000 + + + CH3:1.0 H2O2:1 + CH4:1 HO2:1.0 + + + + + 2 CH3 (+ M) [=] C2H6 (+ M) + + + 6.770000E+13 + -1.1799999999999999 + 654.000000 + + + 3.400000E+35 + -7.0300000000000002 + 2762.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.619 73.2 1180 9999 + + CH3:2.0 + C2H6:1.0 + + + + + 2 CH3 [=] H + C2H5 + + + 6.840000E+09 + 0.10000000000000001 + 10600.000000 + + + CH3:2.0 + H:1.0 C2H5:1 + + + + + CH3 + HCO [=] CH4 + CO + + + 2.648000E+10 + 0 + 0.000000 + + + CH3:1.0 HCO:1 + CO:1 CH4:1.0 + + + + + CH3 + CH2O [=] HCO + CH4 + + + 3.320000E+00 + 2.8100000000000001 + 5860.000000 + + + CH2O:1 CH3:1.0 + CH4:1 HCO:1.0 + + + + + CH3 + CH3OH [=] CH2OH + CH4 + + + 3.000000E+04 + 1.5 + 9940.000000 + + + CH3OH:1 CH3:1.0 + CH2OH:1.0 CH4:1 + + + + + CH3 + CH3OH [=] CH3O + CH4 + + + 1.000000E+04 + 1.5 + 9940.000000 + + + CH3OH:1 CH3:1.0 + CH3O:1.0 CH4:1 + + + + + CH3 + C2H4 [=] C2H3 + CH4 + + + 2.270000E+02 + 2 + 9200.000000 + + + CH3:1.0 C2H4:1 + CH4:1 C2H3:1.0 + + + + + CH3 + C2H6 [=] C2H5 + CH4 + + + 6.140000E+03 + 1.74 + 10450.000000 + + + C2H6:1 CH3:1.0 + C2H5:1.0 CH4:1 + + + + + HCO + H2O [=] H + CO + H2O + + + 1.500000E+15 + -1 + 17000.000000 + + + H2O:1 HCO:1.0 + H:1.0 H2O:1 CO:1 + + + + + HCO + M [=] H + CO + M + + + 1.870000E+14 + -1 + 17000.000000 + + C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:0 + + HCO:1.0 + H:1.0 CO:1 + + + + + HCO + O2 [=] HO2 + CO + + + 1.345000E+10 + 0 + 400.000000 + + + HCO:1.0 O2:1 + CO:1 HO2:1.0 + + + + + CH2OH + O2 [=] HO2 + CH2O + + + 1.800000E+10 + 0 + 900.000000 + + + CH2OH:1.0 O2:1 + CH2O:1 HO2:1.0 + + + + + CH3O + O2 [=] HO2 + CH2O + + + 4.280000E-16 + 7.5999999999999996 + -3530.000000 + + + CH3O:1.0 O2:1 + CH2O:1 HO2:1.0 + + + + + C2H + O2 [=] HCO + CO + + + 1.000000E+10 + 0 + -755.000000 + + + C2H:1.0 O2:1 + CO:1 HCO:1.0 + + + + + C2H + H2 [=] H + C2H2 + + + 5.680000E+07 + 0.90000000000000002 + 1993.000000 + + + H2:1 C2H:1.0 + H:1.0 C2H2:1 + + + + + C2H3 + O2 [=] HCO + CH2O + + + 4.580000E+13 + -1.3899999999999999 + 1015.000000 + + + C2H3:1.0 O2:1 + CH2O:1 HCO:1.0 + + + + + C2H4 (+ M) [=] H2 + C2H2 (+ M) + + + 8.000000E+12 + 0.44 + 86770.000000 + + + 1.580000E+48 + -9.3000000000000007 + 97800.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.7345 180 1035 5417 + + C2H4:1.0 + H2:1.0 C2H2:1 + + + + + C2H5 + O2 [=] HO2 + C2H4 + + + 8.400000E+08 + 0 + 3875.000000 + + + C2H5:1.0 O2:1 + C2H4:1 HO2:1.0 + + + + + HCCO + O2 [=] OH + 2 CO + + + 3.200000E+09 + 0 + 854.000000 + + + HCCO:1.0 O2:1 + CO:2.0 OH:1.0 + + + + + 2 HCCO [=] 2 CO + C2H2 + + + 1.000000E+10 + 0 + 0.000000 + + + HCCO:2.0 + CO:2.0 C2H2:1 + + + + + N + NO [=] N2 + O + + + 2.700000E+10 + 0 + 355.000000 + + + NO:1 N:1.0 + N2:1.0 O:1 + + + + + N + O2 [=] NO + O + + + 9.000000E+06 + 1 + 6500.000000 + + + O2:1 N:1.0 + O:1 NO:1.0 + + + + + N + OH [=] NO + H + + + 3.360000E+10 + 0 + 385.000000 + + + OH:1 N:1.0 + H:1 NO:1.0 + + + + + N2O + O [=] N2 + O2 + + + 1.400000E+09 + 0 + 10810.000000 + + + N2O:1.0 O:1 + N2:1.0 O2:1 + + + + + N2O + O [=] 2 NO + + + 2.900000E+10 + 0 + 23150.000000 + + + N2O:1.0 O:1 + NO:2.0 + + + + + N2O + H [=] N2 + OH + + + 3.870000E+11 + 0 + 18880.000000 + + + H:1 N2O:1.0 + N2:1.0 OH:1 + + + + + N2O + OH [=] N2 + HO2 + + + 2.000000E+09 + 0 + 21060.000000 + + + N2O:1.0 OH:1 + N2:1.0 HO2:1 + + + + + N2O (+ M) [=] N2 + O (+ M) + + + 7.910000E+10 + 0 + 56020.000000 + + + 6.370000E+11 + 0 + 56640.000000 + + AR:0.625 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + + N2O:1.0 + N2:1.0 O:1 + + + + + HO2 + NO [=] NO2 + OH + + + 2.110000E+09 + 0 + -480.000000 + + + HO2:1.0 NO:1 + NO2:1.0 OH:1 + + + + + NO + O + M [=] NO2 + M + + + 1.060000E+14 + -1.4099999999999999 + 0.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + O:1 NO:1.0 + NO2:1.0 + + + + + NO2 + O [=] NO + O2 + + + 3.900000E+09 + 0 + -240.000000 + + + O:1 NO2:1.0 + O2:1 NO:1.0 + + + + + NO2 + H [=] NO + OH + + + 1.320000E+11 + 0 + 360.000000 + + + H:1 NO2:1.0 + OH:1 NO:1.0 + + + + + NH + O [=] NO + H + + + 4.000000E+10 + 0 + 0.000000 + + + NH:1.0 O:1 + H:1 NO:1.0 + + + + + NH + H [=] N + H2 + + + 3.200000E+10 + 0 + 330.000000 + + + NH:1.0 H:1 + H2:1 N:1.0 + + + + + NH + OH [=] HNO + H + + + 2.000000E+10 + 0 + 0.000000 + + + NH:1.0 OH:1 + H:1 HNO:1.0 + + + + + NH + OH [=] N + H2O + + + 2.000000E+06 + 1.2 + 0.000000 + + + NH:1.0 OH:1 + H2O:1 N:1.0 + + + + + NH + O2 [=] HNO + O + + + 4.610000E+02 + 2 + 6500.000000 + + + NH:1.0 O2:1 + O:1 HNO:1.0 + + + + + NH + O2 [=] NO + OH + + + 1.280000E+03 + 1.5 + 100.000000 + + + NH:1.0 O2:1 + OH:1 NO:1.0 + + + + + NH + N [=] N2 + H + + + 1.500000E+10 + 0 + 0.000000 + + + NH:1.0 N:1 + H:1 N2:1.0 + + + + + NH + H2O [=] HNO + H2 + + + 2.000000E+10 + 0 + 13850.000000 + + + NH:1.0 H2O:1 + H2:1 HNO:1.0 + + + + + NH + NO [=] N2 + OH + + + 2.160000E+10 + -0.23000000000000001 + 0.000000 + + + NH:1.0 NO:1 + N2:1.0 OH:1 + + + + + NH + NO [=] N2O + H + + + 3.650000E+11 + -0.45000000000000001 + 0.000000 + + + NH:1.0 NO:1 + H:1 N2O:1.0 + + + + + NH2 + O [=] OH + NH + + + 3.000000E+09 + 0 + 0.000000 + + + O:1 NH2:1.0 + NH:1 OH:1.0 + + + + + NH2 + O [=] H + HNO + + + 3.900000E+10 + 0 + 0.000000 + + + O:1 NH2:1.0 + H:1.0 HNO:1 + + + + + NH2 + H [=] NH + H2 + + + 4.000000E+10 + 0 + 3650.000000 + + + H:1 NH2:1.0 + NH:1.0 H2:1 + + + + + NH2 + OH [=] NH + H2O + + + 9.000000E+04 + 1.5 + -460.000000 + + + OH:1 NH2:1.0 + NH:1.0 H2O:1 + + + + + NNH [=] N2 + H + + + 3.300000E+08 + 0 + 0.000000 + + + NNH:1.0 + H:1 N2:1.0 + + + + + NNH + M [=] N2 + H + M + + + 1.300000E+11 + -0.11 + 4980.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + NNH:1.0 + H:1 N2:1.0 + + + + + NNH + O2 [=] HO2 + N2 + + + 5.000000E+09 + 0 + 0.000000 + + + O2:1 NNH:1.0 + N2:1 HO2:1.0 + + + + + NNH + O [=] OH + N2 + + + 2.500000E+10 + 0 + 0.000000 + + + O:1 NNH:1.0 + N2:1 OH:1.0 + + + + + NNH + O [=] NH + NO + + + 7.000000E+10 + 0 + 0.000000 + + + O:1 NNH:1.0 + NH:1.0 NO:1 + + + + + NNH + H [=] H2 + N2 + + + 5.000000E+10 + 0 + 0.000000 + + + H:1 NNH:1.0 + H2:1.0 N2:1 + + + + + NNH + OH [=] H2O + N2 + + + 2.000000E+10 + 0 + 0.000000 + + + OH:1 NNH:1.0 + H2O:1.0 N2:1 + + + + + NNH + CH3 [=] CH4 + N2 + + + 2.500000E+10 + 0 + 0.000000 + + + CH3:1 NNH:1.0 + N2:1 CH4:1.0 + + + + + H + NO + M [=] HNO + M + + + 4.480000E+13 + -1.3200000000000001 + 740.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + H:1.0 NO:1 + HNO:1.0 + + + + + HNO + O [=] NO + OH + + + 2.500000E+10 + 0 + 0.000000 + + + O:1 HNO:1.0 + OH:1 NO:1.0 + + + + + HNO + H [=] H2 + NO + + + 9.000000E+08 + 0.71999999999999997 + 660.000000 + + + H:1 HNO:1.0 + H2:1.0 NO:1 + + + + + HNO + OH [=] NO + H2O + + + 1.300000E+04 + 1.8999999999999999 + -950.000000 + + + HNO:1.0 OH:1 + H2O:1 NO:1.0 + + + + + HNO + O2 [=] HO2 + NO + + + 1.000000E+10 + 0 + 13000.000000 + + + O2:1 HNO:1.0 + HO2:1.0 NO:1 + + + + + CN + O [=] CO + N + + + 7.700000E+10 + 0 + 0.000000 + + + CN:1.0 O:1 + CO:1.0 N:1 + + + + + CN + OH [=] NCO + H + + + 4.000000E+10 + 0 + 0.000000 + + + CN:1.0 OH:1 + H:1 NCO:1.0 + + + + + CN + H2O [=] HCN + OH + + + 8.000000E+09 + 0 + 7460.000000 + + + H2O:1 CN:1.0 + HCN:1.0 OH:1 + + + + + CN + O2 [=] NCO + O + + + 6.140000E+09 + 0 + -440.000000 + + + CN:1.0 O2:1 + O:1 NCO:1.0 + + + + + CN + H2 [=] HCN + H + + + 2.950000E+02 + 2.4500000000000002 + 2240.000000 + + + H2:1 CN:1.0 + H:1 HCN:1.0 + + + + + NCO + O [=] NO + CO + + + 2.350000E+10 + 0 + 0.000000 + + + O:1 NCO:1.0 + CO:1 NO:1.0 + + + + + NCO + H [=] NH + CO + + + 5.400000E+10 + 0 + 0.000000 + + + H:1 NCO:1.0 + NH:1.0 CO:1 + + + + + NCO + OH [=] NO + H + CO + + + 2.500000E+09 + 0 + 0.000000 + + + OH:1 NCO:1.0 + H:1 CO:1 NO:1.0 + + + + + NCO + N [=] N2 + CO + + + 2.000000E+10 + 0 + 0.000000 + + + N:1 NCO:1.0 + N2:1.0 CO:1 + + + + + NCO + O2 [=] NO + CO2 + + + 2.000000E+09 + 0 + 20000.000000 + + + O2:1 NCO:1.0 + CO2:1 NO:1.0 + + + + + NCO + M [=] N + CO + M + + + 3.100000E+11 + 0 + 54050.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + NCO:1.0 + CO:1 N:1.0 + + + + + NCO + NO [=] N2O + CO + + + 1.900000E+14 + -1.52 + 740.000000 + + + NO:1 NCO:1.0 + CO:1 N2O:1.0 + + + + + NCO + NO [=] N2 + CO2 + + + 3.800000E+15 + -2 + 800.000000 + + + NO:1 NCO:1.0 + N2:1.0 CO2:1 + + + + + HCN + M [=] H + CN + M + + + 1.040000E+26 + -3.2999999999999998 + 126600.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + HCN:1.0 + H:1.0 CN:1 + + + + + HCN + O [=] NCO + H + + + 2.030000E+01 + 2.6400000000000001 + 4980.000000 + + + HCN:1.0 O:1 + H:1 NCO:1.0 + + + + + HCN + O [=] NH + CO + + + 5.070000E+00 + 2.6400000000000001 + 4980.000000 + + + HCN:1.0 O:1 + NH:1.0 CO:1 + + + + + HCN + O [=] CN + OH + + + 3.910000E+06 + 1.5800000000000001 + 26600.000000 + + + HCN:1.0 O:1 + CN:1.0 OH:1 + + + + + HCN + OH [=] HOCN + H + + + 1.100000E+03 + 2.0299999999999998 + 13370.000000 + + + HCN:1.0 OH:1 + HOCN:1.0 H:1 + + + + + HCN + OH [=] HNCO + H + + + 4.400000E+00 + 2.2599999999999998 + 6400.000000 + + + HCN:1.0 OH:1 + HNCO:1.0 H:1 + + + + + HCN + OH [=] NH2 + CO + + + 1.600000E-01 + 2.5600000000000001 + 9000.000000 + + + HCN:1.0 OH:1 + CO:1 NH2:1.0 + + + + + H + HCN (+ M) [=] H2CN (+ M) + + + 3.300000E+10 + 0 + 0.000000 + + + 1.400000E+20 + -3.3999999999999999 + 1900.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + + H:1.0 HCN:1 + H2CN:1.0 + + + + + H2CN + N [=] N2 + CH2 + + + 6.000000E+10 + 0 + 400.000000 + + + H2CN:1.0 N:1 + N2:1.0 CH2:1 + + + + + C + N2 [=] CN + N + + + 6.300000E+10 + 0 + 46020.000000 + + + C:1.0 N2:1 + CN:1.0 N:1 + + + + + CH + N2 [=] HCN + N + + + 3.120000E+06 + 0.88 + 20130.000000 + + + N2:1 CH:1.0 + HCN:1.0 N:1 + + + + + CH + N2 (+ M) [=] HCNN (+ M) + + + 3.100000E+09 + 0.14999999999999999 + 0.000000 + + + 1.300000E+19 + -3.1600000000000001 + 740.000000 + + AR:1 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.667 235 2117 4536 + + N2:1 CH:1.0 + HCNN:1.0 + + + + + CH2 + N2 [=] HCN + NH + + + 1.000000E+10 + 0 + 74000.000000 + + + CH2:1.0 N2:1 + NH:1 HCN:1.0 + + + + + CH2Q + N2 [=] NH + HCN + + + 1.000000E+08 + 0 + 65000.000000 + + + CH2Q:1.0 N2:1 + NH:1.0 HCN:1 + + + + + C + NO [=] CN + O + + + 1.900000E+10 + 0 + 0.000000 + + + C:1.0 NO:1 + CN:1.0 O:1 + + + + + C + NO [=] CO + N + + + 2.900000E+10 + 0 + 0.000000 + + + C:1.0 NO:1 + CO:1.0 N:1 + + + + + CH + NO [=] HCN + O + + + 4.100000E+10 + 0 + 0.000000 + + + CH:1.0 NO:1 + HCN:1.0 O:1 + + + + + CH + NO [=] H + NCO + + + 1.620000E+10 + 0 + 0.000000 + + + CH:1.0 NO:1 + H:1.0 NCO:1 + + + + + CH + NO [=] N + HCO + + + 2.460000E+10 + 0 + 0.000000 + + + CH:1.0 NO:1 + HCO:1 N:1.0 + + + + + CH2 + NO [=] H + HNCO + + + 3.100000E+14 + -1.3799999999999999 + 1270.000000 + + + CH2:1.0 NO:1 + HNCO:1 H:1.0 + + + + + CH2 + NO [=] OH + HCN + + + 2.900000E+11 + -0.68999999999999995 + 760.000000 + + + CH2:1.0 NO:1 + HCN:1 OH:1.0 + + + + + CH2 + NO [=] H + HCNO + + + 3.800000E+10 + -0.35999999999999999 + 580.000000 + + + CH2:1.0 NO:1 + H:1.0 HCNO:1 + + + + + CH2Q + NO [=] H + HNCO + + + 3.100000E+14 + -1.3799999999999999 + 1270.000000 + + + CH2Q:1.0 NO:1 + HNCO:1 H:1.0 + + + + + CH2Q + NO [=] OH + HCN + + + 2.900000E+11 + -0.68999999999999995 + 760.000000 + + + CH2Q:1.0 NO:1 + HCN:1 OH:1.0 + + + + + CH2Q + NO [=] H + HCNO + + + 3.800000E+10 + -0.35999999999999999 + 580.000000 + + + CH2Q:1.0 NO:1 + H:1.0 HCNO:1 + + + + + CH3 + NO [=] HCN + H2O + + + 9.600000E+10 + 0 + 28800.000000 + + + CH3:1.0 NO:1 + H2O:1 HCN:1.0 + + + + + CH3 + NO [=] H2CN + OH + + + 1.000000E+09 + 0 + 21750.000000 + + + CH3:1.0 NO:1 + H2CN:1.0 OH:1 + + + + + HCNN + O [=] CO + H + N2 + + + 2.200000E+10 + 0 + 0.000000 + + + O:1 HCNN:1.0 + H:1 N2:1 CO:1.0 + + + + + HCNN + O [=] HCN + NO + + + 2.000000E+09 + 0 + 0.000000 + + + O:1 HCNN:1.0 + HCN:1.0 NO:1 + + + + + HCNN + O2 [=] O + HCO + N2 + + + 1.200000E+10 + 0 + 0.000000 + + + O2:1 HCNN:1.0 + N2:1 HCO:1 O:1.0 + + + + + HCNN + OH [=] H + HCO + N2 + + + 1.200000E+10 + 0 + 0.000000 + + + OH:1 HCNN:1.0 + H:1.0 N2:1 HCO:1 + + + + + HCNN + H [=] CH2 + N2 + + + 1.000000E+11 + 0 + 0.000000 + + + H:1 HCNN:1.0 + CH2:1.0 N2:1 + + + + + HNCO + O [=] NH + CO2 + + + 9.800000E+04 + 1.4099999999999999 + 8500.000000 + + + HNCO:1.0 O:1 + NH:1.0 CO2:1 + + + + + HNCO + O [=] HNO + CO + + + 1.500000E+05 + 1.5700000000000001 + 44000.000000 + + + HNCO:1.0 O:1 + CO:1 HNO:1.0 + + + + + HNCO + O [=] NCO + OH + + + 2.200000E+03 + 2.1099999999999999 + 11400.000000 + + + HNCO:1.0 O:1 + OH:1 NCO:1.0 + + + + + HNCO + H [=] NH2 + CO + + + 2.250000E+04 + 1.7 + 3800.000000 + + + HNCO:1.0 H:1 + CO:1 NH2:1.0 + + + + + HNCO + H [=] H2 + NCO + + + 1.050000E+02 + 2.5 + 13300.000000 + + + HNCO:1.0 H:1 + H2:1.0 NCO:1 + + + + + HNCO + OH [=] NCO + H2O + + + 3.300000E+04 + 1.5 + 3600.000000 + + + HNCO:1.0 OH:1 + H2O:1 NCO:1.0 + + + + + HNCO + OH [=] NH2 + CO2 + + + 3.300000E+03 + 1.5 + 3600.000000 + + + HNCO:1.0 OH:1 + CO2:1 NH2:1.0 + + + + + HNCO + M [=] NH + CO + M + + + 1.180000E+13 + 0 + 84720.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + + HNCO:1.0 + NH:1.0 CO:1 + + + + + HCNO + H [=] H + HNCO + + + 2.100000E+12 + -0.68999999999999995 + 2850.000000 + + + H:1 HCNO:1.0 + HNCO:1 H:1.0 + + + + + HCNO + H [=] OH + HCN + + + 2.700000E+08 + 0.17999999999999999 + 2120.000000 + + + H:1 HCNO:1.0 + HCN:1 OH:1.0 + + + + + HCNO + H [=] NH2 + CO + + + 1.700000E+11 + -0.75 + 2890.000000 + + + H:1 HCNO:1.0 + CO:1 NH2:1.0 + + + + + HOCN + H [=] H + HNCO + + + 2.000000E+04 + 2 + 2000.000000 + + + HOCN:1.0 H:1 + HNCO:1 H:1.0 + + + + + HCCO + NO [=] HCNO + CO + + + 9.000000E+09 + 0 + 0.000000 + + + HCCO:1.0 NO:1 + CO:1 HCNO:1.0 + + + + + CH3 + N [=] H2CN + H + + + 6.100000E+11 + -0.31 + 290.000000 + + + CH3:1.0 N:1 + H:1 H2CN:1.0 + + + + + CH3 + N [=] HCN + H2 + + + 3.700000E+09 + 0.14999999999999999 + -90.000000 + + + CH3:1.0 N:1 + H2:1 HCN:1.0 + + + + + NH3 + H [=] NH2 + H2 + + + 5.400000E+02 + 2.3999999999999999 + 9915.000000 + + + H:1 NH3:1.0 + H2:1 NH2:1.0 + + + + + NH3 + OH [=] NH2 + H2O + + + 5.000000E+04 + 1.6000000000000001 + 955.000000 + + + NH3:1.0 OH:1 + H2O:1 NH2:1.0 + + + + + NH3 + O [=] NH2 + OH + + + 9.400000E+03 + 1.9399999999999999 + 6460.000000 + + + O:1 NH3:1.0 + OH:1 NH2:1.0 + + + + + NH + CO2 [=] HNO + CO + + + 1.000000E+10 + 0 + 14350.000000 + + + NH:1.0 CO2:1 + CO:1 HNO:1.0 + + + + + CN + NO2 [=] NCO + NO + + + 6.160000E+12 + -0.752 + 345.000000 + + + CN:1.0 NO2:1 + NO:1 NCO:1.0 + + + + + NCO + NO2 [=] N2O + CO2 + + + 3.250000E+09 + 0 + -705.000000 + + + NO2:1 NCO:1.0 + CO2:1 N2O:1.0 + + + + + N + CO2 [=] NO + CO + + + 3.000000E+09 + 0 + 11300.000000 + + + CO2:1 N:1.0 + CO:1 NO:1.0 + + + + + O + CH3 [=] H + H2 + CO + + + 3.370000E+10 + 0 + 0.000000 + + + CH3:1 O:1.0 + H2:1 H:1.0 CO:1 + + + + + O + C2H4 [=] H + CH2CHO + + + 6.700000E+03 + 1.8300000000000001 + 220.000000 + + + C2H4:1 O:1.0 + H:1.0 CH2CHO:1 + + + + + O + C2H5 [=] H + CH3CHO + + + 1.096000E+11 + 0 + 0.000000 + + + C2H5:1 O:1.0 + H:1.0 CH3CHO:1 + + + + + OH + HO2 [=] O2 + H2O + + + 5.000000E+12 + 0 + 17330.000000 + + + HO2:1 OH:1.0 + H2O:1 O2:1.0 + + + + + OH + CH3 [=] H2 + CH2O + + + 8.000000E+06 + 0.5 + -1755.000000 + + + CH3:1 OH:1.0 + H2:1.0 CH2O:1 + + + + + CH + H2 (+ M) [=] CH3 (+ M) + + + 1.970000E+09 + 0.42999999999999999 + -370.000000 + + + 4.820000E+19 + -2.7999999999999998 + 590.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.578 122 2535 9365 + + H2:1 CH:1.0 + CH3:1.0 + + + + + CH2 + O2 [=] 2 H + CO2 + + + 5.800000E+09 + 0 + 1500.000000 + + + CH2:1.0 O2:1 + H:2.0 CO2:1 + + + + + CH2 + O2 [=] O + CH2O + + + 2.400000E+09 + 0 + 1500.000000 + + + CH2:1.0 O2:1 + CH2O:1 O:1.0 + + + + + CH2 + CH2 [=] 2 H + C2H2 + + + 2.000000E+11 + 0 + 10989.000000 + + + CH2:2.0 + H:2.0 C2H2:1 + + + + + CH2Q + H2O [=] H2 + CH2O + + + 6.820000E+07 + 0.25 + -935.000000 + + + CH2Q:1.0 H2O:1 + H2:1.0 CH2O:1 + + + + + C2H3 + O2 [=] O + CH2CHO + + + 3.030000E+08 + 0.28999999999999998 + 11.000000 + + + C2H3:1.0 O2:1 + CH2CHO:1 O:1.0 + + + + + C2H3 + O2 [=] HO2 + C2H2 + + + 1.337000E+03 + 1.6100000000000001 + -384.000000 + + + C2H3:1.0 O2:1 + HO2:1.0 C2H2:1 + + + + + O + CH3CHO [=] OH + CH2CHO + + + 5.840000E+09 + 0 + 1808.000000 + + + CH3CHO:1 O:1.0 + CH2CHO:1 OH:1.0 + + + + + O + CH3CHO [=] OH + CH3 + CO + + + 5.840000E+09 + 0 + 1808.000000 + + + CH3CHO:1 O:1.0 + CH3:1 CO:1 OH:1.0 + + + + + O2 + CH3CHO [=] HO2 + CH3 + CO + + + 3.010000E+10 + 0 + 39150.000000 + + + CH3CHO:1 O2:1.0 + CO:1 CH3:1 HO2:1.0 + + + + + H + CH3CHO [=] CH2CHO + H2 + + + 2.050000E+06 + 1.1599999999999999 + 2405.000000 + + + H:1.0 CH3CHO:1 + H2:1 CH2CHO:1.0 + + + + + H + CH3CHO [=] CH3 + H2 + CO + + + 2.050000E+06 + 1.1599999999999999 + 2405.000000 + + + H:1.0 CH3CHO:1 + H2:1 CH3:1.0 CO:1 + + + + + OH + CH3CHO [=] CH3 + H2O + CO + + + 2.343000E+07 + 0.72999999999999998 + -1113.000000 + + + CH3CHO:1 OH:1.0 + H2O:1 CH3:1.0 CO:1 + + + + + HO2 + CH3CHO [=] CH3 + H2O2 + CO + + + 3.010000E+09 + 0 + 11923.000000 + + + CH3CHO:1 HO2:1.0 + CH3:1.0 CO:1 H2O2:1 + + + + + CH3 + CH3CHO [=] CH3 + CH4 + CO + + + 2.720000E+03 + 1.77 + 5920.000000 + + + CH3CHO:1 CH3:1.0 + CO:1 CH3:1.0 CH4:1 + + + + + H + CH2CO (+ M) [=] CH2CHO (+ M) + + + 4.865000E+08 + 0.42199999999999999 + -1755.000000 + + + 1.012000E+36 + -7.6299999999999999 + 3854.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.465 201 1773 5333 + + H:1.0 CH2CO:1 + CH2CHO:1.0 + + + + + O + CH2CHO [=] H + CH2 + CO2 + + + 1.500000E+11 + 0 + 0.000000 + + + CH2CHO:1 O:1.0 + H:1.0 CH2:1 CO2:1 + + + + + O2 + CH2CHO [=] OH + CO + CH2O + + + 1.810000E+07 + 0 + 0.000000 + + + CH2CHO:1 O2:1.0 + CH2O:1 CO:1 OH:1.0 + + + + + O2 + CH2CHO [=] OH + 2 HCO + + + 2.350000E+07 + 0 + 0.000000 + + + CH2CHO:1 O2:1.0 + HCO:2.0 OH:1.0 + + + + + H + CH2CHO [=] CH3 + HCO + + + 2.200000E+10 + 0 + 0.000000 + + + H:1.0 CH2CHO:1 + CH3:1.0 HCO:1 + + + + + H + CH2CHO [=] CH2CO + H2 + + + 1.100000E+10 + 0 + 0.000000 + + + H:1.0 CH2CHO:1 + H2:1 CH2CO:1.0 + + + + + OH + CH2CHO [=] H2O + CH2CO + + + 1.200000E+10 + 0 + 0.000000 + + + CH2CHO:1 OH:1.0 + H2O:1.0 CH2CO:1 + + + + + OH + CH2CHO [=] HCO + CH2OH + + + 3.010000E+10 + 0 + 0.000000 + + + CH2CHO:1 OH:1.0 + CH2OH:1 HCO:1.0 + + + + + CH3 + C2H5 (+ M) [=] C3H8 (+ M) + + + 9.430000E+09 + 0 + 0.000000 + + + 2.710000E+68 + -16.82 + 13065.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.1527 291 2742 7748 + + C2H5:1 CH3:1.0 + C3H8:1.0 + + + + + O + C3H8 [=] OH + C3H7 + + + 1.930000E+02 + 2.6800000000000002 + 3716.000000 + + + C3H8:1 O:1.0 + C3H7:1 OH:1.0 + + + + + H + C3H8 [=] C3H7 + H2 + + + 1.320000E+03 + 2.54 + 6756.000000 + + + H:1.0 C3H8:1 + H2:1 C3H7:1.0 + + + + + OH + C3H8 [=] C3H7 + H2O + + + 3.160000E+04 + 1.8 + 934.000000 + + + C3H8:1 OH:1.0 + C3H7:1.0 H2O:1 + + + + + C3H7 + H2O2 [=] HO2 + C3H8 + + + 3.780000E-01 + 2.7200000000000002 + 1500.000000 + + + C3H7:1.0 H2O2:1 + HO2:1.0 C3H8:1 + + + + + CH3 + C3H8 [=] C3H7 + CH4 + + + 9.030000E-04 + 3.6499999999999999 + 7154.000000 + + + CH3:1.0 C3H8:1 + C3H7:1.0 CH4:1 + + + + + CH3 + C2H4 (+ M) [=] C3H7 (+ M) + + + 2.550000E+03 + 1.6000000000000001 + 5700.000000 + + + 3.000000E+57 + -14.6 + 18170.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.1894 277 8748 7891 + + CH3:1.0 C2H4:1 + C3H7:1.0 + + + + + O + C3H7 [=] C2H5 + CH2O + + + 9.640000E+10 + 0 + 0.000000 + + + C3H7:1 O:1.0 + CH2O:1 C2H5:1.0 + + + + + H + C3H7 (+ M) [=] C3H8 (+ M) + + + 3.613000E+10 + 0 + 0.000000 + + + 4.420000E+55 + -13.545 + 11357.000000 + + AR:0.7 C2H6:3 CH4:2 CO:1.5 CO2:2 H2:2 H2O:6 + 0.315 369 3285 6667 + + H:1.0 C3H7:1 + C3H8:1.0 + + + + + H + C3H7 [=] CH3 + C2H5 + + + 4.060000E+03 + 2.1899999999999999 + 890.000000 + + + H:1.0 C3H7:1 + C2H5:1 CH3:1.0 + + + + + OH + C3H7 [=] C2H5 + CH2OH + + + 2.410000E+10 + 0 + 0.000000 + + + C3H7:1 OH:1.0 + CH2OH:1 C2H5:1.0 + + + + + HO2 + C3H7 [=] O2 + C3H8 + + + 2.550000E+07 + 0.255 + -943.000000 + + + C3H7:1 HO2:1.0 + O2:1.0 C3H8:1 + + + + + HO2 + C3H7 [=] OH + C2H5 + CH2O + + + 2.410000E+10 + 0 + 0.000000 + + + C3H7:1 HO2:1.0 + CH2O:1 C2H5:1 OH:1.0 + + + + + CH3 + C3H7 [=] 2 C2H5 + + + 1.927000E+10 + -0.32000000000000001 + 0.000000 + + + C3H7:1 CH3:1.0 + C2H5:2.0 + + + diff --git a/examples/od_methane_flame/gri30_chemical_mixture.dat b/examples/od_methane_flame/gri30_chemical_mixture.dat new file mode 100644 index 000000000..fae55cd53 --- /dev/null +++ b/examples/od_methane_flame/gri30_chemical_mixture.dat @@ -0,0 +1,108 @@ +#=========================================================================== +# LEGEND +#=========================================================================== +# +# Species -- Species name +# Mol. Wt. -- Molecular weight (kg/kmol) +# Hform -- Formation enthalpy (J/kg @ 0K) +# cfs -- Nominal T-R Degrees of freedom (cv = cfs*k*T) +# zns -- Charge number +# +# +# +# [DLS]: Hform (0K) taken from the site: http://cccbdb.nist.gov/hf0K.asp +# for species starting on line 82 of this file but also including +# HCO and N2O. +# [DLS]: NNH data taken from Klippenstein, Stephen J., et al. +# "The role of NNH in NO formation and control." Combustion and Flame +# 158.4 (2011): 774-789 (see pg. 2) +# +# Spec. Mol. Wt. Hform (0K), cfs, zns + +Air 28.96000 0.000000000000 2.5 0 +CPAir 28.96000 0.000000000000 2.5 0 +AR 39.94400 0.000000000000 1.5 0 +Ar 39.94400 0.000000000000 1.5 0 +Ar+ 39.94345 3.8068120000e7 1.5 1 +C 12.01100 5.9211889000e7 1.5 0 +C+ 12.01045 1.4967366000e8 1.5 1 +C2 24.02200 3.4234785000e7 2.5 0 +C2H 25.03000 2.2572910000e7 2.5 0 +C2H2 26.03800 8.7548580000e6 2.5 0 +C3 36.03300 2.3062193000e7 2.5 0 +CF 31.00940 9.9617550000e6 2.5 0 +CF2 50.00780 -2.5187600000e6 3.0 0 +CF3 69.00620 -7.1992350000e6 3.0 0 +CF4 88.00460 -1.0258770000e7 3.0 0 +CH 13.01900 4.5627850000e7 2.5 0 +CH2 14.02700 2.7803520000e7 3.0 0 +CH3 15.03500 9.9559030000e6 3.0 0 +CH4 16.04300 -4.1532130000e6 3.0 0 +Cl 35.45300 3.3740400000e6 1.5 0 +Cl2 70.90600 0.000000000000 2.5 0 +CN 26.01900 1.6795420000e7 2.5 0 +CN+ 26.01845 6.8835800000e7 2.5 1 +CO 28.01100 -4.0630824000e6 2.5 0 +CO+ 28.01045 4.4200904000e7 2.5 1 +CO2 44.01100 -8.9328800000e6 2.5 0 +F 18.99840 4.0423050000e6 1.5 0 +F2 37.99680 0.000000000000 2.5 0 +H 1.00800 2.1432040000e8 1.5 0 +H+ 1.00745 1.5167840000e9 1.5 1 +H2 2.01600 0.000000000000 2.5 0 +H2+ 2.01545 7.3847530000e8 2.5 1 +H2O 18.01600 -1.3261710000e7 3.0 0 +H2O2 34.01475 -3.8186669018e6 3.0 0 +HCl 36.46100 -2.5266800000e6 2.5 0 +HCN 27.02700 4.8982130000e6 2.5 0 +HNO 31.01404 3.5467807483e6 3.0 0 +NNH 29.02134 8.7078542830e6 3.0 0 +He 4.00300 0.000000000000 1.5 0 +He+ 4.00245 5.9271800000e8 1.5 1 +HO2 33.00681 4.5239149133e5 3.0 0 +N 14.00800 3.3621610000e7 1.5 0 +Ne 20.17900 0.000000000000 1.5 0 +N+ 14.00745 1.3400000000e8 1.5 1 +N2 28.01600 0.000000000000 2.5 0 +CPN2 28.01600 0.000000000000 2.5 0 +N2+ 28.01545 5.3700000000e7 2.5 1 +NCO 42.01900 4.2124000000e6 2.5 0 +NH 15.01600 2.3867900000e7 2.5 0 +NH+ 15.01545 1.1050000000e8 2.5 1 +NH2 16.02400 1.2036000000e7 3.0 0 +NH3 17.03200 -2.2866370000e6 3.0 0 +NO 30.00800 2.9961230000e6 2.5 0 +NO+ 30.00745 3.2834800000e7 2.5 1 +NO2 46.00800 8.0420800000e5 3.0 0 +N2O 44.01300 1.9312475860e6 2.5 0 +O 16.00000 1.5420000000e7 1.5 0 +O+ 15.99945 9.7560000000e7 1.5 1 +O2 32.00000 0.000000000000 2.5 0 +O2+ 31.99945 3.6370000000e7 2.5 1 +OH 17.00800 2.2995060000e6 2.5 0 +Si 28.08550 1.5868220000e7 1.5 0 +SiO 44.08550 -2.2683200000e6 2.5 0 +e 0.00055 0.000000000000 1.5 -1 +CH2(S) 14.02658 2.7854259600e7 3.0 0 +CH2Q 14.02658 2.7854259600e7 3.0 0 +HCO 29.01800 1.4335929400e6 3.0 0 +CH2O 30.02600 -3.5076000000e6 3.0 0 +CH2OH 31.03390 -3.4478425200e5 3.0 0 +CH3O 31.03390 9.1512829500e5 3.0 0 +CH3OH 32.04190 -5.9328566700e6 3.0 0 +C2H3 27.04520 0.000000000000 2.5 0 +C2H4 28.05320 2.1744399930e6 2.5 0 +C2H5 29.06110 4.5352722400e6 2.5 0 +C2H6 30.06900 -2.2747680300e6 2.5 0 +HCCO 41.02870 4.3111000000e6 3.0 0 +CH2CO 42.03670 -1.0585987800e6 2.5 0 +HCCOH 42.03670 2.2552000000e6 3.0 0 +H2CN 28.03330 8.6409000000e6 2.5 0 +HCNN 41.03200 1.1515000000e7 3.0 0 +HCNO 43.02470 3.9698000000e6 3.0 0 +HOCN 43.02470 -2.8356000000e5 3.0 0 +HNCO 43.02470 -2.2940311000e6 3.0 0 +C3H7 43.08770 2.0887001322e6 3.0 0 +C3H8 44.09560 -1.8686671700e6 3.0 0 +CH2CHO 43.04460 5.2225000000e5 3.0 0 +CH3CHO 44.05260 -3.6365617500e6 3.0 0 diff --git a/examples/od_methane_flame/initial.in b/examples/od_methane_flame/initial.in new file mode 100644 index 000000000..584a0df6a --- /dev/null +++ b/examples/od_methane_flame/initial.in @@ -0,0 +1,24 @@ +# Mesh related options +[Mesh] + [./Generation] + dimension = '1' + element_type = 'EDGE2' + x_min = '0.0' + x_max = '0.015' + n_elems_x = '100' + [../Redistribution] + function = '{x*x/.015}{y}{z}' +[] + +# Solver options +[SolverOptions] + [./TimeStepping] + solver_type = 'libmesh_euler_solver' + delta_t = '5.0e-6' + n_timesteps = '100' + theta = '1.0' +[] + + +# Included things that are common between steady/unsteady and continued runs. +[include similar.in] \ No newline at end of file diff --git a/examples/od_methane_flame/run.sh.in b/examples/od_methane_flame/run.sh.in new file mode 100755 index 000000000..53eb73751 --- /dev/null +++ b/examples/od_methane_flame/run.sh.in @@ -0,0 +1,22 @@ +#!/bin/sh + +GRINS_RUN=${GRINS_RUN:-$LIBMESH_RUN} +DEFAULT_SOLVER_OPTIONS="-ksp_type gmres -pc_type asm -pc_asm_overlap 10 -sub_pc_type lu -sub_pc_factor_shift_type nonzero" +GRINS_SOLVER_OPTIONS=${GRINS_SOLVER_OPTIONS:-$LIBMESH_OPTIONS:$DEFAULT_SOLVER_OPTIONS} + +GRINS=@prefix@/bin/grins +Initial=@prefix@/examples/od_methane_flame/initial.in +Continue=@prefix@/examples/od_methane_flame/continue.in +Steady=@prefix@/examples/od_methane_flame/steady.in + +mkdir -p Run0 +$GRINS_RUN $GRINS $Initial SolverOptions/TimeStepping/delta_t='1e-6' vis-options/vis_output_file_prefix='Run0/output' SolverOptions/TimeStepping/n_timesteps='25' vis-options/timesteps_per_vis='25' $GRINS_SOLVER_OPTIONS + +mkdir -p Run1 +$GRINS_RUN $GRINS $Continue SolverOptions/TimeStepping/delta_t='1e-5' vis-options/vis_output_file_prefix='Run1/output' Mesh/Read/filename='./Run0/output.24.exo' restart-options/restart_file='./Run0/output.24.xdr' SolverOptions/TimeStepping/n_timesteps='25' vis-options/timesteps_per_vis='25' $GRINS_SOLVER_OPTIONS + +mkdir -p Run2 +$GRINS_RUN $GRINS $Continue SolverOptions/TimeStepping/delta_t='5e-4' vis-options/vis_output_file_prefix='Run2/output' Mesh/Read/filename='./Run1/output.24.exo' restart-options/restart_file='./Run1/output.24.xdr' SolverOptions/TimeStepping/n_timesteps='10' vis-options/timesteps_per_vis='10' $GRINS_SOLVER_OPTIONS + +mkdir -p Run_Steady +$GRINS_RUN $GRINS $Steady vis-options/vis_output_file_prefix='Run_Steady/output' Mesh/Read/filename='./Run2/output.9.exo' restart-options/restart_file='./Run2/output.9.xdr' $GRINS_SOLVER_OPTIONS 2>&1 |tee Run_Steady.log \ No newline at end of file diff --git a/examples/od_methane_flame/similar.in b/examples/od_methane_flame/similar.in new file mode 100644 index 000000000..1701160e7 --- /dev/null +++ b/examples/od_methane_flame/similar.in @@ -0,0 +1,148 @@ +# Run Specific Variables +[RunVars] + TmaxCubic = '2300' + TmaxLinear = '2400' + Tinit = '325' + YOxidizer_Start='0.220147' + YOxidizer_MaxCubic='0.04' + YOxidizer_MaxLinear='0.01' + YFuel_Start='0.0551778' + YDilute_Start='0.7246752' + xstart='0' + xend='0.001' +[] + +# Physics +[Physics] + enabled_physics = 'ODPremixedFlame' + [./ODPremixedFlame] + material = 'MethaneGas' + + # Unburnt properties of the premixed mixture + Unburnt_Temperature ='298' + O2 = '0.220147' + CH4 ='0.0551778' + N2 = '.7246752' + + # Initial Conditions + ic_ids = '0' + ic_types = 'parsed' + ic_variables = 'Y_O2:Y_N2:Y_CH4:Y_H2O:T' + + ic_values = '{Ymc:=${RunVars/YOxidizer_MaxCubic};Yi:=${RunVars/YOxidizer_Start};Yml:=${RunVars/YOxidizer_MaxLinear};xs:=${RunVars/xstart}+.001;xe:=${RunVars/xend}+.001;Yi+(xxs)*(((Ymc-Yi)*((x-xs)/(xe-xs))^2*(3-2*((x-xs)/(xe-xs))))+(((x-xs)/(xe-xs))^3-((x-xs)/(xe-xs))^2)*(Yml-Ymc)*(xe-xs)/(.015-xe))+(x>xe)*((Ymc-Yi)+(Yml-Ymc)*(x-xe)/(.015-xe))}{YC:=${RunVars/YDilute_Start};YC}{Yi:=${RunVars/YFuel_Start};xs:=${RunVars/xstart}+.001;xe:=${RunVars/xend}+.001;Yi+(xxs)*(((-Yi)*((x-xs)/(xe-xs))^2*(3-2*((x-xs)/(xe-xs)))))+(x>xe)*((-Yi))}{Ymc:=${RunVars/YOxidizer_MaxCubic};Yi:=${RunVars/YOxidizer_Start};Yml:=${RunVars/YOxidizer_MaxLinear};xs:=${RunVars/xstart}+.001;xe:=${RunVars/xend}+.001;YiF:=${RunVars/YFuel_Start};YC:=${RunVars/YDilute_Start};1-(Yi+(xxs)*(((Ymc-Yi)*((x-xs)/(xe-xs))^2*(3-2*((x-xs)/(xe-xs))))+(((x-xs)/(xe-xs))^3-((x-xs)/(xe-xs))^2)*(Yml-Ymc)*(xe-xs)/(.015-xe))+(x>xe)*((Ymc-Yi)+(Yml-Ymc)*(x-xe)/(.015-xe)))-YC-(YiF+(xxs)*(((-YiF)*((x-xs)/(xe-xs))^2*(3-2*((x-xs)/(xe-xs)))))+(x>xe)*((-YiF)))}{Tmc:=${RunVars/TmaxCubic};Ti:=${RunVars/Tinit};Tml:=${RunVars/TmaxLinear};xs:=${RunVars/xstart};xe:=${RunVars/xend};Ti+(xxs)*(((Tmc-Ti)*((x-xs)/(xe-xs))^2*(3-2*((x-xs)/(xe-xs))))+(((x-xs)/(xe-xs))^3-((x-xs)/(xe-xs))^2)*(Tml-Tmc)*(xe-xs)/(.015-xe))+(x>xe)*((Tmc-Ti)+(Tml-Tmc)*(x-xe)/(.015-xe))}' + output_vars = 'mole_fractions omega_dot u' +[] + +# Boundary Conditions +[BoundaryConditions] + bc_ids = '0 1' + bc_id_name_map = 'Inlet Outlet' + + [./Inlet] + [./SingleVariable] + type = 'homogeneous_neumann' + [../] + + [./Temperature] + type = 'isothermal' + T = '325' + [../] + + [./SpeciesMassFractions] + type = 'parsed_fem_neumann' + normal_flux = '-M_dot*(Y_H2) -M_dot*(Y_H) -M_dot*(Y_O) YO2:=${RunVars/YOxidizer_Start};-M_dot*(Y_O2-YO2) -M_dot*(Y_OH) -M_dot*(Y_H2O) -M_dot*(Y_HO2) -M_dot*(Y_H2O2) -M_dot*(Y_C) -M_dot*(Y_CH) -M_dot*(Y_CH2) -M_dot*(Y_CH2Q) -M_dot*(Y_CH3) YCH4:=${RunVars/YFuel_Start};-M_dot*(Y_CH4-YCH4) -M_dot*(Y_CO) -M_dot*(Y_CO2) -M_dot*(Y_HCO) -M_dot*(Y_CH2O) -M_dot*(Y_CH2OH) -M_dot*(Y_CH3O) -M_dot*(Y_CH3OH) -M_dot*(Y_C2H) -M_dot*(Y_C2H2) -M_dot*(Y_C2H3) -M_dot*(Y_C2H4) -M_dot*(Y_C2H5) -M_dot*(Y_C2H6) -M_dot*(Y_HCCO) -M_dot*(Y_CH2CO) -M_dot*(Y_HCCOH) -M_dot*(Y_N) -M_dot*(Y_NH) -M_dot*(Y_NH2) -M_dot*(Y_NH3) -M_dot*(Y_NNH) -M_dot*(Y_NO) -M_dot*(Y_NO2) -M_dot*(Y_N2O) -M_dot*(Y_HNO) -M_dot*(Y_CN) -M_dot*(Y_HCN) -M_dot*(Y_H2CN) -M_dot*(Y_HCNN) -M_dot*(Y_HCNO) -M_dot*(Y_HOCN) -M_dot*(Y_HNCO) -M_dot*(Y_NCO) YN2:=${RunVars/YDilute_Start};-M_dot*(Y_N2-YN2) -M_dot*(Y_AR) -M_dot*(Y_C3H7) -M_dot*(Y_C3H8) -M_dot*(Y_CH2CHO) -M_dot*(Y_CH3CHO)' + [../] + [../] + + [./Outlet] + [./SingleVariable] + type = 'homogeneous_neumann' + [../] + + [./Temperature] + type = 'homogeneous_neumann' + [../] + + [./SpeciesMassFractions] + type = 'homogeneous_neumann' +[] + +# Visualization options +[vis-options] + output_vis = 'true' + vis_output_file_prefix = './Run0/output' + output_residual = 'false' + output_format = 'ExodusII xdr' + timesteps_per_vis = '25' +[] + +# Gas Material +[Materials] + [./MethaneGas] + [./ThermodynamicPressure] + value = '1e5' #[Pa] + [../GasMixture] + + #Cantera ThermoChemistry + thermochemistry_library = 'cantera' + [./Cantera] + chemical_data = './gri30.xml' + gas_mixture = 'gri30_mix' + + # #Antioch Thermochemistry + # thermochemistry_library = 'antioch' + # [./Antioch] + # chemical_data = './gri30.xml' + # gas_mixture = 'gri30_mix' + # transport_model = 'mixture_averaged' + # thermo_model = 'kinetics_theory' + # viscosity_model = 'kinetics_theory' + # thermal_conductivity_model = 'kinetics_theory' + # mass_diffusivity_model = 'kinetics_theory' + # thermo_model ='ideal_gas' + # species_data = './gri30_chemical_mixture.dat' + +[] + +# Variables +[Variables] + [./Temperature] + names = 'T' + fe_family = 'LAGRANGE' + order = 'FIRST' + + [../SingleVariable] + names = 'M_dot' + fe_family = 'LAGRANGE' + order = 'FIRST' + + [../SpeciesMassFractions] + names = 'Y_' + fe_family = 'LAGRANGE' + order = 'FIRST' + material = 'MethaneGas' +[] + +# Linear and nonlinear solver options +[linear-nonlinear-solver] + continue_after_max_iterations = 'true' + max_nonlinear_iterations = '200' + max_linear_iterations = '2500' + minimum_linear_tolerance = '1.0e-10' + initial_linear_tolerance = '1.0e-10' + use_numerical_jacobians_only = 'true' + relative_residual_tolerance = '1.0e-10' + relative_step_tolerance = '1.0e-6' +[] + +# Options for printing info to the screen +[screen-options] + system_name = 'Methane' + print_equation_system_info = 'true' + print_mesh_info = 'true' + print_log_info = 'true' + solver_verbose = 'true' + solver_quiet = 'false' + print_element_jacobians = 'false' +[] + diff --git a/examples/od_methane_flame/steady.in b/examples/od_methane_flame/steady.in new file mode 100644 index 000000000..771e62390 --- /dev/null +++ b/examples/od_methane_flame/steady.in @@ -0,0 +1,30 @@ +# Mesh related options +[Mesh] + [./Read] + filename= './restart.exo' +[] + +# Restart file option +[restart-options] + restart_file = '' +[] + +# Quantities of Interest Options +[Output] + [./Display] + print_qoi ='true' +[] + +[QoI] + enabled_qois = 'flame_speed adiabiatic_flame_temperature' + [./FlameSpeed] + material = 'MethaneGas' + Unburnt_Temperature='298' + [../] + + [./AdiabiaticFlameTemperature] + point = 0.01 +[] + +# Include things similar between steady/unsteady and continued runs. +[include similar.in] From c9c5c602db80352a236d2cf4a7f01f9a2e48b76c Mon Sep 17 00:00:00 2001 From: Kenneth Budzinski Date: Thu, 30 May 2019 13:34:05 -0400 Subject: [PATCH 41/41] Changing the variable names in the side_time_derivative method. --- src/physics/src/multiphysics_sys.C | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/physics/src/multiphysics_sys.C b/src/physics/src/multiphysics_sys.C index 9cea56498..9cfa75bff 100644 --- a/src/physics/src/multiphysics_sys.C +++ b/src/physics/src/multiphysics_sys.C @@ -342,16 +342,16 @@ namespace GRINS bool MultiphysicsSystem::side_time_derivative( bool request_jacobian, libMesh::DiffContext& context ) { - - bool jacobian_computed2 = this->apply_neumann_bcs(request_jacobian, + + bool jacobian_computed_neumann = this->apply_neumann_bcs(request_jacobian, context); - bool jacobian_computed = this->_general_residual + bool jacobian_computed_residual = this->_general_residual (request_jacobian, context, &GRINS::Physics::side_time_derivative, &GRINS::Physics::compute_side_time_derivative_cache); - - return (jacobian_computed && jacobian_computed2); + + return (jacobian_computed_neumann && jacobian_computed_residual); } bool MultiphysicsSystem::nonlocal_time_derivative( bool request_jacobian,