Commit Graph
100 Commits
Author SHA1 Message Date
Bård Skaflestad 6acd22f7d7 Hook residual formulation up to build. 2011-10-19 13:01:06 +02:00
Bård Skaflestad c8d7ca7fbd Merge cfs_tpfa backout. This restores backwards compatibility. 2011-10-18 23:22:52 +02:00
Bård Skaflestad 151adc6e3f Backed out changeset d83710dd6839 2011-10-18 23:22:26 +02:00
Bård Skaflestad 7d2f0b2b71 Merge 'compr_quant' backout.
This is another attempt at restoring backwards compatibility.
2011-10-18 23:20:57 +02:00
Bård Skaflestad f55b9f5412 Backed out changeset 9faef9e37070 2011-10-18 23:20:34 +02:00
Bård Skaflestad 62e73a8a67 Grab copy of 'compr_quant' module. 2011-10-18 23:19:53 +02:00
Bård Skaflestad 4e77f6cd56 Merge backout. 2011-10-18 23:18:29 +02:00
Bård Skaflestad d909e0f6d5 Backed out changeset 3b7e5d602aab
We need a copy of 'compr_quant' before restoring compat.
2011-10-18 23:18:22 +02:00
Bård Skaflestad d64bdc8997 Merge backout. 2011-10-18 23:17:33 +02:00
Bård Skaflestad 2134f1f91e Backed out changeset 6b1a90716ea5 2011-10-18 23:17:02 +02:00
Bård Skaflestad 000f71e12c Back out cset 5e3d75476d64. 2011-10-18 23:14:15 +02:00
Bård Skaflestad 704d7eab5c Backed out changeset 5e3d75476d64
In preparation of restoring backwards compatibility in 'cfs_tpfa' module.
2011-10-18 23:13:41 +02:00
Bård Skaflestad e81a424995 Grab copy of 'cfs_tpfa' module in preparation of restoring backwards compat. 2011-10-18 23:12:54 +02:00
Bård Skaflestad dd042b75a8 Make first attempt at implementing the residual/Jacobian formulation.
This is a step in the direction of having a true IMPES pressure solver
and to remove the 'experimental_jacobian' option in dune-porsol.
2011-10-18 20:46:05 +02:00
Bård Skaflestad 7fb517e192 Delete trailing whitespace. 2011-10-18 20:40:19 +02:00
Bård Skaflestad 94fc6de78a Rework compressibility representation.
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.
2011-10-18 20:38:28 +02:00
Bård Skaflestad c3036166a9 Factor pressure (increment) assignment out of _press_flux().
The linear solution h->x is the pressure increment, not the actual
pressure value, so we cannot compute fluxes based on h->x alone.
2011-10-17 11:05:04 +02:00
Bård Skaflestad d085ddb314 Use portable array initialisation.
Memset() and calloc() define arrays of bytes, not general objects.  This
is a lesson learned many times over by generations of C programmers...
2011-09-30 09:39:54 +02:00
Bård Skaflestad 06cb0ab97f Add gravity contributions in flux calculations.
Credit:
  Jostein R. Natvig <jostein.r.natvig@sintef.no>
2011-09-20 13:18:33 +02:00
Bård Skaflestad 82a51172b7 Suppress warnings about unused parameters. 2011-09-10 16:48:31 +02:00
Bård Skaflestad 70a9e8a7a8 Add companion output utilities based on already opened streams.
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.
2011-09-07 23:14:47 +02:00
Bård Skaflestad 4e8b35f9ed Comment copy editing.
Remove comments that bring no new information, and formalise
descriptions in a few other cases.
2011-09-06 10:14:02 +02:00
Bård Skaflestad 33c35de2fa Merge from upstream. 2011-09-01 10:37:00 +02:00
Bård Skaflestad 667bd99b85 Merge from upstream. 2011-09-01 10:33:06 +02:00
Bård Skaflestad 9341b3aaac Silence warnings about "signed vs. unsigned" comparisons. 2011-09-01 10:28:27 +02:00
Bård Skaflestad 3a713ac022 Add a simple QFS for testing from C.
Not integrated into Autotools build system.  Compile as

  gcc -g -Wall -ansi -pedantic -Wextra test_cfs_tpfa.c cfs_tpfa.c \
          well.c flow_bc.c trans_tpfa.c sparse_sys.c compr_quant.c \
      -lumfpack -llapack -lblas -lm

(or variants thereof).
2011-08-26 15:30:20 +02:00
Bård Skaflestad f08a4ba437 Use (c1,c2) alias rather than neigh[] references where possible. 2011-05-31 23:06:44 +02:00
Bård Skaflestad 4313d35883 Increase readability of create_c2c().
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...
2011-05-31 23:04:40 +02:00
Bård Skaflestad c689a82c96 Spelling. 2011-05-28 00:08:33 +02:00
Bård Skaflestad bfc50ea14b Avoid signed/unsigned problem. 2011-05-27 23:17:44 +02:00
Bård Skaflestad 809763f333 Delete trailing whitespace. 2011-05-11 15:14:34 +02:00
Bård Skaflestad 1469bc7398 Consistently refer to "half-transmissibilities" as "one-sided".
While here, remove a comment that only describes the mechanics of the
following loop and does not provide any more insight.
2011-05-11 15:14:19 +02:00
Bård Skaflestad e1f715fc71 Merge from upstream. 2011-05-11 14:24:47 +02:00
Bård Skaflestad b75f3df9f1 Reorder declarations to remove warning.
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
2011-04-26 23:15:43 +02:00
Bård Skaflestad 83785e49ad Sort includes. 2011-04-11 11:32:42 +02:00
Bård Skaflestad 8bd7d89d00 Implement total rate constraint for wells.
Untested.
2011-02-16 10:41:43 +01:00
Bård Skaflestad 7e834dd3b5 Explicitly state that ratio->psum is a scalar per total connection. 2011-01-24 11:21:25 +01:00
Bård Skaflestad 07a453225d Satisfy all post-conditions of compute_densrat_update()
The total (accumulated) phase contributions must be available in
ratio->psum for each completion when leaving the function.
2011-01-20 10:49:11 +01:00
Bård Skaflestad fc41c37578 Add compressible well completion flows.
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.
2011-01-19 20:20:15 +01:00
Bård Skaflestad 23ac315663 Restructure calculation of compressible terms.
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.
2011-01-19 12:08:12 +01:00
Bård Skaflestad c648dc1819 Reorder internal functions for call-sequence consistency. 2011-01-18 13:49:35 +01:00
Bård Skaflestad bd3cc50cfb Add gravity contributions to flux.
Only really verified for incompressible data.  There are likely to be
programming errors.
2011-01-16 21:21:06 +01:00
Bård Skaflestad 157b86c21c Improve gravity handling in linear system.
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.
2011-01-14 20:30:07 +01:00
Bård Skaflestad b8fd9a5516 Re-install zero-level enforcement, but only for incompressible problems. 2011-01-13 14:19:07 +01:00
Bård Skaflestad eb30bcb049 Remove enforcement of pressure zero level for pure Neumann problems.
This direct manipulation of the linear system is inappropriate when
solving compressible flows where the absolute pressure level matters
greatly.
2011-01-13 13:06:45 +01:00
Bård Skaflestad 2777a6d8d9 Correct blunders concerning presence of prescribed pressure values.
Specifically, split detection of prescribed reservoir pressure values
from prescribed well (i.e., BHP) pressure values.  Previously, we
would not even assemble any well contributions if there were any
prescribed reservoir pressure values.  Moreover, the return value from
assemble_cell_contrib() was exactly opposite of its intended value...
2010-12-08 14:50:19 +01:00
Bård Skaflestad 30087dd925 Add retrieval of well BHP and perforation fluxes.
Callers may pass NULLs if any given model does not contain wells.
2010-12-07 17:30:13 +01:00
Bård Skaflestad 40debf6a5f Add tentative Peaceman well support.
Callers may pass NULLs in absence of wells in any given model.  This
implementation assembles an equation for each well, irrespective of
well control type (BHP or RATE), and assumes that productivity indices
and perforation pressure drops account for multiphase effects.
2010-12-07 17:12:09 +01:00
Bård Skaflestad 33059b78a8 Document remaining members of struct 'compr_quantities'. 2010-12-07 15:01:47 +01:00
Bård Skaflestad 5af290adc7 Allocate memory resources for well DOFs. 2010-12-06 13:26:47 +01:00
Bård Skaflestad f04892bef0 Be more specific in comment. 2010-12-06 13:17:04 +01:00
Bård Skaflestad ff26a756b8 Add well<->cell topology to system matrix. 2010-12-06 12:43:03 +01:00
Bård Skaflestad 2eb4a6f4a2 Only maintain number of rows in CSR matrix.
We will generate square matrices only in the foreseeable future and
there is no need to maintain the number of columns (the 'n' member)
separately.  Update all users accordingly.
2010-12-06 12:41:12 +01:00
Bård Skaflestad 110b78b84b Explicitly enforce zero flux in absence of other boundary information. 2010-11-25 14:33:04 +01:00
Bård Skaflestad d9493e94ce M-x delete-trailing-whitespace . 2010-11-23 16:51:06 +01:00
Bård Skaflestad 07bae5c921 Implement (IMPES) mass transport across internal interfaces.
Based on component formulas derived from the ->pimpl->masstrans_f and
->pimpl->gravtrans_f quantities.
2010-11-23 16:46:49 +01:00
Bård Skaflestad a8f831be6c Add utility functions for retrieving phase transmissibilities. 2010-11-22 12:17:14 +01:00
Bård Skaflestad 08e2e9c1a3 Only compute face pressure values if explicitly requested.
Following cset ba5d27f90d7a there is no need to compute the interface
pressure values after every linear solve.  Re-factor
cfs_tpfa_press_flux() to only compute cell pressures and interface
fluxes, and move interface pressure value computation to cfs_tpfa_fpress().
2010-11-22 11:36:47 +01:00
Bård Skaflestad 44743f5f1c Merge from upstream. 2010-11-19 15:20:22 +01:00
Bård Skaflestad c26d494696 Complete transition to all-int topology in CSRMatrix structure.
Having a 'MAT_SIZE_T' that is sometimes an int and sometimes an
mwSignedIndex is asking for trouble.  The practical impact for OPM is
low, though, as this issue affects only the MEX interface.
2010-11-19 14:35:39 +01:00
Bård Skaflestad 744a08e513 Promote MEX fluid matrix impl. to official status.
Specifically, move the evaluation of cell transmissibilities into
cfs_tpfa module (from original MEX implementation), and create a new
structure, 'struct compr_quantities', to hold the 'RB^{-1}' data and
(upwind) phase mobilities &c.
2010-11-18 14:37:36 +01:00
Bård Skaflestad 43de7f5d23 Evaluate cell pressure in an existing cell rather than outside... 2010-11-15 12:25:43 +01:00
Bård Skaflestad 0ffaafc9ee Upwind mobility strategy for computing flux/if-pressures.
Derive interface pressure values from fluxes rather than the other way
around.

Suggested by: Jostein R. Natvig
2010-11-15 10:29:23 +01:00
Bård Skaflestad fdb1a0f04a Use pure htrans strategy for computing fluxes/if-pressures.
Still wrong.  Wrong: R-O-N-G.  Wrong.
2010-11-11 14:47:17 +01:00
Bård Skaflestad 8e5105c416 Merge from upstream. 2010-11-11 09:41:16 +01:00
Bård Skaflestad 64cf39691e Compute real Darcy flux in cfs_tpfa_press_flux().
The previous edition made the grave mistake of summing the mass fluxes
per face.  This does not make sense.

Pointed out by: Jostein.R.Natvig@sintef.no
2010-11-10 14:31:30 +01:00
Bård Skaflestad 552bfd5f00 Add flux and face-pressure computations.
Specifically, introduce utilities compute_fpress() and
compute_flux().  The former is needed to implement the latter across
external boundary faces.  Moreover, interface pressure values are
needed to evaluate fluid properties on faces (specifically R/B).

Add small gateway routine, cfs_tpfa_fpress(), to allow callers to
recover interface pressure values.  Re-implement cfs_tpfa_press_flux()
in terms of compute_fpress() and compute_flux().

Also, add fields 'fpress' and 'fpaccum' to struct cfs_tpfa_impl.
2010-11-09 12:52:31 +01:00
Bård Skaflestad 27ddb568ba Remove unused variable. 2010-11-09 10:03:42 +01:00
Bård Skaflestad 80f771d674 Merge from jrn. 2010-11-08 14:13:09 +01:00
Bård Skaflestad 43ddeaeca8 Don't enforce p[0]=0 for non-Neumann problems. 2010-11-06 19:16:23 +01:00
Bård Skaflestad dba90f41bd Tentatively add boundary condition support.
We currently handle only Dirichlet (pressure) BC's, and the feature is
largely untested.  More work remaining.
2010-11-04 19:05:41 +01:00
Bård Skaflestad 650de8a127 Correct silly mistake in defining hface phase contribs.
We were only advancing the phase contrib once per cell, but need a
different contribution for each face for each cell...
2010-11-03 18:08:02 +01:00
Bård Skaflestad 99383e8f02 Move compressible support utilities to cfs_tpfa module.
We may wish to generalise this part into real utility functions but
for now, leave the functionality where it is most directly needed.
Rename the functions to highlight relationship to compr. tpfa.
2010-11-03 14:55:23 +01:00
Bård Skaflestad a24685af0a Add files for implementing compressible TPFA assembly. 2010-11-01 18:45:06 +01:00
Bård Skaflestad 5c6f149485 Add files for implementing compressible TPFA assembly. 2010-11-01 18:44:40 +01:00
Bård Skaflestad ffaa7c4585 Move source files to sub-dir 'src'. 2010-10-29 15:08:09 +02:00
Bård Skaflestad a05de2d311 M-x delete-trailing-whitespace . 2010-10-26 22:30:54 +02:00
Bård Skaflestad a13e6a63d5 Complete cset a68849062624 (Update comment...).
Pointy hat: bska
2010-10-26 12:35:35 +02:00
Bård Skaflestad 0633a430db Update comment to reflect reality. 2010-10-26 12:33:07 +02:00
Bård Skaflestad c918c34e1f Don't update in place. 2010-10-26 12:28:31 +02:00
Bård Skaflestad 8d528e13d1 Implement simple gravity handling.
Produces expected results on standard verification test.
2010-10-26 11:57:00 +02:00
Bård Skaflestad bdd538c764 Remove zero eigenval. Prepare for adding gravity. 2010-10-25 20:28:34 +02:00
Bård Skaflestad 7ee6eb7758 The ifs_tpfa_press_flux() function does not need 'src'. 2010-10-24 21:22:29 +02:00
Bård Skaflestad d130aef655 Add (incomp) pressure system assembler based on TPFA. 2010-10-24 21:20:15 +02:00
Bård Skaflestad 4274f20c27 Add utilities for computing derived fluid quantities.
These are (currently) entirely geared towards pressure solvers.
2010-10-20 19:14:07 +02:00
Bård Skaflestad 664f1ac2fe Add facilities for computing/updating gpress/Binv.
We were already computing the inverse IP, but now centralise the
gpress as well.  Moreover, the mim_ip_*_update() functions will assist
in the pressure solvers accepting effective inner products and gravity
pressures only.
2010-10-14 14:20:11 +02:00
Bård Skaflestad edd470dd7d Move implementation of vector_zero() to central location.
There is no need for each file to contain a separate, though
trivial, implementation of this feature.
2010-10-14 13:58:47 +02:00
Bård Skaflestad ef4d884d12 Use canonical include guards.
Suggested by atgeirr.  Template:

   OPM_<FILENAME>_HEADER_INCLUDED
2010-10-13 18:35:15 +02:00
Bård Skaflestad 35c0ef8ee9 Remove delusional assertion. While its predecessor asserted basic
sanity, the current check would never be satisfied in a reasonable
  grid.
2010-10-06 21:08:56 +00:00
Bård Skaflestad 4357d2564c Correct another off-by-one in the CSR start pointer implementation. 2010-10-04 17:43:45 +00:00
Bård Skaflestad 284683b00d Add a routine for allocating a CSR matrix with known number of rows
and non-zeros.  Note that this routine is for allocation only.
  Caller must create and manage sparsity structure if this is being
  used in a global assembly process.

  This routine finds utility in MsMFEM BF construction.
2010-09-30 21:37:14 +00:00
Bård Skaflestad f3e5ad1723 Use M's notion of the MAT_SIZE_T when building for M. 2010-09-17 17:43:07 +00:00
Bård Skaflestad fca8a08b29 Separate well connections (typically static) from well controls
(often dynamically changing throughout simulation).
2010-09-15 17:27:59 +00:00
Bård Skaflestad 222d6da348 Re-factor creation and destruction of cell->well mapping out to
separate module.  Update callers.
2010-09-15 12:13:53 +00:00
Bård Skaflestad 31c5ff58b5 Don't state that we reverse-insert (i.e., push-forward) the bin
elements when we in fact use jrn's much more straight-forward
  push-back mode.
2010-09-14 12:21:30 +00:00
Bård Skaflestad 293e51f94b Insert "H1 lines" to summarise purpose. Document a few parameters
and return values as well.

  While here, convert CSR build to push-back mode.
2010-09-14 11:19:08 +00:00
Bård Skaflestad 1540fb3949 Remove special MATLAB compilation support. This is provided by blas_lapack.h. 2010-09-13 16:11:49 +00:00
Bård Skaflestad 5e3dc1daea Add simple type for describing boundary conditions for the flow
equation.
2010-09-13 15:46:06 +00:00
Bård Skaflestad 371fd66ced Add initial cut at well definition. 2010-09-10 17:14:00 +00:00
Bård Skaflestad 6e330e6e98 Add simple support routines for building CSR matrices. 2010-09-09 16:48:03 +00:00