Commit Graph

1396 Commits

Author SHA1 Message Date
dr-robertk
bd8586b477 Merge pull request #541 from GitPaean/support_segment_well_rebased
Support multi-segment wells
2015-12-02 11:18:33 -07:00
Atgeirr Flø Rasmussen
241da90531 Merge pull request #547 from blattms/parallel-ilu
Parallel overlapping ILU0
2015-12-02 11:47:13 +01:00
Markus Blatt
cb9d566ec2 Added braces to one-line for loop. 2015-12-02 11:29:38 +01:00
Markus Blatt
99c1b988a7 Fixed typo "consistent consistent" -> consistent. 2015-12-01 15:13:22 +01:00
Markus Blatt
0da66bf45b Removed more dead and code that was already commented out. 2015-12-01 15:11:27 +01:00
Markus Blatt
fd78f1c0b9 Moved includes to \*.cpp file. 2015-12-01 14:56:29 +01:00
Markus Blatt
4adf8487ea Uses more speaking names for template parameter and adds more documentation. 2015-12-01 14:49:07 +01:00
Markus Blatt
e05e3fa478 Removes code that was commented out. 2015-12-01 14:48:35 +01:00
Markus Blatt
0fdd27267b Adds empty lines around namespaces and comment about the end of a namespace. 2015-12-01 14:47:28 +01:00
Markus Blatt
dc1d7c526f Moved ParallelOverlappingILU0 to its own file. 2015-12-01 14:41:06 +01:00
Kai Bao
5a23406d9e naming M to Matrix for better readability in WellMultiSegment 2015-12-01 10:44:05 +01:00
Kai Bao
f7782c30b7 fixing compilation due to update of master. 2015-12-01 00:06:46 +01:00
Kai Bao
38a9dbd9ff parallel running for flow_mutlisegment
SPE9 can be run in parallel now.
2015-12-01 00:06:46 +01:00
Kai Bao
4c73f3c01c refactoring the init() of WellStateMultiSegment
to handle better when nw = 0
2015-12-01 00:06:46 +01:00
Kai Bao
0022bb8465 adding one missing #pragma line resulting from rebasing conflicts. 2015-12-01 00:06:46 +01:00
Kai Bao
8116424f6d documenting the class WellMultiSegment 2015-12-01 00:06:46 +01:00
Atgeirr Flø Rasmussen
57511641e2 Remove unused data members. 2015-12-01 00:06:46 +01:00
Atgeirr Flø Rasmussen
a40d93a170 Comment out changes to residual output. 2015-12-01 00:06:46 +01:00
Atgeirr Flø Rasmussen
c825b599e5 Remove unused include. 2015-12-01 00:06:46 +01:00
Kai Bao
bcc97b44d8 refactoring the construction of WellMultiSegment
for better readability.
2015-12-01 00:06:46 +01:00
Kai Bao
c946749c73 addressing some old comments in WellMultiSegment 2015-12-01 00:06:46 +01:00
Kai Bao
a684c390f5 cleaning up SimulatorFullyImplicitBlackoilMultiSegment_impl 2015-12-01 00:06:46 +01:00
Kai Bao
31061c8331 cleaning up function computeWellConnectionPressures() for ms wells. 2015-12-01 00:06:46 +01:00
Kai Bao
cfa5faab4e cleaning up comments in BlackoilMultiSegmentModel_impl 2015-12-01 00:06:46 +01:00
Kai Bao
f90b96abf6 removing the use of wops_ from the BlackoilModelBase in ms well
Also some cleaning up of comments in BlackoilMultiSegmentModel
2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
61cccfebf8 Refactor updatState() to use numWellVars().
This allows us to use the base version of updateState().
2015-12-01 00:06:45 +01:00
Kai Bao
df30546841 not handling SHUT wells when generating wells_multisegment
it fixed the 7th time step running for Norne.
2015-12-01 00:06:45 +01:00
Kai Bao
9114b56e9b cleaning up comments in WellMultiSegment and WellStateMultiSegment 2015-12-01 00:06:45 +01:00
Kai Bao
edf3c9b08c optimizing the addWellControlEq() for ms wells. 2015-12-01 00:06:45 +01:00
Kai Bao
fcd31d74ac restoring the original wellstate when solveWelleq fails. 2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
233a275191 Made the solveWellEq() method return if it converged.
Also use this to avoid updating if not converged in the
multi-segment version.
2015-12-01 00:06:45 +01:00
Kai Bao
b6ede37ca3 WIP for fixing the solveWellEq running for ms wells.
refactoring needs to be done to finish it.
2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
2055c94269 Implement solveWellEq() for multisegment model.
Note that this initial version has only been tested on regular wells!
2015-12-01 00:06:45 +01:00
Kai Bao
57d796ca68 not extracting the mob and b inside computeWellFlux() ms wells 2015-12-01 00:06:45 +01:00
Kai Bao
4b9064a0f8 optimizing the function computeSegmentPressuresDelta()
Further optimization is possible by introducing new variable for the
model to avoid recomputation.
2015-12-01 00:06:45 +01:00
Kai Bao
79b9039ba1 fixing computeWellFlux() to recover the mutli-segment running. 2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
693f5c791b Refactor computeWellFlux().
Now much faster, avoiding repeated use of subset() etc. by
vectorization of code.
2015-12-01 00:06:45 +01:00
Kai Bao
80723fee12 adding more operators to ms well ops
p2w w2p s2w w2s
2015-12-01 00:06:45 +01:00
Kai Bao
0c28bf5a75 recovering compilation and running after merging master. 2015-12-01 00:06:45 +01:00
Kai Bao
5a0efdba30 adding comments for addWellFluxEq() 2015-12-01 00:06:45 +01:00
Kai Bao
8ae74d5a47 optimizing addWellFluxEq() based on ms well ops 2015-12-01 00:06:45 +01:00
Kai Bao
55e4206c0b adding s2s_inlets and s2s_outlets to ms well ops.
and also fix the s2p and p2s implementation.
2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
5b43018862 Fix ms well ops implementation. 2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
bbf86dcd4a Add wops_ms_ member. 2015-12-01 00:06:45 +01:00
Kai Bao
9ee2d92f3f recovering the compilation from the updated master branch. 2015-12-01 00:06:45 +01:00
Kai Bao
c3b4088448 recovering the compilation after updating opm-parser. 2015-12-01 00:06:45 +01:00
Kai Bao
c8fbb0b80d clearning up some comments and debugging output 2015-12-01 00:06:45 +01:00
Kai Bao
b1fdda00af calculating the pressure difference between segments and perforations. 2015-12-01 00:06:45 +01:00
Kai Bao
31f71dd6f7 calculating the depth difference between segments and perforations 2015-12-01 00:06:45 +01:00
Kai Bao
658ad0a400 calculation of pressure difference between perofration and cells
remained to be verified.

The calculation is explicit, should be performed only once at the
begining of the time step.
2015-12-01 00:06:45 +01:00
Kai Bao
f3b885dc0d removing several member variables not useful
they are related to the presure correction caclulations.
2015-12-01 00:06:45 +01:00
Kai Bao
9f218ef1a3 adding segmentDiameter() to WellMultiSegment 2015-12-01 00:06:45 +01:00
Kai Bao
b9e5518b51 adding compPressureDrop() member function for WellMultiSegment 2015-12-01 00:06:45 +01:00
Kai Bao
5e64da6f8e calculating the viscosity of the fluid in segments 2015-12-01 00:06:45 +01:00
Kai Bao
93a86019af calculating the mass flow rate for the segments. 2015-12-01 00:06:45 +01:00
Kai Bao
3b3ac203d9 change the name of computeSegmentDensitiesAndCompVolumeDt
to computeSegmentFluidProperties to include calculation of more fluid mixture in the segments.
2015-12-01 00:06:45 +01:00
Kai Bao
8bde14d7ce applying the volume effects to the well flux equation.
The effects on the result are really tiny, which makes the real
verfication not easy. It did not bring anything bad for the current
working case though.
2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
9dea3c6b57 Fix typo in variable name. 2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
81e9c25b10 Made methods const in multi-segment model as well. 2015-12-01 00:06:45 +01:00
Kai Bao
95eb44e530 calculating the surface volume of component in segment
For convinience, we calculate and store the surface volume by dt
instead.
2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
e82828527c Make some methods const.
The methods are: computeWellFlux(), updatePerfPhaseRatesAndPressures()
and extractWellPerfProperties().
2015-12-01 00:06:45 +01:00
Kai Bao
847ae2ef8c adding segment volume / dt to BlackoilMultiSegmentModel
to handle the wellbore volume effects.
2015-12-01 00:06:45 +01:00
Kai Bao
d5f917d1ac computing the density of segment mixture and pressure drop earlier
the density of segmetn mixture will be used in the well flux
calculation.
2015-12-01 00:06:45 +01:00
Atgeirr Flø Rasmussen
ba7b3e728c Minor improvements in computeSegmentDensities().
Mainly improving comments, deleting unused code and moving some variable
definitions closer to where they are used.
2015-12-01 00:06:45 +01:00
Kai Bao
6190d002dd adding the hydrostatic drop effects in segment pressure equation.
Verified with current working case.
2015-12-01 00:06:45 +01:00
Kai Bao
92c5927f30 fixing a typo bug in addWellControlEq
verified with a case with a simple horizontal multi-segment well.
2015-12-01 00:06:45 +01:00
Kai Bao
50938effc4 output the well equation residual. 2015-12-01 00:06:45 +01:00
Kai Bao
a44de6bb1d changing p2s_gather to p2s mappling in well flux equation. 2015-12-01 00:06:45 +01:00
Kai Bao
19caace288 unifying the well flux equaions for multi-segment and non-segment wells
verified with non-segment wells.
2015-12-01 00:06:45 +01:00
Kai Bao
7d11b49732 re-organizing the output.
no functional change.
2015-12-01 00:06:44 +01:00
Kai Bao
885dfedc91 adding the pressure drop between segments
remains to be verfied and apply to the pressure equations for segments
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
702cd3170a Remove unused code and fix a few warnings. 2015-12-01 00:06:44 +01:00
Kai Bao
b7b5672c86 deleting the old unused computeSegmentDensities()
which is a first version, whose implementation should not be used
anymore.
2015-12-01 00:06:44 +01:00
Kai Bao
617e4c1786 fixing one bug in computeSegmentDensities()
the flux rate for the producing well are negtive. NotEqualZero should
used for selector instead of GreaterZero.
2015-12-01 00:06:44 +01:00
Kai Bao
f3ce4dc530 finishing computeSegmentDensities()
the results remain to be verified.
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
4dd8536afa Make multi-segment model use Base::addWellContribution...() method.
Also make assemble() more similar to base version, using the
extractWellPerfProperties() member from Base.

To do this it was necessary to change the well_cells member of the
WellOps to be correct for the multi-segment wells (since they may
have different perforation order for some wells).
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
44f36c45cf Add well_cells to WellOps to avoid recreating. 2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
b2787e24e7 Use value() in argument to make Selector constructor compile. 2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
920eeed3b2 Improve assemble() with new method extractWellPerfProperties(). 2015-12-01 00:06:44 +01:00
Kai Bao
d79536b0dd adding the function computeSegmentDensities()
Not verified yet.
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
653e55d7db Make assemble() more similar to base version. 2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
e6a81fca83 Make convergence methods work for multi-segment wells.
The convergenceReduction() method no longer takes a number-of-wells argument,
instead it infers the number of well fluxes to check from the size of the
well_flux_eq member of the residual.

After this, a custom getConvergence() method is no longer required for the
multi-segment well model.
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
1c4f4c646d Add asImpl() to some method calls.
This enables those methods (mostly well related) to be used polymorphically.
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
ae512d5c83 Update location of ErrorMacros.hpp header in includes. 2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
9e664abe6e Add a TODO comment to updateWellControls(). 2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
fce7247da5 Update the SolutionState's qs and bhp members.
This way they can be used instead of repeatedly extracting the top segment data,
which also could make it possible to use more of the existing implementation.
2015-12-01 00:06:44 +01:00
Kai Bao
433d76cd86 adding the related grid cell for each segment.
This concept can be removed in the future.
2015-12-01 00:06:44 +01:00
Kai Bao
98fe7f19c5 not trying to find outlet segment for top segment 2015-12-01 00:06:44 +01:00
Kai Bao
4854bae4cd using s2s_outlet mapping in the pressure equation. 2015-12-01 00:06:44 +01:00
Kai Bao
1b6453c6ba introducing new mapping s2s_outlet
from a segment to its outlet segment
2015-12-01 00:06:44 +01:00
Kai Bao
317cbb0af8 changing the mapping s2s_outlet to s2s_inlets
to better refect the real meaning of the mapping.
2015-12-01 00:06:44 +01:00
Kai Bao
cb3f54b618 the pressure fluctuation only apply for non-segmented well.
to recover previous residual history when running with only
non-segmented wells.
2015-12-01 00:06:44 +01:00
Kai Bao
be293962b6 changing the perforation pressure initialization
to make it slightly different from the pressure of the perforation cell
to avoid NaN for cqt_is.

anotehr way can be initialized them related to the bhp of the well.
some tests will be performed in the future.
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
9c1c87a040 Remember to initialize the data members. 2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
f2c812fb3a Made WellStateMultiSegment use inheritance properly.
Use base class' data members (via public methods),
also change method names to match existing ones.
2015-12-01 00:06:44 +01:00
Kai Bao
cc2d40a1a8 handling aliveWells when adding control equations
to recover the SPE9 running.
2015-12-01 00:06:44 +01:00
Kai Bao
4fe0ae4a58 correcting the index of phase rate of the top segment
When handling the rate control equations.
2015-12-01 00:06:44 +01:00
Kai Bao
70e1ccb736 using the first cell of the well to initialize bhp
instead of using the the first cell of all the wells in
WellStateMultiSegment
2015-12-01 00:06:44 +01:00
Kai Bao
9b5b5198b2 update the currentControls from prevState
when initializing WellStateMultiSegment
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
7aa2672a14 Add TODO comment. 2015-12-01 00:06:44 +01:00
Kai Bao
504dc45de2 some information output
for debugging puropose.
2015-12-01 00:06:44 +01:00
Kai Bao
2b4922a986 updating pressure and phase rates for top segments in updateWellControls 2015-12-01 00:06:44 +01:00
Kai Bao
70d6d253fe correcting bugs when initializing the WellState by copying prevState 2015-12-01 00:06:44 +01:00
Kai Bao
0a3cbe0c1e upating the segment pressure in updateWellState.
The running of the first time step is okay.
2015-12-01 00:06:44 +01:00
Kai Bao
8c522ccc34 correcting a bug in pressure initialization in WellStateMultiSegment
for the pressure of top segment and peforations.
2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
5d5ae7d271 Further silencing of warnings. 2015-12-01 00:06:44 +01:00
Kai Bao
247ae11fc3 fixing the compilation. 2015-12-01 00:06:44 +01:00
Atgeirr Flø Rasmussen
15fd5dad47 Suppress warnings in the multisegment well code. 2015-12-01 00:06:44 +01:00
Kai Bao
d7900d4fe8 updating the pressure of perforations.
only for usual wells now.

for multisegment wells, need to solve the the pressure difference calculation
first.
2015-12-01 00:06:44 +01:00
Kai Bao
2f0818df79 adding a public member function for the top segment index. 2015-12-01 00:06:44 +01:00
Kai Bao
052b61e672 indexing the location of top segments in WellStateMultiSegment
it is better to be in the global well class if we decide to have it
later.
2015-12-01 00:06:44 +01:00
Kai Bao
f7951ef018 correcting the well control equation (rate control) 2015-12-01 00:06:44 +01:00
Kai Bao
cf766b5c3e fixing warnings related to mutlie segment wells. 2015-12-01 00:06:44 +01:00
Kai Bao
09f8da0324 fixing compilation and running after rebasing. 2015-12-01 00:06:44 +01:00
Kai Bao
ca5dd0dca4 WIP debugging. 2015-12-01 00:06:44 +01:00
Kai Bao
0fee0059a6 outputing the well information after updateWellState
for debugging purpose.
2015-12-01 00:06:43 +01:00
Kai Bao
3bce63ed64 correcting the bhp value when calculating connection pressure 2015-12-01 00:06:43 +01:00
Kai Bao
72af213835 outputing the wellMap information.
for debugging purpose.
2015-12-01 00:06:43 +01:00
Kai Bao
5379467b4c adding temperature for WellStateMultiSegment
it is not used though
2015-12-01 00:06:43 +01:00
Kai Bao
895e04b6fa outputing all the information of the WellStateMultiSegment
for debugging purpose.
2015-12-01 00:06:43 +01:00
Kai Bao
4feee98457 correcting the mapping matrix in WellMultiSegment
correcting the calculation of s2s_gather
2015-12-01 00:06:43 +01:00
Kai Bao
34d72a774a correcting some initialization for WellMultiSegment 2015-12-01 00:06:43 +01:00
Kai Bao
33c979b772 outputing all the information related to multisegment wells
for debugging purpose.
2015-12-01 00:06:43 +01:00
Kai Bao
709c030b10 adding public member function WellMultiSegment::inletSegments() 2015-12-01 00:06:43 +01:00
Kai Bao
3eae01de18 pure cleaning up in WellStateMultiSegment 2015-12-01 00:06:43 +01:00
Kai Bao
9526b5a9b1 WIP for addWellControlEq
P_n - P_n-1  = 0;
This is not making sense. remains to be corrected later.

It can run with NaN or too large solutions.
2015-12-01 00:06:43 +01:00
Kai Bao
d8634e41e5 some commenting. 2015-12-01 00:06:43 +01:00
Kai Bao
a137db6d37 using segment rates instead of well rates in addWellControlEq 2015-12-01 00:06:43 +01:00
Kai Bao
3b40a8d5b3 adding computeSegmentDensities for BlackoilMultiSegmentModel
cacluating the density of fluid mixture in segment, which is very
important for the pressure drop calculation for multi-segment wells.

This version is based on \sigma(q_s * dens_s) / \sigma(q_s * B).
More sophiscate techniques will be required to take into consideration
of the segment pressure and also the rs rv.
2015-12-01 00:06:43 +01:00
Kai Bao
bfe77db26f adding p2s_average to the wellOps for WellMultiSegment
this mapping calculate the averaged perforation properties to their
related segments
2015-12-01 00:06:43 +01:00
Kai Bao
487f90ee88 small comments 2015-12-01 00:06:43 +01:00
Kai Bao
45e89c5d28 adding convergenceReduction for BlackoilMultiSegmentModel 2015-12-01 00:06:43 +01:00
Kai Bao
62b6e69de8 adding updateWellState to BlackoilMultiSegmentModel
no THP treament.
2015-12-01 00:06:43 +01:00
Kai Bao
f496646182 adding updateState() for BlackoilMultiSegmentModel 2015-12-01 00:06:43 +01:00
Kai Bao
2e74b7cbaf WIP version for addWellControlEq()
not figuring out how to calculate the density of the mixuture.
2015-12-01 00:06:43 +01:00
Kai Bao
747a295122 adding addWellContributionToMassBalanceEq to BlackoilMultiSegmentModel 2015-12-01 00:06:43 +01:00
Kai Bao
f087ac14e8 adding addWellFluxEq to BlackoilMultiSegmentModel
while it causes segmentation fault.
Will check after adding well control equations
2015-12-01 00:06:43 +01:00
Kai Bao
9ccba2b0eb adding a mapping from segments to their outlet segments
All the mapping related to the WellMultiSegment remained to be verfied.
2015-12-01 00:06:43 +01:00
Kai Bao
2e155c70de WIP on addWellFluxEq(). 2015-12-01 00:06:43 +01:00
Kai Bao
befc152071 adding Zero values for well_perforatoin_cell_pressure_diffs_
Trying to let the code run through first.

And for the current cases, they should be zeros.
2015-12-01 00:06:43 +01:00
Kai Bao
c1683c0c11 correcting the well mapping for WellMultiSegment
p2s_gather should be s2s_gather * p2s instead of s2s_gather * s2p

The mapping generation needs further investigation.
2015-12-01 00:06:43 +01:00
Kai Bao
5aa258fdd6 correcting a bug in computeWellFlux in BlackoilMultiSegmentModel
it should be segment rates instead of well rates.
2015-12-01 00:06:43 +01:00
Kai Bao
02b187e14c friend class BlackoilModelBas in BlackoilMultiSegmentModel
and adding asImp() when using variableWellStateInitials and
variableWellStateInitials.
2015-12-01 00:06:43 +01:00
Kai Bao
eb73b64e3d using Base::perfPhaseRates() and Base::currentControls() WellStateMultiSegment
so that WellStateMultiSegment can use the WellDensitySegmented.
which also implies that WellStateMultiSegment needs a big refactoring
later.
2015-12-01 00:06:43 +01:00
Kai Bao
d61e6b8a56 correcting a bug in the initialization of the WellStateMultiSegment
a_ = a_ to initialize some member variables cause later segmentation
fault.
2015-12-01 00:06:43 +01:00
Kai Bao
b3afd115ff WIP updatePerfPhaseRatesAndPressures for BlackoilMultiSegmentModel 2015-12-01 00:06:43 +01:00
Kai Bao
3cc8a09a65 WIP computeWellFlux() for BlackoilMultiSegmentModel 2015-12-01 00:06:43 +01:00
Kai Bao
788440b6e0 WIP version of computeWellConnectionPressures() for BlackoilMultiSegmentModel 2015-12-01 00:06:43 +01:00
Kai Bao
9776559a21 adding updateWellControls to BlackoilMultiSegmentModel 2015-12-01 00:06:43 +01:00
Kai Bao
dd432c6400 cleaning up and fixing the compilation. 2015-12-01 00:06:43 +01:00