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

#include <reacting_low_mach_navier_stokes_bc_handling.h>

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

Public Member Functions

 ReactingLowMachNavierStokesBCHandling (const std::string &physics_name, const GetPot &input, const Chemistry &chem_mixture)
 
virtual ~ReactingLowMachNavierStokesBCHandling ()
 
virtual int string_to_int (const std::string &bc_type_in) const
 
virtual void init_bc_data (const libMesh::FEMSystem &system)
 Override this method to initialize any system-dependent data. More...
 
virtual void init_bc_types (const GRINS::BoundaryID bc_id, const std::string &bc_id_string, const int bc_type, const std::string &bc_vars, const std::string &bc_value, const GetPot &input)
 
virtual void user_init_dirichlet_bcs (libMesh::FEMSystem *system, libMesh::DofMap &dof_map, GRINS::BoundaryID bc_id, GRINS::BCType bc_type) const
 
virtual void init_dirichlet_bcs (libMesh::FEMSystem *system) const
 
virtual void user_apply_neumann_bcs (AssemblyContext &context, const GRINS::CachedValues &cache, const bool request_jacobian, const GRINS::BoundaryID bc_id, const GRINS::BCType bc_type) const
 
void set_species_bc_type (GRINS::BoundaryID bc_id, int bc_type)
 
void set_species_bc_values (GRINS::BoundaryID bc_id, const std::vector< libMesh::Real > &species_values)
 
libMesh::Real get_species_bc_value (GRINS::BoundaryID bc_id, unsigned int species) const
 
CatalyticWallBase< Chemistry > * get_catalytic_wall (const BoundaryID bc_id)
 
void set_temp_bc_type (GRINS::BoundaryID bc_id, int bc_type)
 
void set_temp_bc_value (GRINS::BoundaryID bc_id, libMesh::Real value)
 
libMesh::Real get_temp_bc_value (GRINS::BoundaryID bc_id) const
 
void attach_neumann_bound_func (GRINS::NBCContainer &neumann_bcs)
 
void attach_dirichlet_bound_func (const GRINS::DBCContainer &dirichlet_bc)
 
virtual void read_bc_data (const GetPot &input, const std::string &id_str, const std::string &bc_str, const std::string &var_str, const std::string &val_str)
 
virtual void apply_neumann_bcs (AssemblyContext &context, const GRINS::CachedValues &cache, const bool request_jacobian, const GRINS::BoundaryID bc_id) const
 
virtual void init_dirichlet_bc_func_objs (libMesh::FEMSystem *system) const
 
virtual void init_periodic_bcs (libMesh::FEMSystem *system) const
 
void set_dirichlet_bc_type (GRINS::BoundaryID bc_id, int bc_type)
 
void set_neumann_bc_type (GRINS::BoundaryID bc_id, int bc_type)
 
void set_dirichlet_bc_value (GRINS::BoundaryID bc_id, libMesh::Real value, int component=0)
 
void set_neumann_bc_value (GRINS::BoundaryID bc_id, const libMesh::Point &q_in)
 
libMesh::Real get_dirichlet_bc_value (GRINS::BoundaryID bc_id, int component=0) const
 
const libMesh::Point & get_neumann_bc_value (GRINS::BoundaryID bc_id) const
 
std::tr1::shared_ptr< GRINS::NeumannFuncObjget_neumann_bound_func (GRINS::BoundaryID bc_id, GRINS::VariableIndex var_id) const
 
std::tr1::shared_ptr< GRINS::NeumannFuncObjget_neumann_bound_func (GRINS::BoundaryID bc_id, GRINS::VariableIndex var_id)
 
GRINS::BCType get_dirichlet_bc_type (const GRINS::BoundaryID bc_id) const
 
bool is_axisymmetric () const
 

Protected Types

enum  BC_BASE {
  PERIODIC = -5, CONSTANT_DIRICHLET, PARSED_DIRICHLET, PARSED_FEM_DIRICHLET,
  AXISYMMETRIC
}
 

Protected Member Functions

void build_catalycities (const GetPot &input, const std::string &reactant, const std::string &bc_id_string, const BoundaryID bc_id, boost::scoped_ptr< CatalycityBase > &gamma_r)
 

Protected Attributes

std::map< GRINS::BoundaryID, std::vector< libMesh::Real > > _species_bc_values
 
std::vector< std::pair< BoundaryID, BCType > > _species_bc_map
 
unsigned int _n_species
 
std::vector< std::string > _species_var_names
 
std::vector< GRINS::VariableIndex_species_vars
 
std::multimap< BoundaryID, std::tr1::shared_ptr< CatalyticWallBase< Chemistry > > > _catalytic_walls
 
const Chemistry & _chemistry
 
std::string _u_var_name
 
std::string _v_var_name
 
std::string _w_var_name
 
std::string _T_var_name
 
GRINS::VariableIndex _T_var
 
std::map< GRINS::BoundaryID, libMesh::Real > _T_values
 
std::vector< std::pair< BoundaryID, BCType > > _temp_bc_map
 
std::vector< std::pair< BoundaryID, BCType > > _dirichlet_bc_map
 Map between boundary id and Dirichlet boundary condition type. More...
 
std::map< GRINS::BoundaryID, GRINS::BCType_neumann_bc_map
 Map between boundary id and Neumann boundary condition type. More...
 
std::map< GRINS::BoundaryID, libMesh::Point > _dirichlet_values
 Stash prescribed Dirichlet boundary values. More...
 
std::map< GRINS::BoundaryID, libMesh::Point > _q_values
 Stash prescribed boundary fluxes. More...
 
std::map< GRINS::BoundaryID, GRINS::NBCContainer_neumann_bound_funcs
 
std::vector< GRINS::DBCContainer_dirichlet_bound_funcs
 
GRINS::BoundaryConditions _bound_conds
 Object that stashes generic boundary condition types. More...
 
std::vector< GRINS::PBCContainer_periodic_bcs
 
unsigned int _num_periodic_bcs
 
std::string _physics_name
 

Static Protected Attributes

static bool _axisymmetric = false
 Flag to cache whether or not there is an axisymmetric boundary present. More...
 

Private Types

enum  RLMNS_BC_TYPES {
  ZERO_SPECIES_FLUX =20, PRESCRIBED_SPECIES, PRESCRIBED_MOLE_FRACTIONS, GAS_RECOMBINATION_CATALYTIC_WALL,
  GAS_SOLID_CATALYTIC_WALL, GENERAL_SPECIES
}
 

Private Member Functions

 ReactingLowMachNavierStokesBCHandling ()
 

Detailed Description

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

Definition at line 38 of file reacting_low_mach_navier_stokes_bc_handling.h.

Member Enumeration Documentation

enum GRINS::BCHandlingBase::BC_BASE
protectedinherited
template<typename Chemistry>
enum GRINS::ReactingLowMachNavierStokesBCHandling::RLMNS_BC_TYPES
private

Constructor & Destructor Documentation

template<typename Chemistry >
GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::ReactingLowMachNavierStokesBCHandling ( const std::string &  physics_name,
const GetPot &  input,
const Chemistry &  chem_mixture 
)
Todo:
Make this prefix string an input option

Definition at line 49 of file reacting_low_mach_navier_stokes_bc_handling.C.

References GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_n_species, GRINS::BCHandlingBase::_physics_name, GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_species_var_names, and GRINS::BCHandlingBase::read_bc_data().

52  : LowMachNavierStokesBCHandling(physics_name,input),
53  _n_species( input.vector_variable_size("Physics/Chemistry/species") ),
56  _chemistry(chemistry)
57  {
58 
59  for( unsigned int s = 0; s < _n_species; s++ )
60  {
62  std::string var_name = "w_"+std::string(input( "Physics/Chemistry/species", "DIE!", s ));
63  _species_var_names[s] = var_name;
64  }
65 
66  std::string id_str = "Physics/"+_physics_name+"/species_bc_ids";
67  std::string bc_str = "Physics/"+_physics_name+"/species_bc_types";
68  std::string var_str = "Physics/"+_physics_name+"/species_bc_variables";
69  std::string val_str = "Physics/"+_physics_name+"/species_bc_values";
70 
71  this->read_bc_data( input, id_str, bc_str, var_str, val_str );
72 
73  return;
74  }
virtual void read_bc_data(const GetPot &input, const std::string &id_str, const std::string &bc_str, const std::string &var_str, const std::string &val_str)
template<typename Chemistry >
GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::~ReactingLowMachNavierStokesBCHandling ( )
virtual

Definition at line 77 of file reacting_low_mach_navier_stokes_bc_handling.C.

78  {
79  return;
80  }
template<typename Chemistry>
GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::ReactingLowMachNavierStokesBCHandling ( )
private

Member Function Documentation

void GRINS::BCHandlingBase::apply_neumann_bcs ( AssemblyContext context,
const GRINS::CachedValues cache,
const bool  request_jacobian,
const GRINS::BoundaryID  bc_id 
) const
virtualinherited

Definition at line 234 of file bc_handling_base.C.

References GRINS::BCHandlingBase::_neumann_bc_map, and GRINS::BCHandlingBase::user_apply_neumann_bcs().

238  {
239  std::map< BoundaryID, BCType>::const_iterator
240  bc_map_it = _neumann_bc_map.find( bc_id );
241 
242  /* We assume that if you didn't put a boundary id in, then you didn't want to
243  set a boundary condition on that boundary. */
244  if( bc_map_it != _neumann_bc_map.end() )
245  {
246  this->user_apply_neumann_bcs( context, cache, request_jacobian,
247  bc_id, bc_map_it->second );
248  }
249  return;
250  }
std::map< GRINS::BoundaryID, GRINS::BCType > _neumann_bc_map
Map between boundary id and Neumann boundary condition type.
virtual void user_apply_neumann_bcs(AssemblyContext &context, const GRINS::CachedValues &cache, const bool request_jacobian, const GRINS::BoundaryID bc_id, const GRINS::BCType bc_type) const
void GRINS::BCHandlingBase::attach_dirichlet_bound_func ( const GRINS::DBCContainer dirichlet_bc)
inherited
void GRINS::BCHandlingBase::attach_neumann_bound_func ( GRINS::NBCContainer neumann_bcs)
inherited

Definition at line 61 of file bc_handling_base.C.

References GRINS::BCHandlingBase::_neumann_bound_funcs, and GRINS::NBCContainer::get_bc_id().

Referenced by GRINS::Physics::attach_neumann_bound_func().

62  {
63  _neumann_bound_funcs.insert( std::make_pair( neumann_bcs.get_bc_id(), neumann_bcs ) );
64  return;
65  }
BoundaryID get_bc_id() const
Definition: nbc_container.C:46
std::map< GRINS::BoundaryID, GRINS::NBCContainer > _neumann_bound_funcs
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::build_catalycities ( const GetPot &  input,
const std::string &  reactant,
const std::string &  bc_id_string,
const BoundaryID  bc_id,
boost::scoped_ptr< CatalycityBase > &  gamma_r 
)
protected
Todo:
We assuming single reaction and single product the product is generated at minus the rate the reactant is consumed. Might want to remove this someday.

Definition at line 578 of file reacting_low_mach_navier_stokes_bc_handling.C.

583  {
584  std::string catalycity_type = input("Physics/"+_physics_name+"/gamma_"+reactant+"_"+bc_id_string+"_type", "none");
585 
586  if( catalycity_type == std::string("constant") )
587  {
588  std::string gamma_r_string = "Physics/"+_physics_name+"/gamma_"+reactant+"_"+bc_id_string;
589  libMesh::Real gamma = input(gamma_r_string, 0.0);
590 
591  if( !input.have_variable(gamma_r_string) )
592  {
593  std::cout << "Error: Could not find catalycity for species " << reactant
594  << ", for boundary " << bc_id << std::endl;
595  libmesh_error();
596  }
597 
598  gamma_r.reset( new ConstantCatalycity( gamma ) );
599  }
600  else if( catalycity_type == std::string("arrhenius") )
601  {
602  std::string gamma_r_string = "Physics/"+_physics_name+"/gamma0_"+reactant+"_"+bc_id_string;
603  std::string Ta_r_string = "Physics/"+_physics_name+"/Ta_"+reactant+"_"+bc_id_string;
604 
605  libMesh::Real gamma0 = input(gamma_r_string, 0.0);
606  libMesh::Real Ta = input(Ta_r_string, 0.0);
607 
608  if( !input.have_variable(gamma_r_string) )
609  {
610  std::cout << "Error: Could not find gamma0 for species " << reactant
611  << ", for boundary " << bc_id << std::endl;
612  libmesh_error();
613  }
614 
615  if( !input.have_variable(Ta_r_string) )
616  {
617  std::cout << "Error: Could not find Ta for species " << reactant
618  << ", for boundary " << bc_id << std::endl;
619  libmesh_error();
620  }
621 
622  gamma_r.reset( new ArrheniusCatalycity( gamma0, Ta ) );
623  }
624  else if( catalycity_type == std::string("power") )
625  {
626  std::string gamma_r_string = "Physics/"+_physics_name+"/gamma0_"+reactant+"_"+bc_id_string;
627  std::string Tref_r_string = "Physics/"+_physics_name+"/Tref_"+reactant+"_"+bc_id_string;
628  std::string alpha_r_string = "Physics/"+_physics_name+"/alpha_"+reactant+"_"+bc_id_string;
629 
630  libMesh::Real gamma0 = input(gamma_r_string, 0.0);
631  libMesh::Real Tref = input(Tref_r_string, 0.0);
632  libMesh::Real alpha = input(alpha_r_string, 0.0);
633 
634  if( !input.have_variable(gamma_r_string) )
635  {
636  std::cout << "Error: Could not find gamma0 for species " << reactant
637  << ", for boundary " << bc_id << std::endl;
638  libmesh_error();
639  }
640 
641  if( !input.have_variable(Tref_r_string) )
642  {
643  std::cout << "Error: Could not find Tref for species " << reactant
644  << ", for boundary " << bc_id << std::endl;
645  libmesh_error();
646  }
647 
648  if( !input.have_variable(alpha_r_string) )
649  {
650  std::cout << "Error: Could not find alpha for species " << reactant
651  << ", for boundary " << bc_id << std::endl;
652  libmesh_error();
653  }
654 
657  gamma_r.reset( new PowerLawCatalycity( gamma0, Tref, alpha ) );
658  }
659  else
660  {
661  std::cerr << "Error: Unsupported catalycity type " << catalycity_type << std::endl
662  << " for reactant " << reactant << std::endl
663  << "Valid catalycity types are: constant" << std::endl
664  << " arrhenius" << std::endl
665  << " power" << std::endl;
666 
667  libmesh_error();
668  }
669 
670 
671  return;
672  }
template<typename Chemistry >
CatalyticWallBase< Chemistry > * GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::get_catalytic_wall ( const BoundaryID  bc_id)
Todo:
Need to generalize this to multiple catalytic-walls-for-same-bcid case.

Definition at line 675 of file reacting_low_mach_navier_stokes_bc_handling.C.

676  {
677  return (_catalytic_walls.find(bc_id)->second).get();
678  }
std::multimap< BoundaryID, std::tr1::shared_ptr< CatalyticWallBase< Chemistry > > > _catalytic_walls
GRINS::BCType GRINS::BCHandlingBase::get_dirichlet_bc_type ( const GRINS::BoundaryID  bc_id) const
inlineinherited

Definition at line 207 of file bc_handling_base.h.

References GRINS::BCHandlingBase::_dirichlet_bc_map.

208  {
209  BCType bc_type_out = -100;
210 
211  for( std::vector<std::pair<BoundaryID,BCType> >::const_iterator it = _dirichlet_bc_map.begin();
212  it != _dirichlet_bc_map.end(); it++ )
213  {
214  if( it->first == bc_id ) bc_type_out = it->second;
215  }
216 
217  libmesh_assert_not_equal_to( bc_type_out, -100 );
218 
219  return bc_type_out;
220  }
std::vector< std::pair< BoundaryID, BCType > > _dirichlet_bc_map
Map between boundary id and Dirichlet boundary condition type.
int BCType
Definition: bc_types.h:32
libMesh::Real GRINS::BCHandlingBase::get_dirichlet_bc_value ( GRINS::BoundaryID  bc_id,
int  component = 0 
) const
inherited
const libMesh::Point & GRINS::BCHandlingBase::get_neumann_bc_value ( GRINS::BoundaryID  bc_id) const
inlineinherited

Definition at line 185 of file bc_handling_base.h.

References GRINS::BCHandlingBase::_q_values.

Referenced by GRINS::AxisymmetricHeatTransferBCHandling::user_apply_neumann_bcs(), GRINS::HeatTransferBCHandling::user_apply_neumann_bcs(), and GRINS::SolidMechanicsBCHandling::user_apply_neumann_bcs().

186  {
187  return (_q_values.find(bc_id))->second;
188  }
std::map< GRINS::BoundaryID, libMesh::Point > _q_values
Stash prescribed boundary fluxes.
std::tr1::shared_ptr< GRINS::NeumannFuncObj > GRINS::BCHandlingBase::get_neumann_bound_func ( GRINS::BoundaryID  bc_id,
GRINS::VariableIndex  var_id 
) const
inlineinherited

Definition at line 192 of file bc_handling_base.h.

References GRINS::BCHandlingBase::_neumann_bound_funcs.

Referenced by GRINS::AxisymmetricHeatTransferBCHandling::user_apply_neumann_bcs(), and GRINS::HeatTransferBCHandling::user_apply_neumann_bcs().

194  {
195  return ((_neumann_bound_funcs.find(bc_id))->second).get_func(var_id);
196  }
std::map< GRINS::BoundaryID, GRINS::NBCContainer > _neumann_bound_funcs
std::tr1::shared_ptr< GRINS::NeumannFuncObj > GRINS::BCHandlingBase::get_neumann_bound_func ( GRINS::BoundaryID  bc_id,
GRINS::VariableIndex  var_id 
)
inlineinherited

Definition at line 200 of file bc_handling_base.h.

References GRINS::BCHandlingBase::_neumann_bound_funcs.

202  {
203  return ((_neumann_bound_funcs.find(bc_id))->second).get_func(var_id);
204  }
std::map< GRINS::BoundaryID, GRINS::NBCContainer > _neumann_bound_funcs
template<typename Chemistry >
libMesh::Real GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::get_species_bc_value ( GRINS::BoundaryID  bc_id,
unsigned int  species 
) const

Definition at line 498 of file reacting_low_mach_navier_stokes_bc_handling.C.

500  {
501  return (_species_bc_values.find(bc_id)->second)[species];
502  }
std::map< GRINS::BoundaryID, std::vector< libMesh::Real > > _species_bc_values
libMesh::Real GRINS::LowMachNavierStokesBCHandling::get_temp_bc_value ( GRINS::BoundaryID  bc_id) const
inherited

Definition at line 489 of file low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::_T_values.

Referenced by GRINS::LowMachNavierStokesBCHandling::user_init_dirichlet_bcs().

490  {
491  return _T_values.find(bc_id)->second;
492  }
std::map< GRINS::BoundaryID, libMesh::Real > _T_values
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::init_bc_data ( const libMesh::FEMSystem &  system)
virtual

Override this method to initialize any system-dependent data.

Override this method to, for example, cache a System variable number. This is called before any of the other init methods in this class. By default, does nothing.

Reimplemented from GRINS::LowMachNavierStokesBCHandling.

Definition at line 398 of file reacting_low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::init_bc_data().

399  {
400  // Call base class
402 
403  for( unsigned int s = 0; s < this->_n_species; s++ )
404  {
405  _species_vars[s] = system.variable_number( _species_var_names[s] );
406  }
407 
408  // See if we have a catalytic wall and initialize them if we do
409  for( std::map< GRINS::BoundaryID, GRINS::BCType>::const_iterator bc_map = _neumann_bc_map.begin();
410  bc_map != _neumann_bc_map.end(); ++bc_map )
411  {
412  const BoundaryID bc_id = bc_map->first;
413  const BCType bc_type = bc_map->second;
414 
415  if( bc_type == GAS_RECOMBINATION_CATALYTIC_WALL ||
416  bc_type == GAS_SOLID_CATALYTIC_WALL )
417  {
418  typedef typename std::multimap<BoundaryID, std::tr1::shared_ptr<CatalyticWallBase<Chemistry> > >::iterator it_type;
419 
420  std::pair< it_type, it_type > it_range = _catalytic_walls.equal_range( bc_id );
421 
422  for( it_type it = it_range.first; it != it_range.second; ++it )
423  {
424  (it->second)->init(system);
425 
426  if( this->is_axisymmetric() )
427  {
428  (it->second)->set_axisymmetric(true);
429  }
430  }
431  } // if( bc_type == GAS_RECOMBINATION_CATALYTIC_WALL )
432 
433  } // end loop over bc_ids
434 
435  return;
436  }
libMesh::boundary_id_type BoundaryID
More descriptive name of the type used for boundary ids.
Definition: var_typedefs.h:54
std::multimap< BoundaryID, std::tr1::shared_ptr< CatalyticWallBase< Chemistry > > > _catalytic_walls
bool is_axisymmetric() const
virtual void init_bc_data(const libMesh::FEMSystem &system)
Override this method to initialize any system-dependent data.
std::map< GRINS::BoundaryID, GRINS::BCType > _neumann_bc_map
Map between boundary id and Neumann boundary condition type.
int BCType
Definition: bc_types.h:32
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::init_bc_types ( const GRINS::BoundaryID  bc_id,
const std::string &  bc_id_string,
const int  bc_type,
const std::string &  bc_vars,
const std::string &  bc_value,
const GetPot &  input 
)
virtual
Todo:
We currently can only handle reactions of the type R -> P, i.e not R1+R2 -> P, etc.

Reimplemented from GRINS::LowMachNavierStokesBCHandling.

Definition at line 120 of file reacting_low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::init_bc_types(), and GRINS::StringUtilities::split_string().

126  {
127  switch(bc_type)
128  {
129  case(ZERO_SPECIES_FLUX):
130  {
131  this->set_neumann_bc_type( bc_id, bc_type );
132  }
133  break;
134 
135  case(PRESCRIBED_SPECIES):
136  {
137  this->set_species_bc_type( bc_id, bc_type );
138 
139  unsigned int n_species_comps = input.vector_variable_size("Physics/"+_physics_name+"/bound_species_"+bc_id_string);
140 
141  if( n_species_comps != _n_species )
142  {
143  std::cerr << "Error: The number of prescribed species values must match" << std::endl
144  << " the number of species in the simulation." << std::endl
145  << "n_species = " << _n_species << std::endl
146  << "n_species_comps = " << n_species_comps << std::endl;
147  libmesh_error();
148  }
149 
150  std::vector<libMesh::Real> species_mass_fracs(n_species_comps);
151 
152  for( unsigned int s = 0; s < n_species_comps; s++ )
153  {
154  species_mass_fracs[s] = input("Physics/"+_physics_name+"/bound_species_"+bc_id_string, -1.0, s );
155 
156  if( (species_mass_fracs[s] > 1.0) ||
157  (species_mass_fracs[s] < 0.0) )
158  {
159  std::cerr << "Error: prescribed species mass fraction must be between 0.0 and 1.0" << std::endl
160  << "w[" << s << "] = " << species_mass_fracs[s] << std::endl;
161  libmesh_error();
162  }
163  }
164 
165  this->set_species_bc_values( bc_id, species_mass_fracs );
166  }
167  break;
168 
170  {
171  this->set_species_bc_type( bc_id, bc_type );
172 
173  unsigned int n_species_comps = input.vector_variable_size("Physics/"+_physics_name+"/bound_species_"+bc_id_string);
174 
175  if( n_species_comps != _n_species )
176  {
177  std::cerr << "Error: The number of prescribed species values must match" << std::endl
178  << " the number of species in the simulation." << std::endl
179  << "n_species = " << _n_species << std::endl
180  << "n_species_comps = " << n_species_comps << std::endl;
181  libmesh_error();
182  }
183 
184  std::vector<libMesh::Real> species_mole_fracs(n_species_comps);
185 
186  for( unsigned int s = 0; s < n_species_comps; s++ )
187  {
188  species_mole_fracs[s] = input("Physics/"+_physics_name+"/bound_species_"+bc_id_string, -1.0, s );
189 
190  if( (species_mole_fracs[s] > 1.0) ||
191  (species_mole_fracs[s] < 0.0) )
192  {
193  std::cerr << "Error: prescribed species mole fraction must be between 0.0 and 1.0" << std::endl
194  << "w[" << s << "] = " << species_mole_fracs[s] << std::endl;
195  libmesh_error();
196  }
197  }
198 
199  // Compute M
200  libMesh::Real M = 0.0;
201  for( unsigned int s = 0; s < n_species_comps; s++ )
202  {
203  M += species_mole_fracs[s]*_chemistry.M(s);
204  }
205 
206  // Convert mole fractions to mass fractions
207  std::vector<libMesh::Real> species_mass_fracs(n_species_comps);
208  for( unsigned int s = 0; s < n_species_comps; s++ )
209  {
210  species_mass_fracs[s] = species_mole_fracs[s]*_chemistry.M(s)/M;
211  }
212 
213  this->set_species_bc_values( bc_id, species_mass_fracs );
214  }
215  break;
216 
217  case(GENERAL_SPECIES):
218  {
219  this->set_dirichlet_bc_type( bc_id, bc_type );
220  }
221  break;
222 
224  {
225  this->set_neumann_bc_type( bc_id, bc_type );
226 
227  // Parse catalytic reactions on this wall
228  std::string reactions_string = "Physics/"+_physics_name+"/wall_catalytic_reactions_"+bc_id_string;
229  if( !input.have_variable(reactions_string) )
230  {
231  std::cerr << "Error: Could not find list of catalytic reactions for boundary id " << bc_id
232  << std::endl;
233  libmesh_error();
234  }
235 
236  const unsigned int n_reactions = input.vector_variable_size(reactions_string);
237 
238  for( unsigned int r = 0; r < n_reactions; r++ )
239  {
240  std::string reaction = input(reactions_string, "DIE!", r);
241 
242  // First, split each reaction into reactants and products
243  std::vector<std::string> partners;
244  StringUtilities::split_string(reaction, "->", partners);
245 
246  const std::string& reactant = partners[0];
247  const std::string& product = partners[1];
248 
250  if( partners.size() == 2 )
251  {
252  /* ------------- Grab the reactant and product species indices ------------- */
253  const unsigned int r_species = _chemistry.species_index( reactant );
254  const unsigned int p_species = _chemistry.species_index( product );
255 
256  /* ------------- Parse and construct the corresponding catalyticities ------------- */
257 
258  // These are temporary and will be cloned, so let them be destroyed when we're done
259  boost::scoped_ptr<CatalycityBase> gamma_r(NULL);
260 
261  this->build_catalycities( input, reactant, bc_id_string, bc_id, gamma_r );
262 
263  /* ------------- Now cache the CatalyticWall functions to init later ------------- */
264  libmesh_assert( gamma_r );
265 
266  std::tr1::shared_ptr<CatalyticWallBase<Chemistry> > wall_ptr( new GasRecombinationCatalyticWall<Chemistry>( _chemistry, *gamma_r, r_species, p_species ) );
267 
268  _catalytic_walls.insert( std::make_pair(bc_id, wall_ptr ) );
269 
270  } // if( partners.size() == 2 )
271  else
272  {
273  std::cerr << "Error: Can currently only handle 1 reactant and 1 product" << std::endl
274  << "in a catalytic reaction." << std::endl
275  << "Found " << partners.size() << " species." << std::endl;
276  libmesh_error();
277  }
278 
279  } // loop over reactions
280  }
281  break;
282 
284  {
285  this->set_neumann_bc_type( bc_id, bc_type );
286 
287  // Parse catalytic reactions on this wall
288  std::string reactions_string = "Physics/"+_physics_name+"/wall_gas_solid_reactions_"+bc_id_string;
289  if( !input.have_variable(reactions_string) )
290  {
291  std::cerr << "Error: Could not find list of gas-solid catalytic reactions for boundary id "
292  << bc_id
293  << std::endl;
294  libmesh_error();
295  }
296 
297  const unsigned int n_reactions = input.vector_variable_size(reactions_string);
298 
299  for( unsigned int r = 0; r < n_reactions; r++ )
300  {
301  std::string reaction = input(reactions_string, "DIE!", r);
302 
303  /* We are expecting reactions of the form
304  X+Y(s)->Z or
305  Y(s)+X->X
306  So, first we'll split on the "->", then split the reactants up and
307  figure out which is the gas species and which is the solid species. */
308 
309  std::vector<std::string> partners;
310  StringUtilities::split_string(reaction, "->", partners);
311 
312  const std::string pre_split_reactants = partners[0];
313  const std::string& product = partners[1];
314 
315  std::vector<std::string> split_reactants;
316  StringUtilities::split_string(pre_split_reactants, "+", split_reactants);
317 
318  // We can only handle two reactants currently
319  if( split_reactants.size() != 2 )
320  {
321  std::cerr << "Error: Currently, GasSolidCatalyticWall boundary condition only supports"
322  << std::endl
323  << " reactions of the form X+Y(s)->Z or Y(s)+X->X. Found "
324  << split_reactants.size() << " reactants." << std::endl;
325  libmesh_error();
326  }
327 
328  std::string gas_reactant;
329  std::string solid_reactant;
330  // Check if the first reactant is the solid one
331  if( split_reactants[0].find("(s)") == split_reactants[0].npos )
332  {
333  // If not found, check the second entry
334  if( split_reactants[1].find("(s)") == split_reactants[1].npos )
335  {
336  std::cerr << "Error: could not find solid reactant for GasSolidCatalyticWall" << std::endl
337  << " boundary condition. Found reactants " << split_reactants[0]
338  << ", " << split_reactants[1] << std::endl;
339  libmesh_error();
340  }
341  else
342  {
343  gas_reactant = split_reactants[0];
344  solid_reactant = split_reactants[1].substr(0,split_reactants[1].find("(s)"));
345  }
346  }
347  // Found (s) in the first entry
348  else
349  {
350  // Check that there's not 2 solid reactants
351  if( split_reactants[1].find("(s)") != split_reactants[1].npos )
352  {
353  std::cerr << "Error: can have only one solid reactant for GasSolidCatalyticWall" << std::endl
354  << " boundary condition. Found reactants " << split_reactants[0]
355  << ", " << split_reactants[1] << std::endl;
356  libmesh_error();
357  }
358 
359  gas_reactant = split_reactants[1];
360  solid_reactant = split_reactants[0].substr(0,split_reactants[0].find("(s)"));
361  }
362 
363  /* Now we have the gas reactant, the solid reactant, and the gas product strings.
364  Next we grab the species indices, build the catalycity, then build the
365  CatalyticWallBase object. */
366  const unsigned int rg_species = _chemistry.species_index( gas_reactant );
367  const unsigned int rs_species = _chemistry.species_index( solid_reactant );
368  const unsigned int p_species = _chemistry.species_index( product );
369 
370  // This is temporary and will be cloned, so let it be destroyed when we're done
371  boost::scoped_ptr<CatalycityBase> gamma_r(NULL);
372 
373  this->build_catalycities( input, gas_reactant, bc_id_string, bc_id, gamma_r );
374 
375  libmesh_assert( gamma_r );
376 
377  std::tr1::shared_ptr<CatalyticWallBase<Chemistry> > wall_ptr( new GasSolidCatalyticWall<Chemistry>( _chemistry, *gamma_r, rg_species, rs_species, p_species ) );
378 
379  _catalytic_walls.insert( std::make_pair(bc_id, wall_ptr ) );
380 
381  } // loop over reactions
382  }
383  break;
384 
385  default:
386  {
387  LowMachNavierStokesBCHandling::init_bc_types( bc_id, bc_id_string, bc_type,
388  bc_vars, bc_value, input );
389  }
390  break;
391 
392  } //switch(bc_type)
393 
394  return;
395  }
virtual void init_bc_types(const GRINS::BoundaryID bc_id, const std::string &bc_id_string, const int bc_type, const std::string &bc_vars, const std::string &bc_value, const GetPot &input)
void build_catalycities(const GetPot &input, const std::string &reactant, const std::string &bc_id_string, const BoundaryID bc_id, boost::scoped_ptr< CatalycityBase > &gamma_r)
std::multimap< BoundaryID, std::tr1::shared_ptr< CatalyticWallBase< Chemistry > > > _catalytic_walls
void split_string(const std::string &input, const std::string &delimiter, std::vector< std::string > &results)
Definition: string_utils.C:31
void set_neumann_bc_type(GRINS::BoundaryID bc_id, int bc_type)
void set_species_bc_values(GRINS::BoundaryID bc_id, const std::vector< libMesh::Real > &species_values)
void set_dirichlet_bc_type(GRINS::BoundaryID bc_id, int bc_type)
void GRINS::BCHandlingBase::init_dirichlet_bc_func_objs ( libMesh::FEMSystem *  system) const
virtualinherited

Definition at line 116 of file bc_handling_base.C.

References GRINS::BCHandlingBase::_dirichlet_bound_funcs.

Referenced by GRINS::Physics::init_bcs().

117  {
118  libMesh::DofMap& dof_map = system->get_dof_map();
119 
120  for( std::vector< DBCContainer >::const_iterator
121  it = _dirichlet_bound_funcs.begin();
122  it != _dirichlet_bound_funcs.end();
123  it++ )
124  {
125  // First, get variable names. We convert them to variable ids,
126  // both to tell the DirichletBoundary what variables to
127  // project and to tell the CompositeFunction what remapping to
128  // do.
129  std::vector<VariableName> var_names = (*it).get_var_names();
130 
131  std::vector<VariableIndex> dbc_vars;
132 
133  for( std::vector<VariableName>::const_iterator name = var_names.begin();
134  name != var_names.end();
135  name++ )
136  {
137  dbc_vars.push_back( system->variable_number( *name ) );
138  }
139 
140  // Get bc_id's
141  std::set<BoundaryID> bc_ids = (*it).get_bc_ids();
142 
143  // Get Dirichlet bc functor
144  std::tr1::shared_ptr<libMesh::FunctionBase<libMesh::Number> >
145  func = (*it).get_func();
146 
147  // Remap indices as necessary
148  if (func.get())
149  {
151  remapped_func.attach_subfunction(*func, dbc_vars);
152 
153  // Now create DirichletBoundary object and give it to libMesh
154  // libMesh makes it own copy of the DirichletBoundary so we can
155  // let this one die.
156  libMesh::DirichletBoundary dbc( bc_ids, dbc_vars,
157  remapped_func );
158 
159  dof_map.add_dirichlet_boundary( dbc );
160  }
161  else
162  {
163  // Get Dirichlet bc functor
164  const std::string& func_string = (*it).get_fem_func_string();
165 
166  libmesh_assert_not_equal_to(func_string, "");
167 
168  // Need to belatedly create Dirichlet functor since we
169  // didn't have a System object handy until now.
170  libMesh::ParsedFEMFunction<libMesh::Number>
171  func(*system, func_string);
172 
173  libMesh::CompositeFEMFunction<libMesh::Number> remapped_func;
174  remapped_func.attach_subfunction(func, dbc_vars);
175 
176  // Now create DirichletBoundary object and give it to libMesh
177  // libMesh makes it own copy of the DirichletBoundary so we can
178  // let this one die.
179  libMesh::DirichletBoundary dbc( bc_ids, dbc_vars,
180  *system,
181  remapped_func );
182 
183  dof_map.add_dirichlet_boundary( dbc );
184  }
185  }
186 
187  return;
188  }
std::vector< GRINS::DBCContainer > _dirichlet_bound_funcs
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::init_dirichlet_bcs ( libMesh::FEMSystem *  system) const
virtual

Reimplemented from GRINS::LowMachNavierStokesBCHandling.

Definition at line 505 of file reacting_low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::init_dirichlet_bcs().

506  {
508 
509  libMesh::DofMap& dof_map = system->get_dof_map();
510 
511  for( std::vector<std::pair<BoundaryID,BCType> >::const_iterator it = _species_bc_map.begin();
512  it != _species_bc_map.end();
513  it++ )
514  {
515  this->user_init_dirichlet_bcs( system, dof_map, it->first, it->second );
516  }
517 
518  return;
519  }
virtual void init_dirichlet_bcs(libMesh::FEMSystem *system) const
virtual void user_init_dirichlet_bcs(libMesh::FEMSystem *system, libMesh::DofMap &dof_map, GRINS::BoundaryID bc_id, GRINS::BCType bc_type) const
std::vector< std::pair< BoundaryID, BCType > > _species_bc_map
void GRINS::BCHandlingBase::init_periodic_bcs ( libMesh::FEMSystem *  system) const
virtualinherited

Definition at line 203 of file bc_handling_base.C.

References GRINS::BCHandlingBase::_num_periodic_bcs, and GRINS::BCHandlingBase::_periodic_bcs.

Referenced by GRINS::Physics::init_bcs().

204  {
205  /* Consistency check required to make sure user actually set periodic bc data.
206  This is needed because of the way we parse periodic boundary conditions. */
207  if( _periodic_bcs.size() != _num_periodic_bcs/2 )
208  {
209  std::cerr << "==========================================================" << std::endl
210  << "Error: Inconsistency in perioidic boundary conditions." << std::endl
211  << " There were " << _num_periodic_bcs << " deteced but " << std::endl
212  << " only " << _periodic_bcs.size() << " pairs of data " << std::endl
213  << " were set." << std::endl
214  << "==========================================================" << std::endl;
215  libmesh_error();
216  }
217 
218  libMesh::DofMap& dof_map = system->get_dof_map();
219 
220  for( std::vector< PBCContainer >::const_iterator it = _periodic_bcs.begin();
221  it != _periodic_bcs.end();
222  it++ )
223  {
224  libMesh::PeriodicBoundary bc( it->get_offset_vector() );
225  bc.myboundary = it->get_master_bcid();
226  bc.pairedboundary = it->get_slave_bcid();
227 
228  dof_map.add_periodic_boundary( bc );
229  }
230 
231  return;
232  }
std::vector< GRINS::PBCContainer > _periodic_bcs
unsigned int _num_periodic_bcs
bool GRINS::BCHandlingBase::is_axisymmetric ( ) const
inlineinherited
void GRINS::BCHandlingBase::read_bc_data ( const GetPot &  input,
const std::string &  id_str,
const std::string &  bc_str,
const std::string &  var_str,
const std::string &  val_str 
)
virtualinherited

Definition at line 73 of file bc_handling_base.C.

References GRINS::BCHandlingBase::init_bc_types(), and GRINS::BCHandlingBase::string_to_int().

Referenced by GRINS::AxisymmetricHeatTransferBCHandling::AxisymmetricHeatTransferBCHandling(), GRINS::HeatTransferBCHandling::HeatTransferBCHandling(), GRINS::IncompressibleNavierStokesBCHandling::IncompressibleNavierStokesBCHandling(), GRINS::LowMachNavierStokesBCHandling::LowMachNavierStokesBCHandling(), GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::ReactingLowMachNavierStokesBCHandling(), GRINS::SolidMechanicsBCHandling::SolidMechanicsBCHandling(), and GRINS::SpalartAllmarasBCHandling::SpalartAllmarasBCHandling().

77  {
78  int num_ids = input.vector_variable_size(id_str);
79  int num_bcs = input.vector_variable_size(bc_str);
80  // int num_vars = input.vector_variable_size(var_str);
81  // int num_vals = input.vector_variable_size(val_str);
82 
83  if( num_ids != num_bcs )
84  {
85  std::cerr << "Error: Must specify equal number of boundary ids and boundary conditions"
86  << std::endl;
87  libmesh_error();
88  }
89 
90  for( int i = 0; i < num_ids; i++ )
91  {
92  int bc_id = input(id_str, -1, i );
93  std::string bc_type_in = input(bc_str, "NULL", i );
94 
95  int bc_type = this->string_to_int( bc_type_in );
96 
97  std::stringstream ss;
98  ss << bc_id;
99  std::string bc_id_string = ss.str();
100 
101  std::string bc_val = input(val_str, std::string(""), i );
102 
103  std::string bc_vars = input(var_str, std::string(""), i );
104 
105  this->init_bc_types( bc_id, bc_id_string, bc_type, bc_vars, bc_val, input );
106  }
107 
108  return;
109  }
virtual void init_bc_types(const GRINS::BoundaryID bc_id, const std::string &bc_id_string, const int bc_type, const std::string &bc_vars, const std::string &bc_value, const GetPot &input)
virtual int string_to_int(const std::string &bc_type_in) const
void GRINS::BCHandlingBase::set_dirichlet_bc_type ( GRINS::BoundaryID  bc_id,
int  bc_type 
)
inherited
void GRINS::BCHandlingBase::set_dirichlet_bc_value ( GRINS::BoundaryID  bc_id,
libMesh::Real  value,
int  component = 0 
)
inherited
void GRINS::BCHandlingBase::set_neumann_bc_type ( GRINS::BoundaryID  bc_id,
int  bc_type 
)
inherited

Definition at line 258 of file bc_handling_base.C.

References GRINS::BCHandlingBase::_neumann_bc_map.

Referenced by GRINS::AxisymmetricHeatTransferBCHandling::init_bc_types(), GRINS::HeatTransferBCHandling::init_bc_types(), GRINS::LowMachNavierStokesBCHandling::init_bc_types(), and GRINS::SolidMechanicsBCHandling::init_bc_types().

259  {
260  _neumann_bc_map[bc_id] = bc_type;
261  return;
262  }
std::map< GRINS::BoundaryID, GRINS::BCType > _neumann_bc_map
Map between boundary id and Neumann boundary condition type.
void GRINS::BCHandlingBase::set_neumann_bc_value ( GRINS::BoundaryID  bc_id,
const libMesh::Point &  q_in 
)
inherited
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::set_species_bc_type ( GRINS::BoundaryID  bc_id,
int  bc_type 
)

Definition at line 483 of file reacting_low_mach_navier_stokes_bc_handling.C.

484  {
485  _species_bc_map.push_back( std::make_pair(bc_id,bc_type) );
486  return;
487  }
std::vector< std::pair< BoundaryID, BCType > > _species_bc_map
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::set_species_bc_values ( GRINS::BoundaryID  bc_id,
const std::vector< libMesh::Real > &  species_values 
)

Definition at line 490 of file reacting_low_mach_navier_stokes_bc_handling.C.

492  {
493  _species_bc_values[bc_id] = species_values;
494  return;
495  }
std::map< GRINS::BoundaryID, std::vector< libMesh::Real > > _species_bc_values
void GRINS::LowMachNavierStokesBCHandling::set_temp_bc_type ( GRINS::BoundaryID  bc_id,
int  bc_type 
)
inherited

Definition at line 476 of file low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::_temp_bc_map.

Referenced by GRINS::LowMachNavierStokesBCHandling::init_bc_types().

477  {
478  _temp_bc_map.push_back( std::make_pair(bc_id,bc_type) );
479  return;
480  }
std::vector< std::pair< BoundaryID, BCType > > _temp_bc_map
void GRINS::LowMachNavierStokesBCHandling::set_temp_bc_value ( GRINS::BoundaryID  bc_id,
libMesh::Real  value 
)
inherited

Definition at line 482 of file low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::_T_values.

Referenced by GRINS::LowMachNavierStokesBCHandling::init_bc_types().

484  {
485  _T_values[bc_id] = value;
486  return;
487  }
std::map< GRINS::BoundaryID, libMesh::Real > _T_values
template<typename Chemistry >
int GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::string_to_int ( const std::string &  bc_type_in) const
virtual

Reimplemented from GRINS::LowMachNavierStokesBCHandling.

Definition at line 83 of file reacting_low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::string_to_int().

84  {
85  int bc_type_out;
86 
87  if( bc_type == "zero_species_flux" )
88  {
89  bc_type_out = ZERO_SPECIES_FLUX;
90  }
91  else if( bc_type == "prescribed_species" )
92  {
93  bc_type_out = PRESCRIBED_SPECIES;
94  }
95  else if( bc_type == "prescribed_mole_fracs" )
96  {
97  bc_type_out = PRESCRIBED_MOLE_FRACTIONS;
98  }
99  else if( bc_type == "gas_recombination_catalytic_wall" )
100  {
101  bc_type_out = GAS_RECOMBINATION_CATALYTIC_WALL;
102  }
103  else if( bc_type == "gas_solid_catalytic_wall" )
104  {
105  bc_type_out = GAS_SOLID_CATALYTIC_WALL;
106  }
107  else if( bc_type == "general_species" )
108  {
109  bc_type_out = GENERAL_SPECIES;
110  }
111  else
112  {
113  bc_type_out = LowMachNavierStokesBCHandling::string_to_int( bc_type );
114  }
115 
116  return bc_type_out;
117  }
virtual int string_to_int(const std::string &bc_type_in) const
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::user_apply_neumann_bcs ( AssemblyContext context,
const GRINS::CachedValues cache,
const bool  request_jacobian,
const GRINS::BoundaryID  bc_id,
const GRINS::BCType  bc_type 
) const
virtual

Reimplemented from GRINS::BCHandlingBase.

Definition at line 522 of file reacting_low_mach_navier_stokes_bc_handling.C.

527  {
528  switch( bc_type )
529  {
530  case( GENERAL_SPECIES ):
531  {
532  for( std::vector<VariableIndex>::const_iterator var = _species_vars.begin();
533  var != _species_vars.end();
534  ++var )
535  {
536  if( this->is_axisymmetric() )
537  {
539  request_jacobian, *var, -1.0,
540  this->get_neumann_bound_func( bc_id, *var ) );
541  }
542  else
543  {
544  _bound_conds.apply_neumann_normal( context, cache,
545  request_jacobian, *var, 1.0,
546  this->get_neumann_bound_func( bc_id, *var ) );
547  }
548  }
549  }
550  break;
551 
553  case( GAS_SOLID_CATALYTIC_WALL ):
554  {
555  typedef typename std::multimap<BoundaryID, std::tr1::shared_ptr<CatalyticWallBase<Chemistry> > >::const_iterator it_type;
556 
557  std::pair< it_type, it_type > it_range = _catalytic_walls.equal_range( bc_id );
558 
559  for( it_type it = it_range.first; it != it_range.second; ++it )
560  {
561  (it->second)->apply_fluxes(context, cache, request_jacobian );
562  }
563  }
564  break;
565 
566  default:
567  {
568  std::cerr << "Error: Invalid Neumann BC type for " << _physics_name
569  << std::endl;
570  libmesh_error();
571  }
572  }
573 
574  return;
575  }
void apply_neumann_normal(AssemblyContext &context, const VariableIndex var, const libMesh::Real sign, const FEShape &value) const
Applies Neumann boundary conditions for the constant case.
std::tr1::shared_ptr< GRINS::NeumannFuncObj > get_neumann_bound_func(GRINS::BoundaryID bc_id, GRINS::VariableIndex var_id) const
std::multimap< BoundaryID, std::tr1::shared_ptr< CatalyticWallBase< Chemistry > > > _catalytic_walls
bool is_axisymmetric() const
GRINS::BoundaryConditions _bound_conds
Object that stashes generic boundary condition types.
void apply_neumann_normal_axisymmetric(AssemblyContext &context, const VariableIndex var, const libMesh::Real sign, const FEShape &value) const
Applies Neumann boundary conditions for the constant case.
template<typename Chemistry >
void GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::user_init_dirichlet_bcs ( libMesh::FEMSystem *  system,
libMesh::DofMap &  dof_map,
GRINS::BoundaryID  bc_id,
GRINS::BCType  bc_type 
) const
virtual

Reimplemented from GRINS::LowMachNavierStokesBCHandling.

Definition at line 439 of file reacting_low_mach_navier_stokes_bc_handling.C.

References GRINS::LowMachNavierStokesBCHandling::user_init_dirichlet_bcs().

443  {
444  switch( bc_type )
445  {
446  case(ZERO_SPECIES_FLUX):
447  // Do nothing BC
448  break;
449  case(PRESCRIBED_SPECIES):
451  {
452  std::set<GRINS::BoundaryID> dbc_ids;
453  dbc_ids.insert(bc_id);
454 
455  for( unsigned int s = 0; s < _n_species; s++ )
456  {
457  std::vector<GRINS::VariableIndex> dbc_vars(1,_species_vars[s]);
458 
459  libMesh::ConstFunction<libMesh::Number> species_func( this->get_species_bc_value(bc_id,s) );
460 
461  libMesh::DirichletBoundary species_dbc( dbc_ids,
462  dbc_vars,
463  &species_func );
464 
465  dof_map.add_dirichlet_boundary( species_dbc );
466  }
467  }
468  break;
469 
470  case(GENERAL_SPECIES):
471  // This case is handled in the BoundaryConditionFactory classes.
472  break;
473  default:
474  {
475  LowMachNavierStokesBCHandling::user_init_dirichlet_bcs(system,dof_map,bc_id,bc_type);
476  }
477  } //switch( bc_type )
478 
479  return;
480  }
virtual void user_init_dirichlet_bcs(libMesh::FEMSystem *system, libMesh::DofMap &dof_map, GRINS::BoundaryID bc_id, GRINS::BCType bc_type) const
libMesh::Real get_species_bc_value(GRINS::BoundaryID bc_id, unsigned int species) const

Member Data Documentation

bool GRINS::BCHandlingBase::_axisymmetric = false
staticprotectedinherited

Flag to cache whether or not there is an axisymmetric boundary present.

Definition at line 170 of file bc_handling_base.h.

Referenced by GRINS::BCHandlingBase::is_axisymmetric(), and GRINS::BCHandlingBase::string_to_int().

GRINS::BoundaryConditions GRINS::BCHandlingBase::_bound_conds
protectedinherited

Object that stashes generic boundary condition types.

Todo:
Move this so that only one object is needed. Perhaps make static?

Definition at line 156 of file bc_handling_base.h.

Referenced by GRINS::AxisymmetricHeatTransferBCHandling::user_apply_neumann_bcs(), GRINS::HeatTransferBCHandling::user_apply_neumann_bcs(), and GRINS::SolidMechanicsBCHandling::user_apply_neumann_bcs().

template<typename Chemistry>
std::multimap<BoundaryID, std::tr1::shared_ptr<CatalyticWallBase<Chemistry> > > GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_catalytic_walls
protected
template<typename Chemistry>
const Chemistry& GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_chemistry
protected
std::vector<std::pair<BoundaryID,BCType> > GRINS::BCHandlingBase::_dirichlet_bc_map
protectedinherited

Map between boundary id and Dirichlet boundary condition type.

We need to keep this around because the libMesh::DirichletBoundary objects can't be created until we init the variables. We use a vector of pairs so that the boundary condition functors get added to the libMesh::DofMap in the same order as in the input file.

Definition at line 137 of file bc_handling_base.h.

Referenced by GRINS::BCHandlingBase::get_dirichlet_bc_type(), GRINS::LowMachNavierStokesBCHandling::init_dirichlet_bcs(), GRINS::BCHandlingBase::init_dirichlet_bcs(), and GRINS::BCHandlingBase::set_dirichlet_bc_type().

std::vector< GRINS::DBCContainer > GRINS::BCHandlingBase::_dirichlet_bound_funcs
protectedinherited
std::map< GRINS::BoundaryID, libMesh::Point > GRINS::BCHandlingBase::_dirichlet_values
protectedinherited

Stash prescribed Dirichlet boundary values.

Definition at line 143 of file bc_handling_base.h.

Referenced by GRINS::BCHandlingBase::set_dirichlet_bc_value().

template<typename Chemistry>
unsigned int GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_n_species
protected
std::map< GRINS::BoundaryID, GRINS::BCType> GRINS::BCHandlingBase::_neumann_bc_map
protectedinherited

Map between boundary id and Neumann boundary condition type.

Definition at line 140 of file bc_handling_base.h.

Referenced by GRINS::BCHandlingBase::apply_neumann_bcs(), and GRINS::BCHandlingBase::set_neumann_bc_type().

std::map< GRINS::BoundaryID, GRINS::NBCContainer > GRINS::BCHandlingBase::_neumann_bound_funcs
protectedinherited
unsigned int GRINS::BCHandlingBase::_num_periodic_bcs
protectedinherited
std::vector< GRINS::PBCContainer > GRINS::BCHandlingBase::_periodic_bcs
protectedinherited
std::string GRINS::BCHandlingBase::_physics_name
protectedinherited
std::map< GRINS::BoundaryID, libMesh::Point > GRINS::BCHandlingBase::_q_values
protectedinherited

Stash prescribed boundary fluxes.

Definition at line 146 of file bc_handling_base.h.

Referenced by GRINS::BCHandlingBase::get_neumann_bc_value(), and GRINS::BCHandlingBase::set_neumann_bc_value().

template<typename Chemistry>
std::vector<std::pair<BoundaryID,BCType> > GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_species_bc_map
protected
template<typename Chemistry>
std::map< GRINS::BoundaryID, std::vector<libMesh::Real> > GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_species_bc_values
protected
template<typename Chemistry>
std::vector<std::string> GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_species_var_names
protected
template<typename Chemistry>
std::vector<GRINS::VariableIndex> GRINS::ReactingLowMachNavierStokesBCHandling< Chemistry >::_species_vars
protected
std::map< GRINS::BoundaryID, libMesh::Real > GRINS::LowMachNavierStokesBCHandling::_T_values
protectedinherited
GRINS::VariableIndex GRINS::LowMachNavierStokesBCHandling::_T_var
protectedinherited
std::string GRINS::LowMachNavierStokesBCHandling::_T_var_name
protectedinherited
std::vector<std::pair<BoundaryID,BCType> > GRINS::LowMachNavierStokesBCHandling::_temp_bc_map
protectedinherited
std::string GRINS::LowMachNavierStokesBCHandling::_u_var_name
protectedinherited
std::string GRINS::LowMachNavierStokesBCHandling::_v_var_name
protectedinherited
std::string GRINS::LowMachNavierStokesBCHandling::_w_var_name
protectedinherited

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

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