Switch to storing a complete fluid-matrix derivative in the
compr_quantities rather than the total compressibility. Maintain the
"volume discrepancy" field. Also, add traditional memory management
functions.
Functions csrmatrix_write_stream() and vector_write_stream() subsume
the output responsibilities of csrmatrix_write() and vector_write(),
respectively, but do not deal with opening or closing streams. This
allows, e.g., a call such as
csrmatrix_write_stream(A, stderr);
for debugging purposes.
Re-implement csrmatrix_write() and vector_write() in terms of
csrmatrix_write_stream() and vector_write_stream(), respectively.
Introduce two intermediate variables, c1, and c2, to hold cell numbers
during the building of the cell<->cell neighbourhood. This reduces
the statement complexity--both for the human reader and the compiler...
1. Changed calculation of face pressures to avoid using mobilities.
2. Added 'scratch_f' array to cfs_tpfa_impl struct (for use by above routine).
3. Changed interface of cfs_tpfa_fpress() to pass the data struct.
Specifically, GCC in strict ISO C90 mode warns of:
cfs_tpfa.c: In function ‘cfs_tpfa_impes_maxtime_cell’:
cfs_tpfa.c:1086: warning: ISO C90 forbids mixed declarations and code
Specifically, allocate storage for 'masstrans' and 'gravtrans' terms
per well completion (perforation), as well as compressible
transmissibilities (scalar per completion). Calculate compressible
quantities by treating each completion as an interface.
Introduce a new structure, 'completion_data', to collect static and
dynamic discretisation data pertaining to each completion (e.g.,
productivity indices, gravity potentials and density ratio
operators). Pass this structure, rather than individual fields, into
affected CFS_TPFA entry points.
Compile tested only.
Specifically, rename the obtuse structure 'disc_data' to the more targeted
'densrat_util' and hoist the compressible terms 'ctrans' and 'P' into
the 'cfs_tpfa_impl' structure. Moreover, rename the remaining fields
into something that makes sense in (almost) isolation. Update
compute_densrat_update() and cfs_tpfa_construct() accordingly.
This is in preparation of adding compressible well terms.
Specifically, only assemble gravity contributions on internal faces or
external Dirichlet faces. Moreover, pay attention to direction of
gravity flux (in/out of cell) during assembly.