30 #include "libmesh/zero_function.h"
31 #include "libmesh/dirichlet_boundaries.h"
32 #include "libmesh/dof_map.h"
33 #include "libmesh/fem_system.h"
47 std::string bc_str =
"Physics/"+
_physics_name+
"/vel_bc_types";
48 std::string var_str =
"Physics/"+
_physics_name+
"/vel_bc_variables";
49 std::string val_str =
"Physics/"+
_physics_name+
"/vel_bc_values";
51 this->
read_bc_data( input, id_str, bc_str, var_str, val_str );
58 this->
read_bc_data( input, id_str, bc_str, var_str, val_str );
72 if( bc_type ==
"no_slip" )
75 else if( bc_type ==
"zero_x_velocity" )
78 else if( bc_type ==
"zero_y_velocity" )
81 else if( bc_type ==
"parabolic_profile" )
84 else if( bc_type ==
"prescribed_vel" )
87 else if( bc_type ==
"general_velocity" )
90 else if( bc_type ==
"isothermal" )
93 else if( bc_type ==
"general_isothermal" )
96 else if( bc_type ==
"adiabatic" )
99 else if( bc_type ==
"prescribed_heat_flux" )
102 else if( bc_type ==
"general_heat_flux" )
122 const std::string& bc_id_string,
124 const std::string& bc_vars,
125 const std::string& bc_value,
126 const GetPot& input )
152 int n_vel_comps = input.vector_variable_size(
"Physics/"+
_physics_name+
"/bound_vel_"+bc_id_string);
153 if( n_vel_comps != 3 )
155 std::cerr <<
"Error: Must specify 3 velocity components when inputting"
157 <<
" prescribed velocities. Found " << n_vel_comps
158 <<
" velocity components."
164 input(
"Physics/"+
_physics_name+
"/bound_vel_"+bc_id_string, 0.0, 0 ),
168 input(
"Physics/"+
_physics_name+
"/bound_vel_"+bc_id_string, 0.0, 1 ),
172 input(
"Physics/"+
_physics_name+
"/bound_vel_"+bc_id_string, 0.0, 2 ),
181 if( input.vector_variable_size(
"Physics/"+
_physics_name+
"/parabolic_profile_coeffs_"+bc_id_string) != 6 )
183 std::cerr <<
"Error: Must specify 6 components when inputting"
185 <<
" coefficients for a parabolic profile. Found "
186 << input.vector_variable_size(
"Physics/"+
_physics_name+
"/parabolic_profile_"+bc_id_string)
192 libMesh::Real a = input(
"Physics/"+
_physics_name+
"/parabolic_profile_coeffs_"+bc_id_string, 0.0, 0 );
193 libMesh::Real b = input(
"Physics/"+
_physics_name+
"/parabolic_profile_coeffs_"+bc_id_string, 0.0, 1 );
194 libMesh::Real c = input(
"Physics/"+
_physics_name+
"/parabolic_profile_coeffs_"+bc_id_string, 0.0, 2 );
195 libMesh::Real d = input(
"Physics/"+
_physics_name+
"/parabolic_profile_coeffs_"+bc_id_string, 0.0, 3 );
196 libMesh::Real e = input(
"Physics/"+
_physics_name+
"/parabolic_profile_coeffs_"+bc_id_string, 0.0, 4 );
197 libMesh::Real f = input(
"Physics/"+
_physics_name+
"/parabolic_profile_coeffs_"+bc_id_string, 0.0, 5 );
199 std::string var = input(
"Physics/"+
_physics_name+
"/parabolic_profile_var_"+bc_id_string,
"DIE!" );
205 std::tr1::shared_ptr<libMesh::FunctionBase<libMesh::Number> >
211 std::string fix_var = input(
"Physics/"+
_physics_name+
"/parabolic_profile_fix_"+bc_id_string,
"DIE!" );
217 std::tr1::shared_ptr<libMesh::FunctionBase<libMesh::Number> >
218 func_fix(
new libMesh::ZeroFunction<libMesh::Number>() );
230 std::string fix_var = input(
"Physics/"+
_physics_name+
"/general_velocity_fix_"+bc_id_string,
"DIE!" );
236 std::tr1::shared_ptr<libMesh::FunctionBase<libMesh::Number> >
237 func_fix(
new libMesh::ZeroFunction<libMesh::Number>() );
265 libMesh::RealGradient q_in;
267 int num_q_components = input.vector_variable_size(
"Physics/"+
_physics_name+
"/q_wall_"+bc_id_string);
269 for(
int i = 0; i < num_q_components; i++ )
271 q_in(i) = input(
"Physics/"+
_physics_name+
"/q_wall_"+bc_id_string, 0.0, i );
293 bc_vars, bc_value, input );
301 libMesh::DofMap& dof_map,
305 int dim = system->get_mesh().mesh_dimension();
318 std::set<BoundaryID> dbc_ids;
319 dbc_ids.insert(bc_id);
321 std::vector<VariableIndex> dbc_vars;
322 dbc_vars.push_back(u_var);
324 libMesh::ZeroFunction<libMesh::Number> zero;
326 libMesh::DirichletBoundary no_slip_dbc(dbc_ids,
330 dof_map.add_dirichlet_boundary( no_slip_dbc );
335 std::set<BoundaryID> dbc_ids;
336 dbc_ids.insert(bc_id);
338 std::vector<VariableIndex> dbc_vars;
339 dbc_vars.push_back(v_var);
341 libMesh::ZeroFunction<libMesh::Number> zero;
343 libMesh::DirichletBoundary no_slip_dbc(dbc_ids,
347 dof_map.add_dirichlet_boundary( no_slip_dbc );
352 std::set<BoundaryID> dbc_ids;
353 dbc_ids.insert(bc_id);
355 std::vector<VariableIndex> dbc_vars;
356 dbc_vars.push_back(u_var);
357 dbc_vars.push_back(v_var);
359 dbc_vars.push_back(w_var);
361 libMesh::ZeroFunction<libMesh::Number> zero;
363 libMesh::DirichletBoundary no_slip_dbc(dbc_ids,
367 dof_map.add_dirichlet_boundary( no_slip_dbc );
372 std::set<BoundaryID> dbc_ids;
373 dbc_ids.insert(bc_id);
375 std::vector<VariableIndex> dbc_vars;
381 dbc_vars.push_back(u_var);
382 libMesh::ConstFunction<libMesh::Number>
385 libMesh::DirichletBoundary vel_dbc(dbc_ids,
389 dof_map.add_dirichlet_boundary( vel_dbc );
394 dbc_vars.push_back(v_var);
395 libMesh::ConstFunction<libMesh::Number>
398 libMesh::DirichletBoundary vel_dbc(dbc_ids,
402 dof_map.add_dirichlet_boundary( vel_dbc );
407 dbc_vars.push_back(w_var);
408 libMesh::ConstFunction<libMesh::Number>
411 libMesh::DirichletBoundary vel_dbc(dbc_ids,
415 dof_map.add_dirichlet_boundary( vel_dbc );
429 std::set<BoundaryID> dbc_ids;
430 dbc_ids.insert(bc_id);
432 std::vector<VariableIndex> dbc_vars;
433 dbc_vars.push_back(T_var);
435 libMesh::ConstFunction<libMesh::Number>
438 libMesh::DirichletBoundary t_dbc( dbc_ids, dbc_vars, &t_func );
440 dof_map.add_dirichlet_boundary( t_dbc );
449 std::set<BoundaryID> dbc_ids;
450 dbc_ids.insert(bc_id);
452 std::vector<VariableIndex> dbc_vars;
453 dbc_vars.push_back(u_var);
455 libMesh::ZeroFunction<libMesh::Number> zero;
457 libMesh::DirichletBoundary no_slip_dbc( dbc_ids,
461 dof_map.add_dirichlet_boundary( no_slip_dbc );
467 std::cerr <<
"Invalid BCType " << bc_type << std::endl;
478 _temp_bc_map.push_back( std::make_pair(bc_id,bc_type) );
483 libMesh::Real value )
496 libMesh::DofMap& dof_map = system->get_dof_map();
498 for( std::vector<std::pair<BoundaryID,BCType> >::const_iterator it =
_dirichlet_bc_map.begin();
504 for( std::vector<std::pair<BoundaryID,BCType> >::const_iterator it =
_temp_bc_map.begin();
virtual void init_dirichlet_bcs(libMesh::FEMSystem *system) const
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
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)
GRINS::VariableIndex _T_var
Simple helper class to setup general Dirichlet boundary conditions.
virtual void user_init_dirichlet_bcs(libMesh::FEMSystem *system, libMesh::DofMap &dof_map, GRINS::BoundaryID bc_id, GRINS::BCType bc_type) const
libMesh::boundary_id_type BoundaryID
More descriptive name of the type used for boundary ids.
void attach_dirichlet_bound_func(const GRINS::DBCContainer &dirichlet_bc)
const std::string v_var_name_default
y-velocity
libMesh::Real get_temp_bc_value(GRINS::BoundaryID bc_id) const
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)
void add_var_name(const GRINS::VariableName &var)
Add variables that are constrained by the Dirichlet bc.
LowMachNavierStokesBCHandling()
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)
std::map< GRINS::BoundaryID, libMesh::Real > _T_values
const std::string T_var_name_default
temperature
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)
std::vector< std::pair< BoundaryID, BCType > > _dirichlet_bc_map
Map between boundary id and Dirichlet boundary condition type.
void set_temp_bc_value(GRINS::BoundaryID bc_id, libMesh::Real value)
std::vector< std::pair< BoundaryID, BCType > > _temp_bc_map
const std::string u_var_name_default
Default physics variable names.
virtual int string_to_int(const std::string &bc_type_in) const
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.
Base class for reading and handling boundary conditions for physics classes.
void set_temp_bc_type(GRINS::BoundaryID bc_id, int bc_type)
void add_bc_id(const GRINS::BoundaryID bc_id)
Add boundary id's for which this Dirichlet bc is to be applied.
virtual ~LowMachNavierStokesBCHandling()
void set_func(std::tr1::shared_ptr< libMesh::FunctionBase< libMesh::Number > > func)
Add the Dirichlet bc functor.
void set_neumann_bc_type(GRINS::BoundaryID bc_id, int bc_type)
void set_dirichlet_bc_type(GRINS::BoundaryID bc_id, int bc_type)
libMesh::Real get_dirichlet_bc_value(GRINS::BoundaryID bc_id, int component=0) const
const std::string w_var_name_default
z-velocity
std::string _physics_name