00001
00010 #ifndef BS_WELLS_WELL_RATE_CONTROL_INTERFACE_H_
00011 #define BS_WELLS_WELL_RATE_CONTROL_INTERFACE_H_
00012
00013 #include "rate_control_type.h"
00014 #include "make_me_happy.h"
00015
00016 namespace blue_sky {
00017
00018 template <typename strategy_t> class calc_model;
00019 template <typename strategy_t> class BS_API_PLUGIN well;
00020
00021 namespace wells {
00022
00023 template <typename strategy_t> class BS_API_PLUGIN connection;
00024 template <typename strategy_t> class BS_API_PLUGIN well_controller;
00025 }
00026
00027 }
00028
00029 namespace blue_sky {
00030 namespace wells {
00031
00032 template <typename strategy_t>
00033 class well_rate_control_interface : public objbase
00034 {
00035 public:
00036 typedef typename strategy_t::item_t item_t;
00037 typedef typename strategy_t::index_t index_t;
00038
00039 typedef calc_model <strategy_t> calc_model_t;
00040 typedef jacobian_matrix <strategy_t> jmatrix_t;
00041 typedef well <strategy_t> well_t;
00042 typedef wells::well_controller <strategy_t> well_controller_t;
00043 typedef wells::connection <strategy_t> connection_t;
00044
00045 typedef smart_ptr <calc_model_t, true> sp_calc_model_t;
00046 typedef smart_ptr <jmatrix_t, true> sp_jmatrix_t;
00047 typedef smart_ptr <well_t, true> sp_well_t;
00048 typedef smart_ptr <well_controller_t, true> sp_well_controller_t;
00049 typedef smart_ptr <connection_t, true> sp_connection_t;
00050
00051 public:
00052 virtual void compute_rate (const sp_calc_model_t &calc_model, sp_jmatrix_t &jmatrix, sp_well_t &well, const sp_well_controller_t &well_controller) const = 0;
00053 virtual void compute_derivs (const sp_calc_model_t &calc_model, sp_jmatrix_t &jmatrix, sp_well_t &well, const sp_well_controller_t &well_controller) const = 0;
00054
00055 virtual ~well_rate_control_interface ()
00056 {
00057 }
00058 };
00059
00060 template <typename strategy_t>
00061 class well_rate_control_factory : public objbase
00062 {
00063 public:
00064 typedef calc_model <strategy_t> calc_model_t;
00065 typedef well_rate_control_interface <strategy_t> well_rate_control_t;
00066
00067 typedef smart_ptr <calc_model_t, true> sp_calc_model_t;
00068 typedef smart_ptr <well_rate_control_t, true> sp_well_rate_control_t;
00069
00070 public:
00071
00072 MAKE_ME_HAPPY (well_rate_control_factory, objbase, "well_rate_control_factory");
00073
00074 virtual sp_well_rate_control_t
00075 create_control (rate_control_type , bool ,
00076 bool , const sp_calc_model_t & )
00077 {
00078
00079 bs_throw_exception ("PURE_CALL");
00080 }
00081
00082 virtual ~well_rate_control_factory ()
00083 {
00084 }
00085 };
00086
00087 }
00088 }
00089
00090
00091 #endif // #ifndef BS_WELLS_WELL_RATE_CONTROL_INTERFACE_H_
00092