opm-simulators
Loading...
Searching...
No Matches
TTagFlowProblemTPSA.hpp
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 Copyright 2025 NORCE AS
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 2 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20
21 Consult the COPYING file in the top-level source directory of this
22 module for the precise wording of the license and the list of
23 copyright holders.
24*/
25#ifndef TTAG_FLOW_PROBLEM_TPSA_HPP
26#define TTAG_FLOW_PROBLEM_TPSA_HPP
27
28#include <dune/common/fvector.hh>
29#include <dune/istl/bvector.hh>
30
31#include <opm/material/densead/Evaluation.hpp>
32
33#include <opm/models/discretization/common/tpsalinearizer.hpp>
34#include <opm/models/tpsa/elasticityindices.hpp>
35#include <opm/models/tpsa/elasticitylocalresidualtpsa.hpp>
36#include <opm/models/tpsa/elasticityprimaryvariables.hpp>
37#include <opm/models/tpsa/tpsabaseproperties.hpp>
38#include <opm/models/tpsa/tpsamodel.hpp>
39#include <opm/models/tpsa/tpsanewtonmethod.hpp>
40
41#include <opm/simulators/flow/BlackoilModelTPSA.hpp>
42#include <opm/simulators/flow/FlowProblemTPSA.hpp>
43#include <opm/simulators/linalg/matrixblock.hh>
44#include <opm/simulators/linalg/ISTLSolverTPSA.hpp>
46
47
48namespace Opm::Properties {
49
50namespace TTag {
51
53
54} // Opm::Properties::TTag
55
56// TPSA indices for primary variables and equations
57template<class TypeTag>
58struct IndicesTPSA<TypeTag, TTag::FlowProblemTpsa>
59{
60 using type = ElasticityIndices</*PVOffset=*/0>;
61};
62
63// Number of TPSA equations
64template<class TypeTag>
65struct NumEqTPSA<TypeTag, TTag::FlowProblemTpsa>
66{ static constexpr int value = GetPropType<TypeTag, Properties::IndicesTPSA>::numEq; };
67
68// TPSA linearizer
69template<class TypeTag>
70struct LinearizerTPSA<TypeTag, TTag::FlowProblemTpsa>
71{ using type = TpsaLinearizer<TypeTag>; };
72
73// Set the function evaluation w.r.t. the TPSA primary variables
74template<class TypeTag>
75struct EvaluationTPSA<TypeTag, TTag::FlowProblemTpsa>
76{
77private:
78 static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEqTPSA>();
79
80 using Scalar = GetPropType<TypeTag, Scalar>;
81
82public:
83 using type = DenseAd::Evaluation<Scalar, numEq>;
84};
85
86// TPSA equation vector
87template<class TypeTag>
88struct EqVectorTPSA<TypeTag, TTag::FlowProblemTpsa>
89{
90 using type = Dune::FieldVector<GetPropType<TypeTag, Scalar>,
92};
93
94// Global TPSA equation vector
95template<class TypeTag>
96struct GlobalEqVectorTPSA<TypeTag, TTag::FlowProblemTpsa>
97{ using type = Dune::BlockVector<GetPropType<TypeTag, Properties::EqVectorTPSA>>; };
98
99// TPSA Newton method
100template<class TypeTag>
101struct NewtonMethodTPSA<TypeTag, TTag::FlowProblemTpsa>
102{ using type = TpsaNewtonMethod<TypeTag>; };
103
104// TPSA primary variables
105template<class TypeTag>
106struct PrimaryVariablesTPSA<TypeTag, TTag::FlowProblemTpsa>
108
109// TPSA solution vector
110template<class TypeTag>
111struct SolutionVectorTPSA<TypeTag, TTag::FlowProblemTpsa>
112{ using type = Dune::BlockVector<GetPropType<TypeTag, Properties::PrimaryVariablesTPSA>>; };
113
114// TPSA number of historic solutions to save
115template<class TypeTag>
116struct SolutionHistorySizeTPSA<TypeTag, TTag::FlowProblemTpsa>
117{ static constexpr int value = 2; };
118
119// TPSA model
120template<class TypeTag>
121struct ModelTPSA<TypeTag, TTag::FlowProblemTpsa>
122{ using type = TpsaModel<TypeTag>; };
123
124// TPSA local residual
125template<class TypeTag>
126struct LocalResidualTPSA<TypeTag, TTag::FlowProblemTpsa>
127{ using type = ElasticityLocalResidual<TypeTag>; };
128
129// TPSA sparse matrix adapter for Jacobian
130template<class TypeTag>
131struct SparseMatrixAdapterTPSA<TypeTag, TTag::FlowProblemTpsa>
132{
133private:
134 using Scalar = GetPropType<TypeTag, Scalar>;
137
138public:
139 using type = typename Linear::IstlSparseMatrixAdapter<Block>;
140
141};
142
143// Set linear solver backend
144template<class TypeTag>
145struct LinearSolverBackendTPSA<TypeTag, TTag::FlowProblemTpsa>
146{ using type = ISTLSolverTPSA<TypeTag>; };
147
148} // namespace Opm::Properties
149
150#endif
Calculation of (linear) elasticity model terms for the residual.
Definition elasticitylocalresidualtpsa.hpp:68
Primary variables in (linear) elasticity equations.
Definition elasticityprimaryvariables.hpp:54
Class for setting up ISTL linear solvers for TPSA.
Definition ISTLSolverTPSA.hpp:68
A sparse matrix interface backend for BCRSMatrix from dune-istl.
Definition istlsparsematrixadapter.hh:43
Definition matrixblock.hh:229
Linearizes TPSA equations and generates system matrix and residual for linear solver.
Definition tpsalinearizer.hpp:53
TPSA geomechanics model.
Definition tpsamodel.hpp:51
Newton method solving for generic TPSA model.
Definition tpsanewtonmethod.hpp:58
A sparse matrix interface backend for BCRSMatrix from dune-istl.
The generic type tag for problems using the immiscible multi-phase model.
Definition blackoilmodel.hh:82
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
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
Definition elasticityindices.hpp:33
Definition tpsabaseproperties.hpp:46
Definition tpsabaseproperties.hpp:43
Definition tpsabaseproperties.hpp:49
Definition tpsabaseproperties.hpp:34
Definition tpsabaseproperties.hpp:73
Definition tpsabaseproperties.hpp:40
Definition tpsabaseproperties.hpp:64
Definition tpsabaseproperties.hpp:61
Definition tpsabaseproperties.hpp:70
Definition tpsabaseproperties.hpp:37
Definition tpsabaseproperties.hpp:52
Definition tpsabaseproperties.hpp:58
Definition tpsabaseproperties.hpp:55
Definition tpsabaseproperties.hpp:67
Definition TTagFlowProblemTPSA.hpp:52