20 #ifndef OPM_FLUIDMATRIXINTERACTIONBLACKOIL_HEADER_INCLUDED
21 #define OPM_FLUIDMATRIXINTERACTIONBLACKOIL_HEADER_INCLUDED
23 #include <opm/core/utility/UniformTableLinear.hpp>
24 #include <opm/core/utility/buildUniformMonotoneTable.hpp>
25 #include <opm/parser/eclipse/Deck/Deck.hpp>
26 #include <opm/parser/eclipse/Parser/ParseMode.hpp>
27 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
36 template <
class ScalarT,
class ParamsT>
39 template <
class ScalarT>
44 void init(Opm::DeckConstPtr deck)
47 EclipseState eclipseState(deck , parseMode);
49 const auto& tables = eclipseState.getTableManager();
50 const auto& swofTable = tables->getSwofTables().getTable<SwofTable>(0);
51 const auto& sgofTable = tables->getSgofTables().getTable<SgofTable>(0);
53 const std::vector<double>& sw = swofTable.getSwColumn();
54 const std::vector<double>& krw = swofTable.getKrwColumn();
55 const std::vector<double>& krow = swofTable.getKrowColumn();
56 const std::vector<double>& pcow = swofTable.getPcowColumn();
57 const std::vector<double>& sg = sgofTable.getSgColumn();
58 const std::vector<double>& krg = sgofTable.getKrgColumn();
59 const std::vector<double>& krog = sgofTable.getKrogColumn();
60 const std::vector<double>& pcog = sgofTable.getPcogColumn();
64 buildUniformMonotoneTable(sw, krw, samples, krw_);
65 buildUniformMonotoneTable(sw, krow, samples, krow_);
66 buildUniformMonotoneTable(sg, krg, samples, krg_);
67 buildUniformMonotoneTable(sg, krog, samples, krog_);
71 buildUniformMonotoneTable(sw, pcow, samples, pcow_);
72 buildUniformMonotoneTable(sg, pcog, samples, pcog_);
76 template <
class S,
class P>
79 Opm::utils::UniformTableLinear<Scalar> krw_;
80 Opm::utils::UniformTableLinear<Scalar> krow_;
81 Opm::utils::UniformTableLinear<Scalar> pcow_;
82 Opm::utils::UniformTableLinear<Scalar> krg_;
83 Opm::utils::UniformTableLinear<Scalar> krog_;
84 Opm::utils::UniformTableLinear<Scalar> pcog_;
94 template <
class ScalarT,
class ParamsT = Flu
idMatrixInteractionBlackoilParams<ScalarT> >
99 typedef typename Params::Scalar
Scalar;
111 template <
class pcContainerT,
class SatContainerT>
112 static void pC(pcContainerT &pc,
113 const Params ¶ms,
114 const SatContainerT &saturations,
117 Scalar sw = saturations[
Aqua];
118 Scalar sg = saturations[
Vapour];
120 pc[
Aqua] = params.pcow_(sw);
121 pc[
Vapour] = params.pcog_(sg);
135 template <
class SatContainerT,
class pcContainerT>
136 static void S(SatContainerT &saturations,
137 const Params ¶ms,
138 const pcContainerT &pc,
141 std::cerr <<
"FluidMatrixInteractionBlackoil::S() is not implemented yet\n";
142 throw std::logic_error(
"Not implemented");
149 template <
class krContainerT,
class SatContainerT>
150 static void kr(krContainerT &
kr,
151 const Params ¶ms,
152 const SatContainerT &saturations,
156 Scalar sw = saturations[
Aqua];
157 Scalar sg = saturations[
Vapour];
158 Scalar krw = params.krw_(sw);
159 Scalar krg = params.krg_(sg);
160 Scalar krow = params.krow_(sw);
161 Scalar krog = params.krog_(sg);
162 Scalar krocw = params.krocw_;
165 kr[
Liquid] = krocw*((krow/krocw + krw)*(krog/krocw + krg) - krw - krg);
175 template <
class krContainerT,
class SatContainerT>
177 const Params ¶ms,
178 const SatContainerT &saturations,
187 Scalar sw = saturations[
Aqua];
188 Scalar sg = saturations[
Vapour];
189 Scalar krw = params.krw_(sw);
190 Scalar dkrww = params.krw_.derivative(sw);
191 Scalar krg = params.krg_(sg);
192 Scalar dkrgg = params.krg_.derivative(sg);
193 Scalar krow = params.krow_(sw);
194 Scalar dkrow = params.krow_.derivative(sw);
195 Scalar krog = params.krog_(sg);
196 Scalar dkrog = params.krog_.derivative(sg);
197 Scalar krocw = params.krocw_;
200 dkr[
Liquid][
Aqua] = krocw*((dkrow/krocw + dkrww)*(krog/krocw + krg) - dkrww);
201 dkr[
Liquid][
Vapour] = krocw*((krow/krocw + krw)*(dkrog/krocw + dkrgg) - dkrgg);
210 #endif // OPM_FLUIDMATRIXINTERACTIONBLACKOIL_HEADER_INCLUDED
Definition: BlackoilFluid.hpp:31
Capillary pressures and relative permeabilities for a black oil system.
Definition: FluidMatrixInteractionBlackoil.hpp:37
void init(Opm::DeckConstPtr deck)
Definition: FluidMatrixInteractionBlackoil.hpp:44
Definition: BlackoilDefs.hpp:34
Definition: FluidMatrixInteractionBlackoil.hpp:40
static void pC(pcContainerT &pc, const Params ¶ms, const SatContainerT &saturations, Scalar)
The linear capillary pressure-saturation curve.
Definition: FluidMatrixInteractionBlackoil.hpp:112
static void kr(krContainerT &kr, const Params ¶ms, const SatContainerT &saturations, Scalar)
The relative permeability of all phases.
Definition: FluidMatrixInteractionBlackoil.hpp:150
Definition: BlackoilDefs.hpp:37
Definition: BlackoilDefs.hpp:30
static void dkr(krContainerT &dkr, const Params ¶ms, const SatContainerT &saturations, Scalar)
The saturation derivatives of relative permeability of all phases.
Definition: FluidMatrixInteractionBlackoil.hpp:176
Definition: BlackoilDefs.hpp:37
ScalarT Scalar
Definition: FluidMatrixInteractionBlackoil.hpp:43
static void S(SatContainerT &saturations, const Params ¶ms, const pcContainerT &pc, Scalar)
The saturation-capillary pressure curve.
Definition: FluidMatrixInteractionBlackoil.hpp:136
Params::Scalar Scalar
Definition: FluidMatrixInteractionBlackoil.hpp:99
Definition: BlackoilDefs.hpp:37
ParamsT Params
Definition: FluidMatrixInteractionBlackoil.hpp:98