Skip to content

Well Estimator + Constraint Selector #3735

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

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

Conversation

tjb-ltk
Copy link
Contributor

@tjb-ltk tjb-ltk commented Jul 18, 2025

  1. Add well estimator solve assuming fixed reservoir conditions

    • solve applied at beginning of Jacobian assembly of the coupled system
    • frequency determined via input setting
  2. Refactor constraint specification

    • Introduce constraint definition in schema such as MinimumBHPConstraint or PhaseProductionConstraint to encapsulate quantities associated with each constraint type
    • Added kernels for constraint equation JacGen specialized for constraint type
  3. Introduced concept of well separator internally to remove ambiguity of fluid model quantities encountered when using same fluid model for constraint flashes and well element calculations. No input schema changes. This should be under separate PR to include formal well separator schema

  4. Introduced limiting constraint selector to work with well estimator. At the beginning of the first n Newton Iterations , for each constraint, the well estimator applied and the most limiting constraint selected and set as the active constraint for the remaining Newton iterations.

  5. PR currently has a fair bit of well debug code that will be removed

tjb-ltk and others added 22 commits May 13, 2025 14:56
…m for each well, 2) refactor accum/flux/presrelation calcs
…Newton for now, incl well dbg for now, compo1&2d run
… skip calcs if well not open, 3) parallel estimator works on a few cases tested
…new&old logic, add basic basic constraint selection
…tor w/well estimator, 3) split constraint derivatives from well rate calculations, 4) add kernels for active constraint jacgen calcs , 5) needs testing
setDefaultValue( -1 ).
setSizedFromParent( 0 ).
setInputFlag( dataRepository::InputFlags::OPTIONAL ).
setDescription( "Global component densities of the injection stream [moles/m^3 or kg/m^3]" );
Copy link
Contributor

Choose a reason for hiding this comment

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

I always assumed this to be fractions (mass or mole).


Group * constraint = nullptr;
if( childKey == viewKeyStruct::minimumBHPConstraintString() )
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing we are expecting only one constraint of each type. Is there a way we can enforce this? Something similar to the NonLinearParameters on the solvers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the user, yes only one constraint of each type, but the code would still select the most limiting constraint. I will put code in to enforce this, and also valid combinations of constraints.

  1. There maybe more than one constraint of each type for operations like WHP or scaling, where the simulator imposes a constraint based on some allocation scheme, or for WHP, it would implement this as a BHP constraint, or other. Constraints are usually tagged with USER or SIM, where SIM being an internally generated constraint. How/when these SIM constraints get registered still needs to be addressed.
  2. you can assign inj and prod constraints to a well. This is more of an oil field usecase, cycling, but for geothermal this might be of use for closed loop well, which could have 2 boundary conditions.

/// string key for the maximum volume rate for a injector
static constexpr char const * volumeInjectionConstraintString() { return "VolumeInjectionConstraint"; }
/// string key for the maximum mass rate for a producer
static constexpr char const * massProductionConstraintString() { return "massProductionConstraint"; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static constexpr char const * massProductionConstraintString() { return "massProductionConstraint"; }
static constexpr char const * massProductionConstraintString() { return "MassProductionConstraint"; }

/// string key for the maximum mass rate for a producer
static constexpr char const * massProductionConstraintString() { return "massProductionConstraint"; }
/// string key for the maximum mass rate for a injector
static constexpr char const * massInjectionConstraintString() { return "massInjectionConstraint"; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
static constexpr char const * massInjectionConstraintString() { return "massInjectionConstraint"; }
static constexpr char const * massInjectionConstraintString() { return "MassInjectionConstraint"; }

* @brief This class describes a phase rate constraint used to control a injection well.
*/

class PhaseInjectionConstraint : public PhaseConstraint
Copy link
Contributor

Choose a reason for hiding this comment

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

How is PhaseInjectionConstraint different from VolumeInjectionConstraint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably should be called TotalVolume...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and Phase could be called PhaseVolume

tjb-ltk added 3 commits July 29, 2025 09:36
… base, 2) numerous fixes, 3) prod and inj well test cases w & wout estimator
@tjb-ltk tjb-ltk requested a review from rasimHZ as a code owner August 14, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants