LifeV
fsi/examples/benchmark_GreenshieldsWeller/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 for the Monolithic Test
30  *
31  * @date 2009-04-09
32  * @author Paolo Crosetto <crosetto@iacspc70.epfl.ch>
33  *
34  * @contributor Cristiano Malossi <cristiano.malossi@epfl.ch>
35  * @maintainer Paolo Crosetto <crosetto@iacspc70.epfl.ch>
36  *
37  * Contains the functions to be assigned as boundary conditions, in the file boundaryConditions.hpp . The functions
38  * can depend on time and space, while they can take in input an ID specifying one of the three principal axis
39  * if the functions to assign is vectorial and the boundary condition is of type \c Full \c.
40  */
41 
42 #ifndef BC_HPP
43 #define BC_HPP
44 
45 // LifeV includes
46 #include "lifev/core/LifeV.hpp"
47 #include "lifev/core/fem/BCHandler.hpp"
48 
49 // Mathcard includes
50 #include "lifev/fsi/solver/FSIMonolithicGE.hpp"
51 #include "lifev/fsi/solver/FSIMonolithicGI.hpp"
52 
53 #define OUTLET 3
54 #define INLET 2
55 #define FLUIDINTERFACE 1
56 #define SOLIDINTERFACE 1
57 #define OUTERWALL 10
58 #define RING 2
59 #define RING2 3
60 #define INOUTEDGE 20
61 #define INEDGE 30
62 
63 namespace LifeV
64 {
65 
66 
67 Real fZero (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
68 {
69  return 0.0;
70 }
71 
72 Real u2normal (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
73 {
74  return -5.e4;
75 }
76 
77 typedef FSIOperator::fluid_Type fluid;
78 typedef FSIOperator::solid_Type solid;
79 
80 FSIOperator::fluidBchandlerPtr_Type BCh_harmonicExtension (FSIOperator& _oper)
81 {
82 
83  // Boundary condition for the mesh
84  debugStream ( 10000 ) << "Boundary condition for the harmonic extension\n";
85 
86  BCFunctionBase bcf (fZero);
87 
88  FSISolver::fluidBchandlerPtr_Type BCh_he (new FSIOperator::fluidBchandler_Type );
89 
90  std::vector<ID> componentsVector (0);
91  componentsVector.push_back (2);
92  BCh_he->addBC ("Base", INLET, Essential, Component, bcf, componentsVector);
93  BCh_he->addBC ("Top", OUTLET, Essential, Component, bcf, componentsVector);
94 
95  if (_oper.data().method() == "monolithicGE")
96  {
97  debugStream (10000) << "FSIMonolithic GCE harmonic extension\n";
98  FSIMonolithicGE* MOper = dynamic_cast<FSIMonolithicGE*> (&_oper);
99  MOper->setStructureDispToHarmonicExtension (_oper.lambdaFluidRepeated() );
100  BCh_he->addBC ("Interface", SOLIDINTERFACE, Essential, Full,
101  *MOper->bcvStructureDispToHarmonicExtension(), 3);
102  }
103 
104  return BCh_he;
105 }
106 
107 
108 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid (FSIOperator& _oper)
109 {
110  // Boundary conditions for the fluid velocity
111 
112  if (! _oper.isFluid() )
113  {
114  return FSIOperator::fluidBchandlerPtr_Type();
115  }
116 
117  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
118 
119  BCFunctionBase bcf (fZero);
120  BCFunctionBase in_flow (u2normal);
121 
122  BCh_fluid->addBC ("InFlow" , INLET, Natural, Normal, in_flow);
123 
124  return BCh_fluid;
125 }
126 
127 FSIOperator::solidBchandlerPtr_Type BCh_monolithicSolid (FSIOperator& _oper)
128 {
129  // Boundary conditions for the solid displacement
130 
131  if (! _oper.isSolid() )
132  {
133  return FSIOperator::solidBchandlerPtr_Type();
134  }
135 
136  FSIOperator::solidBchandlerPtr_Type BCh_solid ( new FSIOperator::solidBchandler_Type );
137 
138  BCFunctionBase bcf (fZero);
139 
140  std::vector<ID> componentsVector (0);
141  componentsVector.push_back (2);
142  BCh_solid->addBC ("Base", INLET, Essential, Component, bcf, componentsVector);
143  BCh_solid->addBC ("Top", OUTLET, Essential, Component, bcf, componentsVector);
144 
145  return BCh_solid;
146 }
147 
148 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFlux (bool /*isOpen=true*/)
149 {
150  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
151  return BCh_fluid;
152 }
153 
154 }
155 
156 #endif
#define debugStream
Definition: LifeDebug.hpp:182