27#ifndef OPM_ECL_SPECROCK_LAW_PARAMS_HPP
28#define OPM_ECL_SPECROCK_LAW_PARAMS_HPP
41template <
class ScalarT>
47 using Scalar = ScalarT;
49 EclSpecrockLawParams(
const EclSpecrockLawParams&) =
default;
51 EclSpecrockLawParams()
57 template <
class Container>
59 const Container& heatCapacity)
61 assert(temperature.size() == heatCapacity.size());
64 Scalar curU = temperature[0]*heatCapacity[0];
65 unsigned n = temperature.size();
66 std::vector<Scalar> T(n);
67 std::vector<Scalar> u(n);
68 for (
unsigned i = 0; i < temperature.size(); ++ i) {
69 T[i] = temperature[i];
72 if (i >= temperature.size() - 1)
77 Scalar c_v0 = heatCapacity[i];
78 Scalar c_v1 = heatCapacity[i + 1];
79 Scalar T0 = temperature[i];
80 Scalar T1 = temperature[i + 1];
81 curU += 0.5*(c_v0 + c_v1)*(T1 - T0);
84 internalEnergyFunction_.setXYContainers(T, u);
96 { EnsureFinalized::check();
return internalEnergyFunction_; }
99 InternalEnergyFunction internalEnergyFunction_;
Default implementation for asserting finalization of parameter objects.
Implements a linearly interpolated scalar function that depends on one variable.
const InternalEnergyFunction & internalEnergyFunction() const
Return the function which maps temparature to the rock's volumetric internal energy.
Definition EclSpecrockLawParams.hpp:95
void setHeatCapacities(const Container &temperature, const Container &heatCapacity)
Specify the volumetric internal energy of rock via heat capacities.
Definition EclSpecrockLawParams.hpp:58
OPM_HOST_DEVICE EnsureFinalized()
The default constructor.
Definition EnsureFinalized.hpp:58
Implements a linearly interpolated scalar function that depends on one variable.
Definition Tabulated1DFunction.hpp:51
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30