LifeV
fsi/testsuite/fsi_monolithic/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 #include "flowConditions.hpp"
54 //#include "lumpedHeart.hpp"
55 #include "ud_functions.hpp"
56 
57 #define OUTLET 3
58 #define INLET 2
59 #define FLUIDINTERFACE 1
60 #define SOLIDINTERFACE 1
61 #define OUTERWALL 10
62 #define RING 2
63 #define RING2 3
64 #define INOUTEDGE 20
65 #define INEDGE 30
66 
67 namespace LifeV
68 {
69 
70 typedef FSIOperator::fluid_Type fluid;
71 typedef FSIOperator::solid_Type solid;
72 
73 FSIOperator::fluidBchandlerPtr_Type BCh_harmonicExtension (FSIOperator& _oper)
74 {
75 
76  // Boundary condition for the mesh
77  debugStream ( 10000 ) << "Boundary condition for the harmonic extension\n";
78 
79  BCFunctionBase bcf (fZero);
80 
81  FSISolver::fluidBchandlerPtr_Type BCh_he (new FSIOperator::fluidBchandler_Type );
82 
83  BCh_he->addBC ("Edges", INOUTEDGE, Essential, Full, bcf, 3);
84  BCh_he->addBC ("Edges", INEDGE, Essential, Full, bcf, 3);
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  else if (_oper.data().method() == "monolithicGI")
96  {
97 
98  }
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 flow_3 (fluxFunction);
109  BCFunctionBase bcf (fZero);
110  //uncomment to use fluxes
111 
112  // BCh_fluid->addBC("InFlow" , INLET, Flux, Normal, flow_3);
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, flow_3);
118 
119  return BCh_fluid;
120 }
121 
122 FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid (FSIOperator& _oper, bool const& isOpen = true)
123 {
124  // Boundary conditions for the fluid velocity
125  debugStream ( 10000 ) << "Boundary condition for the fluid\n";
126 
127  if (! _oper.isFluid() )
128  {
129  return FSIOperator::fluidBchandlerPtr_Type();
130  }
131 
132  FSIOperator::fluidBchandlerPtr_Type BCh_fluid ( new FSIOperator::fluidBchandler_Type );
133 
134  BCFunctionBase bcf (fZero);
135  BCFunctionBase in_flow (/*uInterpolated*/u2normal/*aortaPhisPress*/);
136  // BCFunctionBase out_flow (fZero);
137  //BCFunctionBase in_flow (LumpedHeart::outPressure);
138 
139  BCFunctionBase out_press (FlowConditions::outPressure0);
140  BCFunctionBase bcfw0 (w0);
141 
142  if (!isOpen)
143  {
144  BCh_fluid->addBC ("InFlow" , INLET, Natural, Full, bcf, 3);
145  }
146 
147 
148  BCh_fluid->addBC ("OutFlow", OUTLET, Natural, Normal, out_press);
149  //BCh_fluid->addBC("OutFlow", INOUTEDGE, EssentialEdges, Full, bcf,3);
150 
151  return BCh_fluid;
152 }
153 
154 FSIOperator::solidBchandlerPtr_Type BCh_monolithicSolid (FSIOperator& _oper)
155 {
156 
157  if (! _oper.isSolid() )
158  {
159  return FSIOperator::solidBchandlerPtr_Type();
160  }
161 
162  // Boundary conditions for the solid displacement
163  debugStream ( 10000 ) << "Boundary condition for the solid\n";
164  FSIOperator::solidBchandlerPtr_Type BCh_solid ( new FSIOperator::solidBchandler_Type );
165 
166  BCFunctionBase bcf (fZero);
167 
168  BCh_solid->addBC ("Top", RING, Essential, Full, bcf, 3);
169  BCh_solid->addBC ("Base", RING2, Essential, Full, bcf, 3);
170 
171  aortaVelIn::S_timestep = _oper.dataFluid()->dataTime()->timeStep();
172  BCFunctionBase hyd (fZero);
173  BCFunctionBase young (E);
174  //robin condition on the outer wall
175  _oper.setRobinOuterWall (hyd, young);
176  BCh_solid->addBC ("OuterWall", OUTERWALL, Robin, Normal, _oper.bcfRobinOuterWall() );
177 
178  return BCh_solid;
179 }
180 
181 }
182 
183 #endif
void assignFunction(bcBase_Type &base)
Assign the function to the base of the BCHandler.
#define debugStream
Definition: LifeDebug.hpp:182
BCFunctionBase - class that holds the function used for prescribing boundary conditions.
Definition: BCFunction.hpp:77
NdebugStream noDebugStream(int=0, NdebugStream::stprintf=&printf)
Definition: LifeDebug.hpp:183
FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid(FSIOperator &_oper, bool const &isOpen=true)