41 TSolver.SetupMethod(rs, ctrl);
52 TSolver.InitReservoir(rs);
65 output.PrintInfoSched(rs, ctrl, timer.
Stop());
67 for (
USI d = 0; d < numTSteps - 1; d++) {
72 output.SetVal(rs, ctrl);
73 if (ctrl.printLevel >= PRINT_ALL) {
78 output.PrintInfoSched(rs, ctrl, timer.
Stop());
89 if (ctrl.printLevel >= PRINT_SOME) {
90 cout <<
"### DEBUG: " << setprecision(3) << fixed << ctrl.
GetCurTime()
93 <<
", Last dt: " << ctrl.last_dt <<
" Days" << endl;
98 GoOneStepIsoT(rs, ctrl);
101 GoOneStepT(rs, ctrl);
104 OCP_ABORT(
"Wrong model type specified!");
117 OCP_ABORT(
"Time stepsize is too small!");
125 if (IsoTSolver.
FinishNR(rs, ctrl))
break;
135 TSolver.Prepare(rs, ctrl);
140 OCP_ABORT(
"Time stepsize is too small!");
142 TSolver.AssembleMat(rs, ctrl);
149 if (TSolver.
FinishNR(rs, ctrl))
break;
unsigned int USI
Generic unsigned integer.
const OCP_DBL MIN_TIME_CURSTEP
Minimal time stepsize of current step ???
Solver class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
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 SolveLinearSystem(Reservoir &rs, OCPControl &ctrl)
Solve the linear system in single problem.
void InitReservoir(Reservoir &rs) const
Initialize the Reservoir and prepare variables for some method.
OCP_BOOL UpdateProperty(Reservoir &rs, OCPControl &ctrl)
Update properties of fluid.
void SetupMethod(Reservoir &rs, const OCPControl &ctrl)
Setup the fluid solver.
void FinishStep(Reservoir &rs, OCPControl &ctrl)
Finish the current time step.
void Prepare(Reservoir &rs, OCPControl &ctrl)
Prepare for assembling Mat.
void AssembleMat(const Reservoir &rs, OCPControl &ctrl)
Assemble Mat.
OCP_BOOL FinishNR(Reservoir &rs, OCPControl &ctrl)
Finish the Newton-Raphson iteration.
All control parameters except for well controllers.
USI GetNumTSteps() const
Return number of TSTEPs.
void ApplyControl(const USI &i, const Reservoir &rs)
Apply control for time step i.
void RecordTotalTime(const OCP_DBL &t)
Record the total time of simulation.
OCP_BOOL IsCriticalTime(const USI &d)
Determine whether the critical time point has been reached.
OCP_DBL GetCurDt() const
Return current time step size.
USI GetLSiterT() const
Return the total number of linear iterations.
void ResetIterNRLS()
Reset the number of iterations.
OCP_DBL GetCurTime() const
Return the current time.
USI GetNRiterT() const
Return the total number of Newton iterations.
USI GetModel() const
Get model.
The OCPOutput class manages different kinds of ways to output information.
void SetupT()
Setup static information for reservoir with input params for Thermal model.
void ApplyControl(const USI &i)
Apply the control of ith critical time point.
void SetupIsoT()
Setup static information for reservoir with input params for Isothermal model.
void Setup(Reservoir &rs, const OCPControl &ctrl)
Setup Solver.
void RunSimulation(Reservoir &rs, OCPControl &ctrl, OCPOutput &output)
Start simulation.
void InitReservoir(Reservoir &rs) const
Initialize the reservoir.
void SolveLinearSystem(Reservoir &rs, OCPControl &ctrl)
Solve the linear system in single problem.
OCP_BOOL FinishNR(Reservoir &rs, OCPControl &ctrl)
Finish the Newton-Raphson iteration.
void FinishStep(Reservoir &rs, OCPControl &ctrl)
Finish the current time step.
OCP_BOOL UpdateProperty(Reservoir &rs, OCPControl &ctrl)
Update properties of fluid.