ifs_tpfa.h
Go to the documentation of this file.
1 /*
2  Copyright 2010 SINTEF ICT, Applied Mathematics.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef OPM_IFS_TPFA_HEADER_INCLUDED
21 #define OPM_IFS_TPFA_HEADER_INCLUDED
22 
33 #include <opm/core/grid.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 struct ifs_tpfa_impl;
40 struct CSRMatrix;
42 struct Wells;
43 
48 struct ifs_tpfa_data {
49  struct CSRMatrix *A;
50  double *b;
51  double *x;
53  struct ifs_tpfa_impl *pimpl;
54 };
55 
60  double *cell_press;
61  double *face_flux ;
63  double *well_press;
64  double *well_flux ;
65 };
66 
71  const double *src;
72  const struct FlowBoundaryConditions *bc ;
74  const struct Wells *W ;
75  const double *totmob;
76  const double *wdp ;
77 };
78 
79 
90 struct ifs_tpfa_data *
91 ifs_tpfa_construct(struct UnstructuredGrid *G,
92  struct Wells *W);
93 
94 
104 int
105 ifs_tpfa_assemble(struct UnstructuredGrid *G ,
106  const struct ifs_tpfa_forces *F ,
107  const double *trans ,
108  const double *gpress,
109  struct ifs_tpfa_data *h );
110 
111 int
112 ifs_tpfa_assemble_comprock(struct UnstructuredGrid *G ,
113  const struct ifs_tpfa_forces *F ,
114  const double *trans ,
115  const double *gpress ,
116  const double *porevol ,
117  const double *rock_comp,
118  const double dt ,
119  const double *pressure ,
120  struct ifs_tpfa_data *h );
121 int
122 ifs_tpfa_assemble_comprock_increment(struct UnstructuredGrid *G ,
123  const struct ifs_tpfa_forces *F ,
124  const double *trans ,
125  const double *gpress ,
126  const double *porevol ,
127  const double *rock_comp,
128  const double dt ,
129  const double *prev_pressure ,
130  const double *initial_porevolume,
131  struct ifs_tpfa_data *h );
132 
133 
134 void
135 ifs_tpfa_press_flux(struct UnstructuredGrid *G ,
136  const struct ifs_tpfa_forces *F ,
137  const double *trans,
138  struct ifs_tpfa_data *h ,
139  struct ifs_tpfa_solution *soln );
140 
141 void
142 ifs_tpfa_destroy(struct ifs_tpfa_data *h);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif /* OPM_IFS_TPFA_HEADER_INCLUDED */
struct ifs_tpfa_impl * pimpl
Internal management structure.
Definition: ifs_tpfa.h:53
Solution variables.
Definition: ifs_tpfa.h:59
Basic compressed-sparse row (CSR) matrix data structure.
Definition: sparse_sys.h:38
double * b
Right-hand side.
Definition: ifs_tpfa.h:50
struct CSRMatrix * A
Coefficient matrix.
Definition: ifs_tpfa.h:49
double * x
Solution.
Definition: ifs_tpfa.h:51
const struct FlowBoundaryConditions * bc
Boundary conditions.
Definition: ifs_tpfa.h:72
Definition: flow_bc.h:39
Data structure aggregating static information about all wells in a scenario.
Definition: wells.h:50
Main data structure presenting a view of an assembled system of simultaneous linear equations which m...
Definition: ifs_tpfa.h:48
const struct Wells * W
Well topology.
Definition: ifs_tpfa.h:74
double * well_press
Bottom-hole pressures for each well.
Definition: ifs_tpfa.h:63
double * cell_press
Cell pressures.
Definition: ifs_tpfa.h:60
Driving forces pertaining to a particular model setup.
Definition: ifs_tpfa.h:70
int ifs_tpfa_assemble(struct UnstructuredGrid *G, const struct ifs_tpfa_forces *F, const double *trans, const double *gpress, struct ifs_tpfa_data *h)
Definition: ifs_tpfa.c:702
const double * src
Explicit source terms.
Definition: ifs_tpfa.h:71
double * well_flux
Well connection total fluxes.
Definition: ifs_tpfa.h:64
Definition: ifs_tpfa.c:36
const double * wdp
Gravity adjustment at each perforation.
Definition: ifs_tpfa.h:76
double * face_flux
Interface fluxes.
Definition: ifs_tpfa.h:61
struct ifs_tpfa_data * ifs_tpfa_construct(struct UnstructuredGrid *G, struct Wells *W)
Allocate TPFA management structure capable of assembling a system of simultaneous linear equations co...
Definition: ifs_tpfa.c:670
const double * totmob
Total mobility in each cell.
Definition: ifs_tpfa.h:75