-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: feature/byer3/thermal well #3156
Changes from all commits
3c5801c
de5b3da
993296d
7bd1201
825d27d
c94eed6
701bce6
6858b81
8fd8f40
384e29e
064cc07
aee32bc
6323c13
34a2a01
828b009
8b10201
25e3503
aa800e3
c9138c5
5d95d0f
b4983b0
d297111
0ec258e
a489169
420855d
32ae6b9
bea94d5
887192d
b9b6676
99efdea
2b8ca8d
86ed597
4de08c1
7c8fb31
0e2b420
11e6056
dfaa419
f508369
bce0bf9
a1b70ac
b3ed475
e4edc21
352ca5d
574a18e
25fae7f
371eb04
9c7a462
b5b3413
2e1bb1e
dc1faee
561710e
fbf9898
e6db741
109e43f
8963ffa
25d8e2b
eee00a3
11d1d80
c51952f
47eada8
3a70471
d7c6759
5b66e34
127d4cf
0f46cdc
4da9ef7
b711a87
17cc023
720901c
fdeea3a
4cf2106
35cf15b
f1f633b
e659c7c
3162266
988ae2b
dcb533b
7e3619c
72f8895
32d1d28
12e9314
aa71f2a
f5ef324
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
/* | ||
* ------------------------------------------------------------------------------------------------------------ | ||
* SPDX-License-Identifier: LGPL-2.1-only | ||
* | ||
* Copyright (c) 2018-2020 Lawrence Livermore National Security LLC | ||
* Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University | ||
* Copyright (c) 2018-2020 TotalEnergies | ||
* Copyright (c) 2019- GEOSX Contributors | ||
* All rights reserved | ||
* | ||
* See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details. | ||
* ------------------------------------------------------------------------------------------------------------ | ||
*/ | ||
|
||
/** | ||
* @file ThermalCompositionalMultiphaseFVM.hpp | ||
*/ | ||
|
||
#ifndef GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRTHERMALCOMPOSITIONALMULTIPHASERESERVOIRFVM_HPP_ | ||
#define GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRTHERMALCOMPOSITIONALMULTIPHASERESERVOIRFVM_HPP_ | ||
|
||
#include "linearAlgebra/interfaces/hypre/HypreMGR.hpp" | ||
|
||
namespace geos | ||
{ | ||
|
||
namespace hypre | ||
{ | ||
|
||
namespace mgr | ||
{ | ||
|
||
/** | ||
* @brief ThermalCompositionalMultiphaseReservoirFVM strategy. | ||
* | ||
* Labels description stored in point_marker_array | ||
* 0 = reservoir pressure | ||
* 1 = reservoir density (component 1 ) | ||
* ... = reservoir densities (# components , NC) | ||
* NC + 1 = reservoir temperature | ||
* | ||
* numResLabels - 1 = reservoir temperature | ||
* numResLabels = well pressure | ||
* numResLabels + 1 = well density | ||
* ... = ... (well densities) | ||
* numResLabels + numWellLabels - 3 = last well density | ||
* numResLabels + numWellLabels - 2 = well rate | ||
* numResLabels + numWellLabels - 1 = well temperature | ||
* | ||
* 3-level MGR reduction strategy | ||
* - 1st level: eliminate the well block | ||
* - 2nd level: eliminate the reservoir density associated with the volume constraint | ||
* - 3rd level: eliminate the remaining the reservoir densities | ||
* - The coarse grid (pressure and temperature system) is solved with BoomerAMG with numFunctions==2. | ||
* | ||
*/ | ||
|
||
class ThermalCompositionalMultiphaseReservoirFVM : public MGRStrategyBase< 3 > | ||
{ | ||
public: | ||
/** | ||
* @brief Constructor. | ||
* @param numComponentsPerField array with number of components for each field | ||
*/ | ||
explicit ThermalCompositionalMultiphaseReservoirFVM( arrayView1d< int const > const & numComponentsPerField ) | ||
tjb-ltk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
: MGRStrategyBase( LvArray::integerConversion< HYPRE_Int >( numComponentsPerField[0] + numComponentsPerField[1] ) ) | ||
Check warning on line 66 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L65-L66
|
||
{ | ||
HYPRE_Int const numResLabels = LvArray::integerConversion< HYPRE_Int >( numComponentsPerField[0] ); | ||
Check warning on line 68 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L68
|
||
|
||
// Level 0: eliminate the well block | ||
m_labels[0].resize( numResLabels ); | ||
std::iota( m_labels[0].begin(), m_labels[0].end(), 0 ); | ||
Check warning on line 72 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L71-L72
|
||
|
||
// Level 1: eliminate last density which corresponds to the volume constraint equation | ||
m_labels[1].resize( numResLabels - 2 ); | ||
std::iota( m_labels[1].begin(), m_labels[1].end(), 0 ); | ||
m_labels[1].push_back( numResLabels-1 ); // keep temperature | ||
Check warning on line 77 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L75-L77
|
||
// Level 2: eliminate the other densities | ||
m_labels[2].push_back( 0 ); // keep pressure | ||
m_labels[2].push_back( numResLabels-1 ); // keep temperature | ||
Check warning on line 80 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L79-L80
|
||
|
||
setupLabels(); | ||
Check warning on line 82 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L82
|
||
|
||
// level 0 | ||
m_levelFRelaxType[0] = MGRFRelaxationType::gsElimWInverse; | ||
m_levelFRelaxIters[0] = 1; | ||
m_levelInterpType[0] = MGRInterpolationType::blockJacobi; | ||
m_levelRestrictType[0] = MGRRestrictionType::injection; | ||
m_levelCoarseGridMethod[0] = MGRCoarseGridMethod::galerkin; | ||
m_levelGlobalSmootherType[0] = MGRGlobalSmootherType::none; | ||
Check warning on line 90 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L85-L90
|
||
|
||
m_levelFRelaxType[1] = MGRFRelaxationType::jacobi; | ||
m_levelFRelaxIters[1] = 1; | ||
m_levelInterpType[1] = MGRInterpolationType::jacobi; // Diagonal scaling (Jacobi) | ||
m_levelRestrictType[1] = MGRRestrictionType::injection; | ||
m_levelCoarseGridMethod[1] = MGRCoarseGridMethod::galerkin; // Standard Galerkin | ||
m_levelGlobalSmootherType[1] = MGRGlobalSmootherType::blockGaussSeidel; | ||
m_levelGlobalSmootherIters[1] = 1; | ||
Check warning on line 98 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L92-L98
|
||
|
||
m_levelFRelaxType[2] = MGRFRelaxationType::jacobi; | ||
m_levelFRelaxIters[2] = 1; | ||
m_levelInterpType[2] = MGRInterpolationType::injection; // Injection | ||
m_levelRestrictType[2] = MGRRestrictionType::injection; | ||
m_levelCoarseGridMethod[2] = MGRCoarseGridMethod::cprLikeBlockDiag; // Non-Galerkin Quasi-IMPES CPR | ||
m_levelGlobalSmootherType[2] = MGRGlobalSmootherType::ilu0; | ||
m_levelGlobalSmootherIters[2] = 1; | ||
} | ||
Check warning on line 107 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L100-L107
|
||
|
||
/** | ||
* @brief Setup the MGR strategy. | ||
* @param precond preconditioner wrapper | ||
* @param mgrData auxiliary MGR data | ||
*/ | ||
void setup( LinearSolverParameters::MGR const &, | ||
Check warning on line 114 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L114
|
||
HyprePrecWrapper & precond, | ||
HypreMGRData & mgrData ) | ||
{ | ||
setReduction( precond, mgrData ); | ||
Check warning on line 118 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L118
|
||
|
||
// Configure the BoomerAMG solver used as mgr coarse solver for the pressure/temperature reduced system | ||
setPressureTemperatureAMG( mgrData.coarseSolver ); | ||
} | ||
Check warning on line 122 in src/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp Codecov / codecov/patchsrc/coreComponents/linearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp#L121-L122
|
||
}; | ||
|
||
} // namespace mgr | ||
|
||
} // namespace hypre | ||
|
||
} // namespace geos | ||
|
||
#endif /*GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRCOMPOSITIONALMULTIPHASERESERVOIRFVM_HPP_*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to add one with
true
inThermalCompressibleSinglePhaseFluid
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tjb-ltk Is this resolved?