Skip to content

Commit

Permalink
fixup after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Tor Harald Sandve committed Jan 15, 2025
1 parent 6284483 commit de11bb3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
18 changes: 5 additions & 13 deletions opm/models/blackoil/blackoilenergymodules.hh
Original file line number Diff line number Diff line change
Expand Up @@ -477,19 +477,11 @@ public:
}
}

void updateTemperature_([[maybe_unused]] const ElementContext& elemCtx,
[[maybe_unused]] unsigned dofIdx,
[[maybe_unused]] unsigned timeIdx)
void updateTemperature_(const ElementContext& elemCtx,
unsigned dofIdx,
unsigned timeIdx)
{
auto& fs = asImp_().fluidState_;
const Scalar T = elemCtx.problem().temperature(elemCtx, dofIdx, timeIdx);
// if TEMP is used we solve for temperature seperatly
if constexpr (enableTemperature) {
const Evaluation TE = Evaluation::createVariable(T, Indices::temperatureIdx);
fs.setTemperature(TE);
} else {
fs.setTemperature(T);
}
updateTemperature_(elemCtx.problem(), elemCtx.globalSpaceIndex(dofIdx, timeIdx), timeIdx);
}

template<class Problem>
Expand All @@ -500,7 +492,7 @@ public:
[[maybe_unused]] const LinearizationType& lintype
)
{
updateTemperature_(problem,globalDofIdx, timeIdx);
updateTemperature_(problem, globalDofIdx, timeIdx);
}

void updateEnergyQuantities_(const Problem& problem, unsigned globalDofIdx, unsigned timeIdx)
Expand Down
6 changes: 3 additions & 3 deletions opm/models/blackoil/blackoilintensivequantities.hh
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ public:

void updateTempSalt(const ElementContext& elemCtx, unsigned dofIdx, unsigned timeIdx)
{
if constexpr (enableTemperature || enableEnergy) {
asImp_().updateTemperature_(elemCtx, dofIdx, timeIdx);
}
// the temperature is updated even if the energy equations are not solved
// to allow for temperature dependent properites
asImp_().updateTemperature_(elemCtx, dofIdx, timeIdx);

if constexpr (enableBrine) {
asImp_().updateSaltConcentration_(elemCtx, dofIdx, timeIdx);
Expand Down
2 changes: 1 addition & 1 deletion opm/simulators/flow/BlackoilModelProperties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct EnableSolvent<TypeTag, TTag::FlowProblem>

template<class TypeTag>
struct EnableTemperature<TypeTag, TTag::FlowProblem>
{ static constexpr bool value = true; };
{ static constexpr bool value = false; };

template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::FlowProblem>
Expand Down
2 changes: 2 additions & 0 deletions opm/simulators/flow/TemperatureModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ class TemperatureModel : public GenericTemperatureModel<GetPropType<TypeTag, Pro
const unsigned int numCells = simulator_.model().numTotalDof();
for (unsigned globI = 0; globI < numCells; ++globI) {
intQuants_[globI] = simulator_.model().intensiveQuantities(globI, /*timeIdx*/ 0);
intQuants_[globI].updateTemperature_(simulator_.problem(), globI, /*timeIdx*/ 0);
intQuants_[globI].updateEnergyQuantities_(simulator_.problem(), globI, /*timeIdx*/ 0);
}
advanceTemperatureFields();
}
Expand Down

0 comments on commit de11bb3

Please sign in to comment.