LifeV
fsi/examples/application_aortaFSI/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 #include "ud_functions.hpp"
46 // LifeV includes
47 #include "lifev/core/LifeV.hpp"
48 #include "lifev/core/fem/BCHandler.hpp"
49 
50 // Mathcard includes
51 #include "lifev/fsi/solver/FSIMonolithicGE.hpp"
52 #include "lifev/fsi/solver/FSIMonolithicGI.hpp"
53 
54 //#ifndef BL
55 //Fluid Mesh
56 #define OUTLET 5
57 #define OUTLETRING 50
58 #define INLET 6
59 #define INLETRING 60
60 
61 #define RCCA 8 //Right common carotid artery
62 #define RCCARING 80
63 #define RCSUBCA 2 //Right subclavial artery
64 #define RCSUBCARING 20
65 #define RCSUBSUBCA 9 //Right sub-subclavial artery
66 #define RCSUBSUBCARING 90
67 #define LSUBCA 4 //Left subclavial artery
68 #define LSSUBCARING 40
69 #define LSUBSUBCA 3 //Left sub-subclavial artery
70 #define LSSUBSUBCARING 30
71 #define LCCA 7 //Left common carotid artery
72 #define LCCARING 70
73 #define FLUIDINTERFACE 200
74 
75 //Solid Mesh
76 #define OUTLETWALL 5
77 #define OUTLETWALLRINGIN 50
78 #define OUTLETWALLRINGOUT 51
79 #define INLETWALL 6
80 #define INLETWALLRINGIN 60
81 #define INLETWALLRINGOUT 61
82 
83 #define RCCAWALL 8 //Right common carotid artery
84 #define RCCAWALLRINGIN 80
85 #define RCCAWALLRINGOUT 81
86 #define RCSUBCAWALL 2 //Right subclavial artery
87 #define RCSUBCAWALLRINGIN 20
88 #define RCSUBCAWALLRINGOUT 21
89 #define RCSUBSUBCAWALL 9 //Right sub-subclavial artery
90 #define RCSUBSUBCAWALLRINGIN 90
91 #define RCSUBSUBCAWALLRINGOUT 91
92 #define LSUBCAWALL 4 //Left subclavial artery
93 #define LSSUBCAWALLRINGIN 40
94 #define LSSUBCAWALLRINGOUT 41
95 #define LSUBSUBCAWALL 3 //Left sub-subclavial artery
96 #define LSSUBSUBCAWALLRINGIN 30
97 #define LSSUBSUBCAWALLRINGOUT 31
98 #define LCCAWALL 7 //Left common carotid artery
99 #define LCCAWALLRINGIN 70
100 #define LCCAWALLRINGOUT 70
101 #define SOLIDINTERFACE 200
102 #define OUTERWALL 210
103 
104 //#endif
105 
106 /*
107 //#define RING2 22
108 #define RING 2
109 //thoracic aorta,
110 #define RING3 3
111 //21, L. Brachia, bhanch 3_2
112 #define RING4 4
113 //first branchstd::placeholders::_1,
114 #define RING5 5
115 //branch 1_2 smallest
116 #define RING6 6
117 //R. Brachia, branch 1_3
118 #define RING7 7
119 // 15, LCCA, branch 2
120 #define RING8 8
121 // 20 LVA branch 3_1
122 #define RING9 9
123 #define INOUTEDGE 20
124 #else
125 #define OUTLET 5
126 #define INLET 6
127 #define FLUIDINTERFACE 200
128 #define OUTERWALL 201
129 #define SOLIDINTERFACE 200
130 //#define RING2 22
131 #define RING4 4
132 #define RING5 8
133 #define RING6 9
134 #define RING7 2
135 #define RING8 7
136 #define RING6 4
137 //#define INOUTEDGE 20
138 */
139 
140 namespace LifeV
141 {
142 
143 typedef FSIOperator::fluid_Type fluid;
144 typedef FSIOperator::solid_Type solid;
145 
146 FSIOperator::fluidBchandlerPtr_Type BCh_harmonicExtension (FSIOperator& _oper)
147 {
148 
149  // Boundary condition for the mesh
150  debugStream ( 10000 ) << "Boundary condition for the harmonic extension\n";
151 
152  BCFunctionBase bcf (fZero);
153 
154  FSISolver::fluidBchandlerPtr_Type BCh_he (new FSIOperator::fluidBchandler_Type );
155 
156 
157  BCh_he->addBC ("Base", INLET, Essential, Full, bcf, 3);
158 
159  if (_oper.data().method() == "monolithicGE")
160  {
161  debugStream (10000) << "FSIMonolithic GCE harmonic extension\n";
162  FSIMonolithicGE* MOper = dynamic_cast<FSIMonolithicGE*> (&_oper);
163  MOper->setStructureDispToHarmonicExtension (_oper.lambdaFluidRepeated() );
164  BCh_he->addBC ("Interface", SOLIDINTERFACE, Essential, Full,
165  *MOper->bcvStructureDispToHarmonicExtension(), 3);
166  }
167 
168  return BCh_he;
169 }
170 
171 
172 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFlux()
173 {
174  // Boundary conditions for the fluid velocity
175 
176  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
177 
178  BCFunctionBase flow_in (aortaFluxIn);
179  BCFunctionBase flow_3 (linearFlux3_);
180  BCFunctionBase flow_4 (linearFlux4);
181  BCFunctionBase flow_5 (linearFlux5);
182  BCFunctionBase flow_6 (linearFlux6_);
183  BCFunctionBase flow_7 (linearFlux7);
184  BCFunctionBase flow_8 (linearFlux8);
185  BCFunctionBase flow_9 (linearFlux9);
186 
187  // BCFunctionBase flow_jean (aortaFluxJean);
188 
189  //uncomment to use fluxes
190  BCh_fluid->addBC ("InFlow" , INLET, Flux, /*Full/**/Normal, flow_in);
191  BCh_fluid->addBC ("OutFlow" , OUTLET, Flux/*Essential*/, Normal, flow_3);
192 
193  //BCh_fluid->addBC("Flow4" , 4, Flux/*Essential*/, Normal, flow_4);
194  BCh_fluid->addBC ("Flow4" , LSUBCA, Flux/*Essential*/, Normal, flow_4);
195  BCh_fluid->addBC ("Flow7" , RCSUBCA, Flux/*Essential*/, Normal, flow_7);
196  BCh_fluid->addBC ("Flow6" , RCSUBSUBCA, Flux/*Essential*/, Normal, flow_6);
197  BCh_fluid->addBC ("Flow5" , RCCA, Flux/*Essential*/, Normal, flow_5);
198  BCh_fluid->addBC ("Flow8" , LCCA, Flux/*Essential*/, Normal, flow_8);
199  BCh_fluid->addBC ("Flow9" , LSUBSUBCA, Flux/*Essential*/, Normal, flow_9);
200 
201  return BCh_fluid;
202 }
203 
204 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid (FSIOperator& _oper)
205 {
206  // Boundary conditions for the fluid velocity
207  debugStream ( 10000 ) << "Boundary condition for the fluid\n";
208 
209  if (! _oper.isFluid() )
210  {
211  return FSIOperator::fluidBchandlerPtr_Type();
212  }
213 
214  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
215 
216  BCFunctionBase bcf (fZero);
217  //BCFunctionBase pressure_out(FlowConditions::outPressure0);
218 
219  BCFunctionBase in_flow (aortaPhisPress);
220 
221  BCFunctionBase out_flow (fZero);
222 
223 
224  //BCh_fluid->addBC("InFlow" , INLET, Natural/*Essential*/, Normal, in_flow/*, 3*/);
225  return BCh_fluid;
226 }
227 
228 
229 FSIOperator::solidBchandlerPtr_Type BCh_monolithicSolid (FSIOperator& _oper)
230 {
231  // Boundary conditions for the solid displacement
232 
233  if (! _oper.isSolid() )
234  {
235  return FSIOperator::solidBchandlerPtr_Type();
236  }
237 
238  FSIOperator::solidBchandlerPtr_Type BCh_solid ( new FSIOperator::solidBchandler_Type );
239 
240  BCFunctionBase bcf (fZero);
241 
242 
243  BCFunctionBase young (E);
244 
245  //robin condition on the outer wall
246  _oper.setRobinOuterWall (bcf, young);
247  BCh_solid->addBC ("OuterWall", OUTERWALL, Robin, Normal, _oper.bcfRobinOuterWall() );
248 
249  //BCh_solid->addBC("Top", OUTLET, Essential, Full, bcf, 3);
250  BCh_solid->addBC ("Base", INLET, Essential, Full, bcf, 3);
251 
252  return BCh_solid;
253 }
254 
255 
256 }
257 
258 #endif
#define debugStream
Definition: LifeDebug.hpp:182