cfs_tpfa.h
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_CFS_TPFA_HEADER_INCLUDED
21 #define OPM_CFS_TPFA_HEADER_INCLUDED
22 
23 #include <opm/core/grid.h>
25 #include <opm/core/pressure/flow_bc.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 struct cfs_tpfa_impl;
32 struct CSRMatrix;
33 struct compr_quantities;
34 
35 struct cfs_tpfa_data {
36  struct CSRMatrix *A;
37  double *b;
38  double *x;
39 
40  struct cfs_tpfa_impl *pimpl;
41 };
42 
43 
44 struct cfs_tpfa_data *
45 cfs_tpfa_construct(struct UnstructuredGrid *G, well_t *W, int nphases);
46 
47 void
48 cfs_tpfa_assemble(struct UnstructuredGrid *G,
49  double dt,
50  well_t *W,
51  struct FlowBoundaryConditions *bc,
52  const double *src,
53  struct compr_quantities *cq,
54  const double *trans,
55  const double *gravcap_f,
56  well_control_t *wctrl,
57  struct completion_data *wdata,
58  const double *cpress0,
59  const double *porevol,
60  struct cfs_tpfa_data *h);
61 
62 void
63 cfs_tpfa_press_flux(struct UnstructuredGrid *G,
64  struct FlowBoundaryConditions *bc,
65  well_t *W,
66  int np,
67  const double *trans,
68  const double *pmobf,
69  const double *gravcap_f,
70  struct completion_data *wdata,
71  struct cfs_tpfa_data *h,
72  double *cpress,
73  double *fflux,
74  double *wpress,
75  double *wflux);
76 
77 void
78 cfs_tpfa_fpress(struct UnstructuredGrid *G,
79  struct FlowBoundaryConditions *bc,
80  int np,
81  const double *htrans,
82  const double *pmobf,
83  const double *gravcap_f,
84  struct cfs_tpfa_data *h,
85  const double *cpress,
86  const double *fflux,
87  double *fpress);
88 
89 void
90 cfs_tpfa_retrieve_masstrans(struct UnstructuredGrid *G,
91  int np,
92  struct cfs_tpfa_data *h,
93  double *masstrans_f);
94 
95 void
96 cfs_tpfa_retrieve_gravtrans(struct UnstructuredGrid *G,
97  int np,
98  struct cfs_tpfa_data *h,
99  double *gravtrans_f);
100 
101 double
102 cfs_tpfa_impes_maxtime(struct UnstructuredGrid *G,
103  struct compr_quantities *cq,
104  const double *trans,
105  const double *porevol,
106  struct cfs_tpfa_data *h,
107  const double *dpmobf,
108  const double *surf_dens,
109  const double *gravity);
110 
111 void
112 cfs_tpfa_expl_mass_transport(struct UnstructuredGrid *G,
113  well_t *W,
114  struct completion_data *wdata,
115  int np,
116  double dt,
117  const double *porevol,
118  struct cfs_tpfa_data *h,
119  double *surf_vol);
120 
121 void
122 cfs_tpfa_destroy(struct cfs_tpfa_data *h);
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif /* OPM_CFS_TPFA_HEADER_INCLUDED */
Basic compressed-sparse row (CSR) matrix data structure.
Definition: sparse_sys.h:38
Basic representation of well controls.
Definition: legacy_well.h:61
Definition: flow_bc.h:39
Definition: cfs_tpfa.h:35
Deprecated (and obsolescent) well definition.
Basic representation of well topology.
Definition: legacy_well.h:52
Definition: compr_quant.h:31
Definition: cfs_tpfa.c:39
Dynamic discretisation data relating well to flow in reservoir.
Definition: legacy_well.h:71