GEOS
WellBHPConstraints.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
16 /*
17  * @file WellBHPConstraints.hpp
18  */
19 
20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_WELLBHPCONSTRAINTS_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_WELLBHPCONSTRAINTS_HPP
22 
24 #include "dataRepository/Group.hpp"
26 #include "WellConstraintsBase.hpp"
27 namespace geos
28 {
29 
31 {
32  MIN,
33  MAX,
35 };
36 
37 
42 template< BHPConstraintTypeId T >
44 {
45 public:
50 
56  explicit BHPConstraint( string const & name, dataRepository::Group * const parent );
57 
58 
62  ~BHPConstraint() override;
63 
67  BHPConstraint() = delete;
68 
72  BHPConstraint( BHPConstraint const & ) = delete;
73 
77  BHPConstraint( BHPConstraint && ) = delete;
78 
83  BHPConstraint & operator=( BHPConstraint const & ) = delete;
84 
90 
92 
97 
98  // Temp interface - tjb
99  virtual ConstraintTypeId getControl() const override { return ConstraintTypeId::BHP; };
100 
102 
107  {
109  static constexpr char const * targetBHPString() { return "targetBHP"; }
111  static constexpr char const * refElevString() { return "referenceElevation"; }
112  }
113  viewKeysWellBHPConstraint;
114 
115  virtual bool checkViolation( WellConstraintBase const & currentConstraint, real64 const & currentTime ) const override;
116 
122 
127  void setReferenceElevation( real64 const & refElevation ) { m_refElevation=refElevation; }
128 
134 
138  void setReferenceGravityCoef( real64 const & refGravCoef ) { m_refGravCoef = refGravCoef; }
139 
140 
145  static string catalogName()
146  {
147  if constexpr (T == BHPConstraintTypeId::MAX)
148  {
149  return "MaximumBHPConstraint";
150  }
151  else
152  {
153  return "MinimumBHPConstraint";
154  }
155 
156  }
157 
158 
159  virtual string getCatalogName() const override { return catalogName(); }
160 protected:
161 
162  virtual void postInputInitialization() override;
163 
166 
169 
170 };
171 
174 
175 } //namespace geos
176 
177 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_WELLBHPCONSTRAINTS_HPP
This class describes a minimum pressure constraint used to control a injection well.
BHPConstraint & operator=(BHPConstraint const &)=delete
Deleted assignment operator.
~BHPConstraint() override
Default destructor.
BHPConstraint()=delete
Deleted default constructor.
static string catalogName()
name of the node manager in the object catalog
virtual bool checkViolation(WellConstraintBase const &currentConstraint, real64 const &currentTime) const override
Check if this constraint is violated.
real64 m_refGravCoef
Gravity coefficient of the reference elevation.
virtual string getCatalogName() const override
function to return the catalog name of the derived class
void setReferenceGravityCoef(real64 const &refGravCoef)
Setter for the reference gravity.
BHPConstraint(BHPConstraint &&)=delete
Deleted move constructor.
void setReferenceElevation(real64 const &refElevation)
Set the reference elevation where the BHP control is enforced.
BHPConstraint(string const &name, dataRepository::Group *const parent)
Constructor for WellControls Objects.
virtual void postInputInitialization() override
real64 m_refElevation
Reference elevation.
real64 getReferenceGravityCoef() const
Getter for the reference gravity coefficient.
BHPConstraint & operator=(BHPConstraint &&)=delete
Deleted move operator.
BHPConstraint(BHPConstraint const &)=delete
Deleted copy constructor.
real64 getReferenceElevation() const
Getter for the reference elevation where the BHP control is enforced.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
int integer
Signed integer type.
Definition: DataTypes.hpp:81
Struct to serve as a container for variable strings and keys.
static constexpr char const * targetBHPString()
String key for the well target BHP.
static constexpr char const * refElevString()
String key for the well reference elevation (for BHP control)