OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
Public Member Functions | List of all members
OpenCAEPoro Class Reference

Top-level data structure for the OpenCAEPoro simulator. More...

#include <OCP.hpp>

Public Member Functions

void PrintVersion () const
 Output OpenCAEPoro version information.
 
void PrintUsage (string cmdname) const
 Provide at least InputFileName for the input data.
 
void InputParam (ParamRead &param)
 Read input parameters to an internal structure. More...
 
void SetupSimulator (ParamRead &param, const USI &argc, const char *options[])
 Setup reservoir based on an internal structure. More...
 
void InitReservoir ()
 Initialize or get initial status of reservoir. More...
 
void RunSimulation ()
 Run dynamic simulation. More...
 
void OutputResults () const
 Output necessary information for post-processing. More...
 

Detailed Description

Top-level data structure for the OpenCAEPoro simulator.

Definition at line 26 of file OCP.hpp.

Member Function Documentation

◆ InitReservoir()

void OpenCAEPoro::InitReservoir ( )

Initialize or get initial status of reservoir.

Initialize the reservoir class.

Definition at line 49 of file OCP.cpp.

50 {
51  GetWallTime timer;
52  timer.Start();
53 
54  solver.InitReservoir(reservoir);
55 
56  cout << endl
57  << "Initialization done. Wall time : " << fixed << setprecision(3)
58  << timer.Stop() / 1000 << " Sec" << endl;
59  control.RecordTotalTime(timer.Stop() / 1000);
60 }
Get elapsed wall-time in millisecond.
Definition: UtilTiming.hpp:32
__inline__ double Stop() const
Stop the timer and return duration from start() in ms.
Definition: UtilTiming.hpp:54
__inline__ void Start()
Start the timer.
Definition: UtilTiming.hpp:51
void RecordTotalTime(const OCP_DBL &t)
Record the total time of simulation.
Definition: OCPControl.hpp:166
void InitReservoir(Reservoir &rs) const
Initialize the reservoir.
Definition: Solver.cpp:18

References Solver::InitReservoir(), OCPControl::RecordTotalTime(), GetWallTime::Start(), and GetWallTime::Stop().

◆ InputParam()

void OpenCAEPoro::InputParam ( ParamRead param)

Read input parameters to an internal structure.

Read from input file and set control and output params.

Definition at line 15 of file OCP.cpp.

16 {
17  reservoir.InputParam(param);
18  control.InputParam(param.paramControl);
19  output.InputParam(param.paramOutput);
20 }
void InputParam(const ParamControl &CtrlParam)
Input parameters for control.
Definition: OCPControl.cpp:149
ParamOutput paramOutput
Read the output params.
Definition: ParamRead.hpp:45
ParamControl paramControl
Read the control params.
Definition: ParamRead.hpp:44
void InputParam(ParamRead &param)
Definition: Reservoir.cpp:18

References OCPControl::InputParam(), Reservoir::InputParam(), ParamRead::paramControl, and ParamRead::paramOutput.

◆ OutputResults()

void OpenCAEPoro::OutputResults ( ) const

Output necessary information for post-processing.

Print summary information on screen and SUMMARY.out file.

Definition at line 94 of file OCP.cpp.

95 {
96  cout << "=========================================" << endl;
97  cout << "Final time: " << control.current_time << " Days" << endl;
98  cout << "Total time steps: " << control.numTstep << endl;
99  cout << "Total Newton steps: " << control.iterNR_total << " (+"
100  << control.wastedIterNR << " wasted steps)" << endl;
101  cout << "Total linear steps: " << control.iterLS_total << " (+"
102  << control.wastedIterLS << " wasted steps)" << endl;
103  cout << "Linear solve time: " << control.totalLStime << "s"
104  << " (" << 100.0 * control.totalLStime / control.totalSimTime << "%)" << endl;
105  cout << "Simulation time: " << control.totalSimTime << "s" << endl;
106  output.PrintInfo();
107 }

◆ RunSimulation()

void OpenCAEPoro::RunSimulation ( )

Run dynamic simulation.

Call IMPEC, FIM, etc for dynamic simulation.

Definition at line 63 of file OCP.cpp.

64 {
65  cout << "\n=========================================" << endl;
66  switch (control.GetMethod()) {
67  case IMPEC:
68  cout << "Dynamic simulation with IMPEC";
69  break;
70  case FIM:
71  cout << "Dynamic simulation with FIM";
72  break;
73  case FIMn:
74  cout << "Dynamic simulation with FIMn";
75  break;
76  case AIMc:
77  cout << "Dynamic simulation with AIMc";
78  break;
79  case AIMs:
80  cout << "Dynamic simulation with AIMs";
81  break;
82  case AIMt:
83  cout << "Dynamic simulation with AIMt";
84  break;
85  default:
86  OCP_ABORT("Wrong method type is used!");
87  }
88  cout << "\n=========================================" << endl;
89 
90  solver.RunSimulation(reservoir, control, output);
91 }
const USI AIMs
Adaptive implicit.
Definition: OCPConst.hpp:72
const USI AIMt
improved version of IMPEC, loacl FIM after IMPEC
Definition: OCPConst.hpp:73
const USI FIMn
Solution method = FIM.
Definition: OCPConst.hpp:75
const USI FIM
Solution method = FIM.
Definition: OCPConst.hpp:71
const USI AIMc
Adaptive implicit -— Collins.
Definition: OCPConst.hpp:74
const USI IMPEC
Solution method = IMPEC.
Definition: OCPConst.hpp:70
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
USI GetMethod() const
Return type of the solution method.
Definition: OCPControl.hpp:124
void RunSimulation(Reservoir &rs, OCPControl &ctrl, OCPOutput &output)
Start simulation.
Definition: Solver.cpp:25

References AIMc, AIMs, AIMt, FIM, FIMn, OCPControl::GetMethod(), IMPEC, OCP_ABORT, and Solver::RunSimulation().

◆ SetupSimulator()

void OpenCAEPoro::SetupSimulator ( ParamRead param,
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 23 of file OCP.cpp.

26 {
27  GetWallTime timer;
28  timer.Start();
29 
30  // Read parameters from input file
31  InputParam(param);
32  // Read Fast control
33  control.SetupFastControl(argc, options);
34  // Setup static infomation for reservoir
35  reservoir.Setup();
36  // Setup output for dynamic simulation
37  output.Setup(reservoir, control);
38  // Setup static information for solver
39  solver.Setup(reservoir, control);
40 
41  cout << endl
42  << "Setup simulation done. Wall time : " << fixed << setprecision(3)
43  << timer.Stop() / 1000 << " Sec" << endl
44  << endl;
45  control.RecordTotalTime(timer.Stop() / 1000);
46 }
void SetupFastControl(const USI &argc, const char *optset[])
Setup fast Control.
Definition: OCPControl.cpp:217
void InputParam(ParamRead &param)
Read input parameters to an internal structure.
Definition: OCP.cpp:15
void Setup()
Setup static information for reservoir with input params.
Definition: Reservoir.cpp:28
void Setup(Reservoir &rs, const OCPControl &ctrl)
Setup Solver.
Definition: Solver.cpp:15

References InputParam(), OCPControl::RecordTotalTime(), Reservoir::Setup(), Solver::Setup(), OCPControl::SetupFastControl(), GetWallTime::Start(), and GetWallTime::Stop().


The documentation for this class was generated from the following files: