removed an extra uneeded call to the pressure solver

This commit is contained in:
Kjetil Olsen Lye 2012-05-07 15:51:54 +02:00
parent 562573a078
commit 72a0db5f73

View File

@ -16,12 +16,14 @@
#include <opm/core/pressure/FlowBCManager.hpp>
#include <opm/core/linalg/LinearSolverFactory.hpp>
#include <opm/core/fluid/RockCompressibility.hpp>
int main(int argc, char** argv) {
int main(int argc, char** argv)
{
using namespace Opm::parameter;
using namespace Opm;
ParameterGroup parameters( argc, argv, false );
std::string file_name = parameters.getDefault<std::string>("inputdeck", "data.data");
ParameterGroup parameters(argc, argv, false);
std::string file_name = parameters.getDefault<std::string > ("inputdeck", "data.data");
SimulatorTimer simtimer;
simtimer.init(parameters);
@ -50,7 +52,7 @@ int main(int argc, char** argv) {
std::vector<int> all_cells;
for(int i = 0; i < grid.c_grid()->number_of_cells; i++) {
for (int i = 0; i < grid.c_grid()->number_of_cells; i++) {
all_cells.push_back(i);
}
@ -121,10 +123,10 @@ int main(int argc, char** argv) {
for (int cell = 0; cell < grid.c_grid()->number_of_cells; ++cell) {
double phase_sum = 0.0;
for (int phase = 0; phase < np; ++phase) {
phase_sum += phase_mob[cell*np + phase];
phase_sum += phase_mob[cell * np + phase];
}
for (int phase = 0; phase < np; ++phase) {
fractional_flows[cell*np + phase] = phase_mob[cell*np + phase] / phase_sum;
fractional_flows[cell * np + phase] = phase_mob[cell * np + phase] / phase_sum;
}
}
// End stuff that needs to be refactored into a seperated function
@ -132,11 +134,11 @@ int main(int argc, char** argv) {
// This will be refactored into a separate function once done
std::vector<double> well_resflows(wells.c_wells()->number_of_wells*np, 0.0);
for ( int wix = 0; wix < wells.c_wells()->number_of_wells; ++wix) {
for (int i = wells.c_wells()->well_connpos[wix]; i < wells.c_wells()->well_connpos[wix+1]; ++i) {
for (int wix = 0; wix < wells.c_wells()->number_of_wells; ++wix) {
for (int i = wells.c_wells()->well_connpos[wix]; i < wells.c_wells()->well_connpos[wix + 1]; ++i) {
const int cell = wells.c_wells()->well_cells[i];
for (int phase = 0; phase < np; ++phase) {
well_resflows[wix*np + phase] += well_rate_per_cell[i]*fractional_flows[cell*np + phase];
well_resflows[wix * np + phase] += well_rate_per_cell[i] * fractional_flows[cell * np + phase];
}
}
}
@ -193,19 +195,19 @@ int main(int argc, char** argv) {
TwophaseFluid fluid(incomp_properties);
TransportModel model (fluid, *grid->c_grid(), porevol, gravity[2], true);
TransportModel model(fluid, *grid->c_grid(), porevol, gravity[2], true);
TransportSolver tsolver(model);
TransportSource* tsrc = create_transport_source(2, 2);
double ssrc[] = { 1.0, 0.0 };
double ssink[] = { 0.0, 1.0 };
double zdummy[] = { 0.0, 0.0 };
double ssrc[] = {1.0, 0.0};
double ssink[] = {0.0, 1.0};
double zdummy[] = {0.0, 0.0};
{
int well_cell_index = 0;
for (int well = 0; well < wells.c_wells()->number_of_wells; ++well) {
for( int cell = wells.c_wells()->well_connpos[well]; cell < wells.c_wells()->well_connpos[well + 1]; ++cell) {
for (int cell = wells.c_wells()->well_connpos[well]; cell < wells.c_wells()->well_connpos[well + 1]; ++cell) {
if (well_rate_per_cell[well_cell_index] > 0.0) {
append_transport_source(well_cell_index, 2, 0,
well_rate_per_cell[well_cell_index], ssrc, zdummy, tsrc);