Moved struct WellControls to the implementation file well_controls.c.

This commit is contained in:
Joakim Hove 2014-01-06 15:13:32 +01:00
parent 23b91c5466
commit 38b635a97f
4 changed files with 68 additions and 72 deletions

View File

@ -257,7 +257,6 @@ list (APPEND PUBLIC_HEADER_FILES
opm/core/version.h opm/core/version.h
opm/core/wells.h opm/core/wells.h
opm/core/well_controls.h opm/core/well_controls.h
opm/core/well_control_type.h
opm/core/pressure/CompressibleTpfa.hpp opm/core/pressure/CompressibleTpfa.hpp
opm/core/pressure/FlowBCManager.hpp opm/core/pressure/FlowBCManager.hpp
opm/core/pressure/IncompTpfa.hpp opm/core/pressure/IncompTpfa.hpp

View File

@ -21,80 +21,20 @@
#define OPM_WELL_CONTROLS_H_INCLUDED #define OPM_WELL_CONTROLS_H_INCLUDED
#include <stdbool.h> #include <stdbool.h>
#include <opm/core/well_control_type.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
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 */
* Controls for a single well.
* Each control specifies a well rate or bottom-hole pressure. Only
* one control can be active at a time, indicated by current. The
* meaning of each control's target value depends on the control type:
*
* - BHP -> target pressure in Pascal.
* - RESERVOIR_RATE -> target reservoir volume rate in cubic(meter)/second
* - SURFACE_RATE -> target surface volume rate in cubic(meter)/second
*
* The sign convention for RATE targets is as follows:
*
* - (+) Fluid flowing into reservoir, i.e. injecting.
* - (-) Fluid flowing out of reservoir, i.e. producing.
*
* For *_RATE controls, the distribution of phases used for the control
* is also needed. For example, a total rate control should have 1.0
* for each phase, whereas a control on oil rate should have 1.0 for
* the oil phase and 0.0 for the rest. For BHP controls, this is unused.
* The active control acts as an equality constraint, whereas the
* non-active controls should be interpreted as inequality
* constraints (upper or lower bounds). For instance, a PRODUCER's
* BHP constraint defines a minimum acceptable bottom-hole pressure
* value for the well.
*/
#ifdef HAVE_WELLCONTROLS
struct WellControls
{
/**
* Number of controls.
*/
int num;
int number_of_phases;
/**
* Array of control types.
*/
enum WellControlType *type;
/**
* Array of control targets.
*/
double *target;
/**
* Array of rate control distributions,
* <CODE>number_of_phases</CODE> numbers for each control
*/
double *distr;
/**
* Index of current active control.
*/
int current;
/*
The capacity allocated.
*/
int cpty;
}; };
#else
struct WellControls; struct WellControls;
#endif
bool bool
well_controls_equal(const struct WellControls *ctrls1, const struct WellControls *ctrls2); well_controls_equal(const struct WellControls *ctrls1, const struct WellControls *ctrls2);

View File

@ -21,7 +21,7 @@
#define OPM_WELLS_H_INCLUDED #define OPM_WELLS_H_INCLUDED
#include <stdbool.h> #include <stdbool.h>
#include <opm/core/well_control_type.h> #include <opm/core/well_controls.h>
/** /**
* \file * \file
@ -44,8 +44,6 @@ enum WellType {
}; };
struct WellControls;
/** /**
* Data structure aggregating static information about all wells in a scenario. * Data structure aggregating static information about all wells in a scenario.
*/ */

View File

@ -36,14 +36,73 @@
#include "config.h" #include "config.h"
#define HAVE_WELLCONTROLS
#include <opm/core/well_controls.h> #include <opm/core/well_controls.h>
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
/**
* Controls for a single well.
* Each control specifies a well rate or bottom-hole pressure. Only
* one control can be active at a time, indicated by current. The
* meaning of each control's target value depends on the control type:
*
* - BHP -> target pressure in Pascal.
* - RESERVOIR_RATE -> target reservoir volume rate in cubic(meter)/second
* - SURFACE_RATE -> target surface volume rate in cubic(meter)/second
*
* The sign convention for RATE targets is as follows:
*
* - (+) Fluid flowing into reservoir, i.e. injecting.
* - (-) Fluid flowing out of reservoir, i.e. producing.
*
* For *_RATE controls, the distribution of phases used for the control
* is also needed. For example, a total rate control should have 1.0
* for each phase, whereas a control on oil rate should have 1.0 for
* the oil phase and 0.0 for the rest. For BHP controls, this is unused.
* The active control acts as an equality constraint, whereas the
* non-active controls should be interpreted as inequality
* constraints (upper or lower bounds). For instance, a PRODUCER's
* BHP constraint defines a minimum acceptable bottom-hole pressure
* value for the well.
*/
struct WellControls
{
/**
* Number of controls.
*/
int num;
int number_of_phases;
/**
* Array of control types.
*/
enum WellControlType *type;
/**
* Array of control targets.
*/
double *target;
/**
* Array of rate control distributions,
* <CODE>number_of_phases</CODE> numbers for each control
*/
double *distr;
/**
* Index of current active control.
*/
int current;
/*
The capacity allocated.
*/
int cpty;
};
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */