mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adding extractWellPerfProperties to StandardWellsSolvent
to fix the flow_solvent running.
This commit is contained in:
parent
5da57973fe
commit
19734f2103
@ -386,6 +386,8 @@ namespace Opm {
|
|||||||
void
|
void
|
||||||
assembleMassBalanceEq(const SolutionState& state);
|
assembleMassBalanceEq(const SolutionState& state);
|
||||||
|
|
||||||
|
// TODO: only kept for now due to flow_multisegment
|
||||||
|
// will be removed soon
|
||||||
void
|
void
|
||||||
extractWellPerfProperties(const SolutionState& state,
|
extractWellPerfProperties(const SolutionState& state,
|
||||||
std::vector<ADB>& mob_perfcells,
|
std::vector<ADB>& mob_perfcells,
|
||||||
|
@ -855,7 +855,7 @@ namespace detail {
|
|||||||
|
|
||||||
std::vector<ADB> mob_perfcells;
|
std::vector<ADB> mob_perfcells;
|
||||||
std::vector<ADB> b_perfcells;
|
std::vector<ADB> b_perfcells;
|
||||||
asImpl().stdWells().extractWellPerfProperties(rq_, fluid_.numPhases(), mob_perfcells, b_perfcells);
|
asImpl().stdWells().extractWellPerfProperties(state, rq_, fluid_.numPhases(), fluid_, active_, mob_perfcells, b_perfcells);
|
||||||
if (param_.solve_welleq_initially_ && initial_assembly) {
|
if (param_.solve_welleq_initially_ && initial_assembly) {
|
||||||
// solve the well equations as a pre-processing step
|
// solve the well equations as a pre-processing step
|
||||||
asImpl().solveWellEq(mob_perfcells, b_perfcells, state, well_state);
|
asImpl().solveWellEq(mob_perfcells, b_perfcells, state, well_state);
|
||||||
|
@ -90,7 +90,7 @@ namespace Opm {
|
|||||||
solvent_pos_(detail::solventPos(fluid.phaseUsage())),
|
solvent_pos_(detail::solventPos(fluid.phaseUsage())),
|
||||||
solvent_props_(solvent_props),
|
solvent_props_(solvent_props),
|
||||||
is_miscible_(is_miscible),
|
is_miscible_(is_miscible),
|
||||||
std_wells_(wells_arg, solvent_props)
|
std_wells_(wells_arg, solvent_props, solvent_pos_)
|
||||||
|
|
||||||
{
|
{
|
||||||
if (has_solvent_) {
|
if (has_solvent_) {
|
||||||
|
@ -101,9 +101,12 @@ namespace Opm {
|
|||||||
const std::vector<double>& depth_perf,
|
const std::vector<double>& depth_perf,
|
||||||
const double grav);
|
const double grav);
|
||||||
|
|
||||||
template <class ReservoirResidualQuant>
|
template <class ReservoirResidualQuant, class SolutionState>
|
||||||
void extractWellPerfProperties(const std::vector<ReservoirResidualQuant>& rq,
|
void extractWellPerfProperties(const SolutionState& state,
|
||||||
|
const std::vector<ReservoirResidualQuant>& rq,
|
||||||
const int np,
|
const int np,
|
||||||
|
const BlackoilPropsAdInterface& fluid,
|
||||||
|
const std::vector<bool>& active,
|
||||||
std::vector<ADB>& mob_perfcells,
|
std::vector<ADB>& mob_perfcells,
|
||||||
std::vector<ADB>& b_perfcells) const;
|
std::vector<ADB>& b_perfcells) const;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace Opm {
|
|||||||
using Base = StandardWells;
|
using Base = StandardWells;
|
||||||
|
|
||||||
// --------- Public methods ---------
|
// --------- Public methods ---------
|
||||||
explicit StandardWellsSolvent(const Wells* wells, const SolventPropsAdFromDeck& solvent_props);
|
explicit StandardWellsSolvent(const Wells* wells, const SolventPropsAdFromDeck& solvent_props, const int solvent_pos);
|
||||||
|
|
||||||
template <class SolutionState, class WellState>
|
template <class SolutionState, class WellState>
|
||||||
void computePropertiesForWellConnectionPressures(const SolutionState& state,
|
void computePropertiesForWellConnectionPressures(const SolutionState& state,
|
||||||
@ -48,8 +48,19 @@ namespace Opm {
|
|||||||
std::vector<double>& rsmax_perf,
|
std::vector<double>& rsmax_perf,
|
||||||
std::vector<double>& rvmax_perf,
|
std::vector<double>& rvmax_perf,
|
||||||
std::vector<double>& surf_dens_perf);
|
std::vector<double>& surf_dens_perf);
|
||||||
|
|
||||||
|
// TODO: fluid and active may be can put in the member list
|
||||||
|
template <class ReservoirResidualQuant, class SolutionState>
|
||||||
|
void extractWellPerfProperties(const SolutionState& state,
|
||||||
|
const std::vector<ReservoirResidualQuant>& rq,
|
||||||
|
const int np,
|
||||||
|
const BlackoilPropsAdInterface& fluid,
|
||||||
|
const std::vector<bool>& active,
|
||||||
|
std::vector<ADB>& mob_perfcells,
|
||||||
|
std::vector<ADB>& b_perfcells) const;
|
||||||
protected:
|
protected:
|
||||||
const SolventPropsAdFromDeck& solvent_props_;
|
const SolventPropsAdFromDeck& solvent_props_;
|
||||||
|
const int solvent_pos_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,9 +33,11 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg,
|
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg,
|
||||||
const SolventPropsAdFromDeck& solvent_props)
|
const SolventPropsAdFromDeck& solvent_props,
|
||||||
|
const int solvent_pos)
|
||||||
: Base(wells_arg)
|
: Base(wells_arg)
|
||||||
, solvent_props_(solvent_props)
|
, solvent_props_(solvent_props)
|
||||||
|
, solvent_pos_(solvent_pos)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,4 +180,52 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template <class ReservoirResidualQuant, class SolutionState>
|
||||||
|
void
|
||||||
|
StandardWellsSolvent::
|
||||||
|
extractWellPerfProperties(const SolutionState& state,
|
||||||
|
const std::vector<ReservoirResidualQuant>& rq,
|
||||||
|
const int np,
|
||||||
|
const BlackoilPropsAdInterface& fluid,
|
||||||
|
const std::vector<bool>& active,
|
||||||
|
std::vector<ADB>& mob_perfcells,
|
||||||
|
std::vector<ADB>& b_perfcells) const
|
||||||
|
{
|
||||||
|
Base::extractWellPerfProperties(state, rq, np, fluid, active, mob_perfcells, b_perfcells);
|
||||||
|
// handle the solvent related
|
||||||
|
{
|
||||||
|
int gas_pos = fluid.phaseUsage().phase_pos[Gas];
|
||||||
|
const std::vector<int>& well_cells = wellOps().well_cells;
|
||||||
|
const int nperf = well_cells.size();
|
||||||
|
// Gas and solvent is combinded and solved together
|
||||||
|
// The input in the well equation is then the
|
||||||
|
// total gas phase = hydro carbon gas + solvent gas
|
||||||
|
|
||||||
|
// The total mobility is the sum of the solvent and gas mobiliy
|
||||||
|
mob_perfcells[gas_pos] += subset(rq[solvent_pos_].mob, well_cells);
|
||||||
|
|
||||||
|
// A weighted sum of the b-factors of gas and solvent are used.
|
||||||
|
const int nc = rq[solvent_pos_].mob.size();
|
||||||
|
|
||||||
|
const Opm::PhaseUsage& pu = fluid.phaseUsage();
|
||||||
|
const ADB zero = ADB::constant(Vector::Zero(nc));
|
||||||
|
const ADB& ss = state.solvent_saturation;
|
||||||
|
const ADB& sg = (active[ Gas ]
|
||||||
|
? state.saturation[ pu.phase_pos[ Gas ] ]
|
||||||
|
: zero);
|
||||||
|
|
||||||
|
Selector<double> zero_selector(ss.value() + sg.value(), Selector<double>::Zero);
|
||||||
|
ADB F_solvent = subset(zero_selector.select(ss, ss / (ss + sg)),well_cells);
|
||||||
|
Vector ones = Vector::Constant(nperf,1.0);
|
||||||
|
|
||||||
|
b_perfcells[gas_pos] = (ones - F_solvent) * b_perfcells[gas_pos];
|
||||||
|
b_perfcells[gas_pos] += (F_solvent * subset(rq[solvent_pos_].b, well_cells));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -289,11 +289,14 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class ReservoirResidualQuant>
|
template <class ReservoirResidualQuant, class SolutionState>
|
||||||
void
|
void
|
||||||
StandardWells::
|
StandardWells::
|
||||||
extractWellPerfProperties(const std::vector<ReservoirResidualQuant>& rq,
|
extractWellPerfProperties(const SolutionState& /* state */,
|
||||||
|
const std::vector<ReservoirResidualQuant>& rq,
|
||||||
const int np,
|
const int np,
|
||||||
|
const BlackoilPropsAdInterface& /* fluid */,
|
||||||
|
const std::vector<bool>& /* active */,
|
||||||
std::vector<ADB>& mob_perfcells,
|
std::vector<ADB>& mob_perfcells,
|
||||||
std::vector<ADB>& b_perfcells) const
|
std::vector<ADB>& b_perfcells) const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user