26#ifndef OPM_FI_COMPOSITIONAL_MODEL_HPP
27#define OPM_FI_COMPOSITIONAL_MODEL_HPP
41template <
class TypeTag>
50 : ParentType(simulator)
55 if (!this->storeIntensiveQuantities() ||
56 timeIdx >= this->cachedIntensiveQuantityHistorySize()) {
57 ParentType::invalidateAndUpdateIntensiveQuantities(timeIdx);
61 this->invalidateIntensiveQuantitiesCache(timeIdx);
63 const auto& problem = this->simulator_.problem();
64 const auto& solution = this->solution(timeIdx);
65 const unsigned numDof = this->numGridDof();
66 const auto flashSettings = IntensiveQuantities::FlashSettings::fromParameters();
71 std::mutex exceptionLock;
72 std::exception_ptr exceptionPtr =
nullptr;
76#pragma omp parallel for schedule(dynamic, 64)
78 for (
unsigned globalIdx = 0; globalIdx < numDof; ++globalIdx) {
80 this->intensiveQuantityCache_[timeIdx][globalIdx]
81 .update(problem, solution[globalIdx], globalIdx, timeIdx, flashSettings);
82 this->setIntensiveQuantitiesCacheEntryValidity(globalIdx, timeIdx,
true);
85 const std::lock_guard lock(exceptionLock);
86 exceptionPtr = std::current_exception();
91 std::rethrow_exception(exceptionPtr);
PT-flash model that updates the cached intensive quantities cell by cell, without element contexts.
Definition: FICompositionalModel.hpp:43
FICompositionalModel(Simulator &simulator)
Definition: FICompositionalModel.hpp:49
void invalidateAndUpdateIntensiveQuantities(unsigned timeIdx) const
Definition: FICompositionalModel.hpp:53
A compositional multi-phase model based on flash-calculations.
Definition: ptflash/flashmodel.hh:195
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.