OpenCAEPoro  v0.5.0
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.5.0"
24 
27 {
28 public:
30  void PrintVersion() const
31  {
32  cout << "=========================================" << endl
33  << "OpenCAEPoro Version-" << OCPVersion << endl
34  << "=========================================" << endl;
35  };
36 
38  void PrintUsage(string cmdname) const
39  {
40  cout << "Usage: " << endl
41  << " " << cmdname << " <InputFileName> [<options>]" << endl
42  << endl;
43 
44  cout << "A simple example is to solve SPE1 Case A in default setting" << endl
45  << " " << cmdname << " examples/spe1a/spe1a.data" << endl;
46 
47  cout << endl
48  << "Another example is to solve the same problem using FIM" << endl
49  << " " << cmdname
50  << " examples/spe1a/spe1a.data method=FIM dtInit=1 dtMax=10 dtMin=0.1"
51  << endl
52  << endl;
53 
54  cout << "You can pass optional cmd arguments after the input file:" << endl
55  << " method = solution method to use " << endl
56  << " dtInit = initial time stepsize " << endl
57  << " dtMax = maximum time stepsize " << endl
58  << " dtMin = minimum time stepsize " << endl
59  << " verbose = print level on screen " << endl
60  << endl;
61 
62  cout << "Attention: " << endl
63  << " - Only if `method' is set, other options will take effect;" << endl
64  << " - These cmd options will override those in the input file;" << endl
65  << " - If (dtInit,dtMax,dtMin) are not set, default values will be used."
66  << endl
67  << endl;
68  }
69 
71  void ReadInputFile(const string& filename);
72 
74  void InputParam(ParamRead& param);
75 
77  void SetupSimulator(const USI& argc, const char* options[]);
78 
80  void InitReservoir();
81 
83  void RunSimulation();
84 
86  void OutputResults() const;
87 
88 private:
90  Reservoir reservoir;
91 
93  Solver solver;
94 
96  OCPControl control;
97 
99  OCPOutput output;
100 };
101 
102 #endif /* end if __OCP_HEADER__ */
103 
104 /*----------------------------------------------------------------------------*/
105 /* Brief Change History of This File */
106 /*----------------------------------------------------------------------------*/
107 /* Author Date Actions */
108 /*----------------------------------------------------------------------------*/
109 /* Shizhe Li Oct/01/2021 Create file */
110 /* Chensong Zhang Oct/15/2021 Format file */
111 /* Chensong Zhang Jan/08/2022 New tag info */
112 /* Chensong Zhang Sep/21/2022 Add PrintUsage */
113 /*----------------------------------------------------------------------------*/
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
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 controllers.
Definition: OCPControl.hpp:94
The OCPOutput class manages different kinds of ways to output information.
Definition: OCPOutput.hpp:436
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:24
void PrintUsage(string cmdname) const
Provide at least InputFileName for the input data.
Definition: OCP.hpp:38
void RunSimulation()
Run dynamic simulation.
Definition: OCP.cpp:87
void OutputResults() const
Output necessary information for post-processing.
Definition: OCP.cpp:118
void InitReservoir()
Initialize or get initial status of reservoir.
Definition: OCP.cpp:69
void SetupSimulator(const USI &argc, const char *options[])
Setup reservoir based on an internal structure.
Definition: OCP.cpp:32
void PrintVersion() const
Output OpenCAEPoro version information.
Definition: OCP.hpp:30
void ReadInputFile(const string &filename)
Read Param from an input file.
Definition: OCP.cpp:15
Pre-processing unit for OpenCAEPoro for reading params from input files.
Definition: ParamRead.hpp:33
Solver class for overall solution methods.
Definition: Solver.hpp:22