mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
puting WellModel before Implementation in the template.
This commit is contained in:
parent
5bce482086
commit
ebe60bc5d7
@ -41,10 +41,10 @@ namespace Opm {
|
|||||||
/// It uses automatic differentiation via the class AutoDiffBlock
|
/// It uses automatic differentiation via the class AutoDiffBlock
|
||||||
/// to simplify assembly of the jacobian matrix.
|
/// to simplify assembly of the jacobian matrix.
|
||||||
template<class Grid>
|
template<class Grid>
|
||||||
class BlackoilModel : public BlackoilModelBase<Grid, BlackoilModel<Grid>, StandardWells>
|
class BlackoilModel : public BlackoilModelBase<Grid, StandardWells, BlackoilModel<Grid> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef BlackoilModelBase<Grid, BlackoilModel<Grid>, StandardWells> Base;
|
typedef BlackoilModelBase<Grid, StandardWells, BlackoilModel<Grid> > Base;
|
||||||
|
|
||||||
/// Construct the model. It will retain references to the
|
/// Construct the model. It will retain references to the
|
||||||
/// arguments of this functions, and they are expected to
|
/// arguments of this functions, and they are expected to
|
||||||
|
@ -105,7 +105,7 @@ namespace Opm {
|
|||||||
/// to simplify assembly of the jacobian matrix.
|
/// to simplify assembly of the jacobian matrix.
|
||||||
/// \tparam Grid UnstructuredGrid or CpGrid.
|
/// \tparam Grid UnstructuredGrid or CpGrid.
|
||||||
/// \tparam Implementation Provides concrete state types.
|
/// \tparam Implementation Provides concrete state types.
|
||||||
template<class Grid, class Implementation, class WellModel>
|
template<class Grid, class WellModel, class Implementation>
|
||||||
class BlackoilModelBase
|
class BlackoilModelBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -143,8 +143,8 @@ namespace detail {
|
|||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
BlackoilModelBase(const ModelParameters& param,
|
BlackoilModelBase(const ModelParameters& param,
|
||||||
const Grid& grid ,
|
const Grid& grid ,
|
||||||
const BlackoilPropsAdInterface& fluid,
|
const BlackoilPropsAdInterface& fluid,
|
||||||
@ -217,9 +217,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
prepareStep(const double dt,
|
prepareStep(const double dt,
|
||||||
ReservoirState& reservoir_state,
|
ReservoirState& reservoir_state,
|
||||||
WellState& /* well_state */)
|
WellState& /* well_state */)
|
||||||
@ -234,10 +234,10 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
template <class NonlinearSolverType>
|
template <class NonlinearSolverType>
|
||||||
IterationReport
|
IterationReport
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
nonlinearIteration(const int iteration,
|
nonlinearIteration(const int iteration,
|
||||||
const double dt,
|
const double dt,
|
||||||
NonlinearSolverType& nonlinear_solver,
|
NonlinearSolverType& nonlinear_solver,
|
||||||
@ -289,9 +289,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
afterStep(const double /* dt */,
|
afterStep(const double /* dt */,
|
||||||
ReservoirState& /* reservoir_state */,
|
ReservoirState& /* reservoir_state */,
|
||||||
WellState& /* well_state */)
|
WellState& /* well_state */)
|
||||||
@ -303,9 +303,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
int
|
int
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
sizeNonLinear() const
|
sizeNonLinear() const
|
||||||
{
|
{
|
||||||
return residual_.sizeNonLinear();
|
return residual_.sizeNonLinear();
|
||||||
@ -315,9 +315,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
int
|
int
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
linearIterationsLastSolve() const
|
linearIterationsLastSolve() const
|
||||||
{
|
{
|
||||||
return linsolver_.iterations();
|
return linsolver_.iterations();
|
||||||
@ -327,9 +327,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
bool
|
bool
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
terminalOutputEnabled() const
|
terminalOutputEnabled() const
|
||||||
{
|
{
|
||||||
return terminal_output_;
|
return terminal_output_;
|
||||||
@ -339,9 +339,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
int
|
int
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
numPhases() const
|
numPhases() const
|
||||||
{
|
{
|
||||||
return fluid_.numPhases();
|
return fluid_.numPhases();
|
||||||
@ -351,9 +351,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
int
|
int
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
numMaterials() const
|
numMaterials() const
|
||||||
{
|
{
|
||||||
return material_name_.size();
|
return material_name_.size();
|
||||||
@ -363,9 +363,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
const std::string&
|
const std::string&
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
materialName(int material_index) const
|
materialName(int material_index) const
|
||||||
{
|
{
|
||||||
assert(material_index < numMaterials());
|
assert(material_index < numMaterials());
|
||||||
@ -376,9 +376,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
setThresholdPressures(const std::vector<double>& threshold_pressures)
|
setThresholdPressures(const std::vector<double>& threshold_pressures)
|
||||||
{
|
{
|
||||||
const int num_faces = AutoDiffGrid::numFaces(grid_);
|
const int num_faces = AutoDiffGrid::numFaces(grid_);
|
||||||
@ -407,8 +407,8 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
ReservoirResidualQuant::ReservoirResidualQuant()
|
ReservoirResidualQuant::ReservoirResidualQuant()
|
||||||
: accum(2, ADB::null())
|
: accum(2, ADB::null())
|
||||||
, mflux( ADB::null())
|
, mflux( ADB::null())
|
||||||
@ -422,9 +422,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
int
|
int
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::numWellVars() const
|
BlackoilModelBase<Grid, WellModel, Implementation>::numWellVars() const
|
||||||
{
|
{
|
||||||
// For each well, we have a bhp variable, and one flux per phase.
|
// For each well, we have a bhp variable, and one flux per phase.
|
||||||
const int nw = stdWells().localWellsActive() ? wells().number_of_wells : 0;
|
const int nw = stdWells().localWellsActive() ? wells().number_of_wells : 0;
|
||||||
@ -435,9 +435,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
makeConstantState(SolutionState& state) const
|
makeConstantState(SolutionState& state) const
|
||||||
{
|
{
|
||||||
// HACK: throw away the derivatives. this may not be the most
|
// HACK: throw away the derivatives. this may not be the most
|
||||||
@ -465,9 +465,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
typename BlackoilModelBase<Grid, Implementation, WellModel>::SolutionState
|
typename BlackoilModelBase<Grid, WellModel, Implementation>::SolutionState
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableState(const ReservoirState& x,
|
variableState(const ReservoirState& x,
|
||||||
const WellState& xw) const
|
const WellState& xw) const
|
||||||
{
|
{
|
||||||
@ -480,9 +480,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
std::vector<V>
|
std::vector<V>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableStateInitials(const ReservoirState& x,
|
variableStateInitials(const ReservoirState& x,
|
||||||
const WellState& xw) const
|
const WellState& xw) const
|
||||||
{
|
{
|
||||||
@ -503,9 +503,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableReservoirStateInitials(const ReservoirState& x, std::vector<V>& vars0) const
|
variableReservoirStateInitials(const ReservoirState& x, std::vector<V>& vars0) const
|
||||||
{
|
{
|
||||||
using namespace Opm::AutoDiffGrid;
|
using namespace Opm::AutoDiffGrid;
|
||||||
@ -542,10 +542,10 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableWellStateInitials(const WellState& xw, std::vector<V>& vars0) const
|
variableWellStateInitials(const WellState& xw, std::vector<V>& vars0) const
|
||||||
{
|
{
|
||||||
// Initial well rates.
|
// Initial well rates.
|
||||||
if ( stdWells().localWellsActive() )
|
if ( stdWells().localWellsActive() )
|
||||||
@ -577,9 +577,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
std::vector<int>
|
std::vector<int>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableStateIndices() const
|
variableStateIndices() const
|
||||||
{
|
{
|
||||||
assert(active_[Oil]);
|
assert(active_[Oil]);
|
||||||
@ -601,9 +601,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
std::vector<int>
|
std::vector<int>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableWellStateIndices() const
|
variableWellStateIndices() const
|
||||||
{
|
{
|
||||||
// Black oil model standard is 5 equation.
|
// Black oil model standard is 5 equation.
|
||||||
@ -620,9 +620,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
typename BlackoilModelBase<Grid, Implementation, WellModel>::SolutionState
|
typename BlackoilModelBase<Grid, WellModel, Implementation>::SolutionState
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableStateExtractVars(const ReservoirState& x,
|
variableStateExtractVars(const ReservoirState& x,
|
||||||
const std::vector<int>& indices,
|
const std::vector<int>& indices,
|
||||||
std::vector<ADB>& vars) const
|
std::vector<ADB>& vars) const
|
||||||
@ -693,9 +693,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
variableStateExtractWellsVars(const std::vector<int>& indices,
|
variableStateExtractWellsVars(const std::vector<int>& indices,
|
||||||
std::vector<ADB>& vars,
|
std::vector<ADB>& vars,
|
||||||
SolutionState& state) const
|
SolutionState& state) const
|
||||||
@ -711,9 +711,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
computeAccum(const SolutionState& state,
|
computeAccum(const SolutionState& state,
|
||||||
const int aix )
|
const int aix )
|
||||||
{
|
{
|
||||||
@ -774,8 +774,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void BlackoilModelBase<Grid, Implementation, WellModel>::
|
void
|
||||||
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
computeWellConnectionPressures(const SolutionState& state,
|
computeWellConnectionPressures(const SolutionState& state,
|
||||||
const WellState& xw)
|
const WellState& xw)
|
||||||
{
|
{
|
||||||
@ -808,9 +809,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
assemble(const ReservoirState& reservoir_state,
|
assemble(const ReservoirState& reservoir_state,
|
||||||
WellState& well_state,
|
WellState& well_state,
|
||||||
const bool initial_assembly)
|
const bool initial_assembly)
|
||||||
@ -886,9 +887,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
assembleMassBalanceEq(const SolutionState& state)
|
assembleMassBalanceEq(const SolutionState& state)
|
||||||
{
|
{
|
||||||
// Compute b_p and the accumulation term b_p*s_p for each phase,
|
// Compute b_p and the accumulation term b_p*s_p for each phase,
|
||||||
@ -954,9 +955,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
updateEquationsScaling() {
|
updateEquationsScaling() {
|
||||||
ADB::V B;
|
ADB::V B;
|
||||||
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
|
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
|
||||||
@ -988,9 +989,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
addWellContributionToMassBalanceEq(const std::vector<ADB>& cq_s,
|
addWellContributionToMassBalanceEq(const std::vector<ADB>& cq_s,
|
||||||
const SolutionState&,
|
const SolutionState&,
|
||||||
const WellState&)
|
const WellState&)
|
||||||
@ -1015,9 +1016,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
extractWellPerfProperties(const SolutionState&,
|
extractWellPerfProperties(const SolutionState&,
|
||||||
std::vector<ADB>& mob_perfcells,
|
std::vector<ADB>& mob_perfcells,
|
||||||
std::vector<ADB>& b_perfcells) const
|
std::vector<ADB>& b_perfcells) const
|
||||||
@ -1044,9 +1045,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
addWellFluxEq(const std::vector<ADB>& cq_s,
|
addWellFluxEq(const std::vector<ADB>& cq_s,
|
||||||
const SolutionState& state)
|
const SolutionState& state)
|
||||||
{
|
{
|
||||||
@ -1072,8 +1073,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
bool BlackoilModelBase<Grid, Implementation, WellModel>::
|
bool
|
||||||
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
isVFPActive() const
|
isVFPActive() const
|
||||||
{
|
{
|
||||||
if( ! localWellsActive() ) {
|
if( ! localWellsActive() ) {
|
||||||
@ -1107,8 +1109,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
bool BlackoilModelBase<Grid, Implementation, WellModel>::
|
bool
|
||||||
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
solveWellEq(const std::vector<ADB>& mob_perfcells,
|
solveWellEq(const std::vector<ADB>& mob_perfcells,
|
||||||
const std::vector<ADB>& b_perfcells,
|
const std::vector<ADB>& b_perfcells,
|
||||||
SolutionState& state,
|
SolutionState& state,
|
||||||
@ -1215,8 +1218,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void BlackoilModelBase<Grid, Implementation, WellModel>::
|
void
|
||||||
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
addWellControlEq(const SolutionState& state,
|
addWellControlEq(const SolutionState& state,
|
||||||
const WellState& xw,
|
const WellState& xw,
|
||||||
const V& aliveWells)
|
const V& aliveWells)
|
||||||
@ -1382,9 +1386,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
V
|
V
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
solveJacobianSystem() const
|
solveJacobianSystem() const
|
||||||
{
|
{
|
||||||
return linsolver_.computeNewtonIncrement(residual_);
|
return linsolver_.computeNewtonIncrement(residual_);
|
||||||
@ -1495,9 +1499,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
updateState(const V& dx,
|
updateState(const V& dx,
|
||||||
ReservoirState& reservoir_state,
|
ReservoirState& reservoir_state,
|
||||||
WellState& well_state)
|
WellState& well_state)
|
||||||
@ -1824,9 +1828,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
std::vector<ADB>
|
std::vector<ADB>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
computeRelPerm(const SolutionState& state) const
|
computeRelPerm(const SolutionState& state) const
|
||||||
{
|
{
|
||||||
using namespace Opm::AutoDiffGrid;
|
using namespace Opm::AutoDiffGrid;
|
||||||
@ -1854,9 +1858,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
std::vector<ADB>
|
std::vector<ADB>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
computePressures(const ADB& po,
|
computePressures(const ADB& po,
|
||||||
const ADB& sw,
|
const ADB& sw,
|
||||||
const ADB& so,
|
const ADB& so,
|
||||||
@ -1891,9 +1895,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
V
|
V
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
computeGasPressure(const V& po,
|
computeGasPressure(const V& po,
|
||||||
const V& sw,
|
const V& sw,
|
||||||
const V& so,
|
const V& so,
|
||||||
@ -1909,16 +1913,16 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
computeMassFlux(const int actph ,
|
computeMassFlux(const int actph ,
|
||||||
const V& transi,
|
const V& transi,
|
||||||
const ADB& kr ,
|
const ADB& kr ,
|
||||||
const ADB& mu ,
|
const ADB& mu ,
|
||||||
const ADB& rho ,
|
const ADB& rho ,
|
||||||
const ADB& phasePressure,
|
const ADB& phasePressure,
|
||||||
const SolutionState& state)
|
const SolutionState& state)
|
||||||
{
|
{
|
||||||
// Compute and store mobilities.
|
// Compute and store mobilities.
|
||||||
const ADB tr_mult = transMult(state.pressure);
|
const ADB tr_mult = transMult(state.pressure);
|
||||||
@ -1943,9 +1947,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
applyThresholdPressures(ADB& dp)
|
applyThresholdPressures(ADB& dp)
|
||||||
{
|
{
|
||||||
// We support reversible threshold pressures only.
|
// We support reversible threshold pressures only.
|
||||||
@ -1976,9 +1980,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
std::vector<double>
|
std::vector<double>
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
computeResidualNorms() const
|
computeResidualNorms() const
|
||||||
{
|
{
|
||||||
std::vector<double> residualNorms;
|
std::vector<double> residualNorms;
|
||||||
@ -2017,9 +2021,9 @@ namespace detail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
double
|
double
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
relativeChange(const SimulationDataContainer& previous,
|
relativeChange(const SimulationDataContainer& previous,
|
||||||
const SimulationDataContainer& current ) const
|
const SimulationDataContainer& current ) const
|
||||||
{
|
{
|
||||||
@ -2058,9 +2062,9 @@ namespace detail {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
double
|
double
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
convergenceReduction(const Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>& B,
|
convergenceReduction(const Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>& B,
|
||||||
const Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>& tempV,
|
const Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>& tempV,
|
||||||
const Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>& R,
|
const Eigen::Array<double, Eigen::Dynamic, Eigen::Dynamic>& R,
|
||||||
@ -2145,9 +2149,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
bool
|
bool
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
getConvergence(const double dt, const int iteration)
|
getConvergence(const double dt, const int iteration)
|
||||||
{
|
{
|
||||||
const double tol_mb = param_.tolerance_mb_;
|
const double tol_mb = param_.tolerance_mb_;
|
||||||
@ -2270,9 +2274,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
bool
|
bool
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
getWellConvergence(const int iteration)
|
getWellConvergence(const int iteration)
|
||||||
{
|
{
|
||||||
const double tol_wells = param_.tolerance_wells_;
|
const double tol_wells = param_.tolerance_wells_;
|
||||||
@ -2350,9 +2354,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
ADB
|
ADB
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
fluidViscosity(const int phase,
|
fluidViscosity(const int phase,
|
||||||
const ADB& p ,
|
const ADB& p ,
|
||||||
const ADB& temp ,
|
const ADB& temp ,
|
||||||
@ -2376,9 +2380,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
ADB
|
ADB
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
fluidReciprocFVF(const int phase,
|
fluidReciprocFVF(const int phase,
|
||||||
const ADB& p ,
|
const ADB& p ,
|
||||||
const ADB& temp ,
|
const ADB& temp ,
|
||||||
@ -2402,9 +2406,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
ADB
|
ADB
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
fluidDensity(const int phase,
|
fluidDensity(const int phase,
|
||||||
const ADB& b,
|
const ADB& b,
|
||||||
const ADB& rs,
|
const ADB& rs,
|
||||||
@ -2426,9 +2430,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
V
|
V
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
fluidRsSat(const V& p,
|
fluidRsSat(const V& p,
|
||||||
const V& satOil,
|
const V& satOil,
|
||||||
const std::vector<int>& cells) const
|
const std::vector<int>& cells) const
|
||||||
@ -2440,9 +2444,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
ADB
|
ADB
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
fluidRsSat(const ADB& p,
|
fluidRsSat(const ADB& p,
|
||||||
const ADB& satOil,
|
const ADB& satOil,
|
||||||
const std::vector<int>& cells) const
|
const std::vector<int>& cells) const
|
||||||
@ -2454,9 +2458,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
V
|
V
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
fluidRvSat(const V& p,
|
fluidRvSat(const V& p,
|
||||||
const V& satOil,
|
const V& satOil,
|
||||||
const std::vector<int>& cells) const
|
const std::vector<int>& cells) const
|
||||||
@ -2468,9 +2472,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
ADB
|
ADB
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
fluidRvSat(const ADB& p,
|
fluidRvSat(const ADB& p,
|
||||||
const ADB& satOil,
|
const ADB& satOil,
|
||||||
const std::vector<int>& cells) const
|
const std::vector<int>& cells) const
|
||||||
@ -2482,9 +2486,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
ADB
|
ADB
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
poroMult(const ADB& p) const
|
poroMult(const ADB& p) const
|
||||||
{
|
{
|
||||||
const int n = p.size();
|
const int n = p.size();
|
||||||
@ -2513,9 +2517,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
ADB
|
ADB
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
transMult(const ADB& p) const
|
transMult(const ADB& p) const
|
||||||
{
|
{
|
||||||
const int n = p.size();
|
const int n = p.size();
|
||||||
@ -2544,9 +2548,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
classifyCondition(const ReservoirState& state)
|
classifyCondition(const ReservoirState& state)
|
||||||
{
|
{
|
||||||
using namespace Opm::AutoDiffGrid;
|
using namespace Opm::AutoDiffGrid;
|
||||||
@ -2585,9 +2589,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
updatePrimalVariableFromState(const ReservoirState& state)
|
updatePrimalVariableFromState(const ReservoirState& state)
|
||||||
{
|
{
|
||||||
using namespace Opm::AutoDiffGrid;
|
using namespace Opm::AutoDiffGrid;
|
||||||
@ -2636,9 +2640,9 @@ namespace detail {
|
|||||||
|
|
||||||
|
|
||||||
/// Update the phaseCondition_ member based on the primalVariable_ member.
|
/// Update the phaseCondition_ member based on the primalVariable_ member.
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
updatePhaseCondFromPrimalVariable()
|
updatePhaseCondFromPrimalVariable()
|
||||||
{
|
{
|
||||||
if (! active_[Gas]) {
|
if (! active_[Gas]) {
|
||||||
@ -2677,9 +2681,9 @@ namespace detail {
|
|||||||
|
|
||||||
// TODO: only kept for now due to flow_multisegment
|
// TODO: only kept for now due to flow_multisegment
|
||||||
// will be removed soon
|
// will be removed soon
|
||||||
template <class Grid, class Implementation, class WellModel>
|
template <class Grid, class WellModel, class Implementation>
|
||||||
void
|
void
|
||||||
BlackoilModelBase<Grid, Implementation, WellModel>::
|
BlackoilModelBase<Grid, WellModel, Implementation>::
|
||||||
updateWellState(const V& dwells,
|
updateWellState(const V& dwells,
|
||||||
WellState& well_state)
|
WellState& well_state)
|
||||||
{
|
{
|
||||||
|
@ -36,18 +36,18 @@ namespace Opm {
|
|||||||
/// It uses automatic differentiation via the class AutoDiffBlock
|
/// It uses automatic differentiation via the class AutoDiffBlock
|
||||||
/// to simplify assembly of the jacobian matrix.
|
/// to simplify assembly of the jacobian matrix.
|
||||||
template<class Grid>
|
template<class Grid>
|
||||||
class BlackoilSolventModel : public BlackoilModelBase<Grid, BlackoilSolventModel<Grid>, StandardWellsSolvent>
|
class BlackoilSolventModel : public BlackoilModelBase<Grid, StandardWellsSolvent, BlackoilSolventModel<Grid> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// --------- Types and enums ---------
|
// --------- Types and enums ---------
|
||||||
|
|
||||||
typedef BlackoilModelBase<Grid, BlackoilSolventModel<Grid>, StandardWellsSolvent> Base;
|
typedef BlackoilModelBase<Grid, StandardWellsSolvent, BlackoilSolventModel<Grid> > Base;
|
||||||
typedef typename Base::ReservoirState ReservoirState;
|
typedef typename Base::ReservoirState ReservoirState;
|
||||||
typedef typename Base::WellState WellState;
|
typedef typename Base::WellState WellState;
|
||||||
// The next line requires C++11 support available in g++ 4.7.
|
// The next line requires C++11 support available in g++ 4.7.
|
||||||
// friend Base;
|
// friend Base;
|
||||||
friend class BlackoilModelBase<Grid, BlackoilSolventModel<Grid>, StandardWellsSolvent>;
|
friend class BlackoilModelBase<Grid, StandardWellsSolvent, BlackoilSolventModel<Grid> >;
|
||||||
|
|
||||||
/// Construct the model. It will retain references to the
|
/// Construct the model. It will retain references to the
|
||||||
/// arguments of this functions, and they are expected to
|
/// arguments of this functions, and they are expected to
|
||||||
|
Loading…
Reference in New Issue
Block a user