LifeV
navier_stokes_blocks/examples/example_external_flow/boundaryConditions.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3 *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23 *******************************************************************************
24 */
25 //@HEADER
26 
27 /*!
28  * @file
29  * @brief File containing the boundary conditions of the external fluid flow example
30  *
31  * @author Davide Forti <davide.forti@epfl.ch>
32  *
33  * Contains the functions to be assigned as boundary conditions, in the file boundaryConditions.hpp . The functions
34  * can depend on time and space, while they can take in input an ID specifying one of the three principal axis
35  * if the functions to assign is vectorial and the boundary condition is of type \c Full \c.
36  */
37 
38 #ifndef BCNS_HPP
39 #define BCNS_HPP
40 
41 // LifeV includes
42 #include <lifev/core/LifeV.hpp>
43 #include <lifev/core/fem/BCHandler.hpp>
44 
45 #include "ud_functions.hpp"
46 
47 namespace LifeV
48 {
49 
51 
53 {
54  BCFunctionBase uZero( zeroFunction );
55  BCFunctionBase uInflow( inflowFunction );
56 
57  std::vector<LifeV::ID> xComp(1), yComp(1), zComp(1);
58  xComp[0] = 0;
59  yComp[0] = 1;
60  zComp[0] = 2;
61 
62  bcPtr_Type bcH (new BCHandler );
63 
64  bcH->addBC( "Inflow", 1, Essential, Full, uInflow, 3 );
65  bcH->addBC( "Outflow", 3, Natural, Full, uZero, 3 );
66  bcH->addBC( "TopBottom", 2, Essential, Component, uZero, yComp );
67  bcH->addBC( "LeftRight", 5, Essential, Component, uZero, zComp );
68  //bcH->addBC ("Cylinder" , 4, Essential, Full, uZero, 3 ); // commented since we impose weak bc here, see the datafile
69 
70  return bcH;
71 }
72 
74 {
75  bcPtr_Type bcH (new BCHandler );
76 
77  BCFunctionBase uOneX( oneFunctionX );
78 
79  bcH->addBC( "CylinderDrag", 4, Essential, Full, uOneX, 3 );
80 
81  return bcH;
82 }
83 
85 {
86  bcPtr_Type bcH (new BCHandler );
87 
88  BCFunctionBase uOneY( oneFunctionY );
89 
90  bcH->addBC( "CylinderLift", 4, Essential, Full, uOneY, 3 );
91 
92  return bcH;
93 }
94 
95 }
96 
97 #endif
boost::shared_ptr< BCHandler > bcPtr_Type