opm-simulators
Loading...
Searching...
No Matches
tpsanewtonmethodparams.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 TPSA_NEWTON_METHOD_PARAMS_HPP
26#define TPSA_NEWTON_METHOD_PARAMS_HPP
27
28
29namespace Opm::Parameters {
30
31// The maximum error which may occur in a simulation before the Newton method for the time step is aborted
32template<class Scalar>
33struct TpsaNewtonMaxError { static constexpr Scalar value = 1e100; };
34
35// Number of maximum iterations for the Newton method
36struct TpsaNewtonMaxIterations { static constexpr int value = 20; };
37
38// Number of minimum iterations for the Newton method
39struct TpsaNewtonMinIterations { static constexpr int value = 1; };
40
41// Target number of iterations
42struct TpsaNewtonTargetIterations { static constexpr int value = 10; };
43
44// Convergence tolerance
45template<class Scalar>
46struct TpsaNewtonTolerance { static constexpr Scalar value = 1e-3; };
47
48// Specifies verbosity of print messages
49struct TpsaNewtonVerbosity { static constexpr int value = 1; };
50
51} // namespace Opm::Parameters
52
53namespace Opm {
54
58template<class Scalar>
60{
61 static void registerParameters();
62 void read();
63
64 int verbosity_;
65 bool writeConvergence_;
66 int targetIterations_;
67 int minIterations_;
68 int maxIterations_;
69 Scalar tolerance_;
70 Scalar maxError_;
71}; // struct TpsaNewtonMethodParams
72
73} // namespace Opm
74
75#endif
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
Definition tpsanewtonmethodparams.hpp:33
Definition tpsanewtonmethodparams.hpp:36
Definition tpsanewtonmethodparams.hpp:39
Definition tpsanewtonmethodparams.hpp:42
Definition tpsanewtonmethodparams.hpp:46
Definition tpsanewtonmethodparams.hpp:49
Struct holding the parameters for TpsaNewtonMethod.
Definition tpsanewtonmethodparams.hpp:60
void read()
Read and internalize runtime parameters for TPSA Newton method.
Definition tpsanewtonmethodparams.cpp:59
static void registerParameters()
Register runtime parameters for TPSA Newton method.
Definition tpsanewtonmethodparams.cpp:39