LifeV
2d/darcy.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  @file darcy.hpp
28  @author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
29  @date 2012-06-13
30 */
31 
32 #ifndef __darcy_H
33 #define __darcy_H 1
34 
35 
36 // ===================================================
37 //! Includes
38 // ===================================================
39 
40 #include <lifev/core/LifeV.hpp>
41 
42 #include <lifev/core/mesh/RegionMesh2DStructured.hpp>
43 #include <lifev/core/mesh/MeshPartitioner.hpp>
44 
45 #ifdef HAVE_HDF5
46 #include <lifev/core/filter/ExporterHDF5.hpp>
47 #endif
48 #include <lifev/core/filter/ExporterEmpty.hpp>
49 
50 /*!
51  @class darcy_nonlinear
52  @brief LifeV non-linear and transient Darcy test case
53 
54  @author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
55 
56  A 2D Darcy transient and non-linear test with Dirichlet boundary condition.
57  Let us set \f$ \Omega = (0,1)^3 \f$ and \f$ I_T = \Omega \times [0,4)\f$, solve the problem in dual-mixed form
58  \f[
59  \left\{
60  \begin{array}{l l l }
61  \Lambda^{-1} \left( p \right) \sigma + \nabla p = f_v & \mathrm{in} & I_T, \vspace{0.2cm} \\
62  \displaystyle \phi \frac{\partial p}{\partial t} + \nabla \cdot \sigma + \pi p - f = 0
63  & \mathrm{in} & I_T, \vspace{0.2cm} \\
64  p = g_D & \mathrm{on} & \partial \Omega \times [0,4),\vspace{0.2cm} \\
65  p = p_0 & \mathrm{in} & \Omega.
66  \end{array}
67  \right.
68  \f]
69  Furthermore the data are
70  \f[
71  \begin{array}{l l l}
72  f_v(x,y) = \left( ty - tx, -t^2 y^2 \right)^T &
73  \pi(x,y) = 1 &
74  f(x,y) = tx^2 - 2t^2 - t - (6y + 2 t^2 y)(1 + t^4 x^4 + y^6 + 2 t^2 x^2 y^3)
75  - (3y^2 + t^2 y^2)(6y^5 + 6t^2 x^2 y^2) + t^2 x^2 + y^3, \vspace{0.2cm} \\
76  g_D(x,y,z) = t^2 x^2 + y^3, &
77  \phi(x,y) = 0.5, &
78  \Lambda (x,y,p) =
79  \left(
80  \begin{array}{c c}
81  1 & 0 \\
82  0 & 1+p^2
83  \end{array}
84  \right), \\
85  p_0(x,y) = y^3. & &
86  \end{array}
87  \f]
88  The analytical solutions are
89  \f[
90  p(x,y,z) = t^2 x^2 + y^3,
91  \quad
92  \sigma(x,y,z) =
93  \left(
94  \begin{array}{c}
95  - 2t^2 x + t (y - x) \\
96  - (3y^2 + t^2 y^2)( 1 + t^4 x^4 + y^6 +2 t^2 x^2 y^3)
97  \end{array}
98  \right).
99  \f]
100  Fixing \f$ \Delta t = 0.015625 \f$ and the tolerance of the fixed point scheme at
101  \f$ 10^{-10} \f$, the computed space errors are
102  <table border="1" align="center">
103  <tr>
104  <th> N </th>
105  <th> \f$ \left\Vert p - p_h \right\Vert_{L^2} \f$ </th>
106  <th> \f$ \left\Vert \sigma - \Pi_{P_0} \sigma_h \right\Vert_{L^2} \f$ </th>
107  <th> N proc </th>
108  </tr>
109  <tr>
110  <td> 10 </td>
111  <td> 0.105324 </td>
112  <td> 0.284968 </td>
113  <td> 8 </td>
114  </tr>
115  <tr>
116  <td> 20 </td>
117  <td> 0.0375415 </td>
118  <td> 0.140317 </td>
119  <td> 8 </td>
120  </tr>
121  <tr>
122  <td> 40 </td>
123  <td> 0.0162273 </td>
124  <td> 0.066338 </td>
125  <td> 16 </td>
126  </tr>
127  <tr>
128  <td> 80 </td>
129  <td> 0.00773563 </td>
130  <td> 0.0315562 </td>
131  <td> 16 </td>
132  </tr>
133  <tr>
134  <td> 160 </td>
135  <td> 0.00381641 </td>
136  <td> 0.015142 </td>
137  <td> 32 </td>
138  </tr>
139  </table>
140  where N is the number of subdivisions for each boundary.
141  @image html darcy/2d.png "Example of the solution with N = 10."
142 */
144  // :
145  // public LifeV::Application
146 {
147 public:
148 
149  /* @name Constructors and destructor
150  */
151  //@{
152 
153  //! Constructor
154  darcy_nonlinear ( int argc, char** argv );
155 
156 
157  //! Destructor
159 
160  //@}
161 
162  /* @name Methods
163  */
164  //@{
165 
166  //! To lunch the simulation
167  LifeV::Real run();
168 
169  //@}
170 
171 
172 private:
173  struct Private;
175 };
176 
177 #endif /* __darcy_H */
Private Members.
Definition: 2d/darcy.cpp:66
std::shared_ptr< Private > Members
Definition: 2d/darcy.hpp:173
LifeV::Real run()
To lunch the simulation.
Definition: 2d/darcy.cpp:134
darcy_nonlinear(int argc, char **argv)
Constructor.
Definition: 2d/darcy.cpp:110
~darcy_nonlinear()
Destructor.
Definition: 2d/darcy.hpp:158
Includes.
Definition: 2d/darcy.hpp:143