Exemple #1
0
std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > BunsenBCFactory::build_dirichlet( )
{
  const libMesh::Real delta = 0.0005;
  const libMesh::Real u0 = 0.12;

  GRINS::DBCContainer cont;
  {
    cont.add_var_name( "v" );
    cont.add_bc_id( 1 );
    
    const libMesh::Real factor = 1.0;
    const libMesh::Real r0 = 0.002;

    std::tr1::shared_ptr<libMesh::FunctionBase<Number> > vel_func( new GRINS::ConstantWithExponentialLayer( u0, factor, r0, delta ) );
    
    cont.set_func( vel_func );
  }

  GRINS::DBCContainer cont2;
  {
    cont2.add_var_name( "u" );
    cont2.add_bc_id( 1 );
    cont2.add_bc_id( 3 );
    
    std::tr1::shared_ptr<libMesh::FunctionBase<Number> > vel_func( new ZeroFunction<Number> );

    cont2.set_func( vel_func );
  }

  GRINS::DBCContainer cont3;
  {
    cont3.add_var_name( "v" );
    cont3.add_bc_id( 3 );
    
    const libMesh::Real factor = -1.0;
    const libMesh::Real r0 = 0.0025;

    std::tr1::shared_ptr<libMesh::FunctionBase<Number> > vel_func( new GRINS::ConstantWithExponentialLayer( u0, factor, r0, delta ) );
    
    cont3.set_func( vel_func );
  }

  std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > mymap;
  
  mymap.insert( std::pair<GRINS::PhysicsName, GRINS::DBCContainer >(GRINS::reacting_low_mach_navier_stokes,  cont) );

  mymap.insert( std::pair<GRINS::PhysicsName, GRINS::DBCContainer >(GRINS::reacting_low_mach_navier_stokes,  cont2) );

  mymap.insert( std::pair<GRINS::PhysicsName, GRINS::DBCContainer >(GRINS::reacting_low_mach_navier_stokes,  cont3) );

  return mymap;
}
std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > ParabolicBCFactory::build_dirichlet( )
{
  GRINS::DBCContainer cont;
  cont.add_var_name( "u" );
  cont.add_bc_id( 1 );
  cont.add_bc_id( 3 );

  GRINS::SharedPtr<libMesh::FunctionBase<libMesh::Number> > u_func( new GRINS::ParabolicProfile );

  cont.set_func( u_func );

  std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > mymap;

  mymap.insert( std::pair<GRINS::PhysicsName, GRINS::DBCContainer >(GRINS::stokes,  cont) );

  return mymap;
}
std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > InjectionBCFactory::build_dirichlet( )
{
  GRINS::DBCContainer cont;
  cont.add_var_name( "v" );
  cont.add_bc_id( 1 );
  
  const Real l = 0.2;

  const Real mdot = 1.0;
  const Real R = 287;
  const Real T = 600;
  const Real p0 = 1.0e5;
  const Real rho = p0/(R*T);

  const Real factor = 6.0*mdot/(l*l)/rho;

  std::cout << "factor = " << factor << std::endl;
  
  std::tr1::shared_ptr<libMesh::FunctionBase<Number> > vel_func( new GRINS::ParabolicProfile( -factor, 0.0, 0.0, 0.0, 0.0, factor*l*l/4.0 ) );
    
  cont.set_func( vel_func );


  GRINS::DBCContainer cont2;
  cont2.add_var_name( "u" );
  cont2.add_bc_id( 1 );

  std::tr1::shared_ptr<libMesh::FunctionBase<Number> > vel_func2( new libMesh::ZeroFunction<Number> );

  cont2.set_func( vel_func2 );

  std::multimap< GRINS::PhysicsName, GRINS::DBCContainer > mymap;
  
  mymap.insert( std::pair<GRINS::PhysicsName, GRINS::DBCContainer >(GRINS::low_mach_navier_stokes,  cont) );

  mymap.insert( std::pair<GRINS::PhysicsName, GRINS::DBCContainer >(GRINS::low_mach_navier_stokes,  cont2) );

  return mymap;
}