|
| template<class Scalar , std::size_t numComponents> |
| void | Opm::detail::keepCompositionFloor (std::array< Scalar, numComponents > &z, const Scalar compositionFloor) |
| |
| template<class Scalar , std::size_t numComponents> |
| Scalar | Opm::detail::largestAmountChange (const Scalar share, const std::array< Scalar, numComponents > &z, const Scalar otherShare, const std::array< Scalar, numComponents > &otherZ) |
| | Largest change of the hydrocarbon share h or of an amount h z between two states. More...
|
| |
| template<class Scalar , std::size_t numComponents> |
| void | Opm::detail::shortenStep (std::array< Scalar, numComponents > &z, Scalar &sw, const std::array< Scalar, numComponents > &newZ, const Scalar newShare, const Scalar compositionFloor, const Scalar hydrocarbonFloor, const Scalar maxAmountChange) |
| |
| template<class Scalar , std::size_t numComponents> |
| void | Opm::applyFlashCompositionStep (std::array< Scalar, numComponents > &z, Scalar &sw, const std::array< Scalar, numComponents > &dz, const Scalar dSw, const Scalar compositionFloor, const Scalar hydrocarbonFloor, const Scalar maxAmountChange) |
| | Applies a Newton step to the overall composition and the water saturation. More...
|
| |
Applies a Newton step to the overall composition and the water saturation.
The step is taken and limited in h and the component amounts h z, where h = max(1 - Sw, hydrocarbonFloor) is the regularized hydrocarbon share of the pore space. Component-storage derivatives scale with h, so Newton steps in the mole fractions can become large in cells containing almost only water. Where h ends at its floor, the hydrocarbon has vanished and z is kept, since the equations no longer determine it.
The returned fractions sum to one and are at or above compositionFloor, and Sw stays within [0, 1]. Changes in h and each h z are limited to maxAmountChange. If restoring an input state to these bounds requires a larger change, restoring the bounds takes priority.
- Parameters
-
| z | Overall mole fractions, summing to one, updated in place; zeros are allowed. |
| sw | Water saturation, updated in place; zero without water. |
| dz | Newton step of the mole fractions, summing to zero. |
| dSw | Newton step of the water saturation; zero without water. |
| compositionFloor | Lower bound of every mole fraction. |
| hydrocarbonFloor | Lower bound of h. |
| maxAmountChange | Largest change of h and of every amount. |
- Precondition
- Inputs are finite, 0 <= numComponents * compositionFloor < 1, 0 < hydrocarbonFloor <= 1, and maxAmountChange > 0.