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

Modified well controls to match Intersect results #1202

Merged
merged 12 commits into from
Feb 2, 2021

Conversation

francoishamon
Copy link
Contributor

@francoishamon francoishamon commented Oct 14, 2020

This PR implements some changes in the well controls to match a simulation result generated with Intersect:

  • The pressure control now enforces the BHP at a user-specified reference elevation.
  • The rate control now enforces a volumetric oil phase/total rate at reservoir or surface conditions (for individual wells, no group control implemented).

With these changes I was able to match a two-phase DO simulation result with BHP and surface oil rate controls obtained with Intersect. If at some point we need to deal with more complex constraints, more work will be required.

This PR also changes the scaling of the control/pressure difference equations because the previous scaling was creating issues with fgmres + MGR.

Related to https://github.com/GEOSX/integratedTests/pull/114

@francoishamon francoishamon marked this pull request as ready for review January 8, 2021 18:37
Copy link
Contributor

@klevzoff klevzoff left a comment

Choose a reason for hiding this comment

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

Looks great!

Would be nice to have at least one integrated test exercise the new surface rate option (did I miss it?)

@@ -303,6 +303,9 @@ class WellSolverBase : public SolverBase
/// the number of Degrees of Freedom per reservoir element
localIndex m_numDofPerResElement;

/// copy of the time step size saved in this class for residual normalization
real64 m_currentDt;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a task for this PR, but perhaps we should be passing dt into CalculateResidualNorm()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I agree that it would be useful to have the dt passed as an argument of calculateResidualNorm here and maybe for others as well. I can take care of this in another PR.

@francoishamon
Copy link
Contributor Author

Looks great!

Would be nice to have at least one integrated test exercise the new surface rate option (did I miss it?)

Yes you are right the surface rate option must be used and checked in the integrated tests. In the latest commit it is now used for single-phase flow in staircase_single_phase_wells_hybrid_3d.xml and for multiphase flow in dead_oil_wells_2d.xml.

Copy link
Collaborator

@CusiniM CusiniM left a comment

Choose a reason for hiding this comment

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

Nice work!

// above/below the target pressure depending on well type
pressureControl = ( wellType == WellControls::Type::PRODUCER )
? 0.5 * pres
: 2.0 * pres;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

So isnt' the targetBHP defined even for rate constrained wells as (e.g., as an upper limit for injectors) Is this for the case in which it is not specified by the user? Maybe I am confused by what the reference pressure is. Or is this just like an initial guess?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you are right rate-constrained wells have a targetBHP as well, and the code will stop if the targetBHP is not specified (for both single-phase and compositional). What is done here is just a not-very-good way to initialize the pressure in rate-constrained wells at the beginning of the simulation, before the first iteration.

A better way would be to set the initial pressure using targetBHP (for instance, slightly below targetBHP for injectors). To be honest, I did not use the targetBHP to initialize the injectors that because I sometimes (often ;) ) use a very large targetBHP to keep the wells at rate constraint during the full simulation, even if it is not realistic (and I don't want this large targetBHP to perturb the initialization...). I am going to add this explanation to the inline comment just before the line you referenced.

Ultimately, to have a really good well initialization and to improve the nonlinear convergence, it would be helpful to guess the well pressure and rate by solving small local well systems (with fixed reservoir values), but there is a little bit of work to do to allow that.

@francoishamon francoishamon added ci: run CUDA builds Allows to triggers (costly) CUDA jobs and removed flag: ready for review labels Feb 2, 2021
@francoishamon francoishamon merged commit b204d2c into develop Feb 2, 2021
@francoishamon francoishamon deleted the feature/hamon/newWellConstraints branch February 2, 2021 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: run CUDA builds Allows to triggers (costly) CUDA jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants