20 #ifndef OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_IMPL_HEADER_INCLUDED 21 #define OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_IMPL_HEADER_INCLUDED 25 template <
class Gr
idT>
26 SimulatorFullyImplicitBlackoilSolvent<GridT>::
27 SimulatorFullyImplicitBlackoilSolvent(
const ParameterGroup& param,
30 BlackoilPropsAdFromDeck& props,
31 const SolventPropsAdFromDeck& solvent_props,
32 const RockCompressibility* rock_comp_props,
33 NewtonIterationBlackoilInterface& linsolver,
34 const double* gravity,
35 const bool has_disgas,
36 const bool has_vapoil,
37 std::shared_ptr<EclipseState> eclipse_state,
38 BlackoilOutputWriter& output_writer,
39 std::shared_ptr< Deck > deck,
40 const std::vector<double>& threshold_pressures_by_face,
41 const bool has_solvent)
53 threshold_pressures_by_face,
55 std::unordered_set<
std::string>())
56 , has_solvent_(has_solvent)
58 , solvent_props_(solvent_props)
61 if(deck->hasKeyword(
"MISCIBLE")) {
66 template <
class Gr
idT>
67 auto SimulatorFullyImplicitBlackoilSolvent<GridT>::
68 createSolver(
const WellModel& well_model)
69 -> std::unique_ptr<Solver>
71 typedef typename Traits::Model Model;
74 auto model = std::unique_ptr<Model>(
new Model(BaseType::model_param_,
78 BaseType::rock_comp_props_,
82 BaseType::eclipse_state_,
83 BaseType::has_disgas_,
84 BaseType::has_vapoil_,
85 BaseType::terminal_output_,
89 if (!BaseType::threshold_pressures_by_face_.empty()) {
90 model->setThresholdPressures(BaseType::threshold_pressures_by_face_);
93 return std::unique_ptr<Solver>(
new Solver(BaseType::solver_param_, std::move(model)));
96 template <
class Gr
idT>
97 void SimulatorFullyImplicitBlackoilSolvent<GridT>::
98 handleAdditionalWellInflow(SimulatorTimer& timer,
100 typename BaseType::WellState& well_state,
104 const int nw = wells->number_of_wells;
105 std::vector<double> perfcells_fraction(wells->well_connpos[nw], 0.0);
107 size_t currentStep = timer.currentStepNum();
108 const auto& schedule = BaseType::eclipse_state_->getSchedule();
110 for (
const auto& well_solvent : schedule.getWells( currentStep )) {
111 if (well_solvent->getStatus( currentStep ) == WellCommon::SHUT) {
115 WellInjectionProperties injection = well_solvent->getInjectionProperties(currentStep);
116 if (injection.injectorType == WellInjector::GAS) {
118 double solventFraction = well_solvent->getSolventFraction(currentStep);
122 for (; wix < nw; ++wix) {
123 if (well_solvent->name() == wells->name[wix]) {
127 if (wix == wells->number_of_wells) {
128 OPM_THROW(std::runtime_error,
"Could not find a match for well " 129 << well_solvent->name()
130 <<
" from WSOLVENT.");
132 for (
int j = wells->well_connpos[wix]; j < wells->well_connpos[wix+1]; ++j) {
133 perfcells_fraction[j] = solventFraction;
137 well_state.solventFraction() = perfcells_fraction;
142 #endif // OPM_SIMULATORFULLYIMPLICITBLACKOILSOLVENT_IMPL_HEADER_INCLUDED Definition: AutoDiff.hpp:297
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: AdditionalObjectDeleter.hpp:22