Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
f181983
un..ck flow initialization a bit
Oct 10, 2024
053377b
missing file
Oct 10, 2024
ec91135
build fix
Oct 10, 2024
6018d8c
bug fix and functions cleanup
Oct 11, 2024
c1be658
code style
Oct 11, 2024
1313a67
try this
Oct 12, 2024
81b57c2
unify poromech init again
Oct 12, 2024
e15d0d1
Merge branch 'develop' into pt/flow-init
paveltomin Oct 12, 2024
1d14aeb
Merge branch 'pt/flow-init' into pt/poromech-init-again
paveltomin Oct 12, 2024
4f70588
Merge branch 'develop' into pt/flow-init
paveltomin Oct 25, 2024
29d6887
Merge branch 'pt/flow-init' into pt/poromech-init-again
paveltomin Oct 25, 2024
3ca668f
Merge branch 'develop' into pt/flow-init
paveltomin Nov 7, 2024
fa20021
Merge branch 'develop' into pt/flow-init
paveltomin Nov 7, 2024
a4872a5
Merge branch 'pt/flow-init' into pt/poromech-init-again
paveltomin Nov 7, 2024
8179a57
Merge branch 'develop' into pt/flow-init
paveltomin Nov 11, 2024
c882d2f
Merge branch 'pt/flow-init' into pt/poromech-init-again
paveltomin Nov 11, 2024
035a986
Update CompositionalMultiphaseBase.cpp
paveltomin Nov 14, 2024
b704634
Merge branch 'develop' into pt/flow-init
paveltomin Nov 15, 2024
d9ed44f
cuda build
Nov 15, 2024
62b27fc
Update .integrated_tests.yaml
paveltomin Nov 15, 2024
999f0b4
Update BASELINE_NOTES.md
paveltomin Nov 15, 2024
e7ca59f
cuda
Nov 15, 2024
4e44af8
Merge branch 'pt/flow-init' of https://github.com/GEOS-DEV/GEOS into …
Nov 15, 2024
4c5f4f1
Merge branch 'develop' into pt/flow-init
paveltomin Nov 17, 2024
ac1a262
Merge branch 'develop' into pt/flow-init
paveltomin Nov 21, 2024
f1bbcfe
Update FlowSolverBase.cpp
paveltomin Nov 21, 2024
adcc53f
Merge branch 'develop' into pt/flow-init
paveltomin Nov 22, 2024
c187f5d
Merge branch 'develop' into pt/flow-init
paveltomin Dec 2, 2024
7440d13
Update .integrated_tests.yaml
paveltomin Dec 2, 2024
74b5a7b
Update BASELINE_NOTES.md
paveltomin Dec 2, 2024
ab8fa82
Merge branch 'develop' into pt/flow-init
paveltomin Dec 2, 2024
b95d65a
revert to minimize changes
Dec 2, 2024
aded90f
revert more
Dec 2, 2024
8cccac0
Merge branch 'pt/flow-init' into pt/poromech-init-again
paveltomin Dec 3, 2024
9b4b156
Merge remote-tracking branch 'origin/develop' into pt/poromech-init-a…
Dec 3, 2024
a75dcfa
hope it works
Dec 3, 2024
a9e15a1
test
Dec 3, 2024
ea3467e
merge fix
Dec 3, 2024
2bfc779
Merge branch 'develop' into pt/poromech-init-again
paveltomin Dec 3, 2024
e635c58
add back init
Dec 3, 2024
ee92b4b
Update PoromechanicsSolver.hpp
paveltomin Dec 4, 2024
55ec38a
better version
Dec 4, 2024
9791525
Merge branch 'pt/poromech-init-again' of https://github.com/GEOS-DEV/…
Dec 4, 2024
40889ff
Merge branch 'develop' into pt/poromech-init-again
paveltomin Dec 23, 2024
8976830
Merge branch 'develop' into pt/poromech-init-again
paveltomin Jan 8, 2025
e266546
Merge branch 'develop' into pt/poromech-init-again
paveltomin Jan 13, 2025
8d8441b
Merge branch 'develop' into pt/poromech-init-again
paveltomin Jan 16, 2025
829c9a4
Merge branch 'develop' into pt/poromech-init-again
paveltomin Jan 28, 2025
ddf2789
Merge branch 'develop' into pt/poromech-init-again
paveltomin Feb 6, 2025
0549c83
Merge remote-tracking branch 'origin/develop' into pt/poromech-init-a…
Feb 7, 2025
c71cf4e
Merge branch 'develop' into pt/poromech-init-again
paveltomin Feb 17, 2025
104cbb7
Update PoromechanicsSolver.hpp
paveltomin Feb 17, 2025
8d5c87d
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 4, 2025
7a4f3d0
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 6, 2025
e2a7a5a
try unify hydrofrac
Mar 6, 2025
182906c
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 9, 2025
7d4ae18
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 10, 2025
a1e43cb
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 11, 2025
a13d3dd
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 18, 2025
02e48df
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 19, 2025
13b594f
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 21, 2025
acf4c45
Update .integrated_tests.yaml
paveltomin Mar 21, 2025
2c70d5e
Update BASELINE_NOTES.md
paveltomin Mar 21, 2025
88e5bd4
Merge branch 'develop' into pt/poromech-init-again
paveltomin Mar 22, 2025
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
2 changes: 1 addition & 1 deletion .integrated_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baselines:
bucket: geosx
baseline: integratedTests/baseline_integratedTests-pr2125-10859-1db8623
baseline: integratedTests/baseline_integratedTests-pr3396-10875-13b594f

allow_fail:
all: ''
Expand Down
4 changes: 4 additions & 0 deletions BASELINE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This file is designed to track changes to the integrated test baselines.
Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining.
These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD).

PR #3396 (2024-03-21)
=====================
Use solid mechanics solver directly to perform poromechanics initialization.

PR #2125 (2024-03-20)
=====================
Phase-field nucleation model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ class FlowSolverBase : public PhysicsSolverBase
GEOS_ERROR( "Poroelastic fluxes with conforming fractures not yet implemented." );
}

void initializeState( DomainPartition & domain );

virtual void initializeFluidState( MeshLevel & mesh, string_array const & regionNames ) { GEOS_UNUSED_VAR( mesh, regionNames ); }

virtual void initializeThermalState( MeshLevel & mesh, string_array const & regionNames ) { GEOS_UNUSED_VAR( mesh, regionNames ); }
Expand Down Expand Up @@ -236,8 +238,6 @@ class FlowSolverBase : public PhysicsSolverBase

virtual void initializePostInitialConditionsPreSubGroups() override;

void initializeState( DomainPartition & domain );

virtual void computeHydrostaticEquilibrium( DomainPartition & domain ) { GEOS_UNUSED_VAR( domain ); }

void initializePorosityAndPermeability( MeshLevel & mesh, string_array const & regionNames );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ class CoupledReservoirAndWellsBase : public CoupledSolver< RESERVOIR_SOLVER, WEL
}
}

void initializeState( DomainPartition & domain ) const { return reservoirSolver()->initializeState( domain ); }

void
assembleFluxTerms( real64 const dt,
DomainPartition const & domain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MultiphasePoromechanics : public PoromechanicsSolver< FLOW_SOLVER, MECHANI
using Base::m_stabilizationType;
using Base::m_stabilizationRegionNames;
using Base::m_stabilizationMultiplier;
using Base::getLogLevel;
using Base::updateBulkDensity;

/**
* @brief main constructor for MultiphasePoromechanics Objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include "events/tasks/TasksManager.hpp"
#include "physicsSolvers/PhysicsSolverManager.hpp"
#include "physicsSolvers/fluidFlow/SinglePhaseBase.hpp"
#include "physicsSolvers/solidMechanics/SolidMechanicsStatistics.hpp"
#include "physicsSolvers/multiphysics/MultiphasePoromechanics.hpp"
#include "physicsSolvers/multiphysics/MultiphasePoromechanicsConformingFractures.hpp"
Expand Down Expand Up @@ -87,8 +86,9 @@ postInputInitialization()
TasksManager & tasksManager = problemManager.getGroup< TasksManager >( "Tasks" );

GEOS_THROW_IF( !tasksManager.hasGroup( m_solidMechanicsStatisticsName ),
GEOS_FMT( "{}: statistics task named {} not found",
GEOS_FMT( "{}: {} task named {} not found",
getWrapperDataContext( viewKeyStruct::solidMechanicsStatisticsNameString() ),
SolidMechanicsStatistics::catalogName(),
m_solidMechanicsStatisticsName ),
InputError );

Expand Down Expand Up @@ -116,7 +116,9 @@ execute( real64 const time_n,

m_solidMechanicsStateResetTask.execute( time_n, dt, cycleNumber, eventCounter, eventProgress, domain );

m_poromechanicsSolver->execute( time_n, dt, cycleNumber, eventCounter, eventProgress, domain );
m_poromechanicsSolver->flowSolver()->initializeState( domain );
m_poromechanicsSolver->updateBulkDensity( domain );
m_poromechanicsSolver->solidMechanicsSolver()->execute( time_n, dt, cycleNumber, eventCounter, eventProgress, domain );

GEOS_LOG_LEVEL_RANK_0( logInfo::SolverInitialization, GEOS_FMT( "Task `{}`: at time {}s, physics solver `{}` has completed stress initialization",//1
getName(), time_n + dt, m_poromechanicsSolverName ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ class PoromechanicsInitialization : public TaskBase

void postInputInitialization() override;

// void registerDataOnMesh( Group & meshBodies ) override;

/// Name of the poromechanics solver
string m_poromechanicsSolverName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,14 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER
PoromechanicsSolver( const string & name,
dataRepository::Group * const parent )
: Base( name, parent ),
m_isThermal( 0 )
m_isThermal( 0 ),
m_performStressInitialization( false )
{
this->registerWrapper( viewKeyStruct::isThermalString(), &m_isThermal ).
setApplyDefaultValue( 0 ).
setInputFlag( dataRepository::InputFlags::OPTIONAL ).
setDescription( "Flag indicating whether the problem is thermal or not. Set isThermal=\"1\" to enable the thermal coupling" );

this->registerWrapper( viewKeyStruct::performStressInitializationString(), &m_performStressInitialization ).
setApplyDefaultValue( false ).
setInputFlag( dataRepository::InputFlags::FALSE ).
setDescription( "Flag to indicate that the solver is going to perform stress initialization" );

this->registerWrapper( viewKeyStruct::stabilizationTypeString(), &m_stabilizationType ).
setInputFlag( dataRepository::InputFlags::OPTIONAL ).
setDescription( "StabilizationType. Options are:\n" +
Expand Down Expand Up @@ -220,12 +216,9 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER
setRestartFlags( dataRepository::RestartFlags::NO_WRITE ).
setSizedFromParent( 0 );

if( this->getNonlinearSolverParameters().m_couplingType == NonlinearSolverParameters::CouplingType::Sequential )
{
// register the bulk density for use in the solid mechanics solver
// ideally we would resize it here as well, but the solid model name is not available yet (see below)
subRegion.registerField< fields::poromechanics::bulkDensity >( this->getName() );
}
// register the bulk density for use in the solid mechanics solver
// ideally we would resize it here as well, but the solid model name is not available yet (see below)
subRegion.registerField< fields::poromechanics::bulkDensity >( this->getName() );

if( m_stabilizationType == stabilization::StabilizationType::Global || m_stabilizationType == stabilization::StabilizationType::Local )
{
Expand Down Expand Up @@ -302,9 +295,10 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER
* @brief Utility function to set the stress initialization flag
* @param[in] performStressInitialization true if the solver has to initialize stress, false otherwise
*/
void setStressInitialization( integer const performStressInitialization )
void setStressInitialization( bool const performStressInitialization )
{
m_performStressInitialization = performStressInitialization;
solidMechanicsSolver()->setStressInitialization( performStressInitialization );
}

struct viewKeyStruct : Base::viewKeyStruct
Expand All @@ -315,9 +309,6 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER
/// Flag to indicate that the simulation is thermal
constexpr static char const * isThermalString() { return "isThermal"; }

/// Flag to indicate that the solver is going to perform stress initialization
constexpr static char const * performStressInitializationString() { return "performStressInitialization"; }

/// Type of pressure stabilization
constexpr static char const * stabilizationTypeString() {return "stabilizationType"; }

Expand Down Expand Up @@ -394,6 +385,23 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER

}

void updateBulkDensity( DomainPartition & domain )
{
this->template forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &,
MeshLevel & mesh,
string_array const & regionNames )
{
mesh.getElemManager().forElementSubRegions< CellElementSubRegion >( regionNames, [&]( localIndex const,
auto & subRegion )
{
// update the bulk density
// TODO: ideally, we would not recompute the bulk density, but a more general "rhs" containing the body force and the
// pressure/temperature terms
updateBulkDensity( subRegion );
} );
} );
}

protected:

template< typename CONSTITUTIVE_BASE,
Expand Down Expand Up @@ -561,20 +569,7 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER
/// After the flow solver
if( solverType == static_cast< integer >( SolverType::Flow ) )
{
this->template forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &,
MeshLevel & mesh,
string_array const & regionNames )
{

mesh.getElemManager().forElementSubRegions< CellElementSubRegion >( regionNames, [&]( localIndex const,
auto & subRegion )
{
// update the bulk density
// TODO: ideally, we would not recompute the bulk density, but a more general "rhs" containing the body force and the
// pressure/temperature terms
updateBulkDensity( subRegion );
} );
} );
updateBulkDensity( domain );
}

/// After the solid mechanics solver
Expand Down Expand Up @@ -668,7 +663,7 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER
integer m_isThermal;

/// Flag to indicate that the solver is going to perform stress initialization
integer m_performStressInitialization;
bool m_performStressInitialization;

/// Type of stabilization used
stabilization::StabilizationType m_stabilizationType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class SinglePhasePoromechanics : public PoromechanicsSolver< FLOW_SOLVER, MECHAN
using Base::m_stabilizationType;
using Base::m_stabilizationRegionNames;
using Base::m_stabilizationMultiplier;
using Base::updateBulkDensity;

/**
* @brief main constructor for SinglePhasePoromechanics objects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ SolidMechanicsLagrangianFEM::SolidMechanicsLagrangianFEM( const string & name,
m_maxForce( 0.0 ),
m_maxNumResolves( 10 ),
m_strainTheory( 0 ),
m_isFixedStressPoromechanicsUpdate( false )
m_isFixedStressPoromechanicsUpdate( false ),
m_performStressInitialization( false )
{

registerWrapper( viewKeyStruct::newmarkGammaString(), &m_newmarkGamma ).
Expand Down Expand Up @@ -1006,6 +1007,8 @@ void SolidMechanicsLagrangianFEM::setupSystem( DomainPartition & domain,
ParallelVector & solution,
bool const setSparsity )
{
GEOS_LOG( "SolidMechanicsLagrangianFEM::setupSystem" );

GEOS_MARK_FUNCTION;
PhysicsSolverBase::setupSystem( domain, dofManager, localMatrix, rhs, solution, setSparsity );

Expand All @@ -1021,25 +1024,6 @@ void SolidMechanicsLagrangianFEM::setupSystem( DomainPartition & domain,
arrayView1d< globalIndex const > const
dofNumber = nodeManager.getReference< globalIndex_array >( dofManager.getKey( solidMechanics::totalDisplacement::key() ) );

if( m_contactRelationName != viewKeyStruct::noContactRelationNameString() )

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CusiniM this seems not needed and when called - it does not work, no FE discretization is registered for face elements

{
ElementRegionManager const & elemManager = mesh.getElemManager();
string_array allFaceElementRegions;
elemManager.forElementRegions< SurfaceElementRegion >( [&]( SurfaceElementRegion const & elemRegion )
{
allFaceElementRegions.emplace_back( elemRegion.getName() );
} );

finiteElement::
fillSparsity< FaceElementSubRegion,
solidMechanicsLagrangianFEMKernels::ImplicitSmallStrainQuasiStatic >( mesh,
allFaceElementRegions,
this->getDiscretizationName(),
dofNumber,
dofManager.rankOffset(),
sparsityPattern );

}
finiteElement::
fillSparsity< CellElementSubRegion,
solidMechanicsLagrangianFEMKernels::ImplicitSmallStrainQuasiStatic >( mesh,
Expand Down Expand Up @@ -1072,7 +1056,7 @@ void SolidMechanicsLagrangianFEM::assembleSystem( real64 const GEOS_UNUSED_PARAM
MeshLevel & mesh,
string_array const & regionNames )
{
if( m_isFixedStressPoromechanicsUpdate )
if( m_isFixedStressPoromechanicsUpdate || m_performStressInitialization )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that this PR is the introduction of this, but the single physics solver shouldn't know about the coupled physics solver.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of coupled reservoir and well solver, where the event section only activates the reservoir solver, doesn't the well solver need to know that reservoir solver is assuming that well variables are constant. the well solver knows its coupled to the reservoir via perforations.

{
set< string > poromechanicsRegions;
set< string > mechanicsRegions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ class SolidMechanicsLagrangianFEM : public PhysicsSolverBase
return m_rigidBodyModes;
}

/*
* @brief Utility function to set the stress initialization flag
* @param[in] performStressInitialization true if the solver has to initialize stress, false otherwise
*/
void setStressInitialization( bool const performStressInitialization )
{
m_performStressInitialization = performStressInitialization;
}

protected:
virtual void postInputInitialization() override;

Expand All @@ -293,8 +302,11 @@ class SolidMechanicsLagrangianFEM : public PhysicsSolverBase
real64 m_maxForce = 0.0;
integer m_maxNumResolves;
integer m_strainTheory;
// MPI_iCommData m_iComm;

/// Flag to indicate that the solver is running in fixed stress (sequential) mode
bool m_isFixedStressPoromechanicsUpdate;
/// Flag to indicate that the solver is going to perform stress initialization
bool m_performStressInitialization;

/// Rigid body modes
array1d< ParallelVector > m_rigidBodyModes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ void SolidMechanicsLagrangeContact::assembleSystem( real64 const time,
assembleContact( domain, dofManager, localMatrix, localRhs );

// for sequential: add (fixed) pressure force contribution into residual (no derivatives)
if( m_isFixedStressPoromechanicsUpdate )
if( m_isFixedStressPoromechanicsUpdate || m_performStressInitialization )
{
forDiscretizationOnMeshTargets( domain.getMeshBodies(), [&]( string const &,
MeshLevel const & mesh,
Expand Down