OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
ThermalSolver.cpp
Go to the documentation of this file.
1 
12 // OpenCAEPoro header files
13 #include "ThermalSolver.hpp"
14 
15 void ThermalSolver::SetupMethod(Reservoir& rs, const OCPControl& ctrl)
16 {
17  fim.Setup(rs, LSolver, ctrl);
18 }
19 
20 void ThermalSolver::InitReservoir(Reservoir& rs) const { fim.InitReservoir(rs); }
21 
22 void ThermalSolver::Prepare(Reservoir& rs, const OCPControl& ctrl)
23 {
24  fim.Prepare(rs, ctrl);
25 }
26 
27 void ThermalSolver::AssembleMat(const Reservoir& rs, OCPControl& ctrl)
28 {
29  const OCP_DBL dt = ctrl.GetCurDt();
30 
31  GetWallTime timer;
32  timer.Start();
33 
34  fim.AssembleMat(LSolver, rs, ctrl.GetCurTime() + dt, dt);
35 
36  ctrl.RecordTimeAssembleMat(timer.Stop() / 1000);
37 }
38 
40 {
41  fim.SolveLinearSystem(LSolver, rs, ctrl);
42 }
43 
46 {
47  return fim.UpdateProperty(rs, ctrl);
48 }
49 
52 {
53  return fim.FinishNR(rs, ctrl);
54 }
55 
58 {
59  fim.FinishStep(rs, ctrl);
60 }
61 
62 /*----------------------------------------------------------------------------*/
63 /* Brief Change History of This File */
64 /*----------------------------------------------------------------------------*/
65 /* Author Date Actions */
66 /*----------------------------------------------------------------------------*/
67 /* Shizhe Li Nov/10/2022 Create file */
68 /*----------------------------------------------------------------------------*/
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
ThermalSolver class declaration.
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
All control parameters except for well controllers.
Definition: OCPControl.hpp:94
OCP_DBL GetCurDt() const
Return current time step size.
Definition: OCPControl.hpp:133
void RecordTimeAssembleMat(const OCP_DBL &t)
Record time used for assemble matrix.
Definition: OCPControl.hpp:166
OCP_DBL GetCurTime() const
Return the current time.
Definition: OCPControl.hpp:130
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.