20#ifndef OPM_COMPONENT_NAME_IMPL_HPP
21#define OPM_COMPONENT_NAME_IMPL_HPP
28template<
class Flu
idSystem,
class Indices>
30 : names_(Indices::numEq)
32 if constexpr (
requires {
33 FluidSystem::solventComponentIndex(0u);
34 FluidSystem::canonicalToActiveCompIdx(0u);
36 for (
unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++phaseIdx) {
37 if (!FluidSystem::phaseIsActive(phaseIdx)) {
41 const unsigned canonicalCompIdx = FluidSystem::solventComponentIndex(phaseIdx);
42 names_[FluidSystem::canonicalToActiveCompIdx(canonicalCompIdx)]
43 = FluidSystem::componentName(canonicalCompIdx);
47 constexpr auto numNamedComponents =
48 (Indices::numEq < FluidSystem::numComponents) ? Indices::numEq : FluidSystem::numComponents;
50 for (
unsigned compIdx = 0; compIdx < numNamedComponents; ++compIdx) {
51 names_[compIdx] = FluidSystem::componentName(compIdx);
54 if constexpr (
requires { Indices::waterEnabled; Indices::water0Idx; }) {
55 if constexpr (Indices::waterEnabled
56 && (Indices::water0Idx >= 0)
57 && (Indices::water0Idx < Indices::numEq)) {
58 names_[Indices::water0Idx] =
"Water";
63 if constexpr (
requires { Indices::enableSolvent; Indices::solventSaturationIdx; }) {
64 if constexpr (Indices::enableSolvent) {
65 names_[Indices::solventSaturationIdx] =
"Solvent";
69 if constexpr (
requires { Indices::enableExtbo; Indices::zFractionIdx; }) {
70 if constexpr (Indices::enableExtbo) {
71 names_[Indices::zFractionIdx] =
"ZFraction";
75 if constexpr (
requires { Indices::enablePolymer; Indices::polymerConcentrationIdx; }) {
76 if constexpr (Indices::enablePolymer) {
77 names_[Indices::polymerConcentrationIdx] =
"Polymer";
81 if constexpr (
requires { Indices::polymerMoleWeightIdx; }) {
82 if constexpr (Indices::polymerMoleWeightIdx != std::numeric_limits<unsigned>::max()) {
83 assert(Indices::enablePolymer);
84 names_[Indices::polymerMoleWeightIdx] =
"MolecularWeightP";
88 if constexpr (
requires { Indices::enableFullyImplicitThermal; Indices::temperatureIdx; }) {
89 if constexpr (Indices::enableFullyImplicitThermal) {
90 names_[Indices::temperatureIdx] =
"Energy";
94 if constexpr (
requires { Indices::numFoam; Indices::foamConcentrationIdx; }) {
95 if constexpr (Indices::numFoam == 1) {
96 names_[Indices::foamConcentrationIdx] =
"Foam";
100 if constexpr (
requires { Indices::numBrine; Indices::saltConcentrationIdx; }) {
101 if constexpr (Indices::numBrine == 1) {
102 names_[Indices::saltConcentrationIdx] =
"Brine";
106 if constexpr (
requires {
108 Indices::microbialConcentrationIdx;
109 Indices::oxygenConcentrationIdx;
110 Indices::ureaConcentrationIdx;
111 Indices::biofilmVolumeFractionIdx;
112 Indices::calciteVolumeFractionIdx;
114 if constexpr (Indices::enableMICP) {
115 names_[Indices::microbialConcentrationIdx] =
"Microbes";
116 names_[Indices::oxygenConcentrationIdx] =
"Oxygen";
117 names_[Indices::ureaConcentrationIdx] =
"Urea";
118 names_[Indices::biofilmVolumeFractionIdx] =
"Biofilm";
119 names_[Indices::calciteVolumeFractionIdx] =
"Calcite";
123 if constexpr (
requires { Indices::enableBiofilm; Indices::microbialConcentrationIdx; Indices::biofilmVolumeFractionIdx; }) {
124 if constexpr (Indices::enableBiofilm) {
125 names_[Indices::microbialConcentrationIdx] =
"Microbes";
126 names_[Indices::biofilmVolumeFractionIdx] =
"Biofilm";
ComponentName()
Definition: ComponentName_impl.hpp:29
Definition: blackoilbioeffectsmodules.hh:45