OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
OCP.hpp
Go to the documentation of this file.
1 
12 #ifndef __OCP_HEADER__
13 #define __OCP_HEADER__
14 
15 // OpenCAEPoro header files
16 #include "OCPControl.hpp"
17 #include "OCPOutput.hpp"
18 #include "ParamRead.hpp"
19 #include "Reservoir.hpp"
20 #include "Solver.hpp"
21 #include "UtilTiming.hpp"
22 
23 #define OCPVersion "0.2.1"
24 
27 {
28 public:
30  void PrintVersion() const
31  {
32  cout << "=========================================" << endl
33  << "OpenCAEPoro Version-" << OCPVersion << endl
34  << "=========================================" << endl
35  << endl;
36  };
37 
39  void PrintUsage(string cmdname) const
40  {
41  cout << "Usage: " << endl
42  << " " << cmdname << " <InputFileName> [<options>]" << endl
43  << endl;
44 
45  cout << "The simplest usage is as follows, where parameters are read from file:"
46  << endl
47  << " " << cmdname
48  << " examples/spe1a/spe1a.data %% Solve SPE1a in default setting" << endl
49  << endl;
50 
51  cout << "You can also pass cmd options after the input file:" << endl
52  << " method: solution method to use " << endl
53  << " dtInit: initial time stepsize " << endl
54  << " dtMax: maximum time stepsize " << endl
55  << " dtMin: minimum time stepsize " << endl
56  << " pl: print level on screen " << endl
57  << endl;
58 
59  cout << "Attention: " << endl
60  << " - These cmd options will override those in the input file;" << endl
61  << " - Only if `method' is set, other options will take effect;" << endl
62  << " - If (dtInit,dtMax,dtMin) are not set, default values will be used."
63  << endl;
64 
65  cout << endl
66  << "For example: solve SPE1a using FIM" << endl
67  << " " << cmdname
68  << " examples/spe1a/spe1a.data method=FIM dtInit=1 dtMax=10 dtMin=0.1 pl=1"
69  << endl;
70  }
71 
73  void InputParam(ParamRead& param);
74 
76  void SetupSimulator(ParamRead& param, const USI& argc, const char* options[]);
77 
79  void InitReservoir();
80 
82  void RunSimulation();
83 
85  void OutputResults() const;
86 
87 private:
89  Reservoir reservoir;
90 
92  Solver solver;
93 
95  OCPControl control;
96 
98  OCPOutput output;
99 };
100 
101 #endif /* end if __OCP_HEADER__ */
102 
103 /*----------------------------------------------------------------------------*/
104 /* Brief Change History of This File */
105 /*----------------------------------------------------------------------------*/
106 /* Author Date Actions */
107 /*----------------------------------------------------------------------------*/
108 /* Shizhe Li Oct/01/2021 Create file */
109 /* Chensong Zhang Oct/15/2021 Format file */
110 /* Chensong Zhang Jan/08/2022 New tag info */
111 /* Chensong Zhang Sep/21/2022 Add PrintUsage */
112 /*----------------------------------------------------------------------------*/
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
OCPControl class declaration.
OCPOutput class declaration.
#define OCPVersion
Software version tag used for git.
Definition: OCP.hpp:23
ParamRead class declaration.
Reservoir class declaration.
Solver class declaration.
Elapsed wall-time and CPU-cycles declaration.
All control parameters except for well controlers.
Definition: OCPControl.hpp:94
The OCPOutput class manages different kinds of ways to output information.
Definition: OCPOutput.hpp:202
Top-level data structure for the OpenCAEPoro simulator.
Definition: OCP.hpp:27
void InputParam(ParamRead &param)
Read input parameters to an internal structure.
Definition: OCP.cpp:15
void SetupSimulator(ParamRead &param, const USI &argc, const char *options[])
Setup reservoir based on an internal structure.
Definition: OCP.cpp:23
void PrintUsage(string cmdname) const
Provide at least InputFileName for the input data.
Definition: OCP.hpp:39
void RunSimulation()
Run dynamic simulation.
Definition: OCP.cpp:63
void OutputResults() const
Output necessary information for post-processing.
Definition: OCP.cpp:94
void InitReservoir()
Initialize or get initial status of reservoir.
Definition: OCP.cpp:49
void PrintVersion() const
Output OpenCAEPoro version information.
Definition: OCP.hpp:30
Pre-processing unit for OpenCAEPoro for reading params from input files.
Definition: ParamRead.hpp:33
Solver class for overall solution methods.
Definition: Solver.hpp:21