changes to adjust to review comments

This commit is contained in:
hnil 2024-01-18 10:37:48 +01:00
parent 61329532a7
commit 1900379343
2 changed files with 4 additions and 32 deletions

View File

@ -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_);
} }

View File

@ -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());