GenericTemperatureModel.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
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 2 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 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef OPM_GENERIC_TEMPERATURE_MODEL_HPP
29#define OPM_GENERIC_TEMPERATURE_MODEL_HPP
30
31#include <dune/istl/bcrsmatrix.hh>
32
33#include <opm/grid/common/CartesianIndexMapper.hpp>
34
35#include <opm/input/eclipse/EclipseState/Phase.hpp>
36
38
40
41#include <cstddef>
42#include <memory>
43#include <vector>
44
45namespace Opm {
46
47class EclipseState;
48class Well;
49
50template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
52{
53public:
54 // the jacobian matrix
56 using EnergyMatrix = Dune::BCRSMatrix<MatrixBlockTemp>;
57 using EnergyVector = Dune::BlockVector<Dune::FieldVector<Scalar, 1>>;
59 static constexpr int dimWorld = Grid::dimensionworld;
60
61 bool doTemp()
62 {
63 return doTemp_;
64 }
65
66 const Scalar temperature(size_t globalIdx) const
67 {
68 return temperature_[globalIdx];
69 }
70
71protected:
72 GenericTemperatureModel(const GridView& gridView,
73 const EclipseState& eclState,
74 const CartesianIndexMapper& cartMapper,
75 const DofMapper& dofMapper);
76
80 void doInit(std::size_t numGridDof);
81
83
84 const GridView& gridView_;
85 const EclipseState& eclState_;
87 const DofMapper& dofMapper_;
88
90 std::vector<Scalar> temperature_;
91 std::vector<Scalar> energy_rates_;
92 bool doTemp_{false};
93 Scalar maxTempChange_{5.0};
94};
95
96} // namespace Opm
97
98#endif // OPM_GENERIC_TEMPERATURE_MODEL_HPP
Definition: CollectDataOnIORank.hpp:49
Definition: GenericTemperatureModel.hpp:52
GenericTemperatureModel(const GridView &gridView, const EclipseState &eclState, const CartesianIndexMapper &cartMapper, const DofMapper &dofMapper)
Definition: GenericTemperatureModel_impl.hpp:102
EnergyVector energyVector_
Definition: GenericTemperatureModel.hpp:89
const DofMapper & dofMapper_
Definition: GenericTemperatureModel.hpp:87
std::vector< Scalar > energy_rates_
Definition: GenericTemperatureModel.hpp:91
const CartesianIndexMapper & cartMapper_
Definition: GenericTemperatureModel.hpp:86
bool doTemp_
Definition: GenericTemperatureModel.hpp:92
Dune::BCRSMatrix< MatrixBlockTemp > EnergyMatrix
Definition: GenericTemperatureModel.hpp:56
bool linearSolve_(const EnergyMatrix &M, EnergyVector &x, EnergyVector &b)
Definition: GenericTemperatureModel_impl.hpp:129
Dune::BlockVector< Dune::FieldVector< Scalar, 1 > > EnergyVector
Definition: GenericTemperatureModel.hpp:57
bool doTemp()
Definition: GenericTemperatureModel.hpp:61
static constexpr int dimWorld
Definition: GenericTemperatureModel.hpp:59
Dune::CartesianIndexMapper< Grid > CartesianIndexMapper
Definition: GenericTemperatureModel.hpp:58
void doInit(std::size_t numGridDof)
Initialize all internal data structures needed by the temperature module.
Definition: GenericTemperatureModel_impl.hpp:115
Scalar maxTempChange_
Definition: GenericTemperatureModel.hpp:93
const Scalar temperature(size_t globalIdx) const
Definition: GenericTemperatureModel.hpp:66
std::vector< Scalar > temperature_
Definition: GenericTemperatureModel.hpp:90
const GridView & gridView_
Definition: GenericTemperatureModel.hpp:84
const EclipseState & eclState_
Definition: GenericTemperatureModel.hpp:85
Definition: matrixblock.hh:229
Definition: blackoilbioeffectsmodules.hh:43