20 #ifndef OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_IMPL_HEADER_INCLUDED
21 #define OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_IMPL_HEADER_INCLUDED
25 template <
class Gr
idT>
32 const RockCompressibility* rock_comp_props,
34 const double* gravity,
35 const bool has_disgas,
36 const bool has_vapoil,
37 std::shared_ptr<EclipseState> eclipse_state,
39 Opm::DeckConstPtr& deck,
40 const std::vector<double>& threshold_pressures_by_face,
41 const bool has_solvent)
53 threshold_pressures_by_face)
54 , has_solvent_(has_solvent)
56 , solvent_props_(solvent_props)
58 if(deck->hasKeyword(
"MISCIBLE")) {
59 std::cerr <<
"MISICIBLE keyword is present. Mixing is not currently supported" << std::endl;
63 template <
class Gr
idT>
66 -> std::unique_ptr<Solver>
68 typedef typename Traits::Model
Model;
71 auto model = std::unique_ptr<Model>(
new Model(BaseType::model_param_,
75 BaseType::rock_comp_props_,
79 BaseType::eclipse_state_,
80 BaseType::has_disgas_,
81 BaseType::has_vapoil_,
82 BaseType::terminal_output_,
85 if (!BaseType::threshold_pressures_by_face_.empty()) {
89 return std::unique_ptr<Solver>(
new Solver(BaseType::solver_param_, std::move(model)));
92 template <
class Gr
idT>
100 const int nw = wells->number_of_wells;
101 std::vector<double> perfcells_fraction(wells->well_connpos[nw], 0.0);
103 if (deck_->hasKeyword(
"WSOLVENT")) {
105 size_t currentStep = timer.currentStepNum();
106 ScheduleConstPtr schedule = BaseType::eclipse_state_->getSchedule();
107 Opm::DeckKeywordConstPtr keyword = deck_->getKeyword(
"WSOLVENT");
108 const int num_keywords = keyword->size();
110 for (
int recordNr = 0; recordNr < num_keywords; ++recordNr) {
111 DeckRecordConstPtr record = keyword->getRecord(recordNr);
112 const std::string& wellNamesPattern = record->getItem(
"WELL")->getTrimmedString(0);
113 std::vector<WellPtr> wells_solvent = schedule->getWells(wellNamesPattern);
114 for (
auto wellIter = wells_solvent.begin(); wellIter != wells_solvent.end(); ++wellIter) {
115 WellPtr well_solvent = *wellIter;
116 WellInjectionProperties injection = well_solvent->getInjectionProperties(currentStep);
117 if (injection.injectorType == WellInjector::GAS) {
118 double solventFraction = well_solvent->getSolventFraction(currentStep);
121 for (; wix < nw; ++wix) {
122 if (wellNamesPattern == wells->name[wix]) {
126 if (wix == wells->number_of_wells) {
127 OPM_THROW(std::runtime_error,
"Could not find a match for well "
129 <<
" from WSOLVENT.");
131 for (
int j = wells->well_connpos[wix]; j < wells->well_connpos[wix+1]; ++j) {
132 perfcells_fraction[j] = solventFraction;
135 OPM_THROW(std::logic_error,
"For solvent injector you must have a gas injector");
140 well_state.solventFraction() = perfcells_fraction;
145 #endif // OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_IMPL_HEADER_INCLUDED
Definition: GeoProps.hpp:53
Definition: BlackoilPropsAdInterface.hpp:38
Definition: AdditionalObjectDeleter.hpp:22
void handleAdditionalWellInflow(SimulatorTimer &timer, WellsManager &wells_manager, typename BaseType::WellState &well_state, const Wells *wells)
Definition: SimulatorFullyImplicitBlackoilSolvent_impl.hpp:94
void setThresholdPressures(const std::vector< double > &threshold_pressures_by_face)
Set threshold pressures that prevent or reduce flow. This prevents flow across faces if the potential...
Definition: BlackoilModelBase_impl.hpp:317
Class collecting all necessary components for a two-phase simulation.
Definition: SimulatorBase.hpp:84
Definition: BlackoilSolventModel.hpp:38
std::unique_ptr< Solver > createSolver(const Wells *wells)
Definition: SimulatorFullyImplicitBlackoilSolvent_impl.hpp:65
Interface class for (linear) solvers for the fully implicit black-oil system.
Definition: NewtonIterationBlackoilInterface.hpp:31
SimulatorFullyImplicitBlackoilSolvent(const parameter::ParameterGroup ¶m, const GridT &grid, const DerivedGeology &geo, BlackoilPropsAdInterface &props, const SolventPropsAdFromDeck &solvent_props, const RockCompressibility *rock_comp_props, NewtonIterationBlackoilInterface &linsolver, const double *gravity, const bool disgas, const bool vapoil, std::shared_ptr< EclipseState > eclipse_state, BlackoilOutputWriter &output_writer, Opm::DeckConstPtr &deck, const std::vector< double > &threshold_pressures_by_face, const bool solvent)
Definition: SimulatorFullyImplicitBlackoilSolvent_impl.hpp:27
Definition: SolventPropsAdFromDeck.hpp:38
Wrapper class for VTK, Matlab, and ECL output.
Definition: SimulatorFullyImplicitBlackoilOutput.hpp:195
Traits::WellState WellState
Definition: SimulatorBase.hpp:90