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

IsothermalSolver class for fluid solution method. More...

#include <IsothermalSolver.hpp>

Public Member Functions

void SetupMethod (Reservoir &rs, const OCPControl &ctrl)
 Setup the fluid solver. More...
 
void InitReservoir (Reservoir &rs) const
 Initialize the Reservoir and prepare variables for some method. More...
 
void Prepare (Reservoir &rs, OCP_DBL &dt)
 Prepare for assembling Mat. More...
 
void AssembleMat (const Reservoir &rs, const OCP_DBL &dt)
 Assemble Mat. More...
 
void SolveLinearSystem (Reservoir &rs, OCPControl &ctrl)
 Solve the linear system in single problem. More...
 
bool UpdateProperty (Reservoir &rs, OCPControl &ctrl)
 Update properties of fluid. More...
 
bool FinishNR (Reservoir &rs, OCPControl &ctrl)
 Finish the Newton-Raphson iteration. More...
 
void FinishStep (Reservoir &rs, OCPControl &ctrl)
 Finish the current time step. More...
 

Detailed Description

IsothermalSolver class for fluid solution method.

Definition at line 19 of file IsothermalSolver.hpp.

Member Function Documentation

◆ AssembleMat()

void IsothermalSolver::AssembleMat ( const Reservoir rs,
const OCP_DBL dt 
)

Assemble Mat.

Assemble linear systems for IMPEC and FIM.

Definition at line 96 of file IsothermalSolver.cpp.

97 {
98  switch (method)
99  {
100  case IMPEC:
101  case AIMt:
102  rs.AssembleMatIMPEC(LSolver, dt);
103  break;
104  case FIMn:
105  fim_n.AssembleMat(LSolver, rs, dt);
106  break;
107  case FIM:
108  fim.AssembleMat(LSolver, rs, dt);
109  break;
110  case AIMc:
111  aimc.AssembleMat(LSolver, rs, dt);
112  break;
113  case AIMs:
114  aims.AssembleMat(LSolver, rs, dt);
115  break;
116  default:
117  OCP_ABORT("Wrong method type!");
118  }
119 }
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
void AssembleMat(LinearSystem &myLS, const Reservoir &rs, const OCP_DBL &dt) const
Assemble Matrix.
void AssembleMat(LinearSystem &myLS, const Reservoir &rs, const OCP_DBL &dt)
Assemble Matrix.
void AssembleMat(LinearSystem &myLS, const Reservoir &rs, const OCP_DBL &dt) const
Assemble Matrix.
void AssembleMat(LinearSystem &myLS, const Reservoir &rs, const OCP_DBL &dt) const
Assemble Matrix.
void AssembleMatIMPEC(LinearSystem &myLS, const OCP_DBL &dt) const
Assemble Matrix for IMPEC.
Definition: Reservoir.cpp:232

References AIMc, AIMs, AIMt, OCP_AIMs::AssembleMat(), OCP_FIM::AssembleMat(), OCP_FIMn::AssembleMat(), OCP_AIMc::AssembleMat(), Reservoir::AssembleMatIMPEC(), FIM, FIMn, IMPEC, and OCP_ABORT.

◆ FinishNR()

bool IsothermalSolver::FinishNR ( Reservoir rs,
OCPControl ctrl 
)

Finish the Newton-Raphson iteration.

Finish up Newton-Raphson iteration for IMPEC and FIM.

Definition at line 170 of file IsothermalSolver.cpp.

171 {
172  switch (method) {
173  case IMPEC:
174  case AIMt:
175  return impec.FinishNR(rs);
176  // return impec.FinishNR01(rs, ctrl);
177  case AIMs:
178  return aims.FinishNR(rs, ctrl);
179  case FIMn:
180  return fim_n.FinishNR(rs, ctrl);
181  case FIM:
182  return fim.FinishNR(rs, ctrl);
183  case AIMc:
184  return aimc.FinishNR(rs, ctrl);
185  default:
186  OCP_ABORT("Wrong method type!");
187  }
188 }
bool FinishNR(Reservoir &rs, OCPControl &ctrl)
Finish a Newton-Raphson iteration.
bool FinishNR(Reservoir &rs, OCPControl &ctrl)
Finish a Newton-Raphson iteration.
bool FinishNR(Reservoir &rs, OCPControl &ctrl)
Finish a Newton-Raphson iteration.
bool FinishNR(const Reservoir &rs)
Determine if NR iteration finishes.

References AIMc, AIMs, AIMt, FIM, FIMn, OCP_IMPEC::FinishNR(), OCP_FIM::FinishNR(), OCP_AIMc::FinishNR(), OCP_AIMs::FinishNR(), IMPEC, and OCP_ABORT.

◆ FinishStep()

void IsothermalSolver::FinishStep ( Reservoir rs,
OCPControl ctrl 
)

Finish the current time step.

Finish up time step for IMPEC and FIM.

Definition at line 191 of file IsothermalSolver.cpp.

192 {
193  switch (method)
194  {
195  case IMPEC:
196  case AIMt:
197  return impec.FinishStep(rs, ctrl);
198  case FIMn:
199  return fim_n.FinishStep(rs, ctrl);
200  case FIM:
201  case AIMc:
202  return fim.FinishStep(rs, ctrl);
203  case AIMs:
204  return aims.FinishStep(rs, ctrl);
205  default:
206  OCP_ABORT("Wrong method type!");
207  }
208 }
void FinishStep(Reservoir &rs, OCPControl &ctrl)
Finish a time step.
void FinishStep(Reservoir &rs, OCPControl &ctrl) const
Finish a time step.

References AIMc, AIMs, AIMt, FIM, FIMn, OCP_AIMs::FinishStep(), OCP_FIM::FinishStep(), IMPEC, and OCP_ABORT.

◆ InitReservoir()

void IsothermalSolver::InitReservoir ( Reservoir rs) const

Initialize the Reservoir and prepare variables for some method.

Setup solution methods, including IMPEC and FIM.

Definition at line 44 of file IsothermalSolver.cpp.

45 {
46  switch (method)
47  {
48  case IMPEC:
49  case AIMt:
50  case AIMs:
51  impec.InitReservoir(rs);
52  break;
53  case FIM:
54  fim.InitReservoir(rs);
55  break;
56  case FIMn:
57  fim_n.InitReservoir(rs);
58  break;
59  case AIMc:
60  aimc.InitReservoir(rs);
61  break;
62  default:
63  OCP_ABORT("Wrong method type!");
64  }
65 }
void InitReservoir(Reservoir &rs) const
Init.
void InitReservoir(Reservoir &rs) const
Init.
void InitReservoir(Reservoir &rs) const
Init.
void InitReservoir(Reservoir &rs) const
Init.

References AIMc, AIMs, AIMt, FIM, FIMn, IMPEC, OCP_IMPEC::InitReservoir(), OCP_FIM::InitReservoir(), OCP_FIMn::InitReservoir(), OCP_AIMc::InitReservoir(), and OCP_ABORT.

◆ Prepare()

void IsothermalSolver::Prepare ( Reservoir rs,
OCP_DBL dt 
)

Prepare for assembling Mat.

Prepare solution methods, including IMPEC and FIM.

Definition at line 68 of file IsothermalSolver.cpp.

69 {
70  switch (method)
71  {
72  case IMPEC:
73  impec.Prepare(rs, dt);
74  break;
75  case FIMn:
76  fim_n.Prepare(rs, dt);
77  break;
78  case FIM:
79  fim.Prepare(rs, dt);
80  break;
81  case AIMc:
82  aimc.Prepare(rs, dt);
83  break;
84  case AIMs:
85  aims.Prepare(rs, dt);
86  break;
87  case AIMt:
88  aimt.Prepare(rs, dt);
89  break;
90  default:
91  OCP_ABORT("Wrong method type!");
92  }
93 }
void Prepare(Reservoir &rs, OCP_DBL &dt)
Prepare for Assembling matrix.
void Prepare(Reservoir &rs, OCP_DBL &dt)
Prepare for Assembling matrix.
void Prepare(Reservoir &rs, OCP_DBL &dt)
Prepare for Assembling matrix.
void Prepare(Reservoir &rs, OCP_DBL &dt)
Prepare for Assembling matrix.
void Prepare(Reservoir &rs, OCP_DBL &dt)
Prepare for Assembling matrix.

References AIMc, AIMs, AIMt, FIM, FIMn, IMPEC, OCP_ABORT, OCP_IMPEC::Prepare(), OCP_FIM::Prepare(), OCP_AIMc::Prepare(), OCP_AIMs::Prepare(), and OCP_AIMt::Prepare().

◆ SetupMethod()

void IsothermalSolver::SetupMethod ( Reservoir rs,
const OCPControl ctrl 
)

Setup the fluid solver.

Setup solution methods, including IMPEC and FIM.

Definition at line 15 of file IsothermalSolver.cpp.

16 {
17  method = ctrl.GetMethod();
18 
19  switch (method)
20  {
21  case AIMt:
22  aimt.Setup(rs, LSolver, auxLSolver, ctrl);
23  break;
24  case AIMs:
25  aims.Setup(rs, LSolver, ctrl);
26  break;
27  case IMPEC:
28  impec.Setup(rs, LSolver, ctrl);
29  break;
30  case AIMc:
31  aimc.Setup(rs, LSolver, ctrl);
32  break;
33  case FIMn:
34  fim_n.Setup(rs, LSolver, ctrl);
35  break;
36  case FIM:
37  default:
38  fim.Setup(rs, LSolver, ctrl);
39  break;
40  }
41 }
USI GetMethod() const
Return type of the solution method.
Definition: OCPControl.hpp:124
void Setup(Reservoir &rs, LinearSystem &myLS, const OCPControl &ctrl)
Setup AIMc.
void Setup(Reservoir &rs, LinearSystem &myLS, const OCPControl &ctrl)
Setup AIMs.
void Setup(Reservoir &rs, LinearSystem &myLS, LinearSystem &myAuxLS, const OCPControl &ctrl)
Setup AIMt.
void Setup(Reservoir &rs, LinearSystem &myLS, const OCPControl &ctrl)
Setup FIM.
void Setup(Reservoir &rs, LinearSystem &myLS, const OCPControl &ctrl)
Setup IMPEC.

References AIMc, AIMs, AIMt, FIM, FIMn, OCPControl::GetMethod(), IMPEC, OCP_IMPEC::Setup(), OCP_FIM::Setup(), OCP_AIMc::Setup(), OCP_AIMs::Setup(), and OCP_AIMt::Setup().

◆ SolveLinearSystem()

void IsothermalSolver::SolveLinearSystem ( Reservoir rs,
OCPControl ctrl 
)

Solve the linear system in single problem.

Solve linear systems for IMPEC and FIM.

Definition at line 122 of file IsothermalSolver.cpp.

123 {
124  switch (method)
125  {
126  case IMPEC:
127  case AIMt:
128  impec.SolveLinearSystem(LSolver, rs, ctrl);
129  break;
130  case FIMn:
131  fim_n.SolveLinearSystem(LSolver, rs, ctrl);
132  break;
133  case FIM:
134  fim.SolveLinearSystem(LSolver, rs, ctrl);
135  break;
136  case AIMc:
137  aimc.SolveLinearSystem(LSolver, rs, ctrl);
138  break;
139  case AIMs:
140  aims.SolveLinearSystem(LSolver, rs, ctrl);
141  break;
142  default:
143  OCP_ABORT("Wrong method type!");
144  }
145 }
void SolveLinearSystem(LinearSystem &myLS, Reservoir &rs, OCPControl &ctrl)
Solve the linear system.
void SolveLinearSystem(LinearSystem &myLS, Reservoir &rs, OCPControl &ctrl)
Solve the linear system.
void SolveLinearSystem(LinearSystem &myLS, Reservoir &rs, OCPControl &ctrl) const
Solve the linear system.
void SolveLinearSystem(LinearSystem &myLS, Reservoir &rs, OCPControl &ctrl) const
Solve the linear system.
void SolveLinearSystem(LinearSystem &myLS, Reservoir &rs, OCPControl &ctrl)
Solve the linear system.

References AIMc, AIMs, AIMt, FIM, FIMn, IMPEC, OCP_ABORT, OCP_IMPEC::SolveLinearSystem(), OCP_AIMc::SolveLinearSystem(), OCP_AIMs::SolveLinearSystem(), OCP_FIM::SolveLinearSystem(), and OCP_FIMn::SolveLinearSystem().

◆ UpdateProperty()

bool IsothermalSolver::UpdateProperty ( Reservoir rs,
OCPControl ctrl 
)

Update properties of fluid.

Update physical properties for IMPEC and FIM.

Definition at line 148 of file IsothermalSolver.cpp.

149 {
150  switch (method) {
151  case IMPEC:
152  return impec.UpdateProperty(rs, ctrl);
153  // return impec.UpdateProperty01(rs, ctrl);
154  case FIMn:
155  return fim_n.UpdateProperty(rs, ctrl);
156  case FIM:
157  return fim.UpdateProperty(rs, ctrl);
158  case AIMc:
159  return aimc.UpdateProperty(rs, ctrl);
160  case AIMs:
161  return aims.UpdateProperty(rs, ctrl);
162  case AIMt:
163  return aimt.UpdateProperty(rs, ctrl, auxLSolver);
164  default:
165  OCP_ABORT("Wrong method type!");
166  }
167 }
bool UpdateProperty(Reservoir &rs, OCPControl &ctrl)
Update properties of fluids.
bool UpdateProperty(Reservoir &rs, OCPControl &ctrl)
Update properties of fluids.
bool UpdateProperty(Reservoir &rs, OCPControl &ctrl, LinearSystem &myAuxLS)
Update properties of fluids.
bool UpdateProperty(Reservoir &rs, OCPControl &ctrl)
Update properties of fluids.
bool UpdateProperty(Reservoir &rs, OCPControl &ctrl)
Update properties of fluids.
bool UpdateProperty(Reservoir &rs, OCPControl &ctrl)
Update properties of fluids.

References AIMc, AIMs, AIMt, FIM, FIMn, IMPEC, OCP_ABORT, OCP_IMPEC::UpdateProperty(), OCP_FIM::UpdateProperty(), OCP_FIMn::UpdateProperty(), OCP_AIMc::UpdateProperty(), OCP_AIMs::UpdateProperty(), and OCP_AIMt::UpdateProperty().


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