Commit Graph
100 Commits
Author SHA1 Message Date
Bård Skaflestad 64b5c83f9d Merge remote-tracking branch 'bska/master' 2013-05-16 11:26:44 +02:00
Bård Skaflestad 409cfb1578 White-space cleanup.
No functional changes.
2013-05-16 11:23:59 +02:00
Bård Skaflestad 72dd6a851e Merge remote-tracking branch 'atgeirr/master' 2013-05-16 10:57:44 +02:00
Bård Skaflestad 0063799e86 Merge remote-tracking branch 'atgeirr/master' 2013-05-16 10:29:19 +02:00
Bård Skaflestad c8fb7169aa Move rel-perm and viscosity calculations closer to use
This is an aesthetic change, only.
2013-05-16 09:58:34 +02:00
Bård Skaflestad fa2e02a579 The 'pflux' is really the hydraulic head.
Rename variable accordingly.
2013-05-16 09:51:34 +02:00
Bård Skaflestad ef354792cd Implement first cut at Darcy (total) flux calculation.
This is compile-tested only.
2013-05-16 09:48:56 +02:00
Bård Skaflestad b46cef383f Build 'test_impestpfa_ad' along with the 'examples' 2013-05-16 09:48:01 +02:00
Bård Skaflestad 8bc5f66d8d Promote 'test_impestpfa_ad' to an 'example'
This was the original intention, but the file was misplaced during
the module reorganisation.
2013-05-16 09:33:58 +02:00
Bård Skaflestad 970f308f59 New sentence -> capital first letter. 2013-05-16 00:10:51 +02:00
Bård Skaflestad b74d988a7b New sentence -> capital letter. 2013-05-16 00:10:32 +02:00
Bård Skaflestad 24204cf33e Merge remote-tracking branch 'atgeirr/master' 2013-05-15 16:10:54 +02:00
Bård Skaflestad e0c85a2fdb Adapt to CMake-based build system.
Specifically,

  - #include <config.h> where appropriate (all .cpp files)
  - Adjust include statements to account for sub-directory locations
    of .hpp files.
2013-05-15 16:10:20 +02:00
Bård Skaflestad d2f412e27a Fix inverted set of automated test cases. 2013-05-15 16:08:56 +02:00
Bård Skaflestad 2500f1ae58 Adopt imported build system to OPM-Autodiff specifics
Updated include statements &c to follow.
2013-05-15 15:49:48 +02:00
Bård Skaflestad 582a947d9b Complete import of CMake support from OPM-Core 2013-05-15 10:40:00 +02:00
Bård Skaflestad 57f73517c0 Move MRST example closer to actual example 2013-05-15 10:37:50 +02:00
Bård Skaflestad 9309024d1e First partitioning into source/examples/tests
Reorganisations are likely.
2013-05-15 10:35:39 +02:00
Bård Skaflestad 5ce44e05e6 This is OPM-Autodiff 0.1
We don't depend on any Dune modules.
2013-05-15 10:26:06 +02:00
Bård Skaflestad 116f39e8ab Import CMake support from OPM-Core 2013-05-15 10:24:52 +02:00
Bård Skaflestad 930b88334f Merge upstream changes. 2013-05-15 10:12:30 +02:00
Bård Skaflestad 9139d8a48b Merge remote-tracking branch 'atgeirr/master' 2013-05-15 10:10:01 +02:00
Bård Skaflestad c0dead5e97 Add spdiag() prototype to silence GCC 4.6 warning.
GCC's flag -Wmissing-declarations requires that a valid prototype
exist for non-template (global) functions prior to the corresponding
function definition.
2013-05-15 09:34:59 +02:00
Bård Skaflestad 0225e6c9ee Ignore autosave files from Vim. 2013-05-14 17:45:20 +02:00
Bård Skaflestad b85c0dce88 Add test cases for density and water viscosity.
Currently, ViscosityAD fails due to missing pressure derivatives in
the viscosity primitives.
2013-05-14 17:29:49 +02:00
Bård Skaflestad cebb6fd5fa Add required fluid densities 2013-05-14 15:46:00 +02:00
Bård Skaflestad eb1836c977 Disable 'param' output for all test cases. 2013-05-14 15:45:31 +02:00
Bård Skaflestad 6583aca34c Default to using tables as-is. 2013-05-14 15:41:45 +02:00
Bård Skaflestad ac5350a598 All "parameter" values must be strings. 2013-05-14 15:41:34 +02:00
Bård Skaflestad 667cae6d84 Expose 'param' and 'deck' in TestFixture. 2013-05-14 15:31:41 +02:00
Bård Skaflestad a1ca968991 Merge remote-tracking branch 'atgeirr/master' 2013-05-14 15:19:13 +02:00
Bård Skaflestad 99c3ec2824 Start a test suite for class BlackoilPropsAd.
Relies on external data ("fluid.data") to describe the fluid model.
2013-05-14 14:59:31 +02:00
Bård Skaflestad 1069cfae6d Merge remote-tracking branch 'atgeirr/master' 2013-05-14 13:41:11 +02:00
Bård Skaflestad a13d78bb06 Start fleshing out overall structure of Newton loop
Specifically,
  - Extract method solveJacobianSystem() for solving a single,
    system of linear equations (i.e., the Newton step).
  - Extract method residualNorm() for computing the residual norm.
    Used in loop control.
  - Stub out a method for computing fluxes.

Compile and run-tested on a linear, gravity-driven flow problem.
2013-05-14 13:40:56 +02:00
Bård Skaflestad 55165bd68d Enforce row-major ordering of the pressure Jacobian
Otherwise, we will use the transposed Jacobian as a coefficient
matrix in the 'linsolver_'.  This is wrong when solving compressible
problems for which the Jacobian matrix is not symmetric.
2013-05-14 11:53:09 +02:00
Bård Skaflestad 3f0f0363c3 Add first, working gravity solution
When run as

    ./test_impestfpa_ad permeability=1.01325e15 ref_pressure=1.0e-5 \
    mu1=1000 mu2=1000 rho1=1 rho2=1

this example reproduces the expected solution (a one-Pascal pressure
increase per cell).

Note that this is an incompressible case, so 'test_impestpfa_ad' must
be compiled with the pre-processor symbol

    HACK_INCOMPRESSIBLE_GRAVITY

defined to a true value (e.g., -DHACK_INCOMPRESSIBLE_GRAVITY=1)
2013-05-14 11:40:07 +02:00
Bård Skaflestad 35cb155537 Merge remote-tracking branch 'atgeirr/master' 2013-05-13 16:37:27 +02:00
Bård Skaflestad e31486e288 Add tentative implementation of gravity flux. 2013-05-13 16:31:26 +02:00
Bård Skaflestad a141e79ead Construct (and store) gravity operator on grid.
The gravity flux of phase 'i' across an (internal) interface is then
given by

    gflux = mob_i * (G * rho_i)

assuming 'rho_i' contains the phase density (at reservoir conditions)
of phase 'i' and 'mob_i' is the phase mobility of phase 'i' at the
interface.
2013-05-13 16:11:48 +02:00
Bård Skaflestad 4b737497d5 Implement static gravity potential in DerivedGeology.
This is a stepping stone towards implementing gravity support in
ImpesTPFAAD.
2013-05-13 13:30:00 +02:00
Bård Skaflestad 4721d402e4 Remove an instance of EOL whitespace. 2013-05-13 10:35:50 +02:00
Bård Skaflestad 61f184cdc9 Use constant intermediate quantities. 2013-05-12 22:48:15 +02:00
Bård Skaflestad a174d4eb51 Put spdiag() into an anonymous namespace.
This avoids warnings (GCC 4.6) about missing prior function declaration.
2013-05-08 19:21:09 +02:00
Bård Skaflestad 92592672fe Use upwind mobility flux. 2013-05-08 15:06:13 +02:00
Bård Skaflestad 093daa93d7 Implement first cut at pressure system assembly.
Compile-tested only.
2013-05-08 14:34:48 +02:00
Bård Skaflestad baab2cdf43 Implement simple constructor for sparse, diagonal matrix.
This is, effectively, the same as MATLAB's

    spdiags(d, 0)

constructor.
2013-05-08 14:32:48 +02:00
Bård Skaflestad 673c044a6c Rename 'phase' parameter p->phase to avoid confusion. 2013-05-08 13:13:57 +02:00
Bård Skaflestad dfd33d8973 Merge remote-tracking branch 'atgeirr/master' 2013-05-08 13:02:59 +02:00
Bård Skaflestad ea1cdcd478 Assert non-empty state quantities.
This avoids generating a null-pointer dereference for

   &s[0]

in case of s.empty().
2013-05-08 13:02:51 +02:00
Bård Skaflestad 3ff5347ac9 Distinguish fluid from geology properties.
Most of class ImpesTPFAAD deals (or will deal) with fluid properties
with only a token nod to the geology--mostly in the form of derived
quantities such as transmissibility and pore volumes.  There is no
need to conflate the roles of fluid interface and geology interface
for this purpose.
2013-05-08 09:39:48 +02:00
Bård Skaflestad 1b3e43068f Include proper file header. 2013-05-08 00:19:25 +02:00
Bård Skaflestad 146b1223d2 Don't check input values. Defaults are fine.
While here, also return zero, which although not strictly needed,
nevertheless indicates to the reader that we're exiting successfully.
2013-05-08 00:17:35 +02:00
Bård Skaflestad 843499e071 Include <cassert> for assert() macro. 2013-05-08 00:11:21 +02:00
Bård Skaflestad f3d8277d7a Ignore 'ImpesTPFAAD' test program. 2013-05-07 21:41:02 +02:00
Bård Skaflestad d0cb7d8a4c Move buildAllCells() to anon. namespace.
This avoids diagnostics like "no previous declaration for ...".
2013-05-07 21:40:17 +02:00
Bård Skaflestad cfb7c2916a Merge remote-tracking branch 'bska/master' 2013-05-07 21:25:30 +02:00
Bård Skaflestad 083fef3c69 Merge remote-tracking branch 'atgeirr/master' 2013-05-07 21:23:18 +02:00
Bård Skaflestad 72fdc41caa Add early foundations for compressible flow solver
This is highly incomplete and refactorings are likely.
2013-05-07 19:58:10 +02:00
Bård Skaflestad b4a49c5844 Merge remote-tracking branch 'atgeirr/master' 2013-05-07 13:28:08 +02:00
Bård Skaflestad 2fc7c65118 Ignore simulators 2013-05-07 10:51:05 +02:00
Bård Skaflestad 0058e34aec printSparseMatrix(): Use InnerIterator rather than index
This way, we're (slightly) more agnostic to the inner storage scheme.
2013-05-06 14:09:48 +02:00
Bård Skaflestad c9d65f8c28 Merge remote-tracking branch 'atgeirr/master' 2013-05-06 14:01:06 +02:00
Bård Skaflestad 7980f3f6cb Suppress output from assignment in MATLAB. 2013-05-06 13:37:04 +02:00
Bård Skaflestad e9a1aa2a99 Fix mismerge. 2013-05-06 12:31:13 +02:00
Bård Skaflestad bc547f82c6 Merge remote-tracking branch 'atgeirr/master'
Conflicts:
	sim_simple.cpp
2013-05-06 12:29:47 +02:00
Bård Skaflestad 60509ca960 Output solution as a MATLAB function.
This way, we can run the example as

    ./sim_simple | sed -n '/s1 *=/,$p' > solution.m

to obtain a MATLAB function containing the 'solution'.
2013-05-06 09:43:48 +02:00
Bård Skaflestad b06b0c99ca Decrease amount of output and count iterations in the process.
Specifically, output the solution only at the end (in MATLAB
compatible format, for easy comparison) and annotate the diagnostic
output (i.e., cpu time and residual norm) with the iteration number.
2013-05-05 22:57:42 +02:00
Bård Skaflestad 056b7ae292 Make Darcy flux actually constant.
The definition from commit 6f22d10 included a non-zero derivative
which interfered with the automatic differentiation solver.  Using a
fully constant Darcy flux enables using dt=150 while still computing
the correct solution.

While here, output the solution (s1) using more precision/digits for
comparison with 'sim_simple.m'.
2013-05-05 22:02:40 +02:00
Bård Skaflestad 6f22d10b06 Do real splitting based on total flux/fractional flow
We are now able to compute the correct solution with dt=0.5, but the
convergence rate is dismal.
2013-05-05 21:52:34 +02:00
Bård Skaflestad e31101e80f Incorporate transmissibility into water flux definition.
This means that we're computing the correct solution for dt=0.0005 (as
verified by 'sim_simple.m', but we're still failing larger time steps).
2013-05-05 16:44:51 +02:00
Bård Skaflestad 8b12d1506d Add MATLAB-compatible output of ADB::M values.
This is mostly intended as an interim aid in development.  Not enabled
if 'NDEBUG' is defined.
2013-05-03 23:45:13 +02:00
Bård Skaflestad fc5a3f181e Use S_o=1 as initial condition.
This is the case in 'sim_simple.cpp', too.
2013-05-03 20:28:36 +02:00
Bård Skaflestad 9b65338461 Add MRST function for 'sim_simple' development 2013-05-03 20:21:37 +02:00
Bård Skaflestad d0866c39b5 Implement first cut at upwind-mobility weighting for transport
Specifically,

  - Introduce a new class, UpwindSelector<Scalar> which provides a
    selection service (method select()) to pick out a quantity across
    an interface in the upwind direction.

    Method select() is implemented only for the case of no
    counter-current flow (i.e., no effects of gravity and/or capillary
    pressure).  The selector is affected through applying an explicit
    sparse matrix to each quantity.  This may be inefficient, but only
    measurements will tell.

  - Split function fluxFunc<ADB>() into two components,
    phaseMobility<ADB>() and fluxFunc<ADB>().  The former computes
    phase mobilities (per cell) for water and oil in a subset of the
    grid cells and the latter computes the flux function (for water,
    i.e., the first phase) based on a (2-) vector of phase
    mobilities--either per cell or per internal interface.

  - Compute explicit phase mobilities (per cell) in the non-linear
    loop before employing the upwind selector to pick out proper
    upwind mobilities per (internal) interface to define the quantity
    'fw_face' which was previously computed by an arithmetic average.
2013-05-03 17:48:33 +02:00
Bård Skaflestad bd240a31cb Declare operator?() as 'const'.
None of operator+(), operator-(), operator*() or operator/() modify
their object.  These methods are thus naturally declared as 'const'.
2013-05-03 16:24:20 +02:00
Bård Skaflestad 0a43fe68dd Complete Addition tests. 2013-05-03 12:53:51 +02:00
Bård Skaflestad d6cfe8ab6f Clarify diagnostic message in pressure solve.
Word missing in commit a95fbf0.
2013-05-03 12:39:24 +02:00
Bård Skaflestad a95fbf0e8e Terminate process in case of factorisation/solution failure.
Provide moderately informative diagnostic message in this case.
2013-05-03 12:33:48 +02:00
Bård Skaflestad dddb30b5a5 Use regularised Jacobian when solving pressure system. 2013-05-03 12:26:02 +02:00
Bård Skaflestad cd9c9d5cde Don't require initialiser lists.
These were introduced into GCC as recently as edition 4.7 .  Ubuntu
10.04 LTS features GCC 4.4 only.
2013-05-03 11:28:08 +02:00
Bård Skaflestad e4cbc2c7f2 Merge remote-tracking branch 'atgeirr/master' 2013-05-03 11:08:37 +02:00
Bård Skaflestad 4ffea931e3 Add test for addition of ADB::variable()s. 2013-05-03 11:08:06 +02:00
Bård Skaflestad 9e55006229 Implement a custom comparator for Eigen::SparseMatrix<double>
Use it to simplify the 'FunctionInitialisation' test.
2013-05-03 10:46:46 +02:00
Bård Skaflestad 6794577301 Add stub test for ADB::operator+()
Doesn't actually test anything at the moment.
2013-05-02 18:00:36 +02:00
Bård Skaflestad 49396b6079 Don't include <iostream> in tester.
It is not needed and was only added for convenience during test
development.
2013-05-02 15:40:59 +02:00
Bård Skaflestad b1b245ccab Don't include <iostream> in public header. 2013-05-02 15:16:48 +02:00
Bård Skaflestad b6834de662 Don't rely on header pollution to provide <iostream> 2013-05-02 15:16:21 +02:00
Bård Skaflestad 2b5d49bea9 Merge remote-tracking branch 'atgeirr/master' 2013-05-02 14:48:33 +02:00
Bård Skaflestad e15c389daf Rename typedef ADV -> ADB to reflect reality.
We're working with *Block*s here.
2013-05-02 13:57:05 +02:00
Bård Skaflestad 567d3a80b3 Add various initialisation tests using Boost.Test . 2013-05-02 13:39:33 +02:00
Bård Skaflestad 36f2dd6403 Merge remote-tracking branch 'atgeirr/master' 2013-05-02 11:28:32 +02:00
Bård Skaflestad a496c2d668 Merge remote-tracking branch 'atgeirr/master' 2013-05-02 10:52:36 +02:00
Bård Skaflestad 3c00b0528a Sort list of ignored executables for easy reference 2013-05-02 00:35:40 +02:00
Bård Skaflestad 633de102c2 Fix misprint in operator*() chain rule. 2013-04-30 22:51:29 +02:00
Bård Skaflestad 6ed2b129cb Implement constant() and variable() in terms of function()
Specifically,

  - A constant is a function with zero derivative
  - A variable is a function with unit derivative with respect to
    itself.
2013-04-30 13:41:13 +02:00
Bård Skaflestad 70996fb195 Remove two instances of EOL whitespace. 2013-04-30 13:35:34 +02:00
Bård Skaflestad 86eb29b4c3 variable(): Avoid memory overhead of identity constructor. 2013-04-30 12:48:02 +02:00
Bård Skaflestad c276592ca5 Don't #include <iostream>. It's not needed. 2013-04-30 12:37:08 +02:00
Bård Skaflestad 06d2c078fa Use documented include statements for Eigen 2013-04-30 12:36:43 +02:00
Bård Skaflestad 134b9b1a7f Readjust whitespace to original conventions. 2013-04-30 11:52:03 +02:00