-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: feature/byer3/thermal well (#3156)
* Add support for mass constraits (inj wells only) * Throw error if massinj constraint and useSurfaceConditions set to 0, fix error message for negative mass rate * thermal devs- 1) energy eqn for perf in/out flows, 2) reservoir well coupling 3) residualnomr calcs, 4) some isothermal , 5) refactoring 6) next focus solution updating/scaling * 1) fix isthermal well field runtime error 2) fix refactored isothermal flux index bug 3) 2 isothermal models tested with refactored code 4) thermal case crashes at 2nd linear solve well internal energy derivative = 0 * thermal well devs - 1) derivative bugfixes 2) added thermal to post linear solve well methods 3) next step verify simple test case results * thermal devs - 1) fixes for > 1 well seg 2) added soln updating/scaling 3) removed debug std::couts 4) next steps a) address constant temp BC b) singlephase thermo dev c) deriv checker * 1) Added simple temperature constraint 2) Fixes from running numerical derivative checker and treating warnings as errors * 1) add iterative solver config for thermal res+well 2) skip well calcs for shutin well 3) call well initialization code for wells that come online at t> 0 * 1) add Aww numerical derivative unit tests, 2) thermal index fix * 1) fix temp constraint eqn setup for well spanning > 1 cores , 2) well debug moved to well_debug branch, 3) stored global indices for well segs, 4) stored global reservoir indices for perfs, 5) added interfaces to access newton iteration number * 1) remove schema addition for current nonlinear stats , 2) remove test code that zeroed energy derivatives if phase not present * 1) for shutin wells zero completion perforation rates for clarity in reporting, 2) initialize seg temps with input inj temp, if user specifed surface+inj temp this caused differences with dev for isothermal runs * Update src/coreComponents/unitTests/fluidFlowTests/testCompFlowUtils.hpp * 1) dont allocate temperature_n for isothermal run, 2) uncrustify style * perfs global res cell index set with wrong array (node instead of cell values), quantites only used for reporting * Update .integrated_tests.yaml
- Loading branch information
Showing
52 changed files
with
9,386 additions
and
2,567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
...nearAlgebra/interfaces/hypre/mgrStrategies/ThermalCompositionalMultiphaseReservoirFVM.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) | ||
: MGRStrategyBase( LvArray::integerConversion< HYPRE_Int >( numComponentsPerField[0] + numComponentsPerField[1] ) ) | ||
{ | ||
HYPRE_Int const numResLabels = LvArray::integerConversion< HYPRE_Int >( numComponentsPerField[0] ); | ||
|
||
// Level 0: eliminate the well block | ||
m_labels[0].resize( numResLabels ); | ||
std::iota( m_labels[0].begin(), m_labels[0].end(), 0 ); | ||
|
||
// 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 | ||
// Level 2: eliminate the other densities | ||
m_labels[2].push_back( 0 ); // keep pressure | ||
m_labels[2].push_back( numResLabels-1 ); // keep temperature | ||
|
||
setupLabels(); | ||
|
||
// 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; | ||
|
||
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; | ||
|
||
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; | ||
} | ||
|
||
/** | ||
* @brief Setup the MGR strategy. | ||
* @param precond preconditioner wrapper | ||
* @param mgrData auxiliary MGR data | ||
*/ | ||
void setup( LinearSolverParameters::MGR const &, | ||
HyprePrecWrapper & precond, | ||
HypreMGRData & mgrData ) | ||
{ | ||
setReduction( precond, mgrData ); | ||
|
||
// Configure the BoomerAMG solver used as mgr coarse solver for the pressure/temperature reduced system | ||
setPressureTemperatureAMG( mgrData.coarseSolver ); | ||
} | ||
}; | ||
|
||
} // namespace mgr | ||
|
||
} // namespace hypre | ||
|
||
} // namespace geos | ||
|
||
#endif /*GEOS_LINEARALGEBRA_INTERFACES_HYPREMGRCOMPOSITIONALMULTIPHASERESERVOIRFVM_HPP_*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.