blackoilenergymodules.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef EWOMS_BLACK_OIL_ENERGY_MODULE_HH
29#define EWOMS_BLACK_OIL_ENERGY_MODULE_HH
30
31#include <dune/common/fvector.hh>
32
33#include <opm/material/common/Tabulated1DFunction.hpp>
34#include <opm/material/common/Valgrind.hpp>
35
40
41#include <cassert>
42#include <cmath>
43#include <istream>
44#include <memory>
45#include <ostream>
46#include <stdexcept>
47#include <string>
48
49namespace Opm {
50
56template <class TypeTag, bool enableEnergyV = getPropValue<TypeTag, Properties::EnableEnergy>()>
58{
70
71 static constexpr unsigned temperatureIdx = Indices::temperatureIdx;
72 static constexpr unsigned contiEnergyEqIdx = Indices::contiEnergyEqIdx;
73
74 static constexpr unsigned enableEnergy = enableEnergyV;
75 static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
76 static constexpr unsigned numPhases = FluidSystem::numPhases;
77
78public:
80
84 static void registerParameters()
85 {
86 if constexpr (enableEnergy) {
88 }
89 }
90
94 static void registerOutputModules(Model& model,
95 Simulator& simulator)
96 {
97 if constexpr (enableEnergy) {
98 model.addOutputModule(std::make_unique<VtkBlackOilEnergyModule<TypeTag>>(simulator));
99 }
100 }
101
102 static bool primaryVarApplies(unsigned pvIdx)
103 {
104 if constexpr (enableEnergy) {
105 return pvIdx == temperatureIdx;
106 }
107 else {
108 return false;
109 }
110 }
111
112 static std::string primaryVarName([[maybe_unused]] unsigned pvIdx)
113 {
114 assert(primaryVarApplies(pvIdx));
115
116 return "temperature";
117 }
118
119 static Scalar primaryVarWeight([[maybe_unused]] unsigned pvIdx)
120 {
121 assert(primaryVarApplies(pvIdx));
122
123 // TODO: it may be beneficial to chose this differently.
124 return static_cast<Scalar>(1.0);
125 }
126
127 static bool eqApplies(unsigned eqIdx)
128 {
129 if constexpr (enableEnergy) {
130 return eqIdx == contiEnergyEqIdx;
131 }
132 else {
133 return false;
134 }
135 }
136
137 static std::string eqName([[maybe_unused]] unsigned eqIdx)
138 {
139 assert(eqApplies(eqIdx));
140
141 return "conti^energy";
142 }
143
144 static Scalar eqWeight([[maybe_unused]] unsigned eqIdx)
145 {
146 assert(eqApplies(eqIdx));
147
148 return 1.0;
149 }
150
151 // must be called after water storage is computed
152 template <class LhsEval>
153 static void addStorage(Dune::FieldVector<LhsEval, numEq>& storage,
154 const IntensiveQuantities& intQuants)
155 {
156 if constexpr (enableEnergy) {
157 const auto& poro = decay<LhsEval>(intQuants.porosity());
158
159 // accumulate the internal energy of the fluids
160 const auto& fs = intQuants.fluidState();
161 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
162 if (!FluidSystem::phaseIsActive(phaseIdx)) {
163 continue;
164 }
165
166 const auto& u = decay<LhsEval>(fs.internalEnergy(phaseIdx));
167 const auto& S = decay<LhsEval>(fs.saturation(phaseIdx));
168 const auto& rho = decay<LhsEval>(fs.density(phaseIdx));
169
170 storage[contiEnergyEqIdx] += poro*S*u*rho;
171 }
172
173 // add the internal energy of the rock
174 const Scalar rockFraction = intQuants.rockFraction();
175 const auto& uRock = decay<LhsEval>(intQuants.rockInternalEnergy());
176 storage[contiEnergyEqIdx] += rockFraction * uRock;
177 storage[contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
178 }
179 }
180
181 static void computeFlux([[maybe_unused]] RateVector& flux,
182 [[maybe_unused]] const ElementContext& elemCtx,
183 [[maybe_unused]] unsigned scvfIdx,
184 [[maybe_unused]] unsigned timeIdx)
185 {
186 if constexpr (enableEnergy) {
187 flux[contiEnergyEqIdx] = 0.0;
188
189 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
190 const unsigned focusIdx = elemCtx.focusDofIndex();
191 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
192 if (!FluidSystem::phaseIsActive(phaseIdx)) {
193 continue;
194 }
195
196 const unsigned upIdx = extQuants.upstreamIndex(phaseIdx);
197 if (upIdx == focusIdx) {
198 addPhaseEnthalpyFlux_<Evaluation>(flux, phaseIdx, elemCtx, scvfIdx, timeIdx);
199 }
200 else {
201 addPhaseEnthalpyFlux_<Scalar>(flux, phaseIdx, elemCtx, scvfIdx, timeIdx);
202 }
203 }
204
205 // diffusive energy flux
206 flux[contiEnergyEqIdx] += extQuants.energyFlux();
207 flux[contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
208 }
209 }
210
211 static void addHeatFlux(RateVector& flux,
212 const Evaluation& heatFlux)
213 {
214 if constexpr (enableEnergy) {
215 // diffusive energy flux
216 flux[contiEnergyEqIdx] += heatFlux;
217 flux[contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
218 }
219 }
220
221 template <class UpEval, class Eval, class FluidState>
222 static void addPhaseEnthalpyFluxes_(RateVector& flux,
223 unsigned phaseIdx,
224 const Eval& volumeFlux,
225 const FluidState& upFs)
226 {
227 flux[contiEnergyEqIdx] +=
228 decay<UpEval>(upFs.enthalpy(phaseIdx)) *
229 decay<UpEval>(upFs.density(phaseIdx)) *
230 volumeFlux;
231 }
232
233 template <class UpstreamEval>
234 static void addPhaseEnthalpyFlux_(RateVector& flux,
235 unsigned phaseIdx,
236 const ElementContext& elemCtx,
237 unsigned scvfIdx,
238 unsigned timeIdx)
239 {
240 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
241 const unsigned upIdx = extQuants.upstreamIndex(phaseIdx);
242 const auto& up = elemCtx.intensiveQuantities(upIdx, timeIdx);
243 const auto& fs = up.fluidState();
244 const auto& volFlux = extQuants.volumeFlux(phaseIdx);
245 addPhaseEnthalpyFluxes_<UpstreamEval>(flux,
246 phaseIdx,
247 volFlux,
248 fs);
249 }
250
251 static void addToEnthalpyRate(RateVector& flux,
252 const Evaluation& hRate)
253 {
254 if constexpr (enableEnergy) {
255 flux[contiEnergyEqIdx] += hRate;
256 }
257 }
258
262 template <class FluidState>
263 static void assignPrimaryVars(PrimaryVariables& priVars,
264 const FluidState& fluidState)
265 {
266 if constexpr (enableEnergy) {
267 priVars[temperatureIdx] = fluidState.temperature(/*phaseIdx=*/0);
268 }
269 }
270
274 static void updatePrimaryVars(PrimaryVariables& newPv,
275 const PrimaryVariables& oldPv,
276 const EqVector& delta)
277 {
278 if constexpr (enableEnergy) {
279 // do a plain unchopped Newton update
280 newPv[temperatureIdx] = oldPv[temperatureIdx] - delta[temperatureIdx];
281 }
282 }
283
287 static Scalar computeUpdateError(const PrimaryVariables&,
288 const EqVector&)
289 {
290 // do not consider consider the cange of energy primary variables for
291 // convergence
292 // TODO: maybe this should be changed
293 return static_cast<Scalar>(0.0);
294 }
295
299 static Scalar computeResidualError(const EqVector& resid)
300 {
301 // do not weight the residual of energy when it comes to convergence
302 return std::abs(scalarValue(resid[contiEnergyEqIdx]));
303 }
304
305 template <class DofEntity>
306 static void serializeEntity(const Model& model, std::ostream& outstream, const DofEntity& dof)
307 {
308 if constexpr (enableEnergy) {
309 const unsigned dofIdx = model.dofMapper().index(dof);
310 const PrimaryVariables& priVars = model.solution(/*timeIdx=*/0)[dofIdx];
311 outstream << priVars[temperatureIdx];
312 }
313 }
314
315 template <class DofEntity>
316 static void deserializeEntity(Model& model, std::istream& instream, const DofEntity& dof)
317 {
318 if constexpr (enableEnergy) {
319 const unsigned dofIdx = model.dofMapper().index(dof);
320 PrimaryVariables& priVars0 = model.solution(/*timeIdx=*/0)[dofIdx];
321 PrimaryVariables& priVars1 = model.solution(/*timeIdx=*/1)[dofIdx];
322
323 instream >> priVars0[temperatureIdx];
324
325 // set the primary variables for the beginning of the current time step.
326 priVars1 = priVars0[temperatureIdx];
327 }
328 }
329};
330
331template <class TypeTag, bool enableEnergyV>
333
341template <class TypeTag>
342class BlackOilEnergyIntensiveQuantities<TypeTag, /*enableEnergyV=*/true>
343{
345
355
357
358 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
359 static constexpr int temperatureIdx = Indices::temperatureIdx;
360 static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
361
362public:
367 void updateTemperature_(const ElementContext& elemCtx,
368 unsigned dofIdx,
369 unsigned timeIdx)
370 {
371 auto& fs = asImp_().fluidState_;
372 const auto& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
373
374 // set temperature
375 fs.setTemperature(priVars.makeEvaluation(temperatureIdx, timeIdx, elemCtx.linearizationType()));
376 }
377
382 void updateTemperature_([[maybe_unused]] const Problem& problem,
383 const PrimaryVariables& priVars,
384 [[maybe_unused]] unsigned globalDofIdx,
385 const unsigned timeIdx,
386 const LinearizationType& lintype)
387 {
388 auto& fs = asImp_().fluidState_;
389 fs.setTemperature(priVars.makeEvaluation(temperatureIdx, timeIdx, lintype));
390 }
391
396 void updateEnergyQuantities_(const ElementContext& elemCtx,
397 unsigned dofIdx,
398 unsigned timeIdx,
399 const typename FluidSystem::template ParameterCache<Evaluation>& paramCache)
400 {
401 auto& fs = asImp_().fluidState_;
402
403 // compute the specific enthalpy of the fluids, the specific enthalpy of the rock
404 // and the thermal condictivity coefficients
405 for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
406 if (!FluidSystem::phaseIsActive(phaseIdx)) {
407 continue;
408 }
409
410 const auto& h = FluidSystem::enthalpy(fs, paramCache, phaseIdx);
411 fs.setEnthalpy(phaseIdx, h);
412 }
413
414 const auto& solidEnergyLawParams = elemCtx.problem().solidEnergyLawParams(elemCtx, dofIdx, timeIdx);
415 rockInternalEnergy_ = SolidEnergyLaw::solidInternalEnergy(solidEnergyLawParams, fs);
416
417 const auto& thermalConductionLawParams = elemCtx.problem().thermalConductionLawParams(elemCtx, dofIdx, timeIdx);
418 totalThermalConductivity_ = ThermalConductionLaw::thermalConductivity(thermalConductionLawParams, fs);
419
420 // Retrieve the rock fraction from the problem
421 // Usually 1 - porosity, but if pvmult is used to modify porosity
422 // we will apply the same multiplier to the rock fraction
423 // i.e. pvmult*(1 - porosity) and thus interpret multpv as a volume
424 // multiplier. This is to avoid negative rock volume for pvmult*porosity > 1
425 const unsigned cell_idx = elemCtx.globalSpaceIndex(dofIdx, timeIdx);
426 rockFraction_ = elemCtx.problem().rockFraction(cell_idx, timeIdx);
427 }
428
429 const Evaluation& rockInternalEnergy() const
430 { return rockInternalEnergy_; }
431
432 const Evaluation& totalThermalConductivity() const
433 { return totalThermalConductivity_; }
434
435 Scalar rockFraction() const
436 { return rockFraction_; }
437
438protected:
439 Implementation& asImp_()
440 { return *static_cast<Implementation*>(this); }
441
445};
446
447template <class TypeTag>
449{
456
458 static constexpr bool enableTemperature = getPropValue<TypeTag, Properties::EnableTemperature>();
459
460public:
461 void updateTemperature_([[maybe_unused]] const ElementContext& elemCtx,
462 [[maybe_unused]] unsigned dofIdx,
463 [[maybe_unused]] unsigned timeIdx)
464 {
465 if constexpr (enableTemperature) {
466 // even if energy is conserved, the temperature can vary over the spatial
467 // domain if the EnableTemperature property is set to true
468 auto& fs = asImp_().fluidState_;
469 const Scalar T = elemCtx.problem().temperature(elemCtx, dofIdx, timeIdx);
470 fs.setTemperature(T);
471 }
472 }
473
474 template<class Problem>
475 void updateTemperature_([[maybe_unused]] const Problem& problem,
476 [[maybe_unused]] const PrimaryVariables& priVars,
477 [[maybe_unused]] unsigned globalDofIdx,
478 [[maybe_unused]] unsigned timeIdx,
479 [[maybe_unused]] const LinearizationType& lintype
480 )
481 {
482 if constexpr (enableTemperature) {
483 auto& fs = asImp_().fluidState_;
484 // even if energy is conserved, the temperature can vary over the spatial
485 // domain if the EnableTemperature property is set to true
486 const Scalar T = problem.temperature(globalDofIdx, timeIdx);
487 fs.setTemperature(T);
488 }
489 }
490
491 void updateEnergyQuantities_(const ElementContext&,
492 unsigned,
493 unsigned,
494 const typename FluidSystem::template ParameterCache<Evaluation>&)
495 {}
496
497 const Evaluation& rockInternalEnergy() const
498 {
499 throw std::logic_error("Requested the rock internal energy, which is "
500 "unavailable because energy is not conserved");
501 }
502
503 const Evaluation& totalThermalConductivity() const
504 {
505 throw std::logic_error("Requested the total thermal conductivity, which is "
506 "unavailable because energy is not conserved");
507 }
508
509protected:
510 Implementation& asImp_()
511 { return *static_cast<Implementation*>(this); }
512};
513
514template <class TypeTag, bool enableEnergyV>
516
524template <class TypeTag>
525class BlackOilEnergyExtensiveQuantities<TypeTag, /*enableEnergyV=*/true>
526{
528
536
537 using Toolbox = MathToolbox<Evaluation>;
538
540
541 static constexpr int dimWorld = GridView::dimensionworld;
542 using DimVector = Dune::FieldVector<Scalar, dimWorld>;
543 using DimEvalVector = Dune::FieldVector<Evaluation, dimWorld>;
544
545public:
546 template<class FluidState>
547 static void updateEnergy(Evaluation& energyFlux,
548 const unsigned& focusDofIndex,
549 const unsigned& inIdx,
550 const unsigned& exIdx,
551 const IntensiveQuantities& inIq,
552 const IntensiveQuantities& exIq,
553 const FluidState& inFs,
554 const FluidState& exFs,
555 const Scalar& inAlpha,
556 const Scalar& outAlpha,
557 const Scalar& faceArea)
558 {
559 Evaluation deltaT;
560 if (focusDofIndex == inIdx) {
561 deltaT = decay<Scalar>(exFs.temperature(/*phaseIdx=*/0)) -
562 inFs.temperature(/*phaseIdx=*/0);
563 }
564 else if (focusDofIndex == exIdx) {
565 deltaT = exFs.temperature(/*phaseIdx=*/0) -
566 decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
567 }
568 else {
569 deltaT = decay<Scalar>(exFs.temperature(/*phaseIdx=*/0)) -
570 decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
571 }
572
573 Evaluation inLambda;
574 if (focusDofIndex == inIdx) {
575 inLambda = inIq.totalThermalConductivity();
576 }
577 else {
578 inLambda = decay<Scalar>(inIq.totalThermalConductivity());
579 }
580
581 Evaluation exLambda;
582 if (focusDofIndex == exIdx) {
583 exLambda = exIq.totalThermalConductivity();
584 }
585 else {
586 exLambda = decay<Scalar>(exIq.totalThermalConductivity());
587 }
588
589 Evaluation H;
590 const Evaluation& inH = inLambda*inAlpha;
591 const Evaluation& exH = exLambda*outAlpha;
592 if (inH > 0 && exH > 0) {
593 // compute the "thermal transmissibility". In contrast to the normal
594 // transmissibility this cannot be done as a preprocessing step because the
595 // average thermal conductivity is analogous to the permeability but
596 // depends on the solution.
597 H = 1.0 / (1.0 / inH + 1.0 / exH);
598 }
599 else {
600 H = 0.0;
601 }
602
603 energyFlux = deltaT * (-H / faceArea);
604 }
605
606 void updateEnergy(const ElementContext& elemCtx,
607 unsigned scvfIdx,
608 unsigned timeIdx)
609 {
610 const auto& stencil = elemCtx.stencil(timeIdx);
611 const auto& scvf = stencil.interiorFace(scvfIdx);
612
613 const Scalar faceArea = scvf.area();
614 const unsigned inIdx = scvf.interiorIndex();
615 const unsigned exIdx = scvf.exteriorIndex();
616 const auto& inIq = elemCtx.intensiveQuantities(inIdx, timeIdx);
617 const auto& exIq = elemCtx.intensiveQuantities(exIdx, timeIdx);
618 const auto& inFs = inIq.fluidState();
619 const auto& exFs = exIq.fluidState();
620 const Scalar inAlpha = elemCtx.problem().thermalHalfTransmissibilityIn(elemCtx, scvfIdx, timeIdx);
621 const Scalar outAlpha = elemCtx.problem().thermalHalfTransmissibilityOut(elemCtx, scvfIdx, timeIdx);
622 updateEnergy(energyFlux_,
623 elemCtx.focusDofIndex(),
624 inIdx,
625 exIdx,
626 inIq,
627 exIq,
628 inFs,
629 exFs,
630 inAlpha,
631 outAlpha,
632 faceArea);
633 }
634
635 template <class Context, class BoundaryFluidState>
636 void updateEnergyBoundary(const Context& ctx,
637 unsigned scvfIdx,
638 unsigned timeIdx,
639 const BoundaryFluidState& boundaryFs)
640 {
641 const auto& stencil = ctx.stencil(timeIdx);
642 const auto& scvf = stencil.boundaryFace(scvfIdx);
643
644 const unsigned inIdx = scvf.interiorIndex();
645 const auto& inIq = ctx.intensiveQuantities(inIdx, timeIdx);
646 const auto& focusDofIdx = ctx.focusDofIndex();
647 const Scalar alpha = ctx.problem().thermalHalfTransmissibilityBoundary(ctx, scvfIdx);
648 updateEnergyBoundary(energyFlux_, inIq, focusDofIdx, inIdx, alpha, boundaryFs);
649 }
650
651 template <class BoundaryFluidState>
652 static void updateEnergyBoundary(Evaluation& energyFlux,
653 const IntensiveQuantities& inIq,
654 unsigned focusDofIndex,
655 unsigned inIdx,
656 Scalar alpha,
657 const BoundaryFluidState& boundaryFs)
658 {
659 const auto& inFs = inIq.fluidState();
660 Evaluation deltaT;
661 if (focusDofIndex == inIdx) {
662 deltaT = boundaryFs.temperature(/*phaseIdx=*/0) -
663 inFs.temperature(/*phaseIdx=*/0);
664 }
665 else {
666 deltaT = decay<Scalar>(boundaryFs.temperature(/*phaseIdx=*/0)) -
667 decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
668 }
669
670 Evaluation lambda;
671 if (focusDofIndex == inIdx) {
672 lambda = inIq.totalThermalConductivity();
673 }
674 else {
675 lambda = decay<Scalar>(inIq.totalThermalConductivity());
676 }
677
678 if (lambda > 0.0) {
679 // compute the "thermal transmissibility". In contrast to the normal
680 // transmissibility this cannot be done as a preprocessing step because the
681 // average thermal conductivity is analogous to the permeability but depends
682 // on the solution.
683 energyFlux = deltaT * lambda * -alpha;
684 }
685 else {
686 energyFlux = 0.0;
687 }
688 }
689
690 const Evaluation& energyFlux() const
691 { return energyFlux_; }
692
693private:
694 Implementation& asImp_()
695 { return *static_cast<Implementation*>(this); }
696
697 Evaluation energyFlux_;
698};
699
700template <class TypeTag>
702{
707
708public:
709 template<class FluidState>
710 static void updateEnergy(Evaluation& /*energyFlux*/,
711 const unsigned& /*focusDofIndex*/,
712 const unsigned& /*inIdx*/,
713 const unsigned& /*exIdx*/,
714 const IntensiveQuantities& /*inIq*/,
715 const IntensiveQuantities& /*exIq*/,
716 const FluidState& /*inFs*/,
717 const FluidState& /*exFs*/,
718 const Scalar& /*inAlpha*/,
719 const Scalar& /*outAlpha*/,
720 const Scalar& /*faceArea*/)
721 {}
722
723 void updateEnergy(const ElementContext&,
724 unsigned,
725 unsigned)
726 {}
727
728 template <class Context, class BoundaryFluidState>
729 void updateEnergyBoundary(const Context&,
730 unsigned,
731 unsigned,
732 const BoundaryFluidState&)
733 {}
734
735 template <class BoundaryFluidState>
736 static void updateEnergyBoundary(Evaluation& /*heatFlux*/,
737 const IntensiveQuantities& /*inIq*/,
738 unsigned /*focusDofIndex*/,
739 unsigned /*inIdx*/,
740 unsigned /*timeIdx*/,
741 Scalar /*alpha*/,
742 const BoundaryFluidState& /*boundaryFs*/)
743 {}
744
745 const Evaluation& energyFlux() const
746 { throw std::logic_error("Requested the energy flux, but energy is not conserved"); }
747};
748
749} // namespace Opm
750
751#endif
Declares the properties required by the black oil model.
void updateEnergyBoundary(const Context &, unsigned, unsigned, const BoundaryFluidState &)
Definition: blackoilenergymodules.hh:729
static void updateEnergy(Evaluation &, const unsigned &, const unsigned &, const unsigned &, const IntensiveQuantities &, const IntensiveQuantities &, const FluidState &, const FluidState &, const Scalar &, const Scalar &, const Scalar &)
Definition: blackoilenergymodules.hh:710
static void updateEnergyBoundary(Evaluation &, const IntensiveQuantities &, unsigned, unsigned, unsigned, Scalar, const BoundaryFluidState &)
Definition: blackoilenergymodules.hh:736
void updateEnergy(const ElementContext &, unsigned, unsigned)
Definition: blackoilenergymodules.hh:723
const Evaluation & energyFlux() const
Definition: blackoilenergymodules.hh:745
void updateEnergyBoundary(const Context &ctx, unsigned scvfIdx, unsigned timeIdx, const BoundaryFluidState &boundaryFs)
Definition: blackoilenergymodules.hh:636
static void updateEnergyBoundary(Evaluation &energyFlux, const IntensiveQuantities &inIq, unsigned focusDofIndex, unsigned inIdx, Scalar alpha, const BoundaryFluidState &boundaryFs)
Definition: blackoilenergymodules.hh:652
static void updateEnergy(Evaluation &energyFlux, const unsigned &focusDofIndex, const unsigned &inIdx, const unsigned &exIdx, const IntensiveQuantities &inIq, const IntensiveQuantities &exIq, const FluidState &inFs, const FluidState &exFs, const Scalar &inAlpha, const Scalar &outAlpha, const Scalar &faceArea)
Definition: blackoilenergymodules.hh:547
const Evaluation & energyFlux() const
Definition: blackoilenergymodules.hh:690
void updateEnergy(const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilenergymodules.hh:606
Provides the energy specific extensive quantities to the generic black-oil module's extensive quantit...
Definition: blackoilenergymodules.hh:515
void updateEnergyQuantities_(const ElementContext &, unsigned, unsigned, const typename FluidSystem::template ParameterCache< Evaluation > &)
Definition: blackoilenergymodules.hh:491
const Evaluation & rockInternalEnergy() const
Definition: blackoilenergymodules.hh:497
const Evaluation & totalThermalConductivity() const
Definition: blackoilenergymodules.hh:503
void updateTemperature_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Definition: blackoilenergymodules.hh:461
void updateTemperature_(const Problem &problem, const PrimaryVariables &priVars, unsigned globalDofIdx, unsigned timeIdx, const LinearizationType &lintype)
Definition: blackoilenergymodules.hh:475
Implementation & asImp_()
Definition: blackoilenergymodules.hh:510
Evaluation totalThermalConductivity_
Definition: blackoilenergymodules.hh:443
const Evaluation & totalThermalConductivity() const
Definition: blackoilenergymodules.hh:432
Scalar rockFraction() const
Definition: blackoilenergymodules.hh:435
void updateEnergyQuantities_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx, const typename FluidSystem::template ParameterCache< Evaluation > &paramCache)
Compute the intensive quantities needed to handle energy conservation.
Definition: blackoilenergymodules.hh:396
Implementation & asImp_()
Definition: blackoilenergymodules.hh:439
void updateTemperature_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Update the temperature of the intensive quantity's fluid state.
Definition: blackoilenergymodules.hh:367
Scalar rockFraction_
Definition: blackoilenergymodules.hh:444
void updateTemperature_(const Problem &problem, const PrimaryVariables &priVars, unsigned globalDofIdx, const unsigned timeIdx, const LinearizationType &lintype)
Update the temperature of the intensive quantity's fluid state.
Definition: blackoilenergymodules.hh:382
const Evaluation & rockInternalEnergy() const
Definition: blackoilenergymodules.hh:429
Evaluation rockInternalEnergy_
Definition: blackoilenergymodules.hh:442
Provides the volumetric quantities required for the equations needed by the energys extension of the ...
Definition: blackoilenergymodules.hh:332
Contains the high level supplements required to extend the black oil model by energy.
Definition: blackoilenergymodules.hh:58
static void computeFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilenergymodules.hh:181
static void registerParameters()
Register all run-time parameters for the black-oil energy module.
Definition: blackoilenergymodules.hh:84
GetPropType< TypeTag, Properties::ExtensiveQuantities > ExtensiveQuantities
Definition: blackoilenergymodules.hh:79
static Scalar computeResidualError(const EqVector &resid)
Return how much a residual is considered an error.
Definition: blackoilenergymodules.hh:299
static void deserializeEntity(Model &model, std::istream &instream, const DofEntity &dof)
Definition: blackoilenergymodules.hh:316
static void addStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants)
Definition: blackoilenergymodules.hh:153
static bool primaryVarApplies(unsigned pvIdx)
Definition: blackoilenergymodules.hh:102
static std::string primaryVarName(unsigned pvIdx)
Definition: blackoilenergymodules.hh:112
static std::string eqName(unsigned eqIdx)
Definition: blackoilenergymodules.hh:137
static void serializeEntity(const Model &model, std::ostream &outstream, const DofEntity &dof)
Definition: blackoilenergymodules.hh:306
static Scalar primaryVarWeight(unsigned pvIdx)
Definition: blackoilenergymodules.hh:119
static void updatePrimaryVars(PrimaryVariables &newPv, const PrimaryVariables &oldPv, const EqVector &delta)
Do a Newton-Raphson update the primary variables of the energys.
Definition: blackoilenergymodules.hh:274
static void addToEnthalpyRate(RateVector &flux, const Evaluation &hRate)
Definition: blackoilenergymodules.hh:251
static void addHeatFlux(RateVector &flux, const Evaluation &heatFlux)
Definition: blackoilenergymodules.hh:211
static void registerOutputModules(Model &model, Simulator &simulator)
Register all energy specific VTK and ECL output modules.
Definition: blackoilenergymodules.hh:94
static void addPhaseEnthalpyFlux_(RateVector &flux, unsigned phaseIdx, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilenergymodules.hh:234
static void addPhaseEnthalpyFluxes_(RateVector &flux, unsigned phaseIdx, const Eval &volumeFlux, const FluidState &upFs)
Definition: blackoilenergymodules.hh:222
static bool eqApplies(unsigned eqIdx)
Definition: blackoilenergymodules.hh:127
static Scalar computeUpdateError(const PrimaryVariables &, const EqVector &)
Return how much a Newton-Raphson update is considered an error.
Definition: blackoilenergymodules.hh:287
static void assignPrimaryVars(PrimaryVariables &priVars, const FluidState &fluidState)
Assign the energy specific primary variables to a PrimaryVariables object.
Definition: blackoilenergymodules.hh:263
static Scalar eqWeight(unsigned eqIdx)
Definition: blackoilenergymodules.hh:144
VTK output module for the black oil model's energy related quantities.
Definition: vtkblackoilenergymodule.hpp:54
static void registerParameters()
Register all run-time parameters for the multi-phase VTK output module.
Definition: vtkblackoilenergymodule.hpp:87
Definition: blackoilboundaryratevector.hh:39
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:233
This method contains all callback classes for quantities that are required by some extensive quantiti...
Definition: linearizationtype.hh:34