20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_THERMALPHASEVOLUMEFRACTIONKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_THERMALPHASEVOLUMEFRACTIONKERNEL_HPP
28 namespace thermalCompositionalMultiphaseBaseKernels
39 template<
integer NUM_COMP,
integer NUM_PHASE >
45 using Base::m_dPhaseDens;
46 using Base::m_dPhaseFrac;
47 using Base::m_dPhaseVolFrac;
55 constitutive::MultiFluidBase
const & fluid )
56 :
Base( subRegion, fluid )
66 using Deriv = constitutive::multifluid::DerivativeOffset;
68 arraySlice2d<
real64 const, constitutive::multifluid::USD_PHASE_DC - 2 >
const dPhaseDens = m_dPhaseDens[ei][0];
69 arraySlice2d<
real64 const, constitutive::multifluid::USD_PHASE_DC - 2 >
const dPhaseFrac = m_dPhaseFrac[ei][0];
71 arraySlice2d<
real64, compflow::USD_PHASE_DC - 1 >
const dPhaseVolFrac = m_dPhaseVolFrac[ei];
75 real64 const & phaseVolFrac,
76 real64 const & phaseDensInv,
77 real64 const & totalDensity )
81 dPhaseVolFrac[ip][Deriv::dT] = (dPhaseFrac[ip][Deriv::dT] - phaseVolFrac * dPhaseDens[ip][Deriv::dT]) * phaseDensInv;
82 dPhaseVolFrac[ip][Deriv::dT] *= totalDensity;
103 template<
typename POLICY >
108 constitutive::MultiFluidBase
const & fluid )
110 real64 maxDeltaPhaseVolFrac = 0.0;
113 isothermalCompositionalMultiphaseBaseKernels::
114 internal::kernelLaunchSelectorCompSwitch( numComp, [&] (
auto NC )
116 integer constexpr NUM_COMP = NC();
121 else if( numPhase == 3 )
123 isothermalCompositionalMultiphaseBaseKernels::
124 internal::kernelLaunchSelectorCompSwitch( numComp, [&] (
auto NC )
126 integer constexpr NUM_COMP = NC();
131 return maxDeltaPhaseVolFrac;
#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.
Define the interface for the property kernel in charge of computing the phase volume fractions.
GEOS_HOST_DEVICE real64 compute(localIndex const ei, FUNC &&phaseVolFractionKernelOp=NoOpFunc{}) const
Compute the phase volume fractions in an element.
Define the base interface for the property update kernels.
static real64 createAndLaunch(integer const numComp, integer const numPhase, ObjectManagerBase &subRegion, constitutive::MultiFluidBase const &fluid)
Create a new kernel and launch.
Define the interface for the property kernel in charge of computing the phase volume fractions.
GEOS_HOST_DEVICE real64 compute(localIndex const ei) const
Compute the phase volume fractions in an element.
PhaseVolumeFractionKernel(ObjectManagerBase &subRegion, constitutive::MultiFluidBase const &fluid)
Constructor.
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).
std::int32_t integer
Signed integer type.