LifeV
darcy/examples/twophase_impes/user_fun.hpp
Go to the documentation of this file.
1 /* -*- mode: c++ -*-
2 
3  This file is part of the LifeV Applications.
4 
5  Author(s): A. Fumagalli <alessio.fumagalli@mail.polimi.it>
6  Date: 2010-07-29
7 
8  Copyright (C) 2010 EPFL, Politecnico di Milano
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2.1 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23  USA
24 */
25 
26 /**
27  @file user_fun.hpp
28  @author A. Fumagalli <alessio.fumagalli@mail.polimi.it>
29  @date 2010-07-29
30 */
31 
32 #ifndef __user_fun_H
33 #define __user_fun_H 1
34 
35 #include <vector>
36 
37 
38 #include <boost/numeric/ublas/vector.hpp>
39 #include <boost/numeric/ublas/matrix.hpp>
40 
41 
42 #include <lifev/core/LifeV.hpp>
43 
44 using namespace LifeV;
45 
46 // ===================================================
47 //! User functions for the pressure equation
48 // ===================================================
49 namespace dataProblem
50 {
53 
54 namespace dataPhysical
55 {
58 
59 // Porosity
60 Real Phi ( const Real& x, const Real& y, const Real& z );
61 
62 // Dynamic viscosity
63 const Real mu_w = 1; //1e-3; // [Pa * s]
64 const Real mu_n = 5; //2*1e-3; // [Pa * s]
65 
66 // Density
67 const Real rho_w = 1; //960; // [Kg / m^3]
68 const Real rho_n = 0.5; //700; // [Kg / m^3]
69 
70 // Relative permeability
71 Real k_rw ( const Real& S_w );
72 Real k_rn ( const Real& S_n );
73 
74 // Absolute inverse permeability
75 const Matrix invK ( const Real& t, const Real& x, const Real& y, const Real& z ); // [m^2]
76 
77 // Gravity acceleration, assumed to be g = [0, 0, -9.7803184]
78 const Real g = -9.7803184; // [m / s^2]
79 
80 // Residual saturation
81 const Real S_wr = 0.1;
82 const Real S_nr = 0;
83 
84 // Entry pressure
85 const Real pd = 1200.; // [Pa]
86 
87 // Brooks-Corey constant
88 const Real lambda = 1;
89 
90 // Capillary pressure
91 Real pc ( const Real& S_w ); // [Pa]
92 
93 // First derivative of the relative permeability
94 Real Dk_rw ( const Real& S_w );
95 Real Dk_rn ( const Real& S_n );
96 
97 // First derivative of the capillary pressure
98 Real Dpc ( const Real& S_w ); // [Pa]
99 
100 }
101 
102 // Inverse of permeability matrix
103 Matrix pressurePermeability ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const std::vector<Real>& u );
104 
105 // Source term
106 Real pressureSource ( const Real& /*t*/, const Real& x, const Real& y, const Real& /*z*/, const ID& /*icomp*/);
107 
108 // Boundary condition of Dirichlet
109 Real pressureDirichlet1 ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
110 
111 // Boundary condition of Dirichlet
112 Real pressureDirichlet2 ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
113 
114 // Boundary condition of Dirichlet
115 Real pressureDirichlet3 ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
116 
117 // Boundary condition of Neumann
118 Real pressureNeumann ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& icomp);
119 
120 // Boundary condition of Robin
121 Real pressureRobin ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
122 
123 // ===================================================
124 //! User functions for the saturation equation
125 // ===================================================
126 
127 // Inverse of permeability matrix
128 Matrix saturationPermeability ( const Real& t, const Real& x, const Real& y, const Real& z, const std::vector<Real>& u );
129 
130 // Physical flux function
131 Vector saturationPhysicalFlux ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const std::vector<Real>& u );
132 
133 // First derivative in u of the physical flux function
134 Vector saturationFirstDerivativePhysicalFlux ( const Real& /*t*/, const Real& x, const Real& y, const Real& z, const std::vector<Real>& u );
135 
136 // Source term
137 Real saturationSource ( const Real& /*t*/, const Real& x, const Real& y, const Real& /*z*/, const ID& /*icomp*/);
138 
139 // Initial condition
140 Real saturationInitialCondition ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/ );
141 
142 // Mass function
143 Real saturationMass ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/ );
144 
145 // Boundary condition of Dirichlet
146 Real saturationDirichlet1 ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
147 
148 // Boundary condition of Dirichlet
149 Real saturationDirichlet2 ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
150 
151 // Boundary condition of Dirichlet
152 Real saturationDirichlet3 ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
153 
154 // Boundary condition of Neumann
155 Real saturationNeumann ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& icomp);
156 
157 // Boundary condition of Robin
158 Real saturationRobin ( const Real& /* t */, const Real& x, const Real& y, const Real& z, const ID& /*icomp*/);
159 
160 }
161 
162 #endif /* __user_fun_H */
Real pressureDirichlet2(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Real saturationDirichlet1(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Real saturationDirichlet3(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
boost::numeric::ublas::vector< Real > Vector
Real saturationMass(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Real saturationNeumann(const Real &, const Real &x, const Real &y, const Real &z, const ID &icomp)
Real Phi(const Real &x, const Real &y, const Real &z)
Vector saturationPhysicalFlux(const Real &, const Real &x, const Real &y, const Real &z, const std::vector< Real > &u)
Real pressureNeumann(const Real &, const Real &x, const Real &y, const Real &z, const ID &icomp)
Real saturationSource(const Real &, const Real &x, const Real &y, const Real &, const ID &)
Matrix saturationPermeability(const Real &t, const Real &x, const Real &y, const Real &z, const std::vector< Real > &u)
User functions for the saturation equation.
boost::numeric::ublas::matrix< Real > Matrix
Real saturationDirichlet2(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Vector saturationFirstDerivativePhysicalFlux(const Real &, const Real &x, const Real &y, const Real &z, const std::vector< Real > &u)
boost::numeric::ublas::vector< Real > Vector
Real saturationInitialCondition(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real saturationRobin(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
Real pressureRobin(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
double Real
Generic real data.
Definition: LifeV.hpp:175
Matrix pressurePermeability(const Real &, const Real &x, const Real &y, const Real &z, const std::vector< Real > &u)
Real pressureDirichlet1(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
const Matrix invK(const Real &t, const Real &x, const Real &y, const Real &z)
Real pressureDirichlet3(const Real &, const Real &x, const Real &y, const Real &z, const ID &)
boost::numeric::ublas::matrix< Real > Matrix
Real pressureSource(const Real &, const Real &x, const Real &y, const Real &, const ID &)