Previously, we just called the default constructor. Of course this does not allocate
any memory and we experienced segmentation faults. With this patch we correctly
allocate the arrays by passing the number of row and columns to the constructor.
It took me quite some time to understand the computations done
e.g. during the detection of oscillations, where the stuff returned
by residuals() is used as a vector of doubles. It turns out that
residuals() actually returns the norm of the residuals. To clarify this
we rename residuals() to computeResidualNorms() and residuals to
residual_norms. Having my dare devil day today, I even try to document the
method. (This documented method might feel kind of lonely between the others,
now;). Hopefully this saves others some time.
The computations made to check the convergence are the same for all existing
phases. Therefore this patch uses loops over the phase indices when cmputing
them,
In the convergence check there are several reductions (maxCoeff(), sum())
that will trigger communication in a parallel run. This patch seperates the
reductions from the other computations. The idea is to one reduction for the
reductions that need to done as global communication is expensive.
The number of perforations may change due to completions beeing shut.
If the number of perforations changes the perfPhaseRates are set to
equal the wellRates/(number of perforations) instead of the values from
the previous time step.
The initial definition of the phase indices seems to be in
opm/core/props/BlackoilPhases.hpp. Nevertheless there were
several redefinitions of the same or similar enums (either
Aqua, Liquid, and Vapor, or Water, Oil, and Gas). Surprisingly
most often these definitions did not use the original values.
This is bound to break if there is a change upstream.
This patch limits the definition to one place in opm-autodiff,
namely opm/autodiff/BlackoilPropsAdInterface.hpp. To avoid
downstream confusion we define both the Water and Aqua triplets.
In addition we define the maximum number of phases to use at compile
time.
Shut is renamed to stopped in the wellsManager in order to better
reflect the name logic in the deck. This PR implements the nessesary
change in opm-autodiff
There has been an inconsitancy in which pressure to use in the
evaluation of the fluid properties.
With this commit the phase pressure is used for all the evaluation of
the fluid properties.
The multiplier contribution from the getRegionMultiplier is added to the
face multipliers. The getRegionMultiplier method is called with the cell
index on both side of the face in order to return the correct region
multiplier across faults.
1) Add the possibility for the user to chose between local and global
coordinate permeability in the transmissibility calculations.
2) Trow for CpGrid
3) Add default for switch
dynamical parameter given in the parameter file. The default is 0 (as before).
In addition the relaxation parameter has been added to the parameter with the
default preserving the state from before.
Also, the default parameter for use_amg and use_bicgstab in the constructor of
CPRPrecondition have been removed.
Note that this patch does not introduce any real temperature
dependence but only changes the APIs for the viscosity and for the
density related methods. Note that I also don't like the fact that
this requires so many changes to so many files, but with the current
design of the property classes I cannot see a way to avoid this...
This restores the performance to approximately the level it had before
the change to support non-diagonal well jacobians, for SPE9. All changes
are to the eliminateVariable() method.
- Explicitly compute and apply the inverse.
- Change loop ordering to apply inverse only num_eq - 1 times, instead
of (numeq - 1)^2.
- Use UmfPackLU instead of SparseLU.
1. The right hand side is solved only once
2. The solver is constructed directly with the matrix
3. const is added where it was missing
4. More commennts is added
5. Variable names are changed for clarification
The following comments has been adressed
1. An array is used in stead of pair
2. is not empty is used instead of size>0 to check if the well has been
initialized before
3. const_iterator is used instead of iterator
4. partial copy is removed
5. WellMapType is no longer mutable
If we need more than 150 linear iterations, it's probably something
wrong, and we may be better of by restarting with smaller time-steps.
TODO: make it possible for the user to specify this number.
The non-diagonal elements in the sub-matrices in the Schur complement is
no longer ignored. Instead of assuming the matrix do be diagonal, and
compute the invert of the sub-matrix, small linear systems are solved
using superLU.
Tested on SPE3 and Norne. (With this fix a slightly modified norne runs
until 3292 days)
The residual output is changed from max residual to
total mass balance residual. In this way the output
resemble what is actually used as convergence criteria.
With the introduction of shut wells the same ordering in the well states
can no longer be assumed. The well names is instead used to map the old
well state to the new. Also the partial_copying is moved into the
initialization.
Tested on SPE1, SPE3, SPE9 and Norne. (Do not change the SPEs and is
nessesary for the Norne)
The old rs and rv values are used in the phase transitions calculations.
The update of rs and rv to the state is therefore moved after the phase
transitions in order for the code to use the old values.