28#ifndef OPM_TEMPERATURE_MODEL_HPP
29#define OPM_TEMPERATURE_MODEL_HPP
31#include <opm/common/OpmLog/OpmLog.hpp>
52template<
class TypeTag,
class MyTypeTag>
61template<
typename Scalar,
typename IndexTraits>
class WellState;
64template <
class TypeTag>
76 enum { enableBrine = getPropValue<TypeTag, Properties::EnableBrine>() };
77 enum { enableVapwat = getPropValue<TypeTag, Properties::EnableVapwat>() };
78 enum { enableDisgasInWater = getPropValue<TypeTag, Properties::EnableDisgasInWater>() };
79 enum { enableSaltPrecipitation = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>() };
80 enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
81 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
82 static constexpr bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0;
90 compositionSwitchEnabled,
93 enableSaltPrecipitation,
102 const EvaluationTemp T = EvaluationTemp::createVariable(problem.temperature(globalDofIdx, timeIdx), 0);
107 const unsigned globalSpaceIdx,
108 const unsigned timeIdx)
112 for (
int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
113 if (!FluidSystem::phaseIsActive(phaseIdx)) {
117 const auto& h = FluidSystem::enthalpy(
fluidState_, phaseIdx, problem.pvtRegionIndex(globalSpaceIdx));
121 const auto& solidEnergyLawParams = problem.solidEnergyLawParams(globalSpaceIdx, timeIdx);
124 const auto& thermalConductionLawParams = problem.thermalConductionLawParams(globalSpaceIdx, timeIdx);
132 rockFraction_ = problem.rockFraction(globalSpaceIdx, timeIdx);
147 template <
class Flu
idState>
151 fluidState_.setPvtRegionIndex(fs.pvtRegionIndex());
154 for (
int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
155 fluidState_.setPressure(phaseIdx, getValue(fs.pressure(phaseIdx)));
156 fluidState_.setDensity(phaseIdx, getValue(fs.density(phaseIdx)));
157 fluidState_.setSaturation(phaseIdx, getValue(fs.saturation(phaseIdx)));
158 fluidState_.setInvB(phaseIdx, getValue(fs.invB(phaseIdx)));
174template <class TypeTag, bool enableTempV = getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::SequentialImplicitThermal >
176 GetPropType<TypeTag, Properties::GridView>,
177 GetPropType<TypeTag, Properties::DofMapper>,
178 GetPropType<TypeTag, Properties::Stencil>,
179 GetPropType<TypeTag, Properties::FluidSystem>,
180 GetPropType<TypeTag, Properties::Scalar>>
199 using IndexTraits =
typename FluidSystem::IndexTraitsType;
212 struct ResidualNBInfo
221 enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
222 enum { numPhases = FluidSystem::numPhases };
223 enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
224 enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
225 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
226 static constexpr int temperatureIdx = 0;
230 :
BaseType(simulator.vanguard().gridView(),
231 simulator.vanguard().eclState(),
232 simulator.vanguard().cartesianIndexMapper(),
233 simulator.model().dofMapper())
239 const unsigned int numCells =
simulator_.model().numTotalDof();
249 for (
unsigned globI = 0; globI < numCells; ++globI) {
257 const auto& elemMapper =
simulator_.model().elementMapper();
261 scalingFactor_ = getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
264 using NeighborSet = std::set<unsigned>;
265 std::vector<NeighborSet> neighbors(numCells);
268 std::vector<NeighborInfoCPU> loc_nbinfo;
269 for (
const auto& elem : elements(this->
gridView_)) {
270 stencil.update(elem);
271 for (
unsigned primaryDofIdx = 0; primaryDofIdx < stencil.numPrimaryDof(); ++primaryDofIdx) {
272 const unsigned myIdx = stencil.globalSpaceIndex(primaryDofIdx);
273 loc_nbinfo.resize(stencil.numDof() - 1);
274 for (
unsigned dofIdx = 0; dofIdx < stencil.numDof(); ++dofIdx) {
275 const unsigned neighborIdx = stencil.globalSpaceIndex(dofIdx);
276 neighbors[myIdx].insert(neighborIdx);
278 const auto scvfIdx = dofIdx - 1;
279 const auto& scvf = stencil.interiorFace(scvfIdx);
280 const Scalar area = scvf.area();
281 Scalar inAlpha =
simulator_.problem().thermalHalfTransmissibility(myIdx, neighborIdx);
282 Scalar outAlpha =
simulator_.problem().thermalHalfTransmissibility(neighborIdx, myIdx);
283 ResidualNBInfo nbinfo{area, inAlpha, outAlpha};
284 loc_nbinfo[dofIdx - 1] =
NeighborInfoCPU{neighborIdx, nbinfo,
nullptr};
287 neighborInfo_.appendRow(loc_nbinfo.begin(), loc_nbinfo.end());
294 for (
unsigned globI = 0; globI < numCells; globI++) {
297 for (
auto& nbInfo : nbInfos) {
298 nbInfo.matBlockAddress =
energyMatrix_->blockAddress(nbInfo.neighbor, globI);
310 const unsigned int numCells =
simulator_.model().numTotalDof();
312 #pragma omp parallel for
314 for (
unsigned globI = 0; globI < numCells; ++globI) {
321 const int nw =
simulator_.problem().wellModel().wellState().numWells();
335 const unsigned int numCells =
simulator_.model().numTotalDof();
337 #pragma omp parallel for
339 for (
unsigned globI = 0; globI < numCells; ++globI) {
347 const int nw = wellState.
numWells();
348 for (
auto wellID = 0*nw; wellID < nw; ++wellID) {
349 auto& ws = wellState.
well(wellID);
354 const auto& wellPtrs =
simulator_.problem().wellModel().localNonshutWells();
355 for (
const auto& wellPtr : wellPtrs) {
356 auto& ws = wellState.
well(wellPtr->name());
365 template <
class Restarter>
375 template <
class Restarter>
383 const unsigned int numCells =
simulator_.model().numTotalDof();
385 #pragma omp parallel for
387 for (
unsigned globI = 0; globI < numCells; ++globI) {
388 Scalar storage = 0.0;
396 const int max_iter = 20;
397 const int min_iter = 1;
398 bool is_converged =
false;
400 for (
int iter = 0; iter < max_iter; ++iter) {
402 if (iter >= min_iter &&
converged(iter)) {
410 fmt::format(fmt::runtime(
"Temperature model (TEMP): Newton did not converge after {} iterations. \n"
411 "The Simulator will continue to the next step with an unconverged solution."),
419 const unsigned int numCells =
simulator_.model().numTotalDof();
420 EnergyVector dx(numCells);
423 if (
simulator_.gridView().comm().rank() == 0) {
424 OpmLog::warning(
"Temp model: Linear solver did not converge. Temperature values not updated.");
429 #pragma omp parallel for
431 for (
unsigned globI = 0; globI < numCells; ++globI) {
442 Scalar maxNorm = 0.0;
443 Scalar sumNorm = 0.0;
444 const auto tolerance_cnv_energy_strict = Parameters::Get<Parameters::ToleranceCnvEnergy<Scalar>>();
445 const auto& elemMapper =
simulator_.model().elementMapper();
448 Scalar sum_pv_not_converged = 0.0;
449 for (
const auto& elem : elements(
simulator_.gridView(), Dune::Partitions::interior)) {
450 unsigned globI = elemMapper.index(elem);
451 const auto pvValue =
simulator_.problem().referencePorosity(globI, 0)
454 const Scalar scaled_norm = dt * std::abs(this->
energyVector_[globI])/ pvValue;
455 maxNorm = max(maxNorm, scaled_norm);
456 sumNorm += scaled_norm;
457 if (!isNumericalAquiferCell(elem)) {
458 if (scaled_norm > tolerance_cnv_energy_strict) {
459 sum_pv_not_converged += pvValue;
464 maxNorm =
simulator_.gridView().comm().max(maxNorm);
465 sumNorm =
simulator_.gridView().comm().sum(sumNorm);
466 sum_pv =
simulator_.gridView().comm().sum(sum_pv);
470 sum_pv_not_converged =
simulator_.gridView().comm().sum(sum_pv_not_converged);
471 Scalar relaxed_max_pv_fraction = Parameters::Get<Parameters::RelaxedMaxPvFraction<Scalar>>();
472 const bool relax = (sum_pv_not_converged / sum_pv) < relaxed_max_pv_fraction;
473 const auto tolerance_energy_balance = relax? Parameters::Get<Parameters::ToleranceEnergyBalanceRelaxed<Scalar>>():
475 const bool tolerance_cnv_energy = relax? Parameters::Get<Parameters::ToleranceCnvEnergyRelaxed<Scalar>>():
476 tolerance_cnv_energy_strict;
478 const auto msg = fmt::format(fmt::runtime(
"Temperature model (TEMP): Newton iter {}: "
479 "CNV(E): {:.1e}, EB: {:.1e}"),
480 iter, maxNorm, sumNorm);
482 if (maxNorm < tolerance_cnv_energy && sumNorm < tolerance_energy_balance) {
484 fmt::format(fmt::runtime(
"Temperature model (TEMP): Newton converged after {} iterations"),
492 template<
class LhsEval>
496 const auto& poro = getValue(
simulator_.model().intensiveQuantities(globI, 0).porosity());
498 const auto& fs = intQuants.fluidStateTemp();
499 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
500 if (!FluidSystem::phaseIsActive(phaseIdx)) {
504 const auto& u = decay<LhsEval>(fs.internalEnergy(phaseIdx));
505 const auto& S = decay<LhsEval>(fs.saturation(phaseIdx));
506 const auto& rho = decay<LhsEval>(fs.density(phaseIdx));
508 storage += poro*S*u*rho;
512 const Scalar rockFraction = intQuants.rockFraction();
513 const auto& uRock = decay<LhsEval>(intQuants.rockInternalEnergy());
514 storage += rockFraction*uRock;
518 template <
class RateVector>
520 const FluidStateTemp& fsEx,
521 const RateVector& darcyFlux,
524 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
525 if (!FluidSystem::phaseIsActive(phaseIdx)) {
529 const unsigned activeCompIdx =
530 FluidSystem::canonicalToActiveCompIdx(FluidSystem::solventComponentIndex(phaseIdx));
531 bool inIsUp = darcyFlux[activeCompIdx] > 0;
532 const auto& fs = inIsUp ? fsIn : fsEx;
534 flux += fs.enthalpy(phaseIdx)
535 * fs.density(phaseIdx)
536 * getValue(darcyFlux[activeCompIdx]);
539 flux += getValue(fs.enthalpy(phaseIdx))
540 * getValue(fs.density(phaseIdx))
541 * getValue(darcyFlux[activeCompIdx]);
547 template <
class Res
idualNBInfo>
550 const ResidualNBInfo& res_nbinfo,
551 Evaluation& heatFlux)
553 short interiorDofIdx = 0;
554 short exteriorDofIdx = 1;
555 EnergyModule::ExtensiveQuantities::updateEnergy(heatFlux,
565 res_nbinfo.faceArea);
571 const unsigned int numCells =
simulator_.model().numTotalDof();
572 for (
unsigned globI = 0; globI < numCells; ++globI) {
578 #pragma omp parallel for
580 for (
unsigned globI = 0; globI < numCells; ++globI) {
581 MatrixBlockTemp bMat;
582 Scalar volume =
simulator_.model().dofTotalVolume(globI);
583 Scalar storefac = volume / dt;
584 Evaluation storage = 0.0;
587 bMat[0][0] = storefac * storage.derivative(temperatureIdx);
591 const auto& floresInfo = this->
simulator_.problem().model().linearizer().getFloresInfo();
592 const bool enableDriftCompensation = Parameters::Get<Parameters::EnableDriftCompensationTemp>();
596 #pragma omp parallel for
598 for (
unsigned globI = 0; globI < numCells; ++globI) {
600 const auto& floresInfos = floresInfo[globI];
603 MatrixBlockTemp bMat;
604 for (
const auto& nbInfo : nbInfos) {
605 unsigned globJ = nbInfo.neighbor;
607 assert(globJ != globI);
608 const auto& darcyflux = floresInfos[loc].flow;
610 Evaluation flux = 0.0;
611 computeFluxTerm(intQuantsIn.fluidStateTemp(), intQuantsEx.fluidStateTemp(), darcyflux, flux);
613 Evaluation heatFlux = 0.0;
617 bMat[0][0] = heatFlux.derivative(temperatureIdx);
621 *nbInfo.matBlockAddress += bMat;
625 if (enableDriftCompensation) {
626 auto dofDriftRate = problem.drift()[globI]/dt;
627 const auto& fs = intQuantsIn.fluidStateTemp();
628 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
629 const unsigned activeCompIdx =
630 FluidSystem::canonicalToActiveCompIdx(FluidSystem::solventComponentIndex(phaseIdx));
631 auto drift_hrate = dofDriftRate[activeCompIdx]*getValue(fs.enthalpy(phaseIdx)) * getValue(fs.density(phaseIdx)) / getValue(fs.invB(phaseIdx));
638 const auto& wellPtrs =
simulator_.problem().wellModel().localNonshutWells();
639 for (
const auto& wellPtr : wellPtrs) {
661 const auto& eclWell = well.wellEcl();
662 std::size_t well_index =
simulator_.problem().wellModel().wellState().index(well.name()).value();
663 const auto& ws =
simulator_.problem().wellModel().wellState().well(well_index);
665 MatrixBlockTemp bMat;
666 for (std::size_t i = 0; i < ws.perf_data.size(); ++i) {
667 const auto globI = ws.perf_data.cell_index[i];
669 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
670 if (!FluidSystem::phaseIsActive(phaseIdx)) {
674 Evaluation rate = well.volumetricSurfaceRateForConnection(globI, phaseIdx);
675 if (rate > 0 && eclWell.isInjector()) {
676 fs.setTemperature(eclWell.inj_temperature());
677 const auto& rho = FluidSystem::density(fs, phaseIdx, fs.pvtRegionIndex());
678 fs.setDensity(phaseIdx, rho);
679 const auto& h = FluidSystem::enthalpy(fs, phaseIdx, fs.pvtRegionIndex());
680 fs.setEnthalpy(phaseIdx, h);
681 rate *= getValue(fs.enthalpy(phaseIdx)) * getValue(fs.density(phaseIdx)) / getValue(fs.invB(phaseIdx));
683 const Evaluation d = 1.0 - fs.Rv() * fs.Rs();
684 if (phaseIdx == gasPhaseIdx && d > 0) {
685 const auto& oilrate = well.volumetricSurfaceRateForConnection(globI, oilPhaseIdx);
686 rate -= oilrate * getValue(fs.Rs());
689 if (phaseIdx == oilPhaseIdx && d > 0) {
690 const auto& gasrate = well.volumetricSurfaceRateForConnection(globI, gasPhaseIdx);
691 rate -= gasrate * getValue(fs.Rv());
694 rate *= fs.enthalpy(phaseIdx) * getValue(fs.density(phaseIdx)) / getValue(fs.invB(phaseIdx));
699 bMat[0][0] = -rate.derivative(temperatureIdx);
705 template<
class Well,
class SingleWellState>
708 if (well.isInjector()) {
709 if (ws.
status != WellStatus::STOP) {
714 const int np =
simulator_.problem().wellModel().wellState().numPhases();
715 std::array<Scalar,2> weighted{0.0,0.0};
716 auto& [weighted_temperature, total_weight] = weighted;
717 for (std::size_t i = 0; i < ws.
perf_data.size(); ++i) {
718 const auto globI = ws.
perf_data.cell_index[i];
719 const auto& fs =
intQuants_[globI].fluidStateTemp();
720 Scalar weight_factor =
simulator_.problem().wellModel().computeTemperatureWeightFactor(i, np, fs, ws);
721 total_weight += weight_factor;
722 weighted_temperature += weight_factor * fs.temperature(0).value();
725 ws.
temperature = weighted_temperature / total_weight;
740template <
class TypeTag>
755 template <
class Restarter>
765 template <
class Restarter>
Definition: TemperatureModel.hpp:66
FluidStateTemp fluidState_
Definition: TemperatureModel.hpp:165
void updateTemperature_(const Problem &problem, unsigned globalDofIdx, unsigned timeIdx)
Definition: TemperatureModel.hpp:100
void updateEnergyQuantities_(const Problem &problem, const unsigned globalSpaceIdx, const unsigned timeIdx)
Definition: TemperatureModel.hpp:106
void setFluidState(const FluidState &fs)
Definition: TemperatureModel.hpp:148
const FluidStateTemp & fluidStateTemp() const
Definition: TemperatureModel.hpp:144
Scalar rockFraction_
Definition: TemperatureModel.hpp:166
EvaluationTemp rockInternalEnergy_
Definition: TemperatureModel.hpp:163
EvaluationTemp totalThermalConductivity_
Definition: TemperatureModel.hpp:164
const Scalar & rockFraction() const
Definition: TemperatureModel.hpp:141
const EvaluationTemp & totalThermalConductivity() const
Definition: TemperatureModel.hpp:138
const EvaluationTemp & rockInternalEnergy() const
Definition: TemperatureModel.hpp:135
DenseAd::Evaluation< Scalar, 1 > EvaluationTemp
Definition: TemperatureModel.hpp:85
BlackOilFluidState< EvaluationTemp, FluidSystem, true, true, compositionSwitchEnabled, enableVapwat, enableBrine, enableSaltPrecipitation, enableDisgasInWater, enableSolvent, Indices::numPhases > FluidStateTemp
Definition: TemperatureModel.hpp:96
Contains the high level supplements required to extend the black oil model by energy.
Definition: blackoilenergymodules.hh:63
Definition: GenericTemperatureModel.hpp:53
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::energyVector_ EnergyVector energyVector_
Definition: GenericTemperatureModel.hpp:91
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::dofMapper_ const GetPropType< TypeTag, Properties::DofMapper > & dofMapper_
Definition: GenericTemperatureModel.hpp:89
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::energy_rates_ std::vector< GetPropType< TypeTag, Properties::Scalar > > energy_rates_
Definition: GenericTemperatureModel.hpp:93
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::MatrixBlockTemp MatrixBlock< GetPropType< TypeTag, Properties::Scalar >, 1, 1 > MatrixBlockTemp
Definition: GenericTemperatureModel.hpp:56
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::EnergyMatrix Dune::BCRSMatrix< MatrixBlockTemp > EnergyMatrix
Definition: GenericTemperatureModel.hpp:57
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::linearSolve_ bool linearSolve_(const EnergyMatrix &M, EnergyVector &x, EnergyVector &b)
Definition: GenericTemperatureModel_impl.hpp:166
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::EnergyVector Dune::BlockVector< Dune::FieldVector< GetPropType< TypeTag, Properties::Scalar >, 1 > > EnergyVector
Definition: GenericTemperatureModel.hpp:58
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::doTemp bool doTemp()
Definition: GenericTemperatureModel.hpp:62
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::doInit void doInit(std::size_t numGridDof)
Initialize all internal data structures needed by the temperature module.
Definition: GenericTemperatureModel_impl.hpp:115
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::maxTempChange_ GetPropType< TypeTag, Properties::Scalar > maxTempChange_
Definition: GenericTemperatureModel.hpp:95
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::temperature_ std::vector< GetPropType< TypeTag, Properties::Scalar > > temperature_
Definition: GenericTemperatureModel.hpp:92
Opm::GenericTemperatureModel< GetPropType< TypeTag, Properties::Grid >, GetPropType< TypeTag, Properties::GridView >, GetPropType< TypeTag, Properties::DofMapper >, GetPropType< TypeTag, Properties::Stencil >, GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Scalar > >::gridView_ const GetPropType< TypeTag, Properties::GridView > & gridView_
Definition: GenericTemperatureModel.hpp:86
A sparse matrix interface backend for BCRSMatrix from dune-istl.
Definition: istlsparsematrixadapter.hh:43
Definition: SingleWellState.hpp:43
WellStatus status
Definition: SingleWellState.hpp:97
Scalar temperature
Definition: SingleWellState.hpp:105
PerfData< Scalar > perf_data
Definition: SingleWellState.hpp:143
Definition: BlackoilWellModel.hpp:87
void beginTimeStep()
Definition: TemperatureModel.hpp:770
void init()
Definition: TemperatureModel.hpp:769
const Scalar temperature(size_t) const
Definition: TemperatureModel.hpp:771
void deserialize(Restarter &)
This method restores the complete state of the temperature from disk.
Definition: TemperatureModel.hpp:766
void serialize(Restarter &)
This method writes the complete state of all temperature to the hard disk.
Definition: TemperatureModel.hpp:756
TemperatureModel(Simulator &)
Definition: TemperatureModel.hpp:748
A class which handles sequential implicit solution of the energy equation as specified in by TEMP.
Definition: TemperatureModel.hpp:181
void serialize(Restarter &)
This method writes the complete state of all temperature to the hard disk.
Definition: TemperatureModel.hpp:366
void assembleEquationWell(const Well &well)
Definition: TemperatureModel.hpp:659
void computeFluxTerm(const FluidStateTemp &fsIn, const FluidStateTemp &fsEx, const RateVector &darcyFlux, Evaluation &flux)
Definition: TemperatureModel.hpp:519
std::vector< int > interiorRows_
Definition: TemperatureModel.hpp:735
EnergyVector storage1_
Definition: TemperatureModel.hpp:729
bool converged(const int iter)
Definition: TemperatureModel.hpp:439
void computeStorageTerm(unsigned globI, LhsEval &storage)
Definition: TemperatureModel.hpp:493
void deserialize(Restarter &)
This method restores the complete state of the temperature from disk.
Definition: TemperatureModel.hpp:376
void endTimeStep(WellStateType &wellState)
Informs the temperature model that a time step has just been finished.
Definition: TemperatureModel.hpp:328
const Simulator & simulator_
Definition: TemperatureModel.hpp:728
void computeHeatFluxTerm(const IntensiveQuantitiesTemp &intQuantsIn, const IntensiveQuantitiesTemp &intQuantsEx, const ResidualNBInfo &res_nbinfo, Evaluation &heatFlux)
Definition: TemperatureModel.hpp:548
void beginTimeStep()
Definition: TemperatureModel.hpp:303
void computeWellTemperature(const Well &well, SingleWellState &ws)
Definition: TemperatureModel.hpp:706
void advanceTemperatureFields()
Definition: TemperatureModel.hpp:394
void updateStorageCache()
Definition: TemperatureModel.hpp:380
Scalar scalingFactor_
Definition: TemperatureModel.hpp:736
std::unique_ptr< SpareMatrixEnergyAdapter > energyMatrix_
Definition: TemperatureModel.hpp:733
void assembleEquations()
Definition: TemperatureModel.hpp:569
void solveAndUpdate()
Definition: TemperatureModel.hpp:417
std::vector< MatrixBlockTemp * > diagMatAddress_
Definition: TemperatureModel.hpp:732
std::vector< IntensiveQuantitiesTemp > intQuants_
Definition: TemperatureModel.hpp:730
std::vector< int > overlapRows_
Definition: TemperatureModel.hpp:734
SparseTable< NeighborInfoCPU > neighborInfo_
Definition: TemperatureModel.hpp:731
TemperatureModel(Simulator &simulator)
Definition: TemperatureModel.hpp:229
void init()
Definition: TemperatureModel.hpp:237
Definition: WellState.hpp:66
int numWells() const
Definition: WellState.hpp:114
const SingleWellState< Scalar, IndexTraits > & well(std::size_t well_index) const
Definition: WellState.hpp:306
Provides data handles for parallel communication which operate on DOFs.
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition: parametersystem.hpp:187
Definition: blackoilmodel.hh:80
void findOverlapAndInterior(const Grid &grid, const Mapper &mapper, std::vector< int > &overlapRows, std::vector< int > &interiorRows)
Find the rows corresponding to overlap cells.
Definition: findOverlapRowsAndColumns.hpp:92
Definition: blackoilbioeffectsmodules.hh:45
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
The Opm property system, traits with inheritance.
Definition: AquiferGridUtils.hpp:35
Definition: tpfalinearizer.hh:124
Definition: BlackoilModelParameters.hpp:61
Definition: TemperatureModel.hpp:53
a tag to mark properties as undefined
Definition: propertysystem.hh:38