20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_ACCUMULATIONZFORMULATIONKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_ACCUMULATIONZFORMULATIONKERNEL_HPP
23 #include "codingUtilities/Utilities.hpp"
26 #include "common/GEOS_RAJA_Interface.hpp"
27 #include "constitutive/solid/CoupledSolidBase.hpp"
28 #include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
33 #include "physicsSolvers/fluidFlow/kernels/compositional/KernelLaunchSelectors.hpp"
38 namespace isothermalCompositionalMultiphaseBaseKernels
41 static constexpr
real64 minCompFracForDivision = 0;
51 template<
integer NUM_COMP,
integer NUM_DOF >
80 constitutive::MultiFluidBase
const & fluid,
81 constitutive::CoupledSolidBase
const & solid,
84 BitFlags< KernelFlags >
const KernelFlags )
89 m_volume( subRegion.getElementVolume() ),
91 m_dPoro_dPres( solid.getDporosity_dPressure() ),
92 m_phaseVolFrac( subRegion.getField< fields::flow::phaseVolumeFraction >() ),
93 m_dPhaseVolFrac( subRegion.getField< fields::flow::dPhaseVolumeFraction >() ),
95 m_dTotalDens( fluid.dTotalDensity() ),
96 m_compFrac( subRegion.getField< fields::flow::globalCompFraction >() ),
97 m_compAmount_n( subRegion.getField< fields::flow::compAmount_n >() ),
100 m_KernelFlags( KernelFlags )
173 template<
typename FUNC = NoOpFunc >
178 using Deriv = constitutive::multifluid::DerivativeOffset;
182 arraySlice1d<
real64 const, constitutive::multifluid::USD_FLUID_DC - 2 >
const dTotalDens = m_dTotalDens[ei][0];
189 real64 const compAmount_n = m_compAmount_n[ei][ic];
202 dCompAmount_dC = stack.
poreVolume * (totalDensity + dTotalDens[Deriv::dC+jc] * compFrac[ic]);
204 dCompAmount_dC = stack.
poreVolume * (dTotalDens[Deriv::dC+jc] * compFrac[ic]);
218 template<
typename FUNC = NoOpFunc >
226 real64 oneMinusCompFracSum = 1.0;
231 oneMinusCompFracSum -= compFrac[ic];
258 using namespace compositionalMultiphaseUtilities;
260 if( m_KernelFlags.isSet( KernelFlags::TotalMassEquation ) )
273 for(
integer i = 0; i < numRows; ++i )
290 template<
typename POLICY,
typename KERNEL_TYPE >
293 KERNEL_TYPE
const & kernelComponent )
299 if( kernelComponent.elemGhostRank( ei ) >= 0 )
304 typename KERNEL_TYPE::StackVariables stack;
306 kernelComponent.setup( ei, stack );
307 kernelComponent.computeAccumulation( ei, stack );
308 kernelComponent.computeCompFracSum( ei, stack );
309 kernelComponent.complete( ei, stack );
356 BitFlags< KernelFlags >
const m_KernelFlags;
379 template<
typename POLICY >
384 BitFlags< KernelFlags > kernelFlags,
387 constitutive::MultiFluidBase
const & fluid,
388 constitutive::CoupledSolidBase
const & solid,
392 internal::kernelLaunchSelectorCompSwitch( numComps, [&] (
auto NC )
394 integer constexpr NUM_COMP = NC();
395 integer constexpr NUM_DOF = NC()+1;
398 fluid, solid, localMatrix, localRhs, kernelFlags );
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_UNUSED_PARAM(X)
Mark an unused argument and silence compiler warnings.
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
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, 2, USD > arrayView2d
Alias for 2D array view.
Array< T, 1 > array1d
Alias for 1D array.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.