mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Now initialize with new code (for gas-oil ratio).
This commit is contained in:
@@ -104,10 +104,20 @@ main(int argc, char** argv)
|
|||||||
// Init state variables (saturation and pressure).
|
// Init state variables (saturation and pressure).
|
||||||
if (param.has("init_saturation")) {
|
if (param.has("init_saturation")) {
|
||||||
initStateBasic(*grid->c_grid(), *props, param, gravity[2], state);
|
initStateBasic(*grid->c_grid(), *props, param, gravity[2], state);
|
||||||
|
initBlackoilSurfvol(*grid->c_grid(), *props, state);
|
||||||
|
enum { Oil = BlackoilPhases::Liquid, Gas = BlackoilPhases::Vapour };
|
||||||
|
const PhaseUsage pu = props->phaseUsage();
|
||||||
|
if (pu.phase_used[Oil] && pu.phase_used[Gas]) {
|
||||||
|
const int np = props->numPhases();
|
||||||
|
const int nc = grid->c_grid()->number_of_cells;
|
||||||
|
for (int c = 0; c < nc; ++c) {
|
||||||
|
state.gasoilratio()[c] = state.surfacevol()[c*np + pu.phase_pos[Gas]]
|
||||||
|
/ state.surfacevol()[c*np + pu.phase_pos[Oil]];
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
initStateFromDeck(*grid->c_grid(), *props, *deck, gravity[2], state);
|
initBlackoilStateFromDeck(*grid->c_grid(), *props, *deck, gravity[2], state);
|
||||||
}
|
}
|
||||||
initBlackoilSurfvol(*grid->c_grid(), *props, state);
|
|
||||||
} else {
|
} else {
|
||||||
// Grid init.
|
// Grid init.
|
||||||
const int nx = param.getDefault("nx", 100);
|
const int nx = param.getDefault("nx", 100);
|
||||||
|
|||||||
Reference in New Issue
Block a user