20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_PHASECOMPONENTFLUXZFORMULATION_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_PHASECOMPONENTFLUXZFORMULATION_HPP
25 #include "constitutive/fluid/multifluid/Layouts.hpp"
32 namespace isothermalCompositionalMultiphaseFVMKernelUtilities
35 template<
typename VIEWTYPE >
36 using ElementViewConst = ElementRegionManager::ElementViewConst< VIEWTYPE >;
38 using Deriv = constitutive::multifluid::DerivativeOffset;
60 template< localIndex numComp, localIndex numFluxSupportPo
ints >
65 localIndex const ( &seri )[numFluxSupportPoints],
66 localIndex const ( &sesri )[numFluxSupportPoints],
67 localIndex const ( &sei )[numFluxSupportPoints],
71 real64 const ( &dPhaseFlux_dP )[numFluxSupportPoints],
72 real64 const ( &dPhaseFlux_dC )[numFluxSupportPoints][numComp],
73 real64 ( & compFlux )[numComp],
74 real64 ( & dCompFlux_dP )[numFluxSupportPoints][numComp],
75 real64 ( & dCompFlux_dC )[numFluxSupportPoints][numComp][numComp] )
82 arraySlice1d<
real64 const, constitutive::multifluid::USD_PHASE_COMP-3 > phaseCompFracSub =
83 phaseCompFrac[er_up][esr_up][ei_up][0][ip];
84 arraySlice2d<
real64 const, constitutive::multifluid::USD_PHASE_COMP_DC-3 > dPhaseCompFracSub =
85 dPhaseCompFrac[er_up][esr_up][ei_up][0][ip];
88 for(
integer ic = 0; ic < numComp; ++ic )
90 real64 const ycp = phaseCompFracSub[ic];
91 compFlux[ic] += phaseFlux * ycp;
94 for(
integer ke = 0; ke < numFluxSupportPoints; ++ke )
96 dCompFlux_dP[ke][ic] += dPhaseFlux_dP[ke] * ycp;
97 for(
integer jc = 0; jc < numComp; ++jc )
99 dCompFlux_dC[ke][ic][jc] += dPhaseFlux_dC[ke][jc] * ycp;
104 dCompFlux_dP[k_up][ic] += phaseFlux * dPhaseCompFracSub[ic][Deriv::dP];
107 for(
integer jc = 0; jc < numComp; ++jc )
109 dCompFlux_dC[k_up][ic][jc] += phaseFlux * dPhaseCompFracSub[ic][Deriv::dC+jc];
#define GEOS_HOST_DEVICE
Marks a host-device function.
ArraySlice< T, 2, USD > arraySlice2d
Alias for 2D array slice.
ArrayView< T, 5, USD > arrayView5d
Alias for 5D array view.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
std::int32_t integer
Signed integer type.
ArrayView< T, 4, USD > arrayView4d
Alias for 4D array view.