Skip to content

Commit 06fb1ad

Browse files
Pavel TominPavel Tomin
authored andcommitted
fix: enable FullyImplicit for SinglePhaseReservoirPoromechanicsConformingFractures
1 parent 3a78f14 commit 06fb1ad

11 files changed

Lines changed: 95 additions & 161 deletions

src/coreComponents/dataRepository/Group.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ class Group
319319
{
320320
Group * const child = m_subGroups[ key ];
321321
GEOS_THROW_IF( child == nullptr,
322-
"Group " << getDataContext() << " has no child named " << key << std::endl
322+
"Group " << getDataContext() << " has no child named '" << key << "'" << std::endl
323323
<< dumpSubGroupsNames(),
324324
std::domain_error );
325325
T * const castedChild = dynamicCast< T * >( child );
@@ -338,7 +338,7 @@ class Group
338338
{
339339
Group const * const child = m_subGroups[ key ];
340340
GEOS_THROW_IF( child == nullptr,
341-
"Group " << getDataContext() << " has no child named " << key << std::endl
341+
"Group " << getDataContext() << " has no child named '" << key << "'" << std::endl
342342
<< dumpSubGroupsNames(),
343343
std::domain_error );
344344
T const * const castedChild = dynamicCast< T const * >( child );

src/coreComponents/integrationTests/dataRepositoryTests/testGroupPath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ TEST( testGroupPath, testGlobalPaths )
107107
catch( const std::domain_error & e )
108108
{
109109
static constexpr auto expectedMsg = "***** Controlling expression (should be false): child == nullptr\n"
110-
"***** Rank 0: Group Mesh (CodeIncludedXML0, l.10) has no child named mesh2\n"
110+
"***** Rank 0: Group Mesh (CodeIncludedXML0, l.10) has no child named 'mesh2'\n"
111111
"The children of Mesh are: { mesh1 }";
112112
// checks if the exception contains the expected message
113113
GEOS_ERROR_IF_EQ_MSG( string( e.what() ).find( expectedMsg ), string::npos,

src/coreComponents/mesh/MeshObjectPath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ void processTokenRecursive( dataRepository::Group const & parentGroup,
233233
}
234234
}
235235
GEOS_THROW_IF( !foundMatch,
236-
GEOS_FMT( "{0} has no child named {1}.\n"
236+
GEOS_FMT( "{0} has no child named '{1}'.\n"
237237
"{0} has the following children: {{ {2} }}",
238238
parentGroup.getDataContext().toString(),
239239
inputEntry,

src/coreComponents/physicsSolvers/PhysicsSolverBase.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ class PhysicsSolverBase : public ExecutableGroup
914914
* @brief return the name of the discretization object
915915
* @return the name of the discretization object
916916
*/
917-
string getDiscretizationName() const {return m_discretizationName;}
917+
virtual string getDiscretizationName() const {return m_discretizationName;}
918918

919919
/**
920920
* @brief function to set the value of m_assemblyCallback

src/coreComponents/physicsSolvers/multiphysics/CoupledReservoirAndWellsBase.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ class CoupledReservoirAndWellsBase : public CoupledSolver< RESERVOIR_SOLVER, WEL
244244
virtual void saveSequentialIterationState( DomainPartition & domain ) override
245245
{ reservoirSolver()->saveSequentialIterationState( domain ); }
246246

247+
virtual string getDiscretizationName() const override
248+
{ return reservoirSolver()->getDiscretizationName(); }
249+
247250
protected:
248251

249252
/**

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.cpp

Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ namespace geos
4141
using namespace dataRepository;
4242
using namespace constitutive;
4343
using namespace fields;
44-
using namespace stabilization;
4544

4645
template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
4746
MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::MultiphasePoromechanics( const string & name,
@@ -66,45 +65,6 @@ void MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::setupCoupling( Do
6665
DofManager::Connector::Elem );
6766
}
6867

69-
template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
70-
void MultiphasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::assembleSystem( real64 const time,
71-
real64 const dt,
72-
DomainPartition & domain,
73-
DofManager const & dofManager,
74-
CRSMatrixView< real64, globalIndex const > const & localMatrix,
75-
arrayView1d< real64 > const & localRhs )
76-
{
77-
GEOS_MARK_FUNCTION;
78-
79-
// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
80-
assembleElementBasedTerms( time,
81-
dt,
82-
domain,
83-
dofManager,
84-
localMatrix,
85-
localRhs );
86-
87-
// step 3: compute the fluxes (face-based contributions)
88-
89-
if( m_stabilizationType == StabilizationType::Global ||
90-
m_stabilizationType == StabilizationType::Local )
91-
{
92-
this->flowSolver()->assembleStabilizedFluxTerms( dt,
93-
domain,
94-
dofManager,
95-
localMatrix,
96-
localRhs );
97-
}
98-
else
99-
{
100-
this->flowSolver()->assembleFluxTerms( dt,
101-
domain,
102-
dofManager,
103-
localMatrix,
104-
localRhs );
105-
}
106-
}
107-
10868
template<>
10969
void MultiphasePoromechanics< CompositionalMultiphaseReservoirAndWells<>, SolidMechanicsLagrangianFEM >::assembleSystem( real64 const time,
11070
real64 const dt,
@@ -115,38 +75,11 @@ void MultiphasePoromechanics< CompositionalMultiphaseReservoirAndWells<>, SolidM
11575
{
11676
GEOS_MARK_FUNCTION;
11777

118-
// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
119-
assembleElementBasedTerms( time,
120-
dt,
121-
domain,
122-
dofManager,
123-
localMatrix,
124-
localRhs );
125-
126-
// step 3: compute the fluxes (face-based contributions)
127-
128-
if( m_stabilizationType == StabilizationType::Global ||
129-
m_stabilizationType == StabilizationType::Local )
130-
{
131-
this->flowSolver()->assembleStabilizedFluxTerms( dt,
132-
domain,
133-
dofManager,
134-
localMatrix,
135-
localRhs );
136-
}
137-
else
138-
{
139-
this->flowSolver()->assembleFluxTerms( dt,
140-
domain,
141-
dofManager,
142-
localMatrix,
143-
localRhs );
144-
}
145-
146-
// step 4: assemble well contributions
78+
Base::assembleSystem( time, dt, domain, dofManager, localMatrix, localRhs );
14779

148-
this->flowSolver()->wellSolver()->assembleSystem( time, dt, domain, dofManager, localMatrix, localRhs );
149-
this->flowSolver()->assembleCouplingTerms( time, dt, domain, dofManager, localMatrix, localRhs );
80+
// assemble well contributions
81+
flowSolver()->wellSolver()->assembleSystem( time, dt, domain, dofManager, localMatrix, localRhs );
82+
flowSolver()->assembleCouplingTerms( time, dt, domain, dofManager, localMatrix, localRhs );
15083
}
15184

15285
template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >

src/coreComponents/physicsSolvers/multiphysics/MultiphasePoromechanics.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ class MultiphasePoromechanics : public PoromechanicsSolver< FLOW_SOLVER, MECHANI
9292
DomainPartition & domain,
9393
DofManager const & dofManager,
9494
CRSMatrixView< real64, globalIndex const > const & localMatrix,
95-
arrayView1d< real64 > const & localRhs ) override;
96-
97-
void assembleElementBasedTerms( real64 const time,
98-
real64 const dt,
99-
DomainPartition & domain,
100-
DofManager const & dofManager,
101-
CRSMatrixView< real64, globalIndex const > const & localMatrix,
102-
arrayView1d< real64 > const & localRhs );
95+
arrayView1d< real64 > const & localRhs ) override
96+
{ Base::assembleSystem( time, dt, domain, dofManager, localMatrix, localRhs ); }
97+
98+
virtual void assembleElementBasedTerms( real64 const time,
99+
real64 const dt,
100+
DomainPartition & domain,
101+
DofManager const & dofManager,
102+
CRSMatrixView< real64, globalIndex const > const & localMatrix,
103+
arrayView1d< real64 > const & localRhs ) override;
103104

104105
/**@}*/
105106

src/coreComponents/physicsSolvers/multiphysics/PoromechanicsSolver.hpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,51 @@ class PoromechanicsSolver : public CoupledSolver< FLOW_SOLVER, MECHANICS_SOLVER
253253
this->setupCoupling( domain, dofManager );
254254
}
255255

256+
void assembleSystem( real64 const time,
257+
real64 const dt,
258+
DomainPartition & domain,
259+
DofManager const & dofManager,
260+
CRSMatrixView< real64, globalIndex const > const & localMatrix,
261+
arrayView1d< real64 > const & localRhs )
262+
{
263+
GEOS_MARK_FUNCTION;
264+
265+
// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
266+
assembleElementBasedTerms( time,
267+
dt,
268+
domain,
269+
dofManager,
270+
localMatrix,
271+
localRhs );
272+
273+
// Step 3: compute the fluxes (face-based contributions)
274+
275+
if( m_stabilizationType == stabilization::StabilizationType::Global ||
276+
m_stabilizationType == stabilization::StabilizationType::Local )
277+
{
278+
this->flowSolver()->assembleStabilizedFluxTerms( dt,
279+
domain,
280+
dofManager,
281+
localMatrix,
282+
localRhs );
283+
}
284+
else
285+
{
286+
this->flowSolver()->assembleFluxTerms( dt,
287+
domain,
288+
dofManager,
289+
localMatrix,
290+
localRhs );
291+
}
292+
}
293+
294+
virtual void assembleElementBasedTerms( real64 const time_n,
295+
real64 const dt,
296+
DomainPartition & domain,
297+
DofManager const & dofManager,
298+
CRSMatrixView< real64, globalIndex const > const & localMatrix,
299+
arrayView1d< real64 > const & localRhs ) = 0;
300+
256301
virtual bool checkSequentialConvergence( integer const cycleNumber,
257302
integer const iter,
258303
real64 const & time_n,

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanics.cpp

Lines changed: 4 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ namespace geos
4646
using namespace constitutive;
4747
using namespace dataRepository;
4848
using namespace fields;
49-
using namespace stabilization;
5049

5150
template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
5251
SinglePhasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::SinglePhasePoromechanics( const string & name,
@@ -193,43 +192,6 @@ void SinglePhasePoromechanics< SinglePhaseReservoirAndWells<>, SolidMechanicsLag
193192
EnumStrings< LinearSolverParameters::MGR::StrategyType >::toString( linearSolverParameters.mgr.strategy )));
194193
}
195194

196-
template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >
197-
void SinglePhasePoromechanics< FLOW_SOLVER, MECHANICS_SOLVER >::assembleSystem( real64 const time_n,
198-
real64 const dt,
199-
DomainPartition & domain,
200-
DofManager const & dofManager,
201-
CRSMatrixView< real64, globalIndex const > const & localMatrix,
202-
arrayView1d< real64 > const & localRhs )
203-
{
204-
GEOS_MARK_FUNCTION;
205-
206-
// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
207-
assembleElementBasedTerms( time_n,
208-
dt,
209-
domain,
210-
dofManager,
211-
localMatrix,
212-
localRhs );
213-
214-
// Step 3: compute the fluxes (face-based contributions)
215-
if( m_stabilizationType == StabilizationType::Global || m_stabilizationType == StabilizationType::Local )
216-
{
217-
this->flowSolver()->assembleStabilizedFluxTerms( dt,
218-
domain,
219-
dofManager,
220-
localMatrix,
221-
localRhs );
222-
}
223-
else
224-
{
225-
this->flowSolver()->assembleFluxTerms( dt,
226-
domain,
227-
dofManager,
228-
localMatrix,
229-
localRhs );
230-
}
231-
}
232-
233195
template<>
234196
void SinglePhasePoromechanics< SinglePhaseReservoirAndWells<>, SolidMechanicsLagrangianFEM >::assembleSystem( real64 const time_n,
235197
real64 const dt,
@@ -240,36 +202,11 @@ void SinglePhasePoromechanics< SinglePhaseReservoirAndWells<>, SolidMechanicsLag
240202
{
241203
GEOS_MARK_FUNCTION;
242204

243-
// Steps 1 and 2: compute element-based terms (mechanics and local flow terms)
244-
assembleElementBasedTerms( time_n,
245-
dt,
246-
domain,
247-
dofManager,
248-
localMatrix,
249-
localRhs );
250-
251-
// Step 3: compute the fluxes (face-based contributions)
252-
if( m_stabilizationType == StabilizationType::Global || m_stabilizationType == StabilizationType::Local )
253-
{
254-
this->flowSolver()->assembleStabilizedFluxTerms( dt,
255-
domain,
256-
dofManager,
257-
localMatrix,
258-
localRhs );
259-
}
260-
else
261-
{
262-
this->flowSolver()->assembleFluxTerms( dt,
263-
domain,
264-
dofManager,
265-
localMatrix,
266-
localRhs );
267-
}
268-
269-
// step 4: assemble well contributions
205+
Base::assembleSystem( time_n, dt, domain, dofManager, localMatrix, localRhs );
270206

271-
this->flowSolver()->wellSolver()->assembleSystem( time_n, dt, domain, dofManager, localMatrix, localRhs );
272-
this->flowSolver()->assembleCouplingTerms( time_n, dt, domain, dofManager, localMatrix, localRhs );
207+
// assemble well contributions
208+
flowSolver()->wellSolver()->assembleSystem( time_n, dt, domain, dofManager, localMatrix, localRhs );
209+
flowSolver()->assembleCouplingTerms( time_n, dt, domain, dofManager, localMatrix, localRhs );
273210
}
274211

275212
template< typename FLOW_SOLVER, typename MECHANICS_SOLVER >

src/coreComponents/physicsSolvers/multiphysics/SinglePhasePoromechanicsConformingFractures.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,23 @@ assembleFluidMassResidualDerivativeWrtDisplacement( MeshLevel const & mesh,
225225
} );
226226
}
227227

228+
template<>
229+
void SinglePhasePoromechanicsConformingFractures< SinglePhaseReservoirAndWells<> >::
230+
assembleSystem( real64 const time_n,
231+
real64 const dt,
232+
DomainPartition & domain,
233+
DofManager const & dofManager,
234+
CRSMatrixView< real64, globalIndex const > const & localMatrix,
235+
arrayView1d< real64 > const & localRhs )
236+
{
237+
GEOS_MARK_FUNCTION;
238+
239+
Base::assembleSystem( time_n, dt, domain, dofManager, localMatrix, localRhs );
240+
241+
// assemble well contributions
242+
flowSolver()->wellSolver()->assembleSystem( time_n, dt, domain, dofManager, localMatrix, localRhs );
243+
flowSolver()->assembleCouplingTerms( time_n, dt, domain, dofManager, localMatrix, localRhs );
244+
}
228245

229246
template class SinglePhasePoromechanicsConformingFractures<>;
230247
template class SinglePhasePoromechanicsConformingFractures< SinglePhaseReservoirAndWells<> >;

0 commit comments

Comments
 (0)