20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEREACTIVE_THERMALACCUMULATIONKERNELS_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEREACTIVE_THERMALACCUMULATIONKERNELS_HPP
28 namespace thermalSinglePhaseReactiveBaseKernels
37 template<
typename SUBREGION_TYPE,
integer NUM_DOF,
integer NUM_SPECIES,
typename BASE_FLUID_TYPE >
54 using Base::m_deltaVolume;
55 using Base::m_primarySpeciesAggregateConcentration;
58 using DerivOffset = constitutive::singlefluid::DerivativeOffsetC< 1 >;
71 SUBREGION_TYPE
const & subRegion,
72 constitutive::reactivefluid::ReactiveSinglePhaseFluid< BASE_FLUID_TYPE >
const & fluid,
73 constitutive::CoupledSolidBase
const & solid,
77 :
Base( rankOffset, dofKey, subRegion, fluid, solid, dt, localMatrix, localRhs ),
78 m_energy( subRegion.template getField< fields::flow::energy >() ),
79 m_energy_n( subRegion.template getField< fields::flow::energy_n >() ),
80 m_dEnergy( subRegion.template getField< fields::flow::dEnergy >() ),
103 using Base::StackVariables::poreVolume;
104 using Base::StackVariables::dPoreVolume_dLogPrimaryConc;
232 template<
typename POLICY,
typename SUBREGION_TYPE,
typename BASE_FLUID_TYPE >
238 SUBREGION_TYPE
const & subRegion,
239 constitutive::reactivefluid::ReactiveSinglePhaseFluid< BASE_FLUID_TYPE >
const & fluid,
240 constitutive::CoupledSolidBase
const & solid,
244 singlePhaseReactiveBaseKernels::
245 internal::kernelLaunchSelectorCompSwitch( numSpecies, [&] (
auto NS )
247 integer constexpr NUM_SPECIES = NS();
248 integer constexpr NUM_DOF = 2+NS();
249 AccumulationKernel< SUBREGION_TYPE, NUM_DOF, NUM_SPECIES, BASE_FLUID_TYPE > kernel( rankOffset, dofKey, subRegion, fluid, solid, dt, localMatrix, localRhs );
#define GEOS_HOST_DEVICE
Marks a host-device function.
Define the interface for the assembly kernel in charge of accumulation.
constitutive::singlefluid::DerivativeOffsetC< 0 > DerivOffset
Note: Derivative lineup only supports dP & dT, not component terms.
Define the interface for the assembly kernel in charge of accumulation.
arrayView1d< globalIndex const > const m_dofNumber
View on the dof numbers.
GEOS_HOST_DEVICE void computeAccumulation(localIndex const ei, StackVariables &stack) const
Compute the local accumulation contributions to the residual and Jacobian.
static constexpr integer numDof
Compute time value for the number of degrees of freedom.
GEOS_HOST_DEVICE void setup(localIndex const ei, StackVariables &stack) const
Performs the setup phase for the kernel.
arrayView1d< real64 > const m_localRhs
View on the local RHS.
GEOS_HOST_DEVICE void complete(localIndex const ei, StackVariables &stack) const
Performs the complete phase for the kernel.
static constexpr integer numSpecies
Compile time value for the number of primary species.
arrayView1d< real64 const > const m_volume
View on the element volumes.
CRSMatrixView< real64, globalIndex const > const m_localMatrix
View on the local CRS matrix.
arrayView1d< integer const > const m_elemGhostRank
View on the ghost ranks.
static constexpr integer numEqn
Compute time value for the number of equations.
globalIndex const m_rankOffset
Offset for my MPI rank.
static void createAndLaunch(integer const numSpecies, real64 const dt, globalIndex const rankOffset, string const dofKey, SUBREGION_TYPE const &subRegion, constitutive::reactivefluid::ReactiveSinglePhaseFluid< BASE_FLUID_TYPE > const &fluid, constitutive::CoupledSolidBase const &solid, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs)
Create a new kernel and launch.
Define the interface for the assembly kernel in charge of accumulation.
GEOS_HOST_DEVICE void setup(localIndex const ei, StackVariables &stack) const
Performs the setup phase for the kernel.
GEOS_HOST_DEVICE void complete(localIndex const ei, StackVariables &stack) const
Performs the complete phase for the kernel.
arrayView2d< real64 const > const m_dPoro_dTemp
Views on the porosity derivative.
static constexpr integer numDof
Compute time value for the number of degrees of freedom.
AccumulationKernel(globalIndex const rankOffset, string const dofKey, SUBREGION_TYPE const &subRegion, constitutive::reactivefluid::ReactiveSinglePhaseFluid< BASE_FLUID_TYPE > const &fluid, constitutive::CoupledSolidBase const &solid, real64 const &dt, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs)
Constructor.
arrayView1d< real64 > const m_localRhs
View on the local RHS.
CRSMatrixView< real64, globalIndex const > const m_localMatrix
View on the local CRS matrix.
static constexpr integer numEqn
Compute time value for the number of equations.
arrayView1d< real64 const > const m_energy
View on energy.
GEOS_HOST_DEVICE void computeAccumulation(localIndex const ei, StackVariables &stack) const
Compute the local accumulation contributions to the residual and Jacobian.
ArrayView< T, 1 > arrayView1d
Alias for 1D array 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).
LvArray::CRSMatrixView< T, COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
Kernel variables (dof numbers, jacobian and residual) located on the stack.
real64 localJacobian[numEqn][numDof]
Storage for the element local Jacobian matrix.
localIndex localRow
Index of the local row corresponding to this element.
globalIndex dofIndices[numDof]
Index of the matrix row/column corresponding to the dof in this element.
real64 localResidual[numEqn]
Storage for the element local residual vector.
Kernel variables (dof numbers, jacobian and residual) located on the stack.
real64 dPoreVolume_dTemp
Derivative of pore volume with respect to temperature.