GEOS-DEV / GEOS

GEOS Simulation Framework
GNU Lesser General Public License v2.1
222 stars 89 forks source link

[Bug] Floating point exception when using totalRateTable for well control #1598

Closed wdmhouston closed 3 years ago

wdmhouston commented 3 years ago

Geosx version: latest develop release

I observed this error when testing totalRateTable in a real case. wellcontrol.zip

Attached zip file contains two xml files created to replicate this issue.

wellcontrol_lt_fixedrate.xml is a base case with targetTotalRate specified in WellControls node, and it runs fine without error.

wellcontrol_lt.xml is a case with "totalRateTable", and injectors are shutdown after several years:

        <TableFunction name="totalRateTable"
                       inputVarNames="{time}"
                       coordinates="{0, 373248000, 1508544000}"
                       values="{0.0051, 0, 0}"
                       interpolation="lower"/>

and geosx crashes with the following message:

Time: 6.16896e+08s, dt:2.592e+06s, Cycle: 128
    Attempt:  0, NewtonIter:  0
    ( Rfluid ) = (3.32e-01) ;     ( R ) = ( 3.91e-01 ) ; 
    Attempt:  0, NewtonIter:  1
    ( Rfluid ) = (2.76e-02) ;     ( R ) = ( 3.24e+00 ) ; 
    Last LinSolve(iter,res) = (   2, 6.04e-03 ) ; 
        Line search @ 0.500:          ( Rfluid ) = (1.66e-01) ; 
        Line search @ 0.250:          ( Rfluid ) = (2.49e-01) ; 
    Attempt:  0, NewtonIter:  2
    ( Rfluid ) = (7.43e-03) ;     ( R ) = ( 1.88e+00 ) ; 
    Last LinSolve(iter,res) = (   2, 6.45e-03 ) ; 
        Line search @ 0.500:          ( Rfluid ) = (1.24e-01) ; 
        Line search @ 0.250:          ( Rfluid ) = (1.87e-01) ; 
    Attempt:  0, NewtonIter:  3
    ( Rfluid ) = (5.98e-03) ;     ( R ) = ( 1.10e+00 ) ; 
    Last LinSolve(iter,res) = (   2, 6.86e-03 ) ; 
        Line search @ 0.500:          ( Rfluid ) = (9.32e-02) ; 
        Line search @ 0.250:          ( Rfluid ) = (1.40e-01) ; 
    Attempt:  0, NewtonIter:  4
    ( Rfluid ) = (5.29e-03) ;     ( R ) = ( 6.04e-01 ) ; 
    Last LinSolve(iter,res) = (   2, 7.17e-03 ) ; 
        Line search @ 0.500:          ( Rfluid ) = (7.00e-02) ; 
    Attempt:  0, NewtonIter:  5
    ( Rfluid ) = (8.68e-04) ;     ( R ) = ( 1.54e-01 ) ; 
    Last LinSolve(iter,res) = (   2, 8.60e-03 ) ; 
Received signal 8: Floating point exception
Floating point exception:

** StackTrace of 21 frames **
Frame 0: /lib/x86_64-linux-gnu/libc.so.6 
Frame 1: dgemm_ 
Frame 2: dlsum_fmod_inv_master 
Frame 3: pdgstrs 
Frame 4: pdgssvx 
Frame 5: hypre_SLUDistSolve 
Frame 6: hypre_MGRDirectSolverSolve 
Frame 7: hypre_MGRCycle 
Frame 8: hypre_MGRSolve 
Frame 9: hypre_FlexGMRESSolve 
Frame 10: geosx::HypreSolver::doSolve(geosx::HypreVector const&, geosx::HypreVector&) const 
Frame 11: geosx::HypreSolver::solve(geosx::HypreVector const&, geosx::HypreVector&) const 
Frame 12: geosx::SolverBase::solveSystem(geosx::DofManager const&, geosx::HypreMatrix&, geosx::HypreVector&, geosx::HypreVector&) 
Frame 13: geosx::SolverBase::nonlinearImplicitStep(double const&, double const&, int, geosx::DomainPartition&) 
Frame 14: geosx::ReservoirSolverBase::solverStep(double const&, double const&, int, geosx::DomainPartition&) 
Frame 15: geosx::SolverBase::execute(double, double, int, int, double, geosx::DomainPartition&) 
Frame 16: geosx::EventBase::execute(double, double, int, int, double, geosx::DomainPartition&) 
Frame 17: geosx::EventManager::run(geosx::DomainPartition&) 
Frame 18: geosx::GeosxState::run() 
Frame 19: main 
Frame 20: __libc_start_main 
Frame 21: _start 
=====
...
** StackTrace of 23 frames **
Frame 0: /lib/x86_64-linux-gnu/libc.so.6 
Frame 1: /usr/lib/x86_64-linux-gnu/openmpi/lib/openmpi3/mca_btl_vader.so 
Frame 2: opal_progress 
Frame 3: mca_pml_ob1_recv 
Frame 4: MPI_Recv 
Frame 5: pdgstrs 
Frame 6: pdgssvx 
Frame 7: hypre_SLUDistSolve 
Frame 8: hypre_MGRDirectSolverSolve 
Frame 9: hypre_MGRCycle 
Frame 10: hypre_MGRSolve 
Frame 11: hypre_FlexGMRESSolve 
Frame 12: geosx::HypreSolver::doSolve(geosx::HypreVector const&, geosx::HypreVector&) const 
Frame 13: geosx::HypreSolver::solve(geosx::HypreVector const&, geosx::HypreVector&) const 
Frame 14: geosx::SolverBase::solveSystem(geosx::DofManager const&, geosx::HypreMatrix&, geosx::HypreVector&, geosx::HypreVector&) 
Frame 15: geosx::SolverBase::nonlinearImplicitStep(double const&, double const&, int, geosx::DomainPartition&) 
Frame 16: geosx::ReservoirSolverBase::solverStep(double const&, double const&, int, geosx::DomainPartition&) 
Frame 17: geosx::SolverBase::execute(double, double, int, int, double, geosx::DomainPartition&) 
Frame 18: geosx::EventBase::execute(double, double, int, int, double, geosx::DomainPartition&) 
Frame 19: geosx::EventManager::run(geosx::DomainPartition&) 
Frame 20: geosx::GeosxState::run() 
Frame 21: main 
Frame 22: __libc_start_main 
Frame 23: _start 
=====

[geosx-test:04689] 14 more processes have sent help message help-mpi-api.txt / mpi-abort
[geosx-test:04689] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages

Logs files can be found inside the zip file. Any idea? Please download the dataset for further investigation.

francoishamon commented 3 years ago

Hi @wdmhouston Thanks for reporting the error. The well block seems to become singular after some time when the well is shut, I will have a look at the problem

francoishamon commented 3 years ago

Hello @wdmhouston,

You can check the branch bugfix/hamon/fixWellShutDown that fixes your problem and will allow you to complete the simulation. Regarding a couple of other points in your input file:

wdmhouston commented 3 years ago

Hello @wdmhouston,

You can check the branch bugfix/hamon/fixWellShutDown that fixes your problem and will allow you to complete the simulation. Regarding a couple of other points in your input file:

@francoishamon Thanks! will try it out. For analytical aquifer, can you show me an example or we can have a quick online meeting for this.