20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_PHASEMOBILITYZFORMULATIONKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_PHASEMOBILITYZFORMULATIONKERNEL_HPP
28 namespace isothermalCompositionalMultiphaseFVMKernels
39 template<
integer NUM_COMP,
integer NUM_PHASE >
57 constitutive::MultiFluidBase
const & fluid,
58 constitutive::RelativePermeabilityBase
const & relperm )
60 m_phaseVolFrac( subRegion.getField< fields::flow::phaseVolumeFraction >() ),
61 m_dPhaseVolFrac( subRegion.getField< fields::flow::dPhaseVolumeFraction >() ),
63 m_dPhaseDens( fluid.dPhaseDensity() ),
65 m_dPhaseVisc( fluid.dPhaseViscosity() ),
67 m_dPhaseRelPerm_dPhaseVolFrac( relperm.dPhaseRelPerm_dPhaseVolFraction() ),
68 m_phaseMob( subRegion.getField< fields::flow::phaseMobility >() ),
69 m_dPhaseMob( subRegion.getField< fields::flow::dPhaseMobility >() )
78 template<
typename FUNC = NoOpFunc >
81 FUNC && phaseMobilityKernelOp = NoOpFunc{} )
const
83 using Deriv = constitutive::multifluid::DerivativeOffset;
86 arraySlice2d<
real64 const, constitutive::multifluid::USD_PHASE_DC - 2 >
const dPhaseDens = m_dPhaseDens[ei][0];
88 arraySlice2d<
real64 const, constitutive::multifluid::USD_PHASE_DC - 2 >
const dPhaseVisc = m_dPhaseVisc[ei][0];
90 arraySlice2d<
real64 const, constitutive::relperm::USD_RELPERM_DS - 2 >
const dPhaseRelPerm_dPhaseVolFrac = m_dPhaseRelPerm_dPhaseVolFrac[ei][0];
92 arraySlice2d<
real64 const, compflow::USD_PHASE_DC - 1 >
const dPhaseVolFrac = m_dPhaseVolFrac[ei];
104 bool const phaseExists = (phaseVolFrac[ip] > 0);
110 dPhaseMob[ip][jc] = 0.0;
115 real64 const density = phaseDens[ip];
116 real64 const dDens_dP = dPhaseDens[ip][Deriv::dP];
118 dDens_dC[jc] = dPhaseDens[ip][Deriv::dC+jc];
120 real64 const viscosity = phaseVisc[ip];
121 real64 const dVisc_dP = dPhaseVisc[ip][Deriv::dP];
123 dVisc_dC[jc] = dPhaseVisc[ip][Deriv::dC+jc];
125 real64 const relPerm = phaseRelPerm[ip];
129 dRelPerm_dC[ic] = 0.0;
134 real64 const dRelPerm_dS = dPhaseRelPerm_dPhaseVolFrac[ip][jp];
135 dRelPerm_dP += dRelPerm_dS * dPhaseVolFrac[jp][Deriv::dP];
139 dRelPerm_dC[jc] += dRelPerm_dS * dPhaseVolFrac[jp][Deriv::dC+jc];
143 real64 const mobility = relPerm * density / viscosity;
145 phaseMob[ip] = mobility;
146 dPhaseMob[ip][Deriv::dP] = dRelPerm_dP * density / viscosity
147 + mobility * (dDens_dP / density - dVisc_dP / viscosity);
152 dPhaseMob[ip][Deriv::dC+jc] = dRelPerm_dC[jc] * density / viscosity
153 + mobility * (dDens_dC[jc] / density - dVisc_dC[jc] / viscosity);
158 phaseMobilityKernelOp( ip, phaseMob[ip], dPhaseMob[ip] );
206 template<
typename POLICY >
211 constitutive::MultiFluidBase
const & fluid,
212 constitutive::RelativePermeabilityBase
const & relperm )
216 isothermalCompositionalMultiphaseBaseKernels::internal::kernelLaunchSelectorCompSwitch( numComp, [&] (
auto NC )
218 integer constexpr NUM_COMP = NC();
223 else if( numPhase == 3 )
225 isothermalCompositionalMultiphaseBaseKernels::internal::kernelLaunchSelectorCompSwitch( numComp, [&] (
auto NC )
227 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.
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.
ArrayView< T, 4, USD > arrayView4d
Alias for 4D array view.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.