LifeV
fsi/examples/challenge_VPH/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 
46 #include "ud_functions.hpp"
47 // LifeV includes
48 #include "lifev/core/LifeV.hpp"
49 #include "lifev/core/fem/BCHandler.hpp"
50 
51 // Mathcard includes
52 #include "lifev/fsi/solver/FSIMonolithicGE.hpp"
53 #include "lifev/fsi/solver/FSIMonolithicGI.hpp"
54 
55 #define OUTLET 3
56 #define INLET 2
57 #define FLUIDINTERFACE 200
58 #define OUTERWALL 210
59 #define SOLIDINTERFACE 200
60 //#define RING2 22
61 #define RING 2
62 #define RING3 3
63 #define RING4 4
64 #define RING5 5
65 #define RING6 6
66 #define INOUTEDGE 20
67 
68 namespace LifeV
69 {
70 
71 typedef FSIOperator::fluid_Type fluid;
72 typedef FSIOperator::solid_Type solid;
73 
74 FSIOperator::fluidBchandlerPtr_Type BCh_harmonicExtension (FSIOperator& _oper)
75 {
76 
77  // Boundary condition for the mesh
78  debugStream ( 10000 ) << "Boundary condition for the harmonic extension\n";
79 
80  BCFunctionBase bcf (fZero);
81 
82  FSISolver::fluidBchandlerPtr_Type BCh_he (new FSIOperator::fluidBchandler_Type );
83 
84 
85  //BCh_he->addBC("Base", INLET, Essential, Full, bcf, 3);
86 
87  if (_oper.data().method() == "monolithicGE")
88  {
89  debugStream (10000) << "FSIMonolithic GCE harmonic extension\n";
90  FSIMonolithicGE* MOper = dynamic_cast<FSIMonolithicGE*> (&_oper);
91  MOper->setStructureDispToHarmonicExtension (_oper.lambdaFluidRepeated() );
92  BCh_he->addBC ("Interface", SOLIDINTERFACE, Essential, Full,
93  *MOper->bcvStructureDispToHarmonicExtension(), 3);
94  }
95 
96  return BCh_he;
97 }
98 
99 
100 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFlux()
101 {
102  // Boundary conditions for the fluid velocity
103 
104  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
105 
106  // BCFunctionBase flow_in (aortaFluxIn);
107  // BCFunctionBase flow_3 (linearFlux3_);
108  // BCFunctionBase flow_4 (linearFlux4);
109  // BCFunctionBase flow_5 (linearFlux5);
110  // BCFunctionBase flow_6 (linearFlux6_);
111  // BCFunctionBase flow_7 (linearFlux7);
112  // BCFunctionBase flow_8 (linearFlux8);
113  // BCFunctionBase flow_9 (linearFlux9);
114 
115  BCFunctionBase flow_in (abdominalAorta);
116 
117  // BCFunctionBase flow_jean (aortaFluxJean);
118 
119  //uncomment to use fluxes
120  BCh_fluid->addBC ("InFlow" , INLET, Flux, /*Full*/Normal, flow_in);
121  // BCh_fluid->addBC("OutFlow" , OUTLET, Flux/*Essential*/, Normal, flow_3);
122 
123  // BCh_fluid->addBC("Flow4" , 4, Flux/*Essential*/, Normal, flow_4);
124  // BCh_fluid->addBC("Flow7" , 7, Flux/*Essential*/, Normal, flow_7);
125  // BCh_fluid->addBC("Flow6" , 6, Flux/*Essential*/, Normal, flow_6);
126  // BCh_fluid->addBC("Flow5" , 5, Flux/*Essential*/, Normal, flow_5);
127  // BCh_fluid->addBC("Flow8" , 8, Flux/*Essential*/, Normal, flow_8);
128  // BCh_fluid->addBC("Flow9" , 9, Flux/*Essential*/, Normal, flow_9);
129 
130  return BCh_fluid;
131 }
132 
133 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid (FSIOperator& _oper)
134 {
135  // Boundary conditions for the fluid velocity
136  debugStream ( 10000 ) << "Boundary condition for the fluid\n";
137 
138  if (! _oper.isFluid() )
139  {
140  return FSIOperator::fluidBchandlerPtr_Type();
141  }
142 
143  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
144 
145  BCFunctionBase bcf (fZero);
146  //BCFunctionBase pressure_out(FlowConditions::outPressure0);
147 
148  BCFunctionBase in_flow (aortaPhisPress);
149 
150  BCFunctionBase out_flow (fZero);
151 
152 
153  BCh_fluid->addBC ("InFlow" , INLET, Natural/*Essential*/, Normal, in_flow/*, 3*/);
154  return BCh_fluid;
155 }
156 
157 
158 FSIOperator::solidBchandlerPtr_Type BCh_monolithicSolid (FSIOperator& _oper)
159 {
160  // Boundary conditions for the solid displacement
161 
162  if (! _oper.isSolid() )
163  {
164  return FSIOperator::solidBchandlerPtr_Type();
165  }
166 
167  FSIOperator::solidBchandlerPtr_Type BCh_solid ( new FSIOperator::solidBchandler_Type );
168 
169  BCFunctionBase bcf (fZero);
170 
171 
172  BCFunctionBase young (E);
173 
174  //robin condition on the outer wall
175  _oper.setRobinOuterWall (bcf, young);
176  BCh_solid->addBC ("OuterWall", OUTERWALL, Robin, Full, _oper.bcfRobinOuterWall(), 3);
177 
178  //BCh_solid->addBC("Top", OUTLET, Essential, Full, bcf, 3);
179  //BCh_solid->addBC("Base", INLET, Essential, Full, bcf, 3);
180 
181  return BCh_solid;
182 }
183 
184 
185 }
186 
187 #endif
#define debugStream
Definition: LifeDebug.hpp:182