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: well time step selector based on rates/bhp tables and clarify well rates logic #3427

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from

Conversation

paveltomin
Copy link
Contributor

@paveltomin paveltomin commented Nov 6, 2024

Two things in this PR:

  1. Implement setNextDt in well solver which looks at all rates/bhp/status tables and makes sure time step is selected so that we honor table intervals. Can be enabled by timeStepFromTables flag in well solver.
  2. Change logic for well rates - currently inputted and outputted from t_n+dt (end of time step) - switch to t_n (beginning of time step) - this should be more consistent with lower interpolation method that is used and prevent grabbing "future" rate from tables and avoid weird behavior when time step cut can lead to shutting of wells.

@@ -377,4 +377,73 @@ WellControls const & WellSolverBase::getWellControls( WellElementSubRegion const
return this->getGroup< WellControls >( subRegion.getWellControlsName());
}

real64 WellSolverBase::setNextDt( real64 const & currentTime, const real64 & lastDt, geos::DomainPartition & domain )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

main thing is in this function

@paveltomin paveltomin changed the title feat: well time step selector based on rates/bhp tables feat: well time step selector based on rates/bhp tables and clarify well rates logic Nov 6, 2024
@paveltomin

This comment was marked as resolved.

@paveltomin paveltomin requested a review from dkachuma November 12, 2024 18:04
Copy link
Contributor

@dkachuma dkachuma left a comment

Choose a reason for hiding this comment

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

It's quite a change (switching the well from t+dt to t). But I don't see anything wrong - in any case it seems more correct. I don't think the cases we have with wells would be so greatly affected.

src/coreComponents/functions/TableFunction.cpp Outdated Show resolved Hide resolved
src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp Outdated Show resolved Hide resolved
@@ -2356,13 +2356,6 @@ bool SolidMechanicsLagrangeContact::isFractureAllInStickCondition( DomainPartiti
return ( ( numNewSlip + numSlip + numOpen ) == 0 );
}

real64 SolidMechanicsLagrangeContact::setNextDt( real64 const & currentDt,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional? Do we really want this solver to inherit the behaviour of the base class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

intentional - yes but I forgot about that change and didn't mention it in the description, sorry
it is very confusing what SolidMechanicsLagrangeContact::setNextDt does right now by returning currentDt and next time step, this basically blocks time step increase? (CC @CusiniM @matteofrigo5 @castelletto1)
could go in a small simple PR with just that fix

Copy link
Member

Choose a reason for hiding this comment

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

@paveltomin Put this in its own PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done #3490

@@ -315,4 +315,44 @@ WellControls const & WellSolverBase::getWellControls( WellElementSubRegion const
return this->getGroup< WellControls >( subRegion.getWellControlsName());
}

real64 WellSolverBase::setNextDt( real64 const & time, const real64 & lastDt, geos::DomainPartition & domain )
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should include an option to disable this. I might very finely discretise my rate function without wanting geos to take such small time steps.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok sounds good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added timeStepFromTables flag to enable new behavior, disabled by default

src/coreComponents/functions/TableFunction.hpp Outdated Show resolved Hide resolved
@paveltomin
Copy link
Contributor Author

Waiting on code owner review from @CusiniM, @Guotong-Ren, @VidarStiernstrom, @castelletto1, @cssherman, @frankfeifan, @jhuang2601, @matteofrigo5, @rrsettgast, @ryar9534, and/or 1 others.

@paveltomin

This comment was marked as resolved.

@paveltomin
Copy link
Contributor Author

@paveltomin paveltomin added the ci: run integrated tests Allows to run the integrated tests in GEOS CI label Dec 4, 2024
@paveltomin paveltomin added the flag: requires rebaseline Requires rebaseline branch in integratedTests label Dec 4, 2024
@paveltomin paveltomin removed the ci: run integrated tests Allows to run the integrated tests in GEOS CI label Dec 9, 2024
@paveltomin
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: ready for review flag: requires rebaseline Requires rebaseline branch in integratedTests type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants