LifeV
fsi/testsuite/fsi_restart/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  // BCh_fluid->addBC("InFlow" , INLET, Natural, Full, bcf,3);
144 
145 
146  BCh_fluid->addBC ("OutFlow", OUTLET, Natural, Normal, out_press);
147  //BCh_fluid->addBC("OutFlow", INOUTEDGE, EssentialEdges, Full, bcf,3);
148 
149  return BCh_fluid;
150 }
151 
152 FSIOperator::solidBchandlerPtr_Type BCh_monolithicSolid (FSIOperator& _oper)
153 {
154 
155  if (! _oper.isSolid() )
156  {
157  return FSIOperator::solidBchandlerPtr_Type();
158  }
159 
160  // Boundary conditions for the solid displacement
161  debugStream ( 10000 ) << "Boundary condition for the solid\n";
162  FSIOperator::solidBchandlerPtr_Type BCh_solid ( new FSIOperator::solidBchandler_Type );
163 
164  BCFunctionBase bcf (fZero);
165 
166  BCh_solid->addBC ("Top", RING, Essential, Full, bcf, 3);
167  BCh_solid->addBC ("Base", RING2, Essential, Full, bcf, 3);
168 
169  aortaVelIn::S_timestep = _oper.dataFluid()->dataTime()->timeStep();
170  BCFunctionBase hyd (fZero);
171  BCFunctionBase young (E);
172  //robin condition on the outer wall
173  _oper.setRobinOuterWall (hyd, young);
174  BCh_solid->addBC ("OuterWall", OUTERWALL, Robin, Normal, _oper.bcfRobinOuterWall() );
175 
176  return BCh_solid;
177 }
178 
179 }
180 
181 #endif
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
FSIOperator::fluidBchandlerPtr_Type BCh_monolithicFluid(FSIOperator &_oper, bool const &isOpen=true)