mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Take initial steps towards including wells in assembly.
Specifically, accept (and currently ignore), a WellCompletions structure into the constructor, and aggregate all driving forces (source terms, boundary conditions and all well-related structures) into an assembler-specific "force" structure. Accept a pointer to such a structure into the assemble() function. Currently ignored except for source terms.
This commit is contained in:
parent
9a9b47a49a
commit
a1df963169
@ -125,7 +125,10 @@ impl_deallocate(struct cfs_tpfa_res_impl *pimpl)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
static struct cfs_tpfa_res_impl *
|
static struct cfs_tpfa_res_impl *
|
||||||
impl_allocate(grid_t *G, size_t max_conn, int np)
|
impl_allocate(grid_t *G ,
|
||||||
|
struct WellCompletions *wconn ,
|
||||||
|
size_t max_conn,
|
||||||
|
int np )
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
size_t nnu, ngconn, nwperf;
|
size_t nnu, ngconn, nwperf;
|
||||||
@ -137,6 +140,11 @@ impl_allocate(grid_t *G, size_t max_conn, int np)
|
|||||||
ngconn = G->cell_facepos[ G->number_of_cells ];
|
ngconn = G->cell_facepos[ G->number_of_cells ];
|
||||||
nwperf = 0;
|
nwperf = 0;
|
||||||
|
|
||||||
|
if (wconn != NULL) {
|
||||||
|
nnu += wconn->number_of_wells;
|
||||||
|
nwperf = wconn->well_connpos[ wconn->number_of_wells ];
|
||||||
|
}
|
||||||
|
|
||||||
/* Linear system */
|
/* Linear system */
|
||||||
ddata_sz = nnu; /* b */
|
ddata_sz = nnu; /* b */
|
||||||
|
|
||||||
@ -708,7 +716,9 @@ cfs_tpfa_res_destroy(struct cfs_tpfa_res_data *h)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
struct cfs_tpfa_res_data *
|
struct cfs_tpfa_res_data *
|
||||||
cfs_tpfa_res_construct(grid_t *G, int nphases)
|
cfs_tpfa_res_construct(grid_t *G ,
|
||||||
|
struct WellCompletions *wconn ,
|
||||||
|
int nphases)
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
size_t nc, nf, ngconn;
|
size_t nc, nf, ngconn;
|
||||||
@ -717,7 +727,7 @@ cfs_tpfa_res_construct(grid_t *G, int nphases)
|
|||||||
h = malloc(1 * sizeof *h);
|
h = malloc(1 * sizeof *h);
|
||||||
|
|
||||||
if (h != NULL) {
|
if (h != NULL) {
|
||||||
h->pimpl = impl_allocate(G, maxconn(G), nphases);
|
h->pimpl = impl_allocate(G, wconn, maxconn(G), nphases);
|
||||||
h->J = construct_matrix(G);
|
h->J = construct_matrix(G);
|
||||||
|
|
||||||
if ((h->pimpl == NULL) || (h->J == NULL)) {
|
if ((h->pimpl == NULL) || (h->J == NULL)) {
|
||||||
@ -753,8 +763,7 @@ cfs_tpfa_res_construct(grid_t *G, int nphases)
|
|||||||
void
|
void
|
||||||
cfs_tpfa_res_assemble(grid_t *G,
|
cfs_tpfa_res_assemble(grid_t *G,
|
||||||
double dt,
|
double dt,
|
||||||
flowbc_t *bc,
|
struct cfs_tpfa_res_forces *forces,
|
||||||
struct compr_src *src,
|
|
||||||
const double *zc,
|
const double *zc,
|
||||||
struct compr_quantities_gen *cq,
|
struct compr_quantities_gen *cq,
|
||||||
const double *trans,
|
const double *trans,
|
||||||
@ -785,9 +794,9 @@ cfs_tpfa_res_assemble(grid_t *G,
|
|||||||
assemble_cell_contrib(G, c, h);
|
assemble_cell_contrib(G, c, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src != NULL) {
|
if ((forces != NULL) && (forces->src != NULL)) {
|
||||||
assert (src->nphases == cq->nphases);
|
assert (forces->src->nphases == cq->nphases);
|
||||||
assemble_sources(dt, src, h);
|
assemble_sources(dt, forces->src, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
res_is_neumann = 1;
|
res_is_neumann = 1;
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
#define OPM_CFS_TPFA_HEADER_INCLUDED
|
#define OPM_CFS_TPFA_HEADER_INCLUDED
|
||||||
|
|
||||||
#include "grid.h"
|
#include "grid.h"
|
||||||
#include "flow_bc.h"
|
|
||||||
#include "well.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -32,6 +30,22 @@ struct cfs_tpfa_res_impl;
|
|||||||
struct CSRMatrix;
|
struct CSRMatrix;
|
||||||
struct compr_quantities_gen;
|
struct compr_quantities_gen;
|
||||||
struct compr_src;
|
struct compr_src;
|
||||||
|
struct compr_bc;
|
||||||
|
struct WellCompletions;
|
||||||
|
struct WellControls;
|
||||||
|
struct completion_data;
|
||||||
|
|
||||||
|
struct cfs_tpfa_res_wells {
|
||||||
|
struct WellCompletions *conn;
|
||||||
|
struct WellControls *ctrl;
|
||||||
|
struct completion_data *data;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct cfs_tpfa_res_forces {
|
||||||
|
struct cfs_tpfa_res_wells *W ;
|
||||||
|
struct compr_bc *bc ;
|
||||||
|
struct compr_src *src;
|
||||||
|
};
|
||||||
|
|
||||||
struct cfs_tpfa_res_data {
|
struct cfs_tpfa_res_data {
|
||||||
struct CSRMatrix *J;
|
struct CSRMatrix *J;
|
||||||
@ -42,7 +56,9 @@ struct cfs_tpfa_res_data {
|
|||||||
|
|
||||||
|
|
||||||
struct cfs_tpfa_res_data *
|
struct cfs_tpfa_res_data *
|
||||||
cfs_tpfa_res_construct(grid_t *G, int nphases);
|
cfs_tpfa_res_construct(grid_t *G ,
|
||||||
|
struct WellCompletions *wconn ,
|
||||||
|
int nphases);
|
||||||
|
|
||||||
void
|
void
|
||||||
cfs_tpfa_res_destroy(struct cfs_tpfa_res_data *h);
|
cfs_tpfa_res_destroy(struct cfs_tpfa_res_data *h);
|
||||||
@ -50,8 +66,7 @@ cfs_tpfa_res_destroy(struct cfs_tpfa_res_data *h);
|
|||||||
void
|
void
|
||||||
cfs_tpfa_res_assemble(grid_t *G,
|
cfs_tpfa_res_assemble(grid_t *G,
|
||||||
double dt,
|
double dt,
|
||||||
flowbc_t *bc,
|
struct cfs_tpfa_res_forces *forces,
|
||||||
struct compr_src *src,
|
|
||||||
const double *zc,
|
const double *zc,
|
||||||
struct compr_quantities_gen *cq,
|
struct compr_quantities_gen *cq,
|
||||||
const double *trans,
|
const double *trans,
|
||||||
|
Loading…
Reference in New Issue
Block a user