Skip to content
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: Enable fully coupled mode for CompositionalMultiphaseReservoirPoromechanics and SinglePhaseReservoirPoromechanics #3388

Merged
merged 47 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
220fa52
keep well variables constant during poromech init
Oct 2, 2024
fc9b41a
cleanup setMGRStrategy a bit
Oct 3, 2024
ff67658
missing setMGRStrategy and add log messages
Oct 4, 2024
3a2e268
final pass
Oct 4, 2024
0606617
Merge branch 'pt/wells-seq-poromech-init' into pt/set-mgr-strategy
Oct 4, 2024
06cbc18
enable fim mode
Oct 4, 2024
74aef74
clarify
Oct 4, 2024
6c6a0dc
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
Oct 4, 2024
a71d594
Merge branch 'develop' into pt/wells-seq-poromech-init
paveltomin Oct 4, 2024
5d52aad
Merge branch 'pt/wells-seq-poromech-init' into pt/set-mgr-strategy
paveltomin Oct 4, 2024
735140f
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Oct 4, 2024
bff5314
Update SolidMechanicsEmbeddedFractures.cpp
paveltomin Oct 4, 2024
cb874dc
code style
Oct 4, 2024
1796039
Merge branch 'pt/enable-fim' of https://github.com/GEOS-DEV/GEOS into…
Oct 4, 2024
a0e8b5e
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Oct 4, 2024
d10f4d2
Update WellSolverBase.cpp
paveltomin Oct 14, 2024
a0f4c63
Merge branch 'develop' into pt/wells-seq-poromech-init
paveltomin Oct 15, 2024
77e93bf
Merge branch 'pt/wells-seq-poromech-init' into pt/set-mgr-strategy
paveltomin Oct 25, 2024
56db5f5
Merge branch 'develop' into pt/wells-seq-poromech-init
paveltomin Oct 25, 2024
87e589d
Merge branch 'pt/wells-seq-poromech-init' into pt/set-mgr-strategy
paveltomin Oct 25, 2024
8a66c77
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Oct 25, 2024
0f1efa0
Merge branch 'develop' into pt/wells-seq-poromech-init
paveltomin Oct 28, 2024
1c67dc6
bug fix
Oct 28, 2024
49166d4
Merge branch 'pt/wells-seq-poromech-init' into pt/set-mgr-strategy
paveltomin Oct 28, 2024
584ee5f
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Oct 28, 2024
ab6763d
build fix
Oct 29, 2024
db683d1
build fix
Oct 29, 2024
a5b1931
Update CoupledReservoirAndWellsBase.hpp
paveltomin Oct 29, 2024
5cb58fb
Update SinglePhasePoromechanicsConformingFractures.hpp
paveltomin Oct 29, 2024
8cc05d3
Merge remote-tracking branch 'origin/pt/set-mgr-strategy' into pt/ena…
Oct 29, 2024
20a5f92
build fix
Oct 29, 2024
b17760b
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Oct 29, 2024
62f0712
Merge remote-tracking branch 'origin/develop' into pt/enable-fim
Nov 6, 2024
2a0828e
Merge branch 'pt/enable-fim' of https://github.com/GEOS-DEV/GEOS into…
Nov 6, 2024
20d1650
Revert "Merge remote-tracking branch 'origin/pt/set-mgr-strategy' int…
Nov 6, 2024
1b1a986
Revert "Revert "Merge remote-tracking branch 'origin/pt/set-mgr-strat…
Nov 6, 2024
2e637ae
Merge remote-tracking branch 'origin/develop' into pt/set-mgr-strategy
Nov 6, 2024
c58d62b
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Nov 6, 2024
5398dcf
Merge branch 'develop' into pt/set-mgr-strategy
paveltomin Nov 7, 2024
1b70734
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Nov 7, 2024
a321039
Merge remote-tracking branch 'origin/develop' into pt/set-mgr-strategy
Nov 14, 2024
5b6ac85
code style and missing changes
Nov 14, 2024
91c5058
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Nov 14, 2024
5a1e05c
sync
Nov 14, 2024
e9e4fbb
Merge branch 'develop' into pt/set-mgr-strategy
paveltomin Nov 17, 2024
1818d62
Merge branch 'pt/set-mgr-strategy' into pt/enable-fim
paveltomin Nov 17, 2024
bccfa1e
Merge remote-tracking branch 'origin/develop' into pt/enable-fim
Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "dataRepository/LogLevelsInfo.hpp"
#include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
#include "constitutive/solid/PorousSolid.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.hpp"
#include "physicsSolvers/fluidFlow/FlowSolverBaseFields.hpp"
#include "physicsSolvers/fluidFlow/CompositionalMultiphaseHybridFVM.hpp"
#include "physicsSolvers/multiphysics/poromechanicsKernels/MultiphasePoromechanics.hpp"
Expand Down Expand Up @@ -54,13 +55,6 @@
Base::postInputInitialization();

setMGRStrategy();

GEOS_ERROR_IF( this->flowSolver()->getCatalogName() == "CompositionalMultiphaseReservoir" &&
this->getNonlinearSolverParameters().couplingType() != NonlinearSolverParameters::CouplingType::Sequential,
GEOS_FMT( "{}: {} solver is only designed to work for {} = {}",
this->getDataContext(), catalogName(), NonlinearSolverParameters::viewKeysStruct::couplingTypeString(),
EnumStrings< NonlinearSolverParameters::CouplingType >::toString( NonlinearSolverParameters::CouplingType::Sequential )
));
}

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
Expand All @@ -82,6 +76,7 @@
{
GEOS_MARK_FUNCTION;

// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
assembleElementBasedTerms( time,
dt,
domain,
Expand Down Expand Up @@ -110,6 +105,50 @@
}
}

template<>
void MultiphasePoromechanics< CompositionalMultiphaseReservoirAndWells<>, SolidMechanicsLagrangianFEM >::assembleSystem( real64 const time,

Check warning on line 109 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L109

Added line #L109 was not covered by tests
real64 const dt,
DomainPartition & domain,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs )
{
GEOS_MARK_FUNCTION;

Check warning on line 116 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L116

Added line #L116 was not covered by tests

// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
assembleElementBasedTerms( time,

Check warning on line 119 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L119

Added line #L119 was not covered by tests
dt,
domain,
dofManager,
localMatrix,
localRhs );

// step 3: compute the fluxes (face-based contributions)

if( m_stabilizationType == StabilizationType::Global ||
m_stabilizationType == StabilizationType::Local )

Check warning on line 129 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L128-L129

Added lines #L128 - L129 were not covered by tests
{
this->flowSolver()->assembleStabilizedFluxTerms( dt,

Check warning on line 131 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L131

Added line #L131 was not covered by tests
domain,
dofManager,
localMatrix,
localRhs );
}
else
{
this->flowSolver()->assembleFluxTerms( dt,

Check warning on line 139 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L139

Added line #L139 was not covered by tests
domain,
dofManager,
localMatrix,
localRhs );
}

// step 4: assemble well contributions

this->flowSolver()->wellSolver()->assembleSystem( time, dt, domain, dofManager, localMatrix, localRhs );
this->flowSolver()->assembleCouplingTerms( time, dt, domain, dofManager, localMatrix, localRhs );
}

Check warning on line 150 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L148-L150

Added lines #L148 - L150 were not covered by tests

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
void MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::assembleElementBasedTerms( real64 const time_n,
real64 const dt,
Expand Down Expand Up @@ -275,6 +314,32 @@
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
}

template<>
void MultiphasePoromechanics< CompositionalMultiphaseReservoirAndWells<>, SolidMechanicsLagrangianFEM >::setMGRStrategy()

Check warning on line 318 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L318

Added line #L318 was not covered by tests
{
// same as CompositionalMultiphaseReservoirAndWells< MultiphasePoromechanics<> >::setMGRStrategy

LinearSolverParameters & linearSolverParameters = m_linearSolverParameters.get();

Check warning on line 322 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L322

Added line #L322 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 325 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L324-L325

Added lines #L324 - L325 were not covered by tests

linearSolverParameters.mgr.separateComponents = true;
linearSolverParameters.dofsPerNode = 3;

Check warning on line 328 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L327-L328

Added lines #L327 - L328 were not covered by tests

if( dynamic_cast< CompositionalMultiphaseHybridFVM * >( this->flowSolver() ) )

Check warning on line 330 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L330

Added line #L330 was not covered by tests
{
GEOS_ERROR( GEOS_FMT( "{}: MGR strategy is not implemented for {}/{}",

Check warning on line 332 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L332

Added line #L332 was not covered by tests
this->getName(), this->getCatalogName(), this->flowSolver()->getCatalogName() ) );
}
else
{
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::multiphasePoromechanicsReservoirFVM;

Check warning on line 337 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L337

Added line #L337 was not covered by tests
}
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", getName(),

Check warning on line 339 in src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp#L339

Added line #L339 was not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
}

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
void MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::updateBulkDensity( ElementSubRegionBase & subRegion )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
Base::postInputInitialization();

setMGRStrategy();

GEOS_ERROR_IF( this->flowSolver()->getCatalogName() == "SinglePhaseReservoir" &&
this->getNonlinearSolverParameters().couplingType() != NonlinearSolverParameters::CouplingType::Sequential,
GEOS_FMT( "{}: {} solver is only designed to work for {} = {}",
this->getName(), catalogName(), NonlinearSolverParameters::viewKeysStruct::couplingTypeString(),
EnumStrings< NonlinearSolverParameters::CouplingType >::toString( NonlinearSolverParameters::CouplingType::Sequential )
));
}

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
Expand Down Expand Up @@ -151,6 +144,32 @@
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
}

template<>
void SinglePhasePoromechanics< SinglePhaseReservoirAndWells<>, SolidMechanicsLagrangianFEM >::setMGRStrategy()

Check warning on line 148 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L148

Added line #L148 was not covered by tests
{
// same as SinglePhaseReservoirAndWells< SinglePhasePoromechanics<> >::setMGRStrategy

LinearSolverParameters & linearSolverParameters = m_linearSolverParameters.get();

Check warning on line 152 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L152

Added line #L152 was not covered by tests

if( linearSolverParameters.preconditionerType != LinearSolverParameters::PreconditionerType::mgr )
return;

Check warning on line 155 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L154-L155

Added lines #L154 - L155 were not covered by tests

linearSolverParameters.mgr.separateComponents = true;
linearSolverParameters.dofsPerNode = 3;

Check warning on line 158 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L157-L158

Added lines #L157 - L158 were not covered by tests

if( dynamic_cast< SinglePhaseHybridFVM * >( this->flowSolver() ) )

Check warning on line 160 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L160

Added line #L160 was not covered by tests
{
GEOS_ERROR( GEOS_FMT( "{}: MGR strategy is not implemented for poromechanics {}/{}",

Check warning on line 162 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L162

Added line #L162 was not covered by tests
this->getName(), this->getCatalogName(), this->flowSolver()->getCatalogName()));
}
else
{
linearSolverParameters.mgr.strategy = LinearSolverParameters::MGR::StrategyType::singlePhasePoromechanicsReservoirFVM;

Check warning on line 167 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L167

Added line #L167 was not covered by tests
}
GEOS_LOG_LEVEL_RANK_0( 1, GEOS_FMT( "{}: MGR strategy set to {}", this->getName(),

Check warning on line 169 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L169

Added line #L169 was not covered by tests
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
}

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
void SinglePhasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::assembleSystem( real64 const time_n,
real64 const dt,
Expand Down Expand Up @@ -186,7 +205,48 @@
localMatrix,
localRhs );
}
}

Check warning on line 208 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L208

Added line #L208 was not covered by tests

template<>
void SinglePhasePoromechanics< SinglePhaseReservoirAndWells<>, SolidMechanicsLagrangianFEM >::assembleSystem( real64 const time_n,

Check warning on line 211 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L211

Added line #L211 was not covered by tests
real64 const dt,
DomainPartition & domain,
DofManager const & dofManager,
CRSMatrixView< real64, globalIndex const > const & localMatrix,
arrayView1d< real64 > const & localRhs )
{
GEOS_MARK_FUNCTION;

Check warning on line 218 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L218

Added line #L218 was not covered by tests

// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
assembleElementBasedTerms( time_n,

Check warning on line 221 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L221

Added line #L221 was not covered by tests
dt,
domain,
dofManager,
localMatrix,
localRhs );

// Step 3: compute the fluxes (face-based contributions)
if( m_stabilizationType == StabilizationType::Global || m_stabilizationType == StabilizationType::Local )

Check warning on line 229 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L229

Added line #L229 was not covered by tests
{
this->flowSolver()->assembleStabilizedFluxTerms( dt,

Check warning on line 231 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L231

Added line #L231 was not covered by tests
domain,
dofManager,
localMatrix,
localRhs );
}
else
{
this->flowSolver()->assembleFluxTerms( dt,

Check warning on line 239 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L239

Added line #L239 was not covered by tests
domain,
dofManager,
localMatrix,
localRhs );
}

// step 4: assemble well contributions

this->flowSolver()->wellSolver()->assembleSystem( time_n, dt, domain, dofManager, localMatrix, localRhs );
this->flowSolver()->assembleCouplingTerms( time_n, dt, domain, dofManager, localMatrix, localRhs );

Check warning on line 249 in src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

View check run for this annotation

Codecov / codecov/patch

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp#L248-L249

Added lines #L248 - L249 were not covered by tests
}

template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
Expand Down
Loading