2014-01-03 08:34:01 -06:00
|
|
|
/*
|
|
|
|
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPM_WELL_CONTROLS_H_INCLUDED
|
|
|
|
#define OPM_WELL_CONTROLS_H_INCLUDED
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2014-01-06 08:13:32 -06:00
|
|
|
|
2014-07-01 10:57:02 -05:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* API for managing sets of well controls.
|
|
|
|
*/
|
2014-01-03 08:34:01 -06:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-01-06 08:13:32 -06:00
|
|
|
enum WellControlType {
|
|
|
|
BHP, /**< Well constrained by BHP target */
|
|
|
|
RESERVOIR_RATE, /**< Well constrained by reservoir volume flow rate */
|
|
|
|
SURFACE_RATE /**< Well constrained by surface volume flow rate */
|
2014-01-03 08:34:01 -06:00
|
|
|
};
|
2014-01-06 08:13:32 -06:00
|
|
|
|
2014-01-30 02:50:09 -06:00
|
|
|
struct WellControls;
|
2014-01-03 08:34:01 -06:00
|
|
|
|
2014-01-05 07:47:15 -06:00
|
|
|
bool
|
2014-01-30 02:50:09 -06:00
|
|
|
well_controls_equal(const struct WellControls *ctrls1, const struct WellControls *ctrls2 , bool verbose);
|
2014-01-03 08:34:01 -06:00
|
|
|
|
2014-01-05 07:47:15 -06:00
|
|
|
struct WellControls *
|
|
|
|
well_controls_create(void);
|
|
|
|
|
2014-07-01 10:57:02 -05:00
|
|
|
/**
|
|
|
|
* Create deep copy (clone) of an existing set of well controls.
|
|
|
|
*
|
|
|
|
* @param[in] ctrl Existing set of well controls.
|
|
|
|
*
|
|
|
|
* @return Deep copy of @c ctrl.
|
|
|
|
*/
|
|
|
|
struct WellControls *
|
|
|
|
well_controls_clone(const struct WellControls *ctrl);
|
|
|
|
|
2014-01-05 07:47:15 -06:00
|
|
|
void
|
|
|
|
well_controls_destroy(struct WellControls *ctrl);
|
|
|
|
|
|
|
|
|
2014-01-05 09:22:30 -06:00
|
|
|
int
|
|
|
|
well_controls_get_num(const struct WellControls *ctrl);
|
|
|
|
|
|
|
|
int
|
|
|
|
well_controls_get_current( const struct WellControls * ctrl);
|
|
|
|
|
|
|
|
void
|
|
|
|
well_controls_set_current( struct WellControls * ctrl, int current);
|
|
|
|
|
2014-03-04 07:28:42 -06:00
|
|
|
|
|
|
|
bool
|
2014-11-18 01:32:55 -06:00
|
|
|
well_controls_well_is_stopped(const struct WellControls * ctrl);
|
2014-03-04 07:28:42 -06:00
|
|
|
|
|
|
|
bool
|
|
|
|
well_controls_well_is_open(const struct WellControls * ctrl);
|
|
|
|
|
|
|
|
void
|
|
|
|
well_controls_open_well( struct WellControls * ctrl);
|
|
|
|
|
|
|
|
void
|
2014-11-18 01:32:55 -06:00
|
|
|
well_controls_stop_well( struct WellControls * ctrl);
|
2014-01-06 05:06:36 -06:00
|
|
|
|
2014-01-05 09:22:30 -06:00
|
|
|
int
|
|
|
|
well_controls_add_new(enum WellControlType type , double target , const double * distr , struct WellControls * ctrl);
|
|
|
|
|
|
|
|
enum WellControlType
|
|
|
|
well_controls_iget_type(const struct WellControls * ctrl, int control_index);
|
|
|
|
|
2014-01-06 07:40:03 -06:00
|
|
|
enum WellControlType
|
|
|
|
well_controls_get_current_type(const struct WellControls * ctrl);
|
|
|
|
|
2014-01-06 05:06:36 -06:00
|
|
|
void
|
|
|
|
well_controls_iset_type( struct WellControls * ctrls , int control_index , enum WellControlType type);
|
|
|
|
|
|
|
|
void
|
|
|
|
well_controls_iset_target(struct WellControls * ctrl, int control_index , double target);
|
|
|
|
|
2014-01-05 09:22:30 -06:00
|
|
|
double
|
|
|
|
well_controls_iget_target(const struct WellControls * ctrl, int control_index);
|
|
|
|
|
2014-01-06 07:40:03 -06:00
|
|
|
double
|
|
|
|
well_controls_get_current_target(const struct WellControls * ctrl);
|
|
|
|
|
2014-01-05 09:22:30 -06:00
|
|
|
const double *
|
|
|
|
well_controls_iget_distr(const struct WellControls * ctrl, int control_index);
|
|
|
|
|
2014-01-06 05:22:15 -06:00
|
|
|
void
|
|
|
|
well_controls_iset_distr(const struct WellControls * ctrl, int control_index, const double * distr);
|
|
|
|
|
2014-01-06 07:40:03 -06:00
|
|
|
const double *
|
|
|
|
well_controls_get_current_distr(const struct WellControls * ctrl);
|
|
|
|
|
2014-01-05 09:22:30 -06:00
|
|
|
void
|
|
|
|
well_controls_assert_number_of_phases(struct WellControls * ctrl , int number_of_phases);
|
2014-01-05 07:47:15 -06:00
|
|
|
|
2014-01-05 09:22:30 -06:00
|
|
|
void
|
|
|
|
well_controls_clear(struct WellControls * ctrl);
|
2014-01-05 07:47:15 -06:00
|
|
|
|
2014-01-03 08:34:01 -06:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* OPM_WELL_CONTROLS_H_INCLUDED */
|