Top-level data structure for the OpenCAEPoro simulator.
More...
#include <OCP.hpp>
Top-level data structure for the OpenCAEPoro simulator.
Definition at line 26 of file OCP.hpp.
◆ InitReservoir()
void OpenCAEPoro::InitReservoir |
( |
| ) |
|
Initialize or get initial status of reservoir.
Initialize the reservoir class.
Definition at line 69 of file OCP.cpp.
76 double finalTime = timer.
Stop() / 1000;
77 if (control.printLevel >= PRINT_MIN) {
79 <<
"Initialization done. Wall time : " << fixed << setprecision(3)
80 << finalTime <<
" Sec" << endl;
83 control.initTime = finalTime;
Get elapsed wall-time in millisecond.
__inline__ double Stop() const
Stop the timer and return duration from start() in ms.
__inline__ void Start()
Start the timer.
void RecordTotalTime(const OCP_DBL &t)
Record the total time of simulation.
void InitReservoir(Reservoir &rs) const
Initialize the reservoir.
References Solver::InitReservoir(), OCPControl::RecordTotalTime(), GetWallTime::Start(), and GetWallTime::Stop().
◆ InputParam()
void OpenCAEPoro::InputParam |
( |
ParamRead & |
param | ) |
|
◆ OutputResults()
void OpenCAEPoro::OutputResults |
( |
| ) |
const |
Output necessary information for post-processing.
Print summary information on screen and SUMMARY.out file.
Definition at line 118 of file OCP.cpp.
122 MAX(log10(control.current_time), log10(MAX(control.totalSimTime, 1.0))) + 6;
124 cout <<
"==================================================" << endl;
127 cout <<
"Final time: " << right << fixed << setprecision(3)
128 << setw(fixWidth) << control.current_time <<
" (Days)" << endl;
129 cout <<
" - Avg time step size ......." << setw(fixWidth)
130 << control.current_time / control.numTstep <<
" (" << control.numTstep
131 <<
" steps)" << endl;
132 cout <<
" - Avg Newton steps ........." << setw(fixWidth)
133 <<
static_cast<double>(control.iterNR_total) / control.numTstep <<
" ("
134 << control.iterNR_total <<
" succeeded + " << control.wastedIterNR
135 <<
" wasted)" << endl;
136 cout <<
" - Avg linear steps ........." << setw(fixWidth)
137 <<
static_cast<double>(control.iterLS_total) / control.iterNR_total <<
" ("
138 << control.iterLS_total <<
" succeeded + " << control.wastedIterLS
139 <<
" wasted)" << endl;
142 cout <<
"Simulation time: " << setw(fixWidth) << control.totalSimTime
143 <<
" (Seconds)" << endl;
144 cout <<
" - % Initialization ........." << setw(fixWidth)
145 << 100.0 * control.initTime / control.totalSimTime <<
" (" << control.initTime
147 cout <<
" - % Assembling ............." << setw(fixWidth)
148 << 100.0 * control.totalAssembleMatTime / control.totalSimTime <<
" ("
149 << control.totalAssembleMatTime <<
"s)" << endl;
150 cout <<
" - % Linear solver .........." << setw(fixWidth)
151 << 100.0 * control.totalLStime / control.totalSimTime <<
" ("
152 << control.totalLStime <<
"s)" << endl;
153 cout <<
" - % Updating properties ...." << setw(fixWidth)
154 << 100.0 * control.totalUpdatePropertyTime / control.totalSimTime <<
" ("
155 << control.totalUpdatePropertyTime <<
"s)" << endl;
156 cout <<
" - % Scheduled output ......." << setw(fixWidth)
157 << 100.0 * output.outputTime / control.totalSimTime <<
" ("
158 << output.outputTime <<
"s)" << endl;
160 cout <<
"==================================================" << endl;
◆ ReadInputFile()
void OpenCAEPoro::ReadInputFile |
( |
const string & |
filename | ) |
|
Read Param from an input file.
Read Param from input file.
Definition at line 15 of file OCP.cpp.
void InputParam(ParamRead ¶m)
Read input parameters to an internal structure.
Pre-processing unit for OpenCAEPoro for reading params from input files.
void ReadInputFile(const string &file)
General interface for reading input data.
References InputParam(), and ParamRead::ReadInputFile().
◆ RunSimulation()
void OpenCAEPoro::RunSimulation |
( |
| ) |
|
Run dynamic simulation.
Call IMPEC, FIM, AIM, etc for dynamic simulation.
Definition at line 87 of file OCP.cpp.
91 if (control.printLevel >= PRINT_MIN) {
92 cout <<
"\nDynamic simulation with IMPEC\n" << endl;
96 if (control.printLevel >= PRINT_MIN) {
97 cout <<
"\nDynamic simulation with FIM\n" << endl;
101 if (control.printLevel >= PRINT_MIN) {
102 cout <<
"\nDynamic simulation with FIMn\n" << endl;
106 if (control.printLevel >= PRINT_MIN) {
107 cout <<
"\nDynamic simulation with AIMc\n" << endl;
const USI FIMn
Solution method = FIM.
const USI FIM
Solution method = FIM.
const USI AIMc
Adaptive implicit -— Collins.
const USI IMPEC
Solution method = IMPEC.
#define OCP_ABORT(msg)
Abort if critical error happens.
USI GetMethod() const
Return type of the solution method.
void RunSimulation(Reservoir &rs, OCPControl &ctrl, OCPOutput &output)
Start simulation.
References AIMc, FIM, FIMn, OCPControl::GetMethod(), IMPEC, OCP_ABORT, and Solver::RunSimulation().
◆ SetupSimulator()
void OpenCAEPoro::SetupSimulator |
( |
const USI & |
argc, |
|
|
const char * |
options[] |
|
) |
| |
Setup reservoir based on an internal structure.
Call setup procedures for reservoir, output, and linear solver.
Definition at line 32 of file OCP.cpp.
41 if (control.printLevel >= PRINT_MIN) {
42 cout << endl <<
"Dynamic simulation for isothermal models" << endl;
46 if (control.printLevel >= PRINT_MIN) {
47 cout << endl <<
"Dynamic simulation for thermal models" << endl;
54 solver.
Setup(reservoir, control);
56 output.Setup(reservoir, control);
58 double finalTime = timer.
Stop() / 1000;
59 if (control.printLevel >= PRINT_MIN) {
61 <<
"Setup simulation done. Wall time : " << fixed << setprecision(3)
62 << finalTime <<
" Sec" << endl;
void SetupFastControl(const USI &argc, const char *optset[])
Setup fast Control.
USI GetModel() const
Get model.
void Setup(Reservoir &rs, const OCPControl &ctrl)
Setup Solver.
References OCPControl::GetModel(), OCPControl::SetupFastControl(), and GetWallTime::Start().
The documentation for this class was generated from the following files: