LifeV
navier_stokes_blocks/examples/example_aorta_semi_implicit/ud_functions.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 UDFNS_HPP
43 #define UDFNS_HPP
44 
45 // LifeV includes
46 #include <lifev/core/LifeV.hpp>
47 
48 namespace LifeV
49 {
50 
51 Real fZero (const Real& /*t*/, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
52 {
53  return 0.0;
54 }
55 
56 Real fPressure (const Real& time, const Real& /*x*/, const Real& /*y*/, const Real& /*z*/, const ID& /*i*/)
57 {
58  Real i_HeartBeat = 0.0;
59  Real T_heartbeat = 0.8;
60  Real Q;
61 
62  if ( time < T_heartbeat )
63  {
64  i_HeartBeat = 0.0;
65  }
66  else if ( time >= T_heartbeat && time < 2*T_heartbeat )
67  {
68  i_HeartBeat = 1.0;
69  }
70  else if ( time >= 2*T_heartbeat && time < 3*T_heartbeat )
71  {
72  i_HeartBeat = 2.0;
73  }
74  else if ( time >= 3*T_heartbeat && time < 4*T_heartbeat )
75  {
76  i_HeartBeat = 3.0;
77  }
78 
79  if ( (time >= 0.05 && time <= 0.42) || (time >= (0.05+T_heartbeat) && time <= (0.42+T_heartbeat) ) || (time >= (0.05+2*T_heartbeat) && time <= (0.42+2*T_heartbeat) ) || (time >= (0.05+3*T_heartbeat) && time <= (0.42+3*T_heartbeat) ) )
80  {
81 
82  Q = -2.314569820334801e+09*std::pow(time-i_HeartBeat*T_heartbeat,9) +
83  4.952537061974133e+09*std::pow(time-i_HeartBeat*T_heartbeat,8) -
84  4.532060231242586e+09*std::pow(time-i_HeartBeat*T_heartbeat,7) +
85  2.325743716202249e+09*std::pow(time-i_HeartBeat*T_heartbeat,6) -
86  7.387577876374097e+08*std::pow(time-i_HeartBeat*T_heartbeat,5) +
87  1.514516710083440e+08*std::pow(time-i_HeartBeat*T_heartbeat,4) -
88  2.018053394181958e+07*std::pow(time-i_HeartBeat*T_heartbeat,3) +
89  1.667954643625200e+06*std::pow(time-i_HeartBeat*T_heartbeat,2) -
90  7.160662399848596e+04*(time-i_HeartBeat*T_heartbeat) +
91  1.184312187078482e+03;
92  Q = Q/394;
93  }
94  else
95  {
96  Q = 0.0;
97  }
98 
99  Real Q_inflow = 394*Q;
100  Real Q_flag4 = 20.25*Q; // left_common_carotid
101  Real Q_flag5 = 21.82*Q; // right_common_carotid
102  Real Q_flag6 = 1.43*Q; // right_vertebral
103  Real Q_flag7 = 24.77*Q; // right_subclavian
104  Real Q_flag8 = 4.69*Q; // left_vertebral
105  Real Q_flag9 = 21.54*Q; // left_subclavian
106 
107  Real pressureValue = 1500.0/2.51*(Q_inflow - Q_flag4 - Q_flag5 - Q_flag6 - Q_flag7 - Q_flag8 - Q_flag9);
108 
109  return pressureValue;
110 }
111 
112 }
113 
114 
115 
116 #endif
uint32_type ID
IDs.
Definition: LifeV.hpp:194
double Real
Generic real data.
Definition: LifeV.hpp:175
Real fPressure(const Real &time, const Real &, const Real &, const Real &, const ID &)