opm-simulators
flowexp_comp.hpp
1 /*
2  Copyright 2024, SINTEF Digital
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef FLOWEXP_COMP_HPP
20 #define FLOWEXP_COMP_HPP
21 
22 #include <opm/material/constraintsolvers/PTFlash.hpp>
23 #include <opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp>
24 
27 
30 
32 
33 #include <flowexperimental/comp/EmptyModel.hpp>
34 #include <flowexperimental/comp/wells/CompWellModel.hpp>
35 
36 // // the current code use eclnewtonmethod adding other conditions to proceed_ should do the trick for KA
37 // // adding linearshe sould be chaning the update_ function in the same class with condition that the error is reduced.
38 // the trick is to be able to recalculate the residual from here.
39 // unsure where the timestepping is done from suggestedtime??
40 // suggestTimeStep is taken from newton solver in problem.limitTimestep
41 namespace Opm {
42 
43 template<int numComp, bool EnableWater>
44 int dispatchFlowExpComp(int argc, char** argv);
45 
46 }
47 
48 namespace Opm::Properties {
49 namespace TTag {
50 
51 template<int NumComp, bool EnableWater>
53  using InheritsFrom = std::tuple<FlowBaseProblemComp, FlashModel>;
54 };
55 
56 }
57 
58 template<class TypeTag, int NumComp, bool EnableWater>
59 struct SparseMatrixAdapter<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>>
60 {
61 private:
63  enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
65 
66 public:
67  using type = typename Linear::IstlSparseMatrixAdapter<Block>;
68 };
69 
70 #if 0
71 template<class TypeTag>
72 struct SolidEnergyLaw<TypeTag, TTag::FlowExpCompProblem>
73 {
74 private:
77 
78 public:
79  using EclThermalLawManager = ::Opm::EclThermalLawManager<Scalar, FluidSystem>;
80 
81  using type = typename EclThermalLawManager::SolidEnergyLaw;
82 };
83 
84 // Set the material law for thermal conduction
85 template<class TypeTag>
86 struct ThermalConductionLaw<TypeTag, TTag::FlowExpCompProblem>
87 {
88 private:
91 
92 public:
93  using EclThermalLawManager = ::Opm::EclThermalLawManager<Scalar, FluidSystem>;
94 
95  using type = typename EclThermalLawManager::ThermalConductionLaw;
96 };
97 
98 
99 template <class TypeTag>
100 struct SpatialDiscretizationSplice<TypeTag, TTag::FlowExpCompProblem>
101 {
102  using type = TTag::EcfvDiscretization;
103 };
104 
105 template <class TypeTag>
106 struct LocalLinearizerSplice<TypeTag, TTag::FlowExpCompProblem>
107 {
108  using type = TTag::AutoDiffLocalLinearizer;
109 };
110 #endif
111 
112 // Set the problem property
113 template <class TypeTag, int NumComp, bool EnableWater>
114 struct Problem<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>>
115 {
117 };
118 
119 template<class TypeTag, int NumComp, bool EnableWater>
120 struct AquiferModel<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
121  using type = EmptyModel<TypeTag>;
122 };
123 
124 template<class TypeTag, int NumComp, bool EnableWater>
125 struct WellModel<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
127 };
128 
129 template<class TypeTag, int NumComp, bool EnableWater>
130 struct TracerModel<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
131  using type = EmptyModel<TypeTag>;
132 };
133 
134 
135 template <class TypeTag, int NumComp, bool EnableWater>
136 struct FlashSolver<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
137 private:
141 
142 public:
143  using type = Opm::PTFlash<Scalar, FluidSystem>;
144 };
145 
146 
147 template <class TypeTag, class MyTypeTag>
148 struct NumComp { using type = UndefinedProperty; };
149 
150 // TODO: this is unfortunate, have to check why we need to hard-code it
151 template <class TypeTag, int NumComp_, bool EnableWater_>
152 struct NumComp<TypeTag, TTag::FlowExpCompProblem<NumComp_, EnableWater_>> {
153  static constexpr int value = NumComp_;
154 };
155 
156 template <class TypeTag, class MyTypeTag>
157 struct EnableDummyWater { using type = UndefinedProperty; };
158 
159 template <class TypeTag, int NumComp_, bool EnableWater_>
160 struct EnableDummyWater<TypeTag, TTag::FlowExpCompProblem<NumComp_, EnableWater_>> {
161  static constexpr bool value = EnableWater_;
162 };
163 #if 0
164 struct Temperature { using type = UndefinedProperty; };
165 
166  template <class TypeTag>
167  struct Temperature<TypeTag, TTag::FlowExpCompProblem> {
168  using type = GetPropType<TypeTag, Scalar>;
169  static constexpr type value = 423.25;
170  };
171 #endif
172 
173 template <class TypeTag, int NumComp_, bool EnableWater_>
174 struct FluidSystem<TypeTag, TTag::FlowExpCompProblem<NumComp_, EnableWater_>>
175 {
176 private:
178  static constexpr int num_comp = getPropValue<TypeTag, Properties::NumComp>();
179  static constexpr bool enable_water = getPropValue<TypeTag, Properties::EnableDummyWater>();
180 
181 public:
182  using type = Opm::GenericOilGasWaterFluidSystem<Scalar, num_comp, enable_water>;
183 };
184 template<class TypeTag, int NumComp, bool EnableWater>
185 struct EnableMech<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
186  static constexpr bool value = false;
187 };
188 
189 template<class TypeTag, int NumComp, bool EnableWater>
190 struct EnableDisgasInWater<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
191  static constexpr bool value = false;
192 };
193 
194 template<class TypeTag, int NumComp, bool EnableWater>
195 struct Stencil<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>>
196 {
197 private:
200 
201 public:
203 };
204 
205 template<class TypeTag, int NumComp, bool EnableWater>
206 struct EnableApiTracking<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
207  static constexpr bool value = false;
208 };
209 
210 template<class TypeTag, int NumComp, bool EnableWater>
211 struct EnableSaltPrecipitation<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
212  static constexpr bool value = false;
213 };
214 template<class TypeTag, int NumComp, bool EnableWater>
215 struct EnablePolymerMW<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
216  static constexpr bool value = false;
217 };
218 
219 template<class TypeTag, int NumComp, bool EnableWater>
220 struct EnablePolymer<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
221  static constexpr bool value = false;
222 };
223 
224 template<class TypeTag, int NumComp, bool EnableWater>
225 struct EnableDispersion<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
226  static constexpr bool value = false;
227 };
228 
229 template<class TypeTag, int NumComp, bool EnableWater>
230 struct EnableBrine<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
231  static constexpr bool value = false;
232 };
233 template<class TypeTag, int NumComp, bool EnableWater>
234 struct EnableVapwat<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
235  static constexpr bool value = false;
236 };
237 
238 template<class TypeTag, int NumComp, bool EnableWater>
239 struct EnableSolvent<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
240  static constexpr bool value = false;
241 };
242 template<class TypeTag, int NumComp, bool EnableWater>
243 struct EnableFoam<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
244  static constexpr bool value = false;
245 };
246 template<class TypeTag, int NumComp, bool EnableWater>
247 struct EnableExtbo<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
248  static constexpr bool value = false;
249 };
250 template<class TypeTag, int NumComp, bool EnableWater>
251 struct EnableBioeffects<TypeTag, TTag::FlowExpCompProblem<NumComp, EnableWater>> {
252  static constexpr bool value = false;
253 };
254 
255 // disable thermal flux boundaries by default
256 #if 0
257 template<class TypeTag>
258 struct EnableThermalFluxBoundaries<TypeTag, TTag::FlowExpCompProblem> {
259  static constexpr bool value = false;
260 };
261 #endif
262 
263 } // namespace Opm::Properties
264 
265 #endif
Definition: flow_comp.hpp:174
Definition: FlowBaseProblemProperties.hpp:103
The class describing the stencil of the spatial discretization.
Definition: fvbaseproperties.hh:76
Implements a generic linear solver abstraction.
Definition: blackoilproperties.hh:86
Enable dispersive fluxes?
Definition: multiphasebaseproperties.hh:95
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(...))
Definition: propertysystem.hh:233
Definition: FlowBaseProblemProperties.hpp:68
Enable the ECL-blackoil extension for polymer.
Definition: blackoilproperties.hh:51
A compositional multi-phase model based on flash-calculations
Represents the stencil (finite volume geometry) of a single element in the ECFV discretization.
Definition: ecfvstencil.hh:68
Definition: FlowBaseProblemProperties.hpp:73
Base class for specifying auxiliary equations.
Enable the ECL-blackoil extension for disolution of gas into water.
Definition: blackoilproperties.hh:79
Enable the ECL-blackoil extension for water evaporation.
Definition: blackoilproperties.hh:75
a tag to mark properties as undefined
Definition: propertysystem.hh:38
Definition: matrixblock.hh:228
This problem simulates an input file given in the data format used by the commercial ECLiPSE simulato...
Definition: FlowProblemComp.hpp:59
The class that allows to manipulate sparse matrices.
Definition: linalgproperties.hh:50
Enable the ECL-blackoil extension for salt precipitation.
Definition: blackoilproperties.hh:71
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
Definition: FlowBaseProblemProperties.hpp:94
Enable the ECL-blackoil extension for solvents. ("Second gas")
Definition: blackoilproperties.hh:43
The fluid systems including the information about the phases.
Definition: multiphasebaseproperties.hh:79
Enable the ECL-blackoil extension for foam.
Definition: blackoilproperties.hh:63
Enable the ECL-blackoil extension for extended BO. ("Second gas" - alternative approach) ...
Definition: blackoilproperties.hh:47
Definition: FlowBaseProblemProperties.hpp:98
Enable the ECL-blackoil extension for bioeffects (biofilm/MICP)
Definition: blackoilproperties.hh:83
Property to specify the type of scalar values.
Definition: basicproperties.hh:76
Definition: flowexp_comp.hpp:52
The type of the problem.
Definition: fvbaseproperties.hh:87
Definition: flow_comp.hpp:165
A sparse matrix interface backend for BCRSMatrix from dune-istl.
Definition: istlsparsematrixadapter.hh:42
Definition: EmptyModel.hpp:33
Definition: CompWellModel.hpp:51
Enable the ECL-blackoil extension for salt.
Definition: blackoilproperties.hh:67
The material law for the energy stored in the solid matrix.
Definition: multiphasebaseproperties.hh:63
This problem simulates an input file given in the data format used by the commercial ECLiPSE simulato...
Definition: blackoilmodel.hh:75
The type of the flash constraint solver.
Definition: flashproperties.hh:39
Enable the tracking polymer molecular weight tracking and related functionalities.
Definition: blackoilproperties.hh:55