mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2378 from akva2/use_compressed_blackoil_ext
changed: use compressed field properties for blackoil extension init conds
This commit is contained in:
commit
766410ff7c
@ -2743,53 +2743,27 @@ private:
|
|||||||
const auto& simulator = this->simulator();
|
const auto& simulator = this->simulator();
|
||||||
const auto& vanguard = simulator.vanguard();
|
const auto& vanguard = simulator.vanguard();
|
||||||
const auto& eclState = vanguard.eclState();
|
const auto& eclState = vanguard.eclState();
|
||||||
const auto& comm = vanguard.gridView().comm();
|
|
||||||
size_t numDof = this->model().numGridDof();
|
size_t numDof = this->model().numGridDof();
|
||||||
|
|
||||||
size_t globalSize;
|
|
||||||
if (comm.rank() == 0)
|
|
||||||
globalSize = eclState.getInputGrid().getCartesianSize();
|
|
||||||
comm.broadcast(&globalSize, 1, 0);
|
|
||||||
|
|
||||||
if (enableSolvent) {
|
if (enableSolvent) {
|
||||||
std::vector<double> solventSaturationData(globalSize, 0.0);
|
|
||||||
if (eclState.fieldProps().has_double("SSOL"))
|
if (eclState.fieldProps().has_double("SSOL"))
|
||||||
solventSaturationData = eclState.fieldProps().get_global_double("SSOL");
|
solventSaturation_ = eclState.fieldProps().get_double("SSOL");
|
||||||
|
else
|
||||||
solventSaturation_.resize(numDof, 0.0);
|
solventSaturation_.resize(numDof, 0.0);
|
||||||
for (size_t dofIdx = 0; dofIdx < numDof; ++dofIdx) {
|
|
||||||
size_t cartesianDofIdx = vanguard.cartesianIndex(dofIdx);
|
|
||||||
assert(0 <= cartesianDofIdx);
|
|
||||||
assert(cartesianDofIdx <= solventSaturationData.size());
|
|
||||||
solventSaturation_[dofIdx] = solventSaturationData[cartesianDofIdx];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enablePolymer) {
|
if (enablePolymer) {
|
||||||
std::vector<double> polyConcentrationData(globalSize, 0.0);
|
|
||||||
if (eclState.fieldProps().has_double("SPOLY"))
|
if (eclState.fieldProps().has_double("SPOLY"))
|
||||||
polyConcentrationData = eclState.fieldProps().get_global_double("SPOLY");
|
polymerConcentration_ = eclState.fieldProps().get_double("SPOLY");
|
||||||
|
else
|
||||||
polymerConcentration_.resize(numDof, 0.0);
|
polymerConcentration_.resize(numDof, 0.0);
|
||||||
for (size_t dofIdx = 0; dofIdx < numDof; ++dofIdx) {
|
|
||||||
size_t cartesianDofIdx = vanguard.cartesianIndex(dofIdx);
|
|
||||||
assert(0 <= cartesianDofIdx);
|
|
||||||
assert(cartesianDofIdx <= polyConcentrationData.size());
|
|
||||||
polymerConcentration_[dofIdx] = polyConcentrationData[cartesianDofIdx];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enablePolymerMolarWeight) {
|
if (enablePolymerMolarWeight) {
|
||||||
std::vector<double> polyMoleWeightData(globalSize, 0.0);
|
|
||||||
if (eclState.fieldProps().has_double("SPOLYMW"))
|
if (eclState.fieldProps().has_double("SPOLYMW"))
|
||||||
polyMoleWeightData = eclState.fieldProps().get_global_double("SPOLYMW");
|
polymerMoleWeight_ = eclState.fieldProps().get_double("SPOLYMW");
|
||||||
polymerMoleWeight_.resize(numDof, 0.0);
|
else
|
||||||
for (size_t dofIdx = 0; dofIdx < numDof; ++dofIdx) {
|
polymerMoleWeight_.resize(numDof, 0.0);
|
||||||
const size_t cartesianDofIdx = vanguard.cartesianIndex(dofIdx);
|
|
||||||
assert(0 <= cartesianDofIdx);
|
|
||||||
assert(cartesianDofIdx <= polyMoleWeightData.size());
|
|
||||||
polymerMoleWeight_[dofIdx] = polyMoleWeightData[cartesianDofIdx];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user