20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEREACTIVE_THERMALSOURCEFLUXCOMPUTEKERNELS_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASEREACTIVE_THERMALSOURCEFLUXCOMPUTEKERNELS_HPP
28 namespace thermalSinglePhaseReactiveBaseKernels
37 template<
integer NUM_DOF,
integer NUM_SPECIES,
typename BASE_FLUID_TYPE >
48 using Base::m_primarySpeciesAggregateConcentration;
49 using Base::m_density;
50 using Base::m_dDensity;
54 using DerivOffset = constitutive::singlefluid::DerivativeOffsetC< 1 >;
60 real64 const sizeScalingFactor,
61 constitutive::reactivefluid::ReactiveSinglePhaseFluid< BASE_FLUID_TYPE >
const & fluid,
64 RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd )
69 rhsContributionArrayView,
76 m_dEnthalpy( fluid.dEnthalpy() )
95 using Base::StackVariables::totalInflowMass;
125 stack.
localSpeciesJacobian[i][
numDof-
numSpecies-1] += -m_primarySpeciesAggregateConcentration[ei][0][i] * m_dDensity[ei][0][DerivOffset::dT] / (m_density[ei][0] * m_density[ei][0]) *
141 if( stack.totalInflowMass > 0.0 )
146 m_localMatrix.template addToRow< serialAtomic >( energyRowIndex,
183 template<
typename POLICY,
typename BASE_FLUID_TYPE >
191 real64 const sizeScalingFactor,
192 constitutive::reactivefluid::ReactiveSinglePhaseFluid< BASE_FLUID_TYPE >
const & fluid,
195 RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd )
197 singlePhaseReactiveBaseKernels::
198 internal::kernelLaunchSelectorCompSwitch( numSpecies, [&] (
auto NS )
200 integer constexpr NUM_SPECIES = NS();
201 integer constexpr NUM_DOF = 2+NS();
203 SourceFluxComputeKernel< NUM_DOF, NUM_SPECIES, BASE_FLUID_TYPE > kernel( rankOffset, dofNumber, elemGhostRank, rhsContributionArrayView, sizeScalingFactor, fluid, localMatrix, localRhs,
#define GEOS_HOST_DEVICE
Marks a host-device function.
Define the interface for the assembly kernel in charge of source flux.
CRSMatrixView< real64, globalIndex const > const m_localMatrix
View on the local CRS matrix.
GEOS_HOST_DEVICE void complete(localIndex const GEOS_UNUSED_PARAM(ei), StackVariables &stack) const
Performs the complete phase for the kernel.
GEOS_HOST_DEVICE void computeSourceFlux(localIndex const ei, StackVariables &stack) const
Compute the local source flux contributions to the residual and Jacobian.
GEOS_HOST_DEVICE integer elemGhostRank(localIndex const ei) const
Getter for the ghost rank of an element.
static constexpr integer numSpecies
Compile time value for the number of primary species.
static constexpr integer numEqn
Compute time value for the number of equations.
static constexpr integer numDof
Compute time value for the number of degrees of freedom.
real64 const m_sizeScalingFactor
size scaling factor
arrayView1d< real64 > const m_localRhs
View on the local RHS.
static void createAndLaunch(integer const numSpecies, globalIndex const rankOffset, arrayView1d< globalIndex const > const dofNumber, arrayView1d< integer const > const elemGhostRank, SortedArrayView< localIndex const > const targetSet, arrayView1d< real64 const > const rhsContributionArrayView, real64 const sizeScalingFactor, constitutive::reactivefluid::ReactiveSinglePhaseFluid< BASE_FLUID_TYPE > const &fluid, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, RAJA::ReduceSum< parallelDeviceReduce, real64 > massProd)
Create a new kernel and launch.
Define the interface for the assembly kernel in charge of source flux.
CRSMatrixView< real64, globalIndex const > const m_localMatrix
View on the local CRS matrix.
arrayView2d< real64 const, constitutive::singlefluid::USD_FLUID > const m_enthalpy
Views on enthalpies.
GEOS_HOST_DEVICE void computeSourceFlux(localIndex const ei, StackVariables &stack) const
Compute the local source flux contributions to the residual and Jacobian.
static constexpr integer numSpecies
Compile time value for the number of primary species.
GEOS_HOST_DEVICE void complete(localIndex const ei, StackVariables &stack) const
Performs the complete phase for the kernel.
static constexpr integer numDof
Compute time value for the number of degrees of freedom.
real64 const m_sizeScalingFactor
size scaling factor
arrayView1d< real64 > const m_localRhs
View on the local RHS.
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.
LvArray::SortedArrayView< T, localIndex, LvArray::ChaiBuffer > SortedArrayView
A sorted array view of local indices.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Kernel variables (dof numbers, jacobian and residual) located on the stack.
globalIndex dofIndices[numDof]
Index of the matrix row/column corresponding to the dof in this element.
real64 localSpeciesJacobian[numSpecies][numDof]
Storage for the element local Jacobian matrix for species rows.
localIndex massRowIndex
Index of the local row corresponding to this element.
Kernel variables (dof numbers, jacobian and residual) located on the stack.
real64 localEnergyJacobian[numDof]
Storage for the element local Jacobian matrix for energy row.
real64 localEnergyRhs
Storage for the element local residual vector for energy row.