Commit Graph

450 Commits

Author SHA1 Message Date
Bård Skaflestad
e3b52c3a44 Backed out changeset 9faef9e37070 2011-10-18 23:20:34 +02:00
Bård Skaflestad
e54f1cf147 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
986e8183c4 Backed out changeset 6b1a90716ea5 2011-10-18 23:17:02 +02:00
Bård Skaflestad
ceaea9f987 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
9b0b258198 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
Halvor M. Nilsen
9610763e07 changes the code compile: runs: and give wrong results 2011-10-12 16:10:51 +02:00
Bård Skaflestad
bdbd90916b 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
ef0bac2fc0 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
e077cf6ca4 Suppress warnings about unused parameters. 2011-09-10 16:48:31 +02:00
Bård Skaflestad
2c89db5f87 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
7d3d468ed0 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
cdea6504b9 Merge from upstream. 2011-09-01 10:37:00 +02:00
Bård Skaflestad
035dca2b8c Merge from upstream. 2011-09-01 10:33:06 +02:00
Bård Skaflestad
03a1d1feca Silence warnings about "signed vs. unsigned" comparisons. 2011-09-01 10:28:27 +02:00
Bård Skaflestad
a56d8a7b25 Implement cset c450ec75621e wherever applicable. 2011-08-30 14:34:27 +02:00
Bård Skaflestad
abc87e170f Adapt to removal of 'const' in struct compr_quantities.
The members cannot be 'const' in C lest the structure be impossible to
create using traditional C idioms (a sequence of malloc() calls).  If
the library is to be usable in a more general context, we cannot impose
C++ specific conveniences.
2011-08-30 10:32:19 +02:00
Bård Skaflestad
c723f7d4f7 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
85c05fc31c Free the 'dof2conn' mapping in _destroy().
This memory leak existed for a long time.
2011-08-21 21:09:25 +02:00
Atgeirr Flø Rasmussen
249d5af80a Changed interface, taking pointers to data instead of vectors. 2011-06-28 13:49:02 +02:00
Bård Skaflestad
5a2739caca Refactor accumulation of fine-scale fluxes.
Specifically, move accumulation out of IFSH_MS and into a separate
function, 'coarse_sys_compute_fs_flux', in the coarse-system module.
This decoupling facilitates independent access to the projection
operation and is more natural.
2011-06-22 09:22:40 +02:00
Bård Skaflestad
b8b56ca955 Merge from upstream. 2011-06-21 22:22:04 +02:00
Bård Skaflestad
aa4f77e0db Implement prototype TPFA discretisation for local problems.
Contingent upon preprocessor symbol "USE_MIM_IP_TPFA" and only a
mimetic two-point discretisation (not cell-centred systems).  Hide
existing discretisation behind preprocessor symbol "USE_MIM_IP_SIMPLE".
2011-06-21 14:02:39 +02:00
Bård Skaflestad
e15bdb5d51 Catch debugging code up to field renames in cset cb524598a847. 2011-06-14 18:27:42 +02:00
Bård Skaflestad
2b8bde1b55 Summarise the fields of struct coarse_topology. 2011-06-05 13:20:15 +02:00
Bård Skaflestad
11ae0c62ae Use (c1,c2) alias rather than neigh[] references where possible. 2011-05-31 23:06:44 +02:00
Bård Skaflestad
1cb20e7637 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
eed3e5bc65 Spelling. 2011-05-28 00:08:33 +02:00
Bård Skaflestad
f825d4e23d Avoid signed/unsigned problem. 2011-05-27 23:17:44 +02:00
Bård Skaflestad
f316c730d0 Enable silent build rules if available in Automake.
Automake 1.11 introduced the concept of "silent build rules" wherein the
build commands are reported as

  CC     cfsh.lo

rather than something along the lines of

  bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../../../opmpressure/src -I..   -DMATLAB_MEX_FILE=1 -I/work/opt/matlab/R2009b/extern/include/  -O3 -DNDEBUG -std=c99 -Wall -Wextra -pedantic -march=native -mtune=native -MT cfsh.lo -MD -MP -MF .deps/cfsh.Tpo -c -o cfsh.lo ../../../../../opmpressure/src/cfsh.c
  libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../../opmpressure/src -I.. -DMATLAB_MEX_FILE=1 -I/work/opt/matlab/R2009b/extern/include/ -O3 -DNDEBUG -std=c99 -Wall -Wextra -pedantic -march=native -mtune=native -MT cfsh.lo -MD -MP -MF .deps/cfsh.Tpo -c ../../../../../opmpressure/src/cfsh.c  -fPIC -DPIC -o .libs/cfsh.o

The former is much easier to read and, consequently, more conducive to
visually noticing diagnostics from the toolset (compiler, linker &c).

On the other hand, only fairly recent editions of Automake have the
"silent rule" capability, so enable silent rules only if available.  In
particular, Automake 1.10.x (the default Automake version in MacOS X
10.6) does not support the capability.  Neither does the default
Automake in CentOS 5.6.

Further details on silent build rules can be found at

  http://sources.redhat.com/automake/automake.html#Options
  http://www.flameeyes.eu/autotools-mythbuster/automake/silent.html

Thanks to Arne Morten Kvarving in Dune Flyspray issue #922
(http://www.dune-project.org/flyspray/index.php?do=details&task_id=922)
for the tip on how to preserve "configure.ac" backwards compatibility
with Automake < 1.11 .
2011-05-27 15:09:58 +02:00
Bård Skaflestad
4eeb70e016 Delete trailing whitespace. 2011-05-11 15:14:34 +02:00
Bård Skaflestad
298034ea98 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
79b5e95bc4 Merge from upstream. 2011-05-11 14:24:47 +02:00
Atgeirr Flø Rasmussen
70ff7a1b99 Three changes:
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.
2011-05-11 14:17:30 +02:00
Atgeirr Flø Rasmussen
23f1cff3c2 Now assemble() expects gravcapf as a parameter instead of computing it. 2011-05-10 11:35:01 +02:00
Bård Skaflestad
9efc70d353 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
Atgeirr Flø Rasmussen
deb1f4e5ad Using gravtrans_p for well impes transport. 2011-04-26 11:06:46 +02:00
Atgeirr Flø Rasmussen
9730ea81c1 Merged. 2011-04-18 13:52:54 +02:00
Atgeirr Flø Rasmussen
c7fb0bfc3a Bugfix in impes transport for well perforations, function signature change. 2011-04-18 13:51:54 +02:00
Bård Skaflestad
61bbaf821b Merge from upstream. 2011-04-12 12:34:04 +02:00
Atgeirr Flø Rasmussen
c0a1444fa4 More output. Substantially changed effect of do_impes parameter. In detail:
0. Writes total fluid volumes to octave and vtk output files.
(following considerations ONLY apply to IMPES mode: do_impes=true)
1. Now we do timestep safety evaluations for IMPES, a la Coats.
   This is done after the pressure computation.
2. If current timestep is unsafe, we set the new timestep to the safe one,
   divided by 1.5.
3. If minimum_stepsize is set, we will not further reduce the timestep once
   it is below the minimum (yes, this is not quite a "minimum").
All in all, timestepping and reporting should be reconsidered to make a
user-friendly yet controllable impes code. The current impes mode does
not interact well with timestep_file for instance.
2011-04-12 09:44:39 +02:00
Bård Skaflestad
87a0756af6 Merge from upstream. 2011-04-11 16:35:06 +02:00
Atgeirr Flø Rasmussen
389d7627f4 Added explicitTimestepLimit() method. 2011-04-11 13:37:30 +02:00
Bård Skaflestad
5548973e73 Sort includes. 2011-04-11 11:32:42 +02:00
Atgeirr Flø Rasmussen
58b7db31c5 Added setting of dpmob arrays. Minor edit and reindent. 2011-04-11 11:12:33 +02:00
Atgeirr Flø Rasmussen
3ceab3dc45 Added gravity parameter, and gravity potential computations. 2011-04-11 11:04:52 +02:00
Atgeirr Flø Rasmussen
7e290e8bfd First partial implementation of Coats' stable IMPES step limit. 2011-04-11 10:11:22 +02:00
Bård Skaflestad
fb2192a7ed Implement total rate constraint for wells.
Untested.
2011-02-16 10:41:43 +01:00
Ove Saevareid
405900ac39 Bugfix: Correct number of connections also for the last well. 2011-02-07 17:52:32 +01:00
Atgeirr Flø Rasmussen
c1e686a3d6 Removed check for wells, no longer necessary since we support them now. 2011-02-03 15:44:36 +01:00
Atgeirr Flø Rasmussen
a0c54cb6de Added well handling to cfs_tpfa_expl_mass_transport(), simplified interface. 2011-02-03 12:51:53 +01:00