mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changes to adjust to review comments
This commit is contained in:
parent
61329532a7
commit
1900379343
@ -102,7 +102,7 @@ struct FlexibleSolverInfo
|
|||||||
bool parallel,
|
bool parallel,
|
||||||
const PropertyTree& prm,
|
const PropertyTree& prm,
|
||||||
std::size_t pressureIndex,
|
std::size_t pressureIndex,
|
||||||
std::function<Vector()> trueFunc,
|
std::function<Vector()> weightCalculator,
|
||||||
const bool forceSerial,
|
const bool forceSerial,
|
||||||
Comm& comm);
|
Comm& comm);
|
||||||
|
|
||||||
@ -463,13 +463,13 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
|
|||||||
auto wellOp = std::make_unique<WellModelOperator>(simulator_.problem().wellModel());
|
auto wellOp = std::make_unique<WellModelOperator>(simulator_.problem().wellModel());
|
||||||
flexibleSolver_[activeSolverNum_].wellOperator_ = std::move(wellOp);
|
flexibleSolver_[activeSolverNum_].wellOperator_ = std::move(wellOp);
|
||||||
}
|
}
|
||||||
std::function<Vector()> trueFunc = this->getWeightsCalculator(prm_[activeSolverNum_], getMatrix(), pressureIndex);
|
std::function<Vector()> weightCalculator = this->getWeightsCalculator(prm_[activeSolverNum_], getMatrix(), pressureIndex);
|
||||||
OPM_TIMEBLOCK(flexibleSolverCreate);
|
OPM_TIMEBLOCK(flexibleSolverCreate);
|
||||||
flexibleSolver_[activeSolverNum_].create(getMatrix(),
|
flexibleSolver_[activeSolverNum_].create(getMatrix(),
|
||||||
isParallel(),
|
isParallel(),
|
||||||
prm_[activeSolverNum_],
|
prm_[activeSolverNum_],
|
||||||
pressureIndex,
|
pressureIndex,
|
||||||
trueFunc,
|
weightCalculator,
|
||||||
forceSerial_,
|
forceSerial_,
|
||||||
*comm_);
|
*comm_);
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ namespace Amg
|
|||||||
VectorBlockType rhs(0.0);
|
VectorBlockType rhs(0.0);
|
||||||
const auto& solution = model.solution(/*timeIdx*/ 0);
|
const auto& solution = model.solution(/*timeIdx*/ 0);
|
||||||
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
||||||
for (const auto& elem : elements(gridView)) {
|
for (const auto& elem : elements(gridView)) {
|
||||||
elemCtx.updatePrimaryStencil(elem);
|
elemCtx.updatePrimaryStencil(elem);
|
||||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||||
const auto& index = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
const auto& index = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||||
@ -192,9 +192,6 @@ namespace Amg
|
|||||||
denominator = Toolbox::template decay<LhsEval>(1 - rs * rv);
|
denominator = Toolbox::template decay<LhsEval>(1 - rs * rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not(denominator > 0)) {
|
|
||||||
std::cout << "Probably negative compressibility" << std::endl;
|
|
||||||
}
|
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
|
||||||
unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(
|
unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(
|
||||||
FluidSystem::solventComponentIndex(FluidSystem::oilPhaseIdx));
|
FluidSystem::solventComponentIndex(FluidSystem::oilPhaseIdx));
|
||||||
@ -209,31 +206,6 @@ namespace Amg
|
|||||||
(1 / fs.invB(FluidSystem::gasPhaseIdx) - rv / fs.invB(FluidSystem::oilPhaseIdx))
|
(1 / fs.invB(FluidSystem::gasPhaseIdx) - rv / fs.invB(FluidSystem::oilPhaseIdx))
|
||||||
/ denominator);
|
/ denominator);
|
||||||
}
|
}
|
||||||
if(false){
|
|
||||||
// usure about the best for undersaturated
|
|
||||||
|
|
||||||
if (
|
|
||||||
(priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rv)
|
|
||||||
||
|
|
||||||
(priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rs)
|
|
||||||
) {
|
|
||||||
// Probably not need bweiths may be initialized to zero anyway
|
|
||||||
unsigned activeCompIdx = -10;
|
|
||||||
if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rv) {
|
|
||||||
// only water and gas pressent
|
|
||||||
activeCompIdx = Indices::canonicalToActiveComponentIndex(
|
|
||||||
FluidSystem::solventComponentIndex(FluidSystem::oilPhaseIdx));
|
|
||||||
bweights[activeCompIdx] = 0.0;
|
|
||||||
}
|
|
||||||
if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rs) {
|
|
||||||
// only water and oil pressent
|
|
||||||
activeCompIdx = Indices::canonicalToActiveComponentIndex(
|
|
||||||
FluidSystem::solventComponentIndex(FluidSystem::gasPhaseIdx));
|
|
||||||
bweights[activeCompIdx] = 0.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
weights[index] = bweights;
|
weights[index] = bweights;
|
||||||
}
|
}
|
||||||
OPM_END_PARALLEL_TRY_CATCH("getTrueImpesAnalyticWeights() failed: ", elemCtx.simulator().vanguard().grid().comm());
|
OPM_END_PARALLEL_TRY_CATCH("getTrueImpesAnalyticWeights() failed: ", elemCtx.simulator().vanguard().grid().comm());
|
||||||
|
Loading…
Reference in New Issue
Block a user