Changed input arguments for group checking

This commit is contained in:
Kjetil Olsen Lye 2012-04-12 16:56:58 +02:00
parent b6afa84a65
commit 1a524b0a14
5 changed files with 14 additions and 12 deletions

View File

@ -68,8 +68,10 @@ int main(int argc, char** argv) {
std::vector<double> pressure;
std::vector<double> face_flux;
//pressure_solver.solve(totmob, omega, src, bcs.c_bcs(), pressure, face_flux);
if(wells.wellCollection().conditionsMet(pressure, *grid.c_grid())) {
std::vector<double> well_bhp;
std::vector<double> well_rate;
//pressure_solver.solve(totmob, omega, src, bcs.c_bcs(), pressure, face_flux, well_bhp, well_rate);
if(wells.wellCollection().conditionsMet(well_bhp, well_rate)) {
std::cout << "Conditions met for wells!" << std::endl;
}
else

View File

@ -88,9 +88,9 @@ namespace Opm
return NULL;
}
bool WellCollection::conditionsMet(const std::vector<double>& pressure, const UnstructuredGrid& grid) const {
bool WellCollection::conditionsMet(const std::vector<double>& well_bhp, const std::vector<double>& well_rate) const {
for(size_t i = 0; i < leaf_nodes_.size(); i++) {
if(! static_cast<WellNode*>(leaf_nodes_[i].get())->conditionsMet(pressure, grid) ) {
if(! static_cast<WellNode*>(leaf_nodes_[i].get())->conditionsMet(well_bhp, well_rate) ) {
return false;
}
}

View File

@ -40,7 +40,7 @@ namespace Opm
const EclipseGridParser& deck);
bool conditionsMet(const std::vector<double>& pressure, const UnstructuredGrid& grid) const;
bool conditionsMet(const std::vector<double>& well_bhp, const std::vector<double>& well_rate) const;
const std::vector<std::tr1::shared_ptr<WellsGroupInterface> >& getLeafNodes() const;
private:

View File

@ -64,11 +64,11 @@ namespace Opm
}
bool WellsGroup::conditionsMet(const std::vector<double>& pressure,
const UnstructuredGrid& grid, const struct Wells* wells, int index_of_well)
bool WellsGroup::conditionsMet(const std::vector<double>& well_bhp, const std::vector<double>& well_rate,
const struct Wells* wells, int index_of_well)
{
if(parent_ != NULL) {
bool parent_ok = (static_cast<WellsGroup*>(parent_))->conditionsMet(pressure, grid, wells, index_of_well);
bool parent_ok = (static_cast<WellsGroup*>(parent_))->conditionsMet(well_bhp, well_rate, wells, index_of_well);
if(!parent_ok) {
return false;
}
@ -88,10 +88,10 @@ namespace Opm
{
}
bool WellNode::conditionsMet(const std::vector<double>& pressure, const UnstructuredGrid& grid)
bool WellNode::conditionsMet(const std::vector<double>& well_bhp, const std::vector<double>& well_rate)
{
if(parent_ != NULL) {
bool parent_ok = (static_cast<WellsGroup*>(parent_))->conditionsMet(pressure, grid, wells_, self_index_);
bool parent_ok = (static_cast<WellsGroup*>(parent_))->conditionsMet(well_bhp, well_rate, wells_, self_index_);
if(!parent_ok) {
return false;
}

View File

@ -58,7 +58,7 @@ namespace Opm
void addChild(std::tr1::shared_ptr<WellsGroupInterface> child);
bool conditionsMet(const std::vector<double>& pressure, const UnstructuredGrid& grid, const struct Wells* wells,
bool conditionsMet(const std::vector<double>& well_bhp, const std::vector<double>& well_rate, const struct Wells* wells,
int index_of_well);
private:
std::vector<std::tr1::shared_ptr<WellsGroupInterface> > children_;
@ -74,7 +74,7 @@ namespace Opm
InjectionSpecification inj_spec);
virtual WellsGroupInterface* findGroup(std::string name_of_node);
virtual bool conditionsMet(const std::vector<double>& pressure, const UnstructuredGrid& grid);
virtual bool conditionsMet(const std::vector<double>& well_bhp, const std::vector<double>& well_rate);
virtual bool isLeafNode() const;
void setWellsPointer(const struct Wells* wells, int self_index);