LifeV
fsi/examples/example_SmoothAneurysm/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 #include <lifev/fsi/solver/FSIMonolithicGE.hpp>
50 #include <lifev/fsi/solver/FSIMonolithicGI.hpp>
51 
52 #include "flowConditions.hpp"
53 #include "resistance.hpp"
54 #include "ud_functions.hpp"
55 
56 
57 //Regular mesh
58 #define INLET 2
59 #define INLETRING 20
60 #define OUTLET 3
61 #define OUTLETRING 30
62 #define FLUIDINTERFACE 200
63 
64 #define SOLIDINTERFACE 200
65 #define INLETWALL 2
66 #define INLETWALL_INTRING 20
67 #define INLETWALL_OUTRING 21
68 
69 #define OUTLETWALL 3
70 #define OUTLETWALL_INTRING 30
71 #define OUTLETWALL_OUTRING 31
72 
73 #define OUTERWALL 210
74 
75 
76 
77 namespace LifeV
78 {
79 
80 typedef FSIOperator::fluid_Type fluid;
81 typedef FSIOperator::solid_Type solid;
82 
83 FSIOperator::fluidBchandlerPtr_Type BCh_harmonicExtension (FSIOperator& /*_oper*/)
84 {
85 
86  // Boundary condition for the mesh
87  debugStream ( 10000 ) << "Boundary condition for the harmonic extension\n";
88 
89  BCFunctionBase bcf (fZero);
90 
91  FSISolver::fluidBchandlerPtr_Type BCh_he (new FSIOperator::fluidBchandler_Type );
92 
93  BCh_he->addBC ("in", INLET, Essential, Full, bcf, 3);
94  BCh_he->addBC ("in", OUTLET, Essential, Full, bcf, 3);
95 
96  // Rings of the fluid domain
97  // BCh_he->addBC ("inRing", INLETRING, EssentialVertices, Full, bcf, 3);
98  // BCh_he->addBC ("inRing", OUTLETRING, EssentialVertices, Full, bcf, 3);
99 
100  return BCh_he;
101 }
102 
103 
104 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFlux (bool /*isOpen=true*/)
105 {
106  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
107 
108  BCFunctionBase flowAneurysm (fluxFunctionAneurysm);
109  BCFunctionBase bcf (fZero);
110  //uncomment to use fluxes
111 
112  //BCh_fluid->addBC("InFlow" , INLET, Flux, Normal, flowAneurysm);
113  // if(!isOpen)
114  // BCh_fluid->addBC("InFlow" , INLET, Flux, Normal, bcf);
115 
116  //uncomment to use fluxes
117  //BCh_fluid->addBC("InFlow" , INLET, Flux, Normal, flowAneurysm);
118 
119  return BCh_fluid;
120 }
121 
122 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid ( FSIOperator& _oper, bool const& /*isOpen=true*/,
123  ImplicitResistance& resistanceBC )
124 {
125  // Boundary conditions for the fluid velocity
126  debugStream ( 10000 ) << "Boundary condition for the fluid\n";
127 
128  if (! _oper.isFluid() )
129  {
130  return FSIOperator::fluidBchandlerPtr_Type();
131  }
132 
133  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
134 
135  BCFunctionBase bcf (fZero);
136  BCFunctionBase pressureEpsilon (epsilon);
137  // BCFunctionBase out_flow (fZero);
138 
139  BCFunctionBase out_press3 (ResistanceBCs::outPressure0);
140 
141  BCFunctionBase InletVect (aneurismFluxInVectorial);
142  //BCFunctionBase bcfw0 (w0);
143 
144  //Inlets
145  BCh_fluid->addBC ("InFlow" , INLET, EssentialVertices, Full, InletVect, 3);
146  BCh_fluid->addBC ("InFlow" , 20, EssentialVertices, Full, bcf, 3);
147 
148  // BCh_fluid->addBC ("out3", OUTLET, Natural, Normal, out_press3);
149 
150  // resistanceBC.vector() gives back the vector we are considering.
151  BCh_fluid->addBC ("out3", OUTLET, Resistance, Full, resistanceBC.vector() , 3);
152 
153 
154  return BCh_fluid;
155 }
156 
157 FSIOperator::solidBchandlerPtr_Type BCh_monolithicSolid (FSIOperator& _oper)
158 {
159 
160  if (! _oper.isSolid() )
161  {
162  return FSIOperator::solidBchandlerPtr_Type();
163  }
164 
165  // Boundary conditions for the solid displacement
166  debugStream ( 10000 ) << "Boundary condition for the solid\n";
167  FSIOperator::solidBchandlerPtr_Type BCh_solid ( new FSIOperator::solidBchandler_Type );
168 
169  BCFunctionBase bcf (fZero);
170 
171  //Inlets & Outlets
172  BCh_solid->addBC ("BORDERS", INLETWALL, Essential, Full, bcf, 3);
173  BCh_solid->addBC ("BORDERS", OUTLETWALL, Essential, Full, bcf, 3);
174 
175  //Robin BC
176  BCFunctionBase hyd (fZero);
177  BCFunctionBase young (E);
178  BCFunctionBase externalPressure (outerWallPressure);
179  //robin condition on the outer wall
180  //_oper.setRobinOuterWall (externalPressure, young);
181 
182  //BCh_solid->addBC ("OuterWall", OUTERWALL, Robin, Normal, _oper.bcfRobinOuterWall() );
183  //First try: Homogeneous Neumann
184  BCh_solid->addBC ("OuterWall", OUTERWALL, Natural, Normal, bcf);
185 
186  //Constant pressure Neumann
187  //BCh_solid->addBC ("OuterWall", OUTERWALL, Natural, Normal, externalPressure);
188 
189  return BCh_solid;
190 }
191 
192 }
193 
194 #endif
FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid(FSIOperator &_oper, bool const &, ImplicitResistance &resistanceBC)
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
#define debugStream
Definition: LifeDebug.hpp:182
NdebugStream noDebugStream(int=0, NdebugStream::stprintf=&printf)
Definition: LifeDebug.hpp:183