mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adding variableStateExtractWellsVars() for BlackoilMultiSegmentModel
This commit is contained in:
parent
01a5de4c4c
commit
b154779a44
@ -240,12 +240,15 @@ namespace Opm {
|
|||||||
const WellState& xw,
|
const WellState& xw,
|
||||||
const V& aliveWells) {};
|
const V& aliveWells) {};
|
||||||
|
|
||||||
std::vector<int>
|
|
||||||
variableWellStateIndices() const {};
|
|
||||||
|
|
||||||
void
|
void
|
||||||
makeConstantState(SolutionState& state) const;
|
makeConstantState(SolutionState& state) const;
|
||||||
|
|
||||||
|
void
|
||||||
|
variableStateExtractWellsVars(const std::vector<int>& indices,
|
||||||
|
std::vector<ADB>& vars,
|
||||||
|
SolutionState& state) const;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
const Grid& grid_;
|
const Grid& grid_;
|
||||||
@ -315,11 +318,6 @@ namespace Opm {
|
|||||||
const std::vector<int>& indices,
|
const std::vector<int>& indices,
|
||||||
std::vector<ADB>& vars) const;
|
std::vector<ADB>& vars) const;
|
||||||
|
|
||||||
void
|
|
||||||
variableStateExtractWellsVars(const std::vector<int>& indices,
|
|
||||||
std::vector<ADB>& vars,
|
|
||||||
SolutionState& state) const;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
computeAccum(const SolutionState& state,
|
computeAccum(const SolutionState& state,
|
||||||
const int aix );
|
const int aix );
|
||||||
|
@ -153,77 +153,25 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: using the original Qs for the segment rates for now.
|
||||||
|
// TODO: using the original Bhp for the segment pressures for now.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
template <class Grid>
|
||||||
/*
|
|
||||||
template <class Grid, class Implementation>
|
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation>::
|
BlackoilMultiSegmentModel<Grid>::variableStateExtractWellsVars(const std::vector<int>& indices,
|
||||||
variableWellState(const WellState& xw, std::vector<V>& vars0) const
|
std::vector<ADB>& vars,
|
||||||
|
SolutionState& state) const
|
||||||
{
|
{
|
||||||
if ( wellsActive() )
|
// segment phase rates in surface volume
|
||||||
{
|
state.segqs = std::move(vars[indices[Qs]]);
|
||||||
//TODO: BEGIN WITH Q_o, Q_w, Q_g and P.
|
|
||||||
//TODO: THEN TESTING IF G_T, F_W, F_G and P WILL BE BETTER.
|
|
||||||
const int nw = wellsMultiSegment().size();
|
|
||||||
// number of segments
|
|
||||||
int nseg = 0;
|
|
||||||
int nperf = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < nw; ++i) {
|
// segment pressures
|
||||||
nseg += wellsMultiSegment()[i].numberOfSegments();
|
state.segp = std::move(vars[indices[Bhp]]);
|
||||||
nperf += wellsMultiSegment()[i].numberOfPerforations();
|
|
||||||
}
|
|
||||||
|
|
||||||
// number of phases
|
|
||||||
const int np = wellsMultiSegment()[0].numberOfPhases();
|
|
||||||
|
|
||||||
const DataBlock seg_rates = Eigen::Map<const DataBlock>(& xw.segPhaseRates()[0], nw, nseg).transpose();
|
|
||||||
const V qs = Eigen::Map<const V>(seg_rates.data(), nseg * np);
|
|
||||||
vars0.push_back(qs);
|
|
||||||
|
|
||||||
|
|
||||||
// Initial pressures
|
|
||||||
const V seg_pressures = Eigen::Map<const V>(& xw.segPress()[0], nseg);
|
|
||||||
vars0.push_back(seg_pressures);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vars0.push_back(V());
|
|
||||||
vars0.push_back(V());
|
|
||||||
}
|
|
||||||
// the number of the segments
|
|
||||||
// the number of the phases
|
|
||||||
// then the rate related functions
|
|
||||||
// then the pressure related functions
|
|
||||||
// the ordering will be interleaved way (4 X 4 block for each segment?) or
|
|
||||||
// Continous G_T, F_W, F_G and P
|
|
||||||
|
|
||||||
// The varaibles will be Q_o, Q_w, Q_g and P?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation>
|
|
||||||
std::vector<int>
|
|
||||||
BlackoilModelBase<Grid, Implementation>::variableWellStateIndices() const
|
|
||||||
{
|
|
||||||
// Black oil model standard is 5 equation.
|
|
||||||
// For the pure well solve, only the well equations are picked.
|
|
||||||
std::vector<int> indices(5, -1);
|
|
||||||
int next = 0;
|
|
||||||
indices[Qs] = next++;
|
|
||||||
indices[Bhp] = next++;
|
|
||||||
assert(next == 2);
|
|
||||||
return indices;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* template <class Grid, class Implementation>
|
/* template <class Grid, class Implementation>
|
||||||
typename BlackoilModelBase<Grid, Implementation>::SolutionState
|
typename BlackoilModelBase<Grid, Implementation>::SolutionState
|
||||||
BlackoilModelBase<Grid, Implementation>::variableStateExtractVars(const ReservoirState& x,
|
BlackoilModelBase<Grid, Implementation>::variableStateExtractVars(const ReservoirState& x,
|
||||||
@ -297,16 +245,6 @@ namespace Opm {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
BlackoilModelBase<Grid, Implementation>::variableStateExtractWellsVars(const std::vector<int>& indices,
|
|
||||||
std::vector<ADB>& vars,
|
|
||||||
SolutionState& state) const
|
|
||||||
{
|
|
||||||
// Qs.
|
|
||||||
state.qs = std::move(vars[indices[Qs]]);
|
|
||||||
|
|
||||||
// Bhp.
|
|
||||||
state.bhp = std::move(vars[indices[Bhp]]);
|
|
||||||
} */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user