104 void update(
const ElementContext& elemCtx,
unsigned dofIdx,
unsigned timeIdx)
106 ParentType::update(elemCtx, dofIdx, timeIdx);
107 EnergyIntensiveQuantities::updateTemperatures_(fluidState_, elemCtx, dofIdx, timeIdx);
109 const auto& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
110 const auto& problem = elemCtx.problem();
114 ComponentVector cTotal;
115 for (
unsigned compIdx = 0; compIdx < numComponents; ++compIdx) {
116 cTotal[compIdx] = priVars.makeEvaluation(cTot0Idx + compIdx, timeIdx);
119 const auto* hint = elemCtx.thermodynamicHint(dofIdx, timeIdx);
124 const Evaluation T = fluidState_.temperature(0);
125 fluidState_.assign(hint->fluidState());
126 fluidState_.setTemperature(T);
129 FlashSolver::guessInitial(fluidState_, cTotal);
133 typename FluidSystem::template ParameterCache<Evaluation> paramCache;
134 const MaterialLawParams& materialParams =
135 problem.materialLawParams(elemCtx, dofIdx, timeIdx);
136 FlashSolver::template solve<MaterialLaw>(fluidState_,
143 MaterialLaw::relativePermeabilities(relativePermeability_,
144 materialParams, fluidState_);
145 Valgrind::CheckDefined(relativePermeability_);
148 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
149 paramCache.updatePhase(fluidState_, phaseIdx);
151 const Evaluation& mu = FluidSystem::viscosity(fluidState_, paramCache, phaseIdx);
152 fluidState_.setViscosity(phaseIdx, mu);
154 mobility_[phaseIdx] = relativePermeability_[phaseIdx] / mu;
155 Valgrind::CheckDefined(mobility_[phaseIdx]);
163 porosity_ = problem.porosity(elemCtx, dofIdx, timeIdx);
164 Valgrind::CheckDefined(porosity_);
167 intrinsicPerm_ = problem.intrinsicPermeability(elemCtx, dofIdx, timeIdx);
170 FluxIntensiveQuantities::update_(elemCtx, dofIdx, timeIdx);
173 EnergyIntensiveQuantities::update_(fluidState_, paramCache, elemCtx, dofIdx, timeIdx);
176 DiffusionIntensiveQuantities::update_(fluidState_, paramCache, elemCtx, dofIdx, timeIdx);