mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add auxiliary module in BlackoilModelEbos constructor.
Previously, we did this during assemble. Unfortunately, this resulted in the sparsity pattern being recomputed every time instead of just once for a non-linear solve.
This commit is contained in:
parent
799cbb4b62
commit
07f61c2a2b
@ -156,6 +156,15 @@ namespace Opm {
|
||||
{
|
||||
OPM_THROW(std::logic_error,"solver down cast to ISTLSolver failed");
|
||||
}
|
||||
|
||||
if ( param_.matrix_add_well_contributions_ )
|
||||
{
|
||||
// This might be dangerous?!
|
||||
ebosSimulator_.model().clearAuxiliaryModules();
|
||||
auto auxMod = std::make_shared<WellConnectionAuxiliaryModule<TypeTag> >( wellModel().wells() );
|
||||
ebosSimulator_.model().addAuxiliaryModule(auxMod);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool isParallel() const
|
||||
@ -354,15 +363,6 @@ namespace Opm {
|
||||
SimulatorReport assemble(const SimulatorTimerInterface& timer,
|
||||
const int iterationIdx)
|
||||
{
|
||||
if ( param_.matrix_add_well_contributions_ )
|
||||
{
|
||||
// This might be dangerous?!
|
||||
ebosSimulator_.model().clearAuxiliaryModules();
|
||||
auto auxMod = std::make_shared<WellConnectionAuxiliaryModule<TypeTag> >( wellModel().wells() );
|
||||
ebosSimulator_.model().addAuxiliaryModule(auxMod);
|
||||
}
|
||||
|
||||
|
||||
// -------- Mass balance equations --------
|
||||
ebosSimulator_.model().newtonMethod().setIterationIndex(iterationIdx);
|
||||
ebosSimulator_.problem().beginIteration();
|
||||
|
Loading…
Reference in New Issue
Block a user