mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Remove usage of cachedIntensiveQuantities from getWellConvergence
This commit is contained in:
parent
f6153f8133
commit
4768bc9e90
@ -23,6 +23,8 @@
|
|||||||
#ifndef OPM_STANDARDWELLSDENSE_HEADER_INCLUDED
|
#ifndef OPM_STANDARDWELLSDENSE_HEADER_INCLUDED
|
||||||
#define OPM_STANDARDWELLSDENSE_HEADER_INCLUDED
|
#define OPM_STANDARDWELLSDENSE_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#include <opm/autodiff/BlackoilModelEbosTypeTags.hpp>
|
||||||
|
|
||||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||||
|
|
||||||
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
||||||
@ -69,7 +71,9 @@ enum WellVariablePositions {
|
|||||||
template<typename FluidSystem, typename BlackoilIndices>
|
template<typename FluidSystem, typename BlackoilIndices>
|
||||||
class StandardWellsDense {
|
class StandardWellsDense {
|
||||||
public:
|
public:
|
||||||
|
// --------- Ebos property system stuff -------
|
||||||
|
typedef typename TTAG(EclFlowProblem) TypeTag;
|
||||||
|
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
|
||||||
// --------- Types ---------
|
// --------- Types ---------
|
||||||
typedef WellStateFullyImplicitBlackoilDense WellState;
|
typedef WellStateFullyImplicitBlackoilDense WellState;
|
||||||
typedef BlackoilModelParameters ModelParameters;
|
typedef BlackoilModelParameters ModelParameters;
|
||||||
|
@ -934,15 +934,24 @@ namespace Opm {
|
|||||||
std::vector< Vector > B( np, Vector( nc ) );
|
std::vector< Vector > B( np, Vector( nc ) );
|
||||||
std::vector< Vector > R2( np, Vector( nc ) );
|
std::vector< Vector > R2( np, Vector( nc ) );
|
||||||
std::vector< Vector > tempV( np, Vector( nc ) );
|
std::vector< Vector > tempV( np, Vector( nc ) );
|
||||||
|
auto& grid = ebosSimulator.gridManager().grid();
|
||||||
|
const auto& gridView = grid.leafGridView();
|
||||||
|
ElementContext elemCtx(ebosSimulator);
|
||||||
|
const auto& elemEndIt = gridView.template end</*codim=*/0, Dune::Interior_Partition>();
|
||||||
|
|
||||||
for ( int idx = 0; idx < np; ++idx )
|
for (auto elemIt = gridView.template begin</*codim=*/0, Dune::Interior_Partition>();
|
||||||
|
elemIt != elemEndIt; ++elemIt)
|
||||||
{
|
{
|
||||||
Vector& B_idx = B[ idx ];
|
elemCtx.updatePrimaryStencil(*elemIt);
|
||||||
const int ebosPhaseIdx = flowPhaseToEbosPhaseIdx(idx);
|
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||||
|
|
||||||
for (int cell_idx = 0; cell_idx < nc; ++cell_idx) {
|
const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||||
const auto& intQuants = *(ebosSimulator.model().cachedIntensiveQuantities(cell_idx, /*timeIdx=*/0));
|
const auto& fs = intQuants.fluidState();
|
||||||
const auto& fs = intQuants.fluidState();
|
|
||||||
|
for ( int idx = 0; idx < np; ++idx )
|
||||||
|
{
|
||||||
|
Vector& B_idx = B[ idx ];
|
||||||
|
const int ebosPhaseIdx = flowPhaseToEbosPhaseIdx(idx);
|
||||||
|
|
||||||
B_idx [cell_idx] = 1 / fs.invB(ebosPhaseIdx).value();
|
B_idx [cell_idx] = 1 / fs.invB(ebosPhaseIdx).value();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user