28#ifndef OPM_TEMPERATURE_MODEL_HPP
29#define OPM_TEMPERATURE_MODEL_HPP
31#include <opm/common/OpmLog/OpmLog.hpp>
32#include <opm/common/utility/gpuDecorators.hpp>
56template<
class TypeTag,
class MyTypeTag>
65template<
typename Scalar,
typename IndexTraits>
class WellState;
68template <
class TypeTag>
78 static constexpr bool enableBrine = getPropValue<TypeTag, Properties::EnableBrine>();
79 enum { enableVapwat = getPropValue<TypeTag, Properties::EnableVapwat>() };
80 enum { enableDisgasInWater = getPropValue<TypeTag, Properties::EnableDisgasInWater>() };
81 enum { enableSaltPrecipitation = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>() };
82 static constexpr bool enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>();
83 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
84 static constexpr bool compositionSwitchEnabled =
85 Indices::compositionSwitchIdx != std::numeric_limits<unsigned>::max();
93 compositionSwitchEnabled,
96 enableSaltPrecipitation,
104 unsigned globalDofIdx,
107 const EvaluationTemp T = EvaluationTemp::createVariable(problem.temperature(globalDofIdx, timeIdx), 0);
112 const unsigned globalSpaceIdx,
113 const unsigned timeIdx)
117 for (
int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
118 if (!FluidSystem::phaseIsActive(phaseIdx)) {
122 const auto& h = FluidSystem::enthalpy(
fluidState_, phaseIdx, problem.pvtRegionIndex(globalSpaceIdx));
126 const auto& solidEnergyLawParams = problem.solidEnergyLawParams(globalSpaceIdx, timeIdx);
129 const auto& thermalConductionLawParams = problem.thermalConductionLawParams(globalSpaceIdx, timeIdx);
137 rockFraction_ = problem.rockFraction(globalSpaceIdx, timeIdx);
152 template <
class Flu
idState>
156 fluidState_.setPvtRegionIndex(fs.pvtRegionIndex());
159 for (
int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
160 fluidState_.setPressure(phaseIdx, getValue(fs.pressure(phaseIdx)));
161 fluidState_.setDensity(phaseIdx, getValue(fs.density(phaseIdx)));
162 fluidState_.setSaturation(phaseIdx, getValue(fs.saturation(phaseIdx)));
163 fluidState_.setInvB(phaseIdx, getValue(fs.invB(phaseIdx)));
179template <class TypeTag, bool enableTempV = getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::SequentialImplicitThermal >
181 GetPropType<TypeTag, Properties::GridView>,
182 GetPropType<TypeTag, Properties::DofMapper>,
183 GetPropType<TypeTag, Properties::Stencil>,
184 GetPropType<TypeTag, Properties::FluidSystem>,
185 GetPropType<TypeTag, Properties::Scalar>>
203 static constexpr EnergyModules energyModuleType = getPropValue<TypeTag, Properties::EnergyModuleType>();
205 using IndexTraits =
typename FluidSystem::IndexTraitsType;
218 struct ResidualNBInfo
227 enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
228 enum { numPhases = FluidSystem::numPhases };
229 enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
230 enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
231 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
232 static constexpr unsigned temperatureIdx = 0;
236 :
BaseType(simulator.vanguard().gridView(),
237 simulator.vanguard().eclState(),
238 simulator.vanguard().cartesianIndexMapper(),
239 simulator.model().dofMapper())
245 const unsigned int numCells =
simulator_.model().numTotalDof();
255 for (
unsigned globI = 0; globI < numCells; ++globI) {
263 const auto& elemMapper =
simulator_.model().elementMapper();
267 scalingFactor_ = getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
270 using NeighborSet = std::set<unsigned>;
271 std::vector<NeighborSet> neighbors(numCells);
274 std::vector<NeighborInfoCPU> loc_nbinfo;
275 for (
const auto& elem : elements(this->
gridView_)) {
276 stencil.update(elem);
277 for (
unsigned primaryDofIdx = 0; primaryDofIdx < stencil.numPrimaryDof(); ++primaryDofIdx) {
278 const unsigned myIdx = stencil.globalSpaceIndex(primaryDofIdx);
279 loc_nbinfo.resize(stencil.numDof() - 1);
280 for (
unsigned dofIdx = 0; dofIdx < stencil.numDof(); ++dofIdx) {
281 const unsigned neighborIdx = stencil.globalSpaceIndex(dofIdx);
282 neighbors[myIdx].insert(neighborIdx);
284 const auto scvfIdx = dofIdx - 1;
285 const auto& scvf = stencil.interiorFace(scvfIdx);
286 const Scalar area = scvf.area();
287 Scalar inAlpha =
simulator_.problem().thermalHalfTransmissibility(myIdx, neighborIdx);
288 Scalar outAlpha =
simulator_.problem().thermalHalfTransmissibility(neighborIdx, myIdx);
289 ResidualNBInfo nbinfo{area, inAlpha, outAlpha};
290 loc_nbinfo[dofIdx - 1] =
NeighborInfoCPU{neighborIdx, nbinfo,
nullptr};
293 neighborInfo_.appendRow(loc_nbinfo.begin(), loc_nbinfo.end());
300 for (
unsigned globI = 0; globI < numCells; globI++) {
303 for (
auto& nbInfo : nbInfos) {
304 nbInfo.matBlockAddress =
energyMatrix_->blockAddress(nbInfo.neighbor, globI);
316 const unsigned int numCells =
simulator_.model().numTotalDof();
318 #pragma omp parallel for
320 for (
unsigned globI = 0; globI < numCells; ++globI) {
327 const int nw =
simulator_.problem().wellModel().wellState().numWells();
339 OPM_TIMEBLOCK(TemperatureModel_endTimeStep);
342 const unsigned int numCells =
simulator_.model().numTotalDof();
344 #pragma omp parallel for
346 for (
unsigned globI = 0; globI < numCells; ++globI) {
354 const int nw = wellState.
numWells();
355 for (
auto wellID = 0*nw; wellID < nw; ++wellID) {
356 auto& ws = wellState.
well(wellID);
361 const auto& wellPtrs =
simulator_.problem().wellModel().localNonshutWells();
362 for (
const auto& wellPtr : wellPtrs) {
363 auto& ws = wellState.
well(wellPtr->name());
372 template <
class Restarter>
382 template <
class Restarter>
390 const unsigned int numCells =
simulator_.model().numTotalDof();
392 #pragma omp parallel for
394 for (
unsigned globI = 0; globI < numCells; ++globI) {
395 Scalar storage = 0.0;
403 OPM_TIMEBLOCK(TemperatureModel_advanceTemperatureFields);
404 const int max_iter = 20;
405 const int min_iter = 1;
406 bool is_converged =
false;
408 for (
int iter = 0; iter < max_iter; ++iter) {
410 if (iter >= min_iter &&
converged(iter)) {
418 fmt::format(fmt::runtime(
"Temperature model (TEMP): Newton did not converge after {} iterations. \n"
419 "The Simulator will continue to the next step with an unconverged solution."),
427 OPM_TIMEBLOCK(TemperatureModel_solveAndUpdate);
428 const unsigned int numCells =
simulator_.model().numTotalDof();
429 EnergyVector dx(numCells);
432 if (
simulator_.gridView().comm().rank() == 0) {
433 OpmLog::warning(
"Temp model: Linear solver did not converge. Temperature values not updated.");
437 OPM_TIMEBLOCK(TemperatureModel_solveAndUpdate_update);
439 #pragma omp parallel for
441 for (
unsigned globI = 0; globI < numCells; ++globI) {
451 OPM_TIMEBLOCK(TemperatureModel_converged);
453 Scalar maxNorm = 0.0;
454 Scalar sumNorm = 0.0;
455 const auto tolerance_cnv_energy_strict = Parameters::Get<Parameters::ToleranceCnvEnergy<Scalar>>();
456 const auto& elemMapper =
simulator_.model().elementMapper();
459 Scalar sum_pv_not_converged = 0.0;
460 for (
const auto& elem : elements(
simulator_.gridView(), Dune::Partitions::interior)) {
461 unsigned globI = elemMapper.index(elem);
462 const auto pvValue =
simulator_.problem().referencePorosity(globI, 0)
465 const Scalar scaled_norm = dt * std::abs(this->
energyVector_[globI])/ pvValue;
466 maxNorm = max(maxNorm, scaled_norm);
467 sumNorm += scaled_norm;
468 if (!isNumericalAquiferCell(elem)) {
469 if (scaled_norm > tolerance_cnv_energy_strict) {
470 sum_pv_not_converged += pvValue;
476 OPM_TIMEBLOCK(TemperatureModel_converged_communicate);
478 maxNorm =
simulator_.gridView().comm().max(maxNorm);
479 sumNorm =
simulator_.gridView().comm().sum(sumNorm);
480 sum_pv =
simulator_.gridView().comm().sum(sum_pv);
484 sum_pv_not_converged =
simulator_.gridView().comm().sum(sum_pv_not_converged);
486 Scalar relaxed_max_pv_fraction = Parameters::Get<Parameters::RelaxedMaxPvFraction<Scalar>>();
487 const bool relax = (sum_pv_not_converged / sum_pv) < relaxed_max_pv_fraction;
488 const auto tolerance_energy_balance = relax? Parameters::Get<Parameters::ToleranceEnergyBalanceRelaxed<Scalar>>():
490 const bool tolerance_cnv_energy = relax? Parameters::Get<Parameters::ToleranceCnvEnergyRelaxed<Scalar>>():
491 tolerance_cnv_energy_strict;
493 const auto msg = fmt::format(fmt::runtime(
"Temperature model (TEMP): Newton iter {}: "
494 "CNV(E): {:.1e}, EB: {:.1e}"),
495 iter, maxNorm, sumNorm);
497 if (maxNorm < tolerance_cnv_energy && sumNorm < tolerance_energy_balance) {
499 fmt::format(fmt::runtime(
"Temperature model (TEMP): Newton converged after {} iterations"),
507 template<
class LhsEval>
511 const auto& poro = getValue(
simulator_.model().intensiveQuantities(globI, 0).porosity());
513 const auto& fs = intQuants.fluidStateTemp();
514 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
515 if (!FluidSystem::phaseIsActive(phaseIdx)) {
519 const auto& u = decay<LhsEval>(fs.internalEnergy(phaseIdx));
520 const auto& S = decay<LhsEval>(fs.saturation(phaseIdx));
521 const auto& rho = decay<LhsEval>(fs.density(phaseIdx));
523 storage += poro*S*u*rho;
527 const Scalar rockFraction = intQuants.rockFraction();
528 const auto& uRock = decay<LhsEval>(intQuants.rockInternalEnergy());
529 storage += rockFraction*uRock;
533 template <
class RateVector>
535 const FluidStateTemp& fsEx,
536 const RateVector& darcyFlux,
539 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
540 if (!FluidSystem::phaseIsActive(phaseIdx)) {
544 const unsigned activeCompIdx =
545 FluidSystem::canonicalToActiveCompIdx(FluidSystem::solventComponentIndex(phaseIdx));
546 bool inIsUp = darcyFlux[activeCompIdx] > 0;
547 const auto& fs = inIsUp ? fsIn : fsEx;
549 flux += fs.enthalpy(phaseIdx)
550 * fs.density(phaseIdx)
551 * getValue(darcyFlux[activeCompIdx]);
554 flux += getValue(fs.enthalpy(phaseIdx))
555 * getValue(fs.density(phaseIdx))
556 * getValue(darcyFlux[activeCompIdx]);
562 template <
class Res
idualNBInfo>
565 const ResidualNBInfo& res_nbinfo,
566 Evaluation& heatFlux)
568 short interiorDofIdx = 0;
569 short exteriorDofIdx = 1;
581 res_nbinfo.faceArea);
587 OPM_TIMEBLOCK(TemperatureModel_assembleEquations);
589 const unsigned int numCells =
simulator_.model().numTotalDof();
590 for (
unsigned globI = 0; globI < numCells; ++globI) {
598 OPM_TIMEBLOCK(TemperatureModel_assembleEquations_storage);
600 #pragma omp parallel for
602 for (
unsigned globI = 0; globI < numCells; ++globI) {
603 MatrixBlockTemp bMat;
604 Scalar volume =
simulator_.model().dofTotalVolume(globI);
605 Scalar storefac = volume / dt;
606 Evaluation storage = 0.0;
609 bMat[0][0] = storefac * storage.derivative(temperatureIdx);
616 OPM_TIMEBLOCK(TemperatureModel_assembleEquations_flux);
617 const auto& floresInfo = this->
simulator_.problem().model().linearizer().getFloresInfo();
618 const bool enableDriftCompensation = Parameters::Get<Parameters::EnableDriftCompensationTemp>();
622 #pragma omp parallel for
624 for (
unsigned globI = 0; globI < numCells; ++globI) {
626 const auto& floresInfos = floresInfo[globI];
629 MatrixBlockTemp bMat;
630 for (
const auto& nbInfo : nbInfos) {
631 unsigned globJ = nbInfo.neighbor;
633 assert(globJ != globI);
634 const auto& darcyflux = floresInfos[loc].flow;
636 Evaluation flux = 0.0;
637 computeFluxTerm(intQuantsIn.fluidStateTemp(), intQuantsEx.fluidStateTemp(), darcyflux, flux);
639 Evaluation heatFlux = 0.0;
643 bMat[0][0] = heatFlux.derivative(temperatureIdx);
647 *nbInfo.matBlockAddress += bMat;
651 if (enableDriftCompensation) {
652 auto dofDriftRate = problem.drift()[globI]/dt;
653 const auto& fs = intQuantsIn.fluidStateTemp();
654 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
655 const unsigned activeCompIdx =
656 FluidSystem::canonicalToActiveCompIdx(FluidSystem::solventComponentIndex(phaseIdx));
657 auto drift_hrate = dofDriftRate[activeCompIdx]*getValue(fs.enthalpy(phaseIdx)) * getValue(fs.density(phaseIdx)) / getValue(fs.invB(phaseIdx));
666 OPM_TIMEBLOCK(TemperatureModel_assembleEquations_wells);
667 const auto& wellPtrs =
simulator_.problem().wellModel().localNonshutWells();
668 for (
const auto& wellPtr : wellPtrs) {
691 const auto& eclWell = well.wellEcl();
692 std::size_t well_index =
simulator_.problem().wellModel().wellState().index(well.name()).value();
693 const auto& ws =
simulator_.problem().wellModel().wellState().well(well_index);
695 MatrixBlockTemp bMat;
696 for (std::size_t i = 0; i < ws.perf_data.size(); ++i) {
697 const auto globI = ws.perf_data.cell_index[i];
699 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
700 if (!FluidSystem::phaseIsActive(phaseIdx)) {
704 Evaluation rate = well.volumetricSurfaceRateForConnection(globI, phaseIdx);
705 if (rate > 0 && eclWell.isInjector()) {
706 fs.setTemperature(eclWell.inj_temperature());
707 const auto& rho = FluidSystem::density(fs, phaseIdx, fs.pvtRegionIndex());
708 fs.setDensity(phaseIdx, rho);
709 const auto& h = FluidSystem::enthalpy(fs, phaseIdx, fs.pvtRegionIndex());
710 fs.setEnthalpy(phaseIdx, h);
711 rate *= getValue(fs.enthalpy(phaseIdx)) * getValue(fs.density(phaseIdx)) / getValue(fs.invB(phaseIdx));
713 const Evaluation d = 1.0 - fs.Rv() * fs.Rs();
714 if (phaseIdx == gasPhaseIdx && d > 0) {
715 const auto& oilrate = well.volumetricSurfaceRateForConnection(globI, oilPhaseIdx);
716 rate -= oilrate * getValue(fs.Rs());
719 if (phaseIdx == oilPhaseIdx && d > 0) {
720 const auto& gasrate = well.volumetricSurfaceRateForConnection(globI, gasPhaseIdx);
721 rate -= gasrate * getValue(fs.Rv());
724 rate *= fs.enthalpy(phaseIdx) * getValue(fs.density(phaseIdx)) / getValue(fs.invB(phaseIdx));
729 bMat[0][0] = -rate.derivative(temperatureIdx);
735 template<
class Well,
class SingleWellState>
738 if (well.isInjector()) {
739 if (ws.
status != WellStatus::STOP) {
744 const int np =
simulator_.problem().wellModel().wellState().numPhases();
745 std::array<Scalar,2> weighted{0.0,0.0};
746 auto& [weighted_temperature, total_weight] = weighted;
747 for (std::size_t i = 0; i < ws.
perf_data.size(); ++i) {
748 const auto globI = ws.
perf_data.cell_index[i];
749 const auto& fs =
intQuants_[globI].fluidStateTemp();
750 Scalar weight_factor =
simulator_.problem().wellModel().computeTemperatureWeightFactor(i, np, fs, ws);
751 total_weight += weight_factor;
752 weighted_temperature += weight_factor * fs.temperature(0).value();
755 ws.
temperature = weighted_temperature / total_weight;
770template <
class TypeTag>
785 template <
class Restarter>
795 template <
class Restarter>
Provides the energy specific extensive quantities to the generic black-oil module's extensive quantit...
Definition: blackoilmodules.hpp:73
Definition: TemperatureModel.hpp:70
FluidStateTemp fluidState_
Definition: TemperatureModel.hpp:170
OPM_HOST_DEVICE const Scalar & rockFraction() const
Definition: TemperatureModel.hpp:146
OPM_HOST_DEVICE void setFluidState(const FluidState &fs)
Definition: TemperatureModel.hpp:153
Scalar rockFraction_
Definition: TemperatureModel.hpp:171
EvaluationTemp rockInternalEnergy_
Definition: TemperatureModel.hpp:168
EvaluationTemp totalThermalConductivity_
Definition: TemperatureModel.hpp:169
OPM_HOST_DEVICE void updateTemperature_(const Problem &problem, unsigned globalDofIdx, unsigned timeIdx)
Definition: TemperatureModel.hpp:103
OPM_HOST_DEVICE const EvaluationTemp & totalThermalConductivity() const
Definition: TemperatureModel.hpp:143
OPM_HOST_DEVICE void updateEnergyQuantities_(const Problem &problem, const unsigned globalSpaceIdx, const unsigned timeIdx)
Definition: TemperatureModel.hpp:111
OPM_HOST_DEVICE const EvaluationTemp & rockInternalEnergy() const
Definition: TemperatureModel.hpp:140
DenseAd::Evaluation< Scalar, 1 > EvaluationTemp
Definition: TemperatureModel.hpp:88
OPM_HOST_DEVICE const FluidStateTemp & fluidStateTemp() const
Definition: TemperatureModel.hpp:149
BlackOilFluidState< EvaluationTemp, FluidSystem, true, true, compositionSwitchEnabled, enableVapwat, enableBrine, enableSaltPrecipitation, enableDisgasInWater, enableSolvent, Indices::numPhases > FluidStateTemp
Definition: TemperatureModel.hpp:99
Definition: blackoilmodules.hpp: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:44
WellStatus status
Definition: SingleWellState.hpp:100
Scalar temperature
Definition: SingleWellState.hpp:108
PerfData< Scalar > perf_data
Definition: SingleWellState.hpp:156
Definition: BlackoilWellModel.hpp:90
void beginTimeStep()
Definition: TemperatureModel.hpp:800
void init()
Definition: TemperatureModel.hpp:799
const Scalar temperature(size_t) const
Definition: TemperatureModel.hpp:801
void deserialize(Restarter &)
This method restores the complete state of the temperature from disk.
Definition: TemperatureModel.hpp:796
void serialize(Restarter &)
This method writes the complete state of all temperature to the hard disk.
Definition: TemperatureModel.hpp:786
TemperatureModel(Simulator &)
Definition: TemperatureModel.hpp:778
A class which handles sequential implicit solution of the energy equation as specified in by TEMP.
Definition: TemperatureModel.hpp:186
void serialize(Restarter &)
This method writes the complete state of all temperature to the hard disk.
Definition: TemperatureModel.hpp:373
void assembleEquationWell(const Well &well)
Definition: TemperatureModel.hpp:689
void computeFluxTerm(const FluidStateTemp &fsIn, const FluidStateTemp &fsEx, const RateVector &darcyFlux, Evaluation &flux)
Definition: TemperatureModel.hpp:534
std::vector< int > interiorRows_
Definition: TemperatureModel.hpp:765
EnergyVector storage1_
Definition: TemperatureModel.hpp:759
bool converged(const int iter)
Definition: TemperatureModel.hpp:449
void computeStorageTerm(unsigned globI, LhsEval &storage)
Definition: TemperatureModel.hpp:508
void deserialize(Restarter &)
This method restores the complete state of the temperature from disk.
Definition: TemperatureModel.hpp:383
void endTimeStep(WellStateType &wellState)
Informs the temperature model that a time step has just been finished.
Definition: TemperatureModel.hpp:334
const Simulator & simulator_
Definition: TemperatureModel.hpp:758
void computeHeatFluxTerm(const IntensiveQuantitiesTemp &intQuantsIn, const IntensiveQuantitiesTemp &intQuantsEx, const ResidualNBInfo &res_nbinfo, Evaluation &heatFlux)
Definition: TemperatureModel.hpp:563
void beginTimeStep()
Definition: TemperatureModel.hpp:309
void computeWellTemperature(const Well &well, SingleWellState &ws)
Definition: TemperatureModel.hpp:736
void advanceTemperatureFields()
Definition: TemperatureModel.hpp:401
void updateStorageCache()
Definition: TemperatureModel.hpp:387
Scalar scalingFactor_
Definition: TemperatureModel.hpp:766
std::unique_ptr< SpareMatrixEnergyAdapter > energyMatrix_
Definition: TemperatureModel.hpp:763
void assembleEquations()
Definition: TemperatureModel.hpp:585
void solveAndUpdate()
Definition: TemperatureModel.hpp:425
std::vector< MatrixBlockTemp * > diagMatAddress_
Definition: TemperatureModel.hpp:762
std::vector< IntensiveQuantitiesTemp > intQuants_
Definition: TemperatureModel.hpp:760
std::vector< int > overlapRows_
Definition: TemperatureModel.hpp:764
SparseTable< NeighborInfoCPU > neighborInfo_
Definition: TemperatureModel.hpp:761
TemperatureModel(Simulator &simulator)
Definition: TemperatureModel.hpp:235
void init()
Definition: TemperatureModel.hpp:243
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:75
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: tpfalinearizerstructs.hh:66
Definition: BlackoilModelParameters.hpp:61
Definition: TemperatureModel.hpp:57
a tag to mark properties as undefined
Definition: propertysystem.hh:38