20 #ifndef OPM_BLACKOILSOLVENTMODEL_HEADER_INCLUDED 21 #define OPM_BLACKOILSOLVENTMODEL_HEADER_INCLUDED 23 #include <opm/autodiff/BlackoilModelBase.hpp> 24 #include <opm/autodiff/BlackoilModelParameters.hpp> 25 #include <opm/autodiff/WellStateFullyImplicitBlackoilSolvent.hpp> 26 #include <opm/autodiff/SolventPropsAdFromDeck.hpp> 27 #include <opm/autodiff/StandardWellsSolvent.hpp> 45 typedef typename Base::ReservoirState ReservoirState;
46 typedef typename Base::WellState WellState;
71 const RockCompressibility* rock_comp_props,
75 std::shared_ptr< const EclipseState > eclState,
76 const bool has_disgas,
77 const bool has_vapoil,
78 const bool terminal_output,
79 const bool has_solvent,
80 const bool is_miscible);
87 ReservoirState& reservoir_state,
88 WellState& well_state);
93 std::vector<std::vector<double> >
94 computeFluidInPlace(
const ReservoirState& x,
95 const std::vector<int>& fipnum);
101 typedef typename Base::SolutionState SolutionState;
102 typedef typename Base::DataBlock DataBlock;
103 enum { Solvent = CanonicalVariablePositions::Next };
106 const bool has_solvent_;
107 const int solvent_pos_;
109 const bool is_miscible_;
110 std::vector<ADB> mu_eff_;
111 std::vector<ADB> b_eff_;
117 using Base::rock_comp_props_;
118 using Base::linsolver_;
123 using Base::has_disgas_;
124 using Base::has_vapoil_;
126 using Base::use_threshold_pressure_;
127 using Base::threshold_pressures_by_connection_;
129 using Base::phaseCondition_;
130 using Base::residual_;
138 using Base::variableState;
139 using Base::computeGasPressure;
140 using Base::applyThresholdPressures;
141 using Base::fluidRsSat;
142 using Base::fluidRvSat;
143 using Base::poroMult;
144 using Base::transMult;
147 using Base::dpMaxRel;
149 using Base::drMaxRel;
150 using Base::maxResidualAllowed;
157 computeRelPerm(
const SolutionState& state)
const;
160 fluidViscosity(
const int phase,
165 const std::vector<PhasePresence>& cond)
const;
168 fluidReciprocFVF(
const int phase,
173 const std::vector<PhasePresence>& cond)
const;
176 fluidDensity(
const int phase,
179 const ADB& rv)
const;
182 makeConstantState(SolutionState& state)
const;
185 variableStateInitials(
const ReservoirState& x,
186 const WellState& xw)
const;
189 variableStateIndices()
const;
192 variableStateExtractVars(
const ReservoirState& x,
193 const std::vector<int>& indices,
194 std::vector<ADB>& vars)
const;
197 computeAccum(
const SolutionState& state,
201 assembleMassBalanceEq(
const SolutionState& state);
204 addWellContributionToMassBalanceEq(
const std::vector<ADB>& cq_s,
205 const SolutionState& state,
208 void updateEquationsScaling();
211 computeMassFlux(
const int actph ,
217 const SolutionState& state );
219 const std::vector<PhasePresence>
220 phaseCondition()
const {
return this->phaseCondition_;}
223 void computeEffectiveProperties(
const SolutionState& state);
226 void computeToddLongstaffMixing(std::vector<ADB>& viscosity, std::vector<ADB>& density,
const std::vector<ADB>& saturations,
const ADB po,
const Opm::PhaseUsage pu);
230 computePressures(
const ADB& po,
234 const ADB& ss)
const;
248 ADB solvent_saturation;
254 template <
class Gr
id>
257 typedef BlackoilState ReservoirState;
265 #include "BlackoilSolventModel_impl.hpp" 267 #endif // OPM_BLACKOILSOLVENTMODEL_HEADER_INCLUDED static AutoDiffBlock null()
Construct an empty AutoDiffBlock.
Definition: AutoDiffBlock.hpp:104
Definition: WellStateFullyImplicitBlackoilSolvent.hpp:28
BlackoilSolventModel(const typename Base::ModelParameters ¶m, const Grid &grid, const BlackoilPropsAdFromDeck &fluid, const DerivedGeology &geo, const RockCompressibility *rock_comp_props, const SolventPropsAdFromDeck &solvent_props, const StandardWellsSolvent &well_model, const NewtonIterationBlackoilInterface &linsolver, std::shared_ptr< const EclipseState > eclState, const bool has_disgas, const bool has_vapoil, const bool terminal_output, const bool has_solvent, const bool is_miscible)
Construct the model.
Definition: BlackoilSolventModel_impl.hpp:73
Class for handling the standard well model for solvent model.
Definition: StandardWellsSolvent.hpp:32
Need to include concentration in our state variables, otherwise all is as the default blackoil model...
Definition: BlackoilSolventModel.hpp:241
A model implementation for three-phase black oil.
Definition: BlackoilModelBase.hpp:76
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: AdditionalObjectDeleter.hpp:22
Solver parameters for the BlackoilModel.
Definition: BlackoilModelParameters.hpp:31
void updateState(const V &dx, ReservoirState &reservoir_state, WellState &well_state)
Apply an update to the primary variables, chopped if appropriate.
Definition: BlackoilSolventModel_impl.hpp:389
void updatePrimalVariableFromState(const ReservoirState &state)
update the primal variable for Sg, Rv or Rs.
Definition: BlackoilModelBase_impl.hpp:2193
Traits to encapsulate the types used by classes using or extending this model.
Definition: BlackoilModelBase.hpp:60
StandardWellsSolvent & wellModel()
return the WellModel object
Definition: BlackoilModelBase.hpp:268
bool terminal_output_
Whether we print something to std::cout.
Definition: BlackoilModelBase.hpp:353
const Wells & wells() const
return the Well struct in the WellModel
Definition: BlackoilModelBase.hpp:383
Struct for containing iteration variables.
Definition: DefaultBlackoilSolutionState.hpp:29
Class containing static geological properties that are derived from grid and petrophysical properties...
Definition: GeoProps.hpp:59
Interface class for (linear) solvers for the fully implicit black-oil system.
Definition: NewtonIterationBlackoilInterface.hpp:31
This class implements the AD-adapted fluid interface for three-phase black-oil.
Definition: BlackoilPropsAdFromDeck.hpp:61
Definition: SolventPropsAdFromDeck.hpp:37
void updatePhaseCondFromPrimalVariable(const ReservoirState &state)
Update the phaseCondition_ member based on the primalVariable_ member.
Definition: BlackoilModelBase_impl.hpp:2206
A model implementation for three-phase black oil with one extra component.
Definition: BlackoilSolventModel.hpp:38