mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #311 from totto82/fix_verticalscaling
Apply the swatinit scaling to new_props
This commit is contained in:
commit
fec50b491a
@ -95,7 +95,7 @@ try
|
||||
}
|
||||
std::shared_ptr<GridManager> grid;
|
||||
std::shared_ptr<BlackoilPropertiesInterface> props;
|
||||
std::shared_ptr<BlackoilPropsAdInterface> new_props;
|
||||
std::shared_ptr<BlackoilPropsAdFromDeck> new_props;
|
||||
std::shared_ptr<RockCompressibility> rock_comp;
|
||||
BlackoilState state;
|
||||
// bool check_well_controls = false;
|
||||
@ -170,6 +170,16 @@ try
|
||||
initBlackoilStateFromDeck(*grid->c_grid(), *props, deck, gravity[2], state);
|
||||
}
|
||||
|
||||
// The capillary pressure is scaled in new_props to match the scaled capillary pressure in props.
|
||||
if (deck->hasKeyword("SWATINIT")) {
|
||||
const int nc = grid->c_grid()->number_of_cells;
|
||||
std::vector<int> cells(nc);
|
||||
for (int c = 0; c < nc; ++c) { cells[c] = c; }
|
||||
std::vector<double> pc = state.saturation();
|
||||
props->capPress(nc, state.saturation().data(), cells.data(), pc.data(),NULL);
|
||||
new_props->setSwatInitScaling(state.saturation(),pc);
|
||||
}
|
||||
|
||||
bool use_gravity = (gravity[0] != 0.0 || gravity[1] != 0.0 || gravity[2] != 0.0);
|
||||
const double *grav = use_gravity ? &gravity[0] : 0;
|
||||
|
||||
|
@ -207,6 +207,17 @@ try
|
||||
*props, deck, gravity[2], state);
|
||||
}
|
||||
|
||||
|
||||
// The capillary pressure is scaled in new_props to match the scaled capillary pressure in props.
|
||||
if (deck->hasKeyword("SWATINIT")) {
|
||||
const int nc = grid->numCells();
|
||||
std::vector<int> cells(nc);
|
||||
for (int c = 0; c < nc; ++c) { cells[c] = c; }
|
||||
std::vector<double> pc = state.saturation();
|
||||
props->capPress(nc, state.saturation().data(), cells.data(), pc.data(),NULL);
|
||||
new_props->setSwatInitScaling(state.saturation(),pc);
|
||||
}
|
||||
|
||||
BlackoilState distributed_state;
|
||||
std::shared_ptr<Opm::BlackoilPropsAdFromDeck> distributed_props = new_props;
|
||||
Dune::CpGrid distributed_grid = *grid;
|
||||
|
@ -1166,6 +1166,22 @@ BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck&
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Set capillary pressure scaling according to pressure diff. and initial water saturation.
|
||||
/// \param[in] saturation Array of n*numPhases saturation values.
|
||||
/// \param[in] pc Array of n*numPhases capillary pressure values.
|
||||
void BlackoilPropsAdFromDeck::setSwatInitScaling(const std::vector<double>& saturation,
|
||||
const std::vector<double>& pc)
|
||||
{
|
||||
const int nc = rock_.numCells();
|
||||
const int numActivePhases = numPhases();
|
||||
for (int i = 0; i < nc; ++i) {
|
||||
double pcow = pc[numActivePhases*i + phase_usage_.phase_pos[Water]];
|
||||
double swat = saturation[numActivePhases*i + phase_usage_.phase_pos[Water]];
|
||||
satprops_->swatInitScaling(i, pcow, swat);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Apply correction to rs/rv according to kw VAPPARS
|
||||
/// \param[in/out] r Array of n rs/rv values.
|
||||
|
@ -425,6 +425,13 @@ namespace Opm
|
||||
/// Update for max oil saturation.
|
||||
void updateSatOilMax(const std::vector<double>& saturation);
|
||||
|
||||
/// Set capillary pressure scaling according to pressure diff. and initial water saturation.
|
||||
/// \param[in] saturation Array of n*numPhases saturation values.
|
||||
/// \param[in] pc Array of n*numPhases capillary pressure values.
|
||||
void setSwatInitScaling(const std::vector<double>& saturation,
|
||||
const std::vector<double>& pc);
|
||||
|
||||
|
||||
private:
|
||||
/// Initializes the properties.
|
||||
template <class CentroidIterator>
|
||||
|
Loading…
Reference in New Issue
Block a user