20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_GLOBALCOMPONENTFRACTIONKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_GLOBALCOMPONENTFRACTIONKERNEL_HPP
28 namespace isothermalCompositionalMultiphaseBaseKernels
38 template<
integer NUM_COMP >
53 m_compDens( subRegion.getField< fields::flow::globalCompDensity >() ),
54 m_compFrac( subRegion.getField< fields::flow::globalCompFraction >() ),
55 m_dCompFrac_dCompDens( subRegion.getField< fields::flow::dGlobalCompFraction_dGlobalCompDensity >() )
64 template<
typename FUNC = NoOpFunc >
67 FUNC && compFractionKernelOp = NoOpFunc{} )
const
71 arraySlice2d<
real64, compflow::USD_COMP_DC - 1 >
const dCompFrac_dCompDens = m_dCompFrac_dCompDens[ei];
77 totalDensity += compDens[ic];
80 real64 const totalDensityInv = 1.0 / totalDensity;
84 compFrac[ic] = compDens[ic] * totalDensityInv;
87 dCompFrac_dCompDens[ic][jc] = -compFrac[ic] * totalDensityInv;
89 dCompFrac_dCompDens[ic][ic] += totalDensityInv;
92 compFractionKernelOp( compFrac, dCompFrac_dCompDens );
100 arrayView2d< real64 const, compflow::USD_COMP > m_compDens;
105 arrayView2d< real64, compflow::USD_COMP > m_compFrac;
106 arrayView3d< real64, compflow::USD_COMP_DC > m_dCompFrac_dCompDens;
124 template<
typename POLICY >
129 internal::kernelLaunchSelectorCompSwitch( numComp, [&] (
auto NC )
131 integer constexpr NUM_COMP = NC();
#define GEOS_HOST_DEVICE
Marks a host-device function.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers.
static void createAndLaunch(integer const numComp, ObjectManagerBase &subRegion)
Create a new kernel and launch.
Define the interface for the update kernel in charge of computing the phase volume fractions.
GEOS_HOST_DEVICE void compute(localIndex const ei, FUNC &&compFractionKernelOp=NoOpFunc{}) const
Compute the phase volume fractions in an element.
GlobalComponentFractionKernel(ObjectManagerBase &subRegion)
Constructor.
static constexpr integer numComp
Compile time value for the number of components.
Define the base interface for the property update kernels.
static constexpr integer numComp
Compile time value for the number of components.
ArraySlice< T, 2, USD > arraySlice2d
Alias for 2D array slice.
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.