Using resize to allocate memory for 1/BMu.

This commit is contained in:
Kai Bao 2014-09-22 10:28:23 +02:00
parent 2b18b8f27f
commit ee73105c95
2 changed files with 9 additions and 4 deletions

View File

@ -62,7 +62,10 @@ namespace Opm
saturated_gas_table_[pvtTableIdx][0] = pvtgTable.getOuterTable()->getPressureColumn(); // Pressure
saturated_gas_table_[pvtTableIdx][1] = pvtgTable.getOuterTable()->getGasFormationFactorColumn(); // Bg
saturated_gas_table_[pvtTableIdx][2] = pvtgTable.getOuterTable()->getGasViscosityColumn(); // mu_g
saturated_gas_table_[pvtTableIdx][3] = pvtgTable.getOuterTable()->getGasFormationFactorColumn(); // TODO
// The number of the columns
int nColumns = saturated_gas_table_[pvtTableIdx][2].size();
saturated_gas_table_[pvtTableIdx][3].resize(nColumns); // allocate memory for 1/(Bg*mu_g)
// saturated_gas_table_[pvtTableIdx][3] = pvtgTable.getOuterTable()->getGasFormationFactorColumn(); // TODO
saturated_gas_table_[pvtTableIdx][4] = pvtgTable.getOuterTable()->getOilSolubilityColumn(); // Rv
int sz = pvtgTable.getOuterTable()->numRows();
@ -75,7 +78,9 @@ namespace Opm
undersat_gas_tables_[pvtTableIdx][i][0] = undersatTable.getOilSolubilityColumn(); // Rv
undersat_gas_tables_[pvtTableIdx][i][1] = undersatTable.getGasFormationFactorColumn(); // Bg
undersat_gas_tables_[pvtTableIdx][i][2] = undersatTable.getGasViscosityColumn(); // mu_g
undersat_gas_tables_[pvtTableIdx][i][3] = undersatTable.getGasViscosityColumn(); // TODO
int nColumns = undersat_gas_tables_[pvtTableIdx][i][2].size();
undersat_gas_tables_[pvtTableIdx][i][3].resize(nColumns); // allocate memory for 1/(Bg*mu_g)
// undersat_gas_tables_[pvtTableIdx][i][3] = undersatTable.getGasViscosityColumn(); // TODO
}
// Bg -> 1/Bg

View File

@ -68,7 +68,7 @@ namespace Opm
const auto undersaturatedPvto = pvtoTable.getInnerTable(i);
// undersat_oil_tables_[pvtTableIdx][i].resize(3);
// adding a extra colummn to the PVTO to store 1/BV
// adding a extra colummn to the PVTO to store 1/(B*mu)
undersat_oil_tables_[pvtTableIdx][i].resize(4);
int tsize = undersaturatedPvto->numRows();
undersat_oil_tables_[pvtTableIdx][i][0].resize(tsize);
@ -117,7 +117,7 @@ namespace Opm
double mu = (undersat_oil_tables_[pvtTableIdx][i][2].back())*(1.0+0.5*visc)/(1.0-0.5*visc);
undersat_oil_tables_[pvtTableIdx][i][2].push_back(mu);
// a try to expolate the 1/BMu
// A try to expolate the 1/BMu with the expolated mu and B
double inverseBMu = 1.0 / (B*mu);
undersat_oil_tables_[pvtTableIdx][i][3].push_back(inverseBMu);