GEOS
FluxComputeKernel.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNEL_HPP
22 
24 
25 #include "codingUtilities/Utilities.hpp"
26 #include "common/DataLayouts.hpp"
27 #include "common/DataTypes.hpp"
28 #include "common/GEOS_RAJA_Interface.hpp"
29 #include "constitutive/fluid/multifluid/MultiFluidFields.hpp"
34 #include "physicsSolvers/fluidFlow/kernels/compositional/KernelLaunchSelectors.hpp"
38 
39 namespace geos
40 {
41 
42 namespace isothermalCompositionalMultiphaseFVMKernels
43 {
44 
52 template< integer NUM_COMP, integer NUM_DOF, typename STENCILWRAPPER >
54 {
55 public:
56 
58  static constexpr integer numComp = NUM_COMP;
59 
61  static constexpr integer numDof = NUM_DOF;
62 
64  static constexpr integer numEqn = NUM_DOF-1;
65 
67  static constexpr localIndex maxNumElems = STENCILWRAPPER::maxNumPointsInFlux;
68 
70  static constexpr localIndex maxNumConns = STENCILWRAPPER::maxNumConnections;
71 
73  static constexpr localIndex maxStencilSize = STENCILWRAPPER::maxStencilSize;
74 
76  static constexpr integer numFluxSupportPoints = 2;
77 
93  FluxComputeKernel( integer const numPhases,
94  globalIndex const rankOffset,
95  STENCILWRAPPER const & stencilWrapper,
96  DofNumberAccessor const & dofNumberAccessor,
97  CompFlowAccessors const & compFlowAccessors,
98  MultiFluidAccessors const & multiFluidAccessors,
99  CapPressureAccessors const & capPressureAccessors,
100  PermeabilityAccessors const & permeabilityAccessors,
101  real64 const dt,
102  CRSMatrixView< real64, globalIndex const > const & localMatrix,
103  arrayView1d< real64 > const & localRhs,
104  BitFlags< KernelFlags > kernelFlags )
105  : FluxComputeKernelBase( numPhases,
106  rankOffset,
107  dofNumberAccessor,
108  compFlowAccessors,
109  multiFluidAccessors,
110  dt,
111  localMatrix,
112  localRhs,
113  kernelFlags ),
114  m_permeability( permeabilityAccessors.get( fields::permeability::permeability {} ) ),
115  m_dPerm_dPres( permeabilityAccessors.get( fields::permeability::dPerm_dPressure {} ) ),
116  m_phaseMob( compFlowAccessors.get( fields::flow::phaseMobility {} ) ),
117  m_dPhaseMob( compFlowAccessors.get( fields::flow::dPhaseMobility {} ) ),
118  m_phaseMassDens( multiFluidAccessors.get( fields::multifluid::phaseMassDensity {} ) ),
119  m_dPhaseMassDens( multiFluidAccessors.get( fields::multifluid::dPhaseMassDensity {} ) ),
120  m_phaseCapPressure( capPressureAccessors.get( fields::cappres::phaseCapPressure {} ) ),
121  m_dPhaseCapPressure_dPhaseVolFrac( capPressureAccessors.get( fields::cappres::dPhaseCapPressure_dPhaseVolFraction {} ) ),
122  m_stencilWrapper( stencilWrapper ),
123  m_seri( stencilWrapper.getElementRegionIndices() ),
124  m_sesri( stencilWrapper.getElementSubRegionIndices() ),
125  m_sei( stencilWrapper.getElementIndices() )
126  { }
127 
133  {
134 public:
135 
142  StackVariables( localIndex const size, localIndex numElems )
143  : stencilSize( size ),
144  numConnectedElems( numElems ),
145  dofColIndices( size * numDof ),
146  localFlux( numElems * numEqn ),
147  localFluxJacobian( numElems * numEqn, size * numDof )
148  {}
149 
150  // Stencil information
151 
156 
157  // Transmissibility and derivatives
158 
163 
164  // Local degrees of freedom and local residual/jacobian
165 
168 
173  };
174 
175 
182  inline
183  localIndex stencilSize( localIndex const iconn ) const { return m_sei[iconn].size(); }
184 
191  inline
192  localIndex numPointsInFlux( localIndex const iconn ) const { return m_stencilWrapper.numPointsInFlux( iconn ); }
193 
194 
201  inline
202  void setup( localIndex const iconn,
203  StackVariables & stack ) const
204  {
205  // set degrees of freedom indices for this face
206  for( integer i = 0; i < stack.stencilSize; ++i )
207  {
208  globalIndex const offset = m_dofNumber[m_seri( iconn, i )][m_sesri( iconn, i )][m_sei( iconn, i )];
209 
210  for( integer jdof = 0; jdof < numDof; ++jdof )
211  {
212  stack.dofColIndices[i * numDof + jdof] = offset + jdof;
213  }
214  }
215  }
216 
224  template< typename FUNC = NoOpFunc >
226  inline
227  void computeFlux( localIndex const iconn,
228  StackVariables & stack,
229  FUNC && compFluxKernelOp = NoOpFunc{} ) const
230  {
231 
232  // first, compute the transmissibilities at this face
233  m_stencilWrapper.computeWeights( iconn,
235  m_dPerm_dPres,
236  stack.transmissibility,
237  stack.dTrans_dPres );
238 
239 
241  localIndex connectionIndex = 0;
242  for( k[0] = 0; k[0] < stack.numConnectedElems; ++k[0] )
243  {
244  for( k[1] = k[0] + 1; k[1] < stack.numConnectedElems; ++k[1] )
245  {
247  localIndex const seri[numFluxSupportPoints] = {m_seri( iconn, k[0] ), m_seri( iconn, k[1] )};
248  localIndex const sesri[numFluxSupportPoints] = {m_sesri( iconn, k[0] ), m_sesri( iconn, k[1] )};
249  localIndex const sei[numFluxSupportPoints] = {m_sei( iconn, k[0] ), m_sei( iconn, k[1] )};
250 
251  // clear working arrays
252  real64 compFlux[numComp]{};
253  real64 dCompFlux_dP[numFluxSupportPoints][numComp]{};
254  real64 dCompFlux_dC[numFluxSupportPoints][numComp][numComp]{};
255 
256  real64 const trans[numFluxSupportPoints] = { stack.transmissibility[connectionIndex][0],
257  stack.transmissibility[connectionIndex][1] };
258 
259  real64 const dTrans_dPres[numFluxSupportPoints] = { stack.dTrans_dPres[connectionIndex][0],
260  stack.dTrans_dPres[connectionIndex][1] };
261 
262  //***** calculation of flux *****
263  // loop over phases, compute and upwind phase flux and sum contributions to each component's flux
264  for( integer ip = 0; ip < m_numPhases; ++ip )
265  {
266  // create local work arrays
267  real64 potGrad = 0.0;
268  real64 phaseFlux = 0.0;
269  real64 dPhaseFlux_dP[numFluxSupportPoints]{};
270  real64 dPhaseFlux_dC[numFluxSupportPoints][numComp]{};
271 
272  localIndex k_up = -1;
273 
274  if( m_kernelFlags.isSet( KernelFlags::C1PPU ) )
275  {
276  isothermalCompositionalMultiphaseFVMKernelUtilities::C1PPUPhaseFlux::compute< numComp, numFluxSupportPoints >
277  ( m_numPhases,
278  ip,
279  m_kernelFlags.isSet( KernelFlags::CapPressure ),
280  seri, sesri, sei,
281  trans,
282  dTrans_dPres,
283  m_pres,
284  m_gravCoef,
285  m_phaseMob, m_dPhaseMob,
286  m_phaseVolFrac, m_dPhaseVolFrac,
287  m_phaseCompFrac, m_dPhaseCompFrac,
289  m_phaseMassDens, m_dPhaseMassDens,
290  m_phaseCapPressure, m_dPhaseCapPressure_dPhaseVolFrac,
291  k_up,
292  potGrad,
293  phaseFlux,
294  dPhaseFlux_dP,
295  dPhaseFlux_dC,
296  compFlux,
297  dCompFlux_dP,
298  dCompFlux_dC );
299  }
300  else if( m_kernelFlags.isSet( KernelFlags::IHU ) )
301  {
302  isothermalCompositionalMultiphaseFVMKernelUtilities::IHUPhaseFlux::compute< numComp, numFluxSupportPoints >
303  ( m_numPhases,
304  ip,
305  m_kernelFlags.isSet( KernelFlags::CapPressure ),
306  seri, sesri, sei,
307  trans,
308  dTrans_dPres,
309  m_pres,
310  m_gravCoef,
311  m_phaseMob, m_dPhaseMob,
312  m_phaseVolFrac, m_dPhaseVolFrac,
313  m_phaseCompFrac, m_dPhaseCompFrac,
315  m_phaseMassDens, m_dPhaseMassDens,
316  m_phaseCapPressure, m_dPhaseCapPressure_dPhaseVolFrac,
317  k_up,
318  potGrad,
319  phaseFlux,
320  dPhaseFlux_dP,
321  dPhaseFlux_dC,
322  compFlux,
323  dCompFlux_dP,
324  dCompFlux_dC );
325  }
326  else
327  {
328  isothermalCompositionalMultiphaseFVMKernelUtilities::PPUPhaseFlux::compute< numComp, numFluxSupportPoints >
329  ( m_numPhases,
330  ip,
331  m_kernelFlags.isSet( KernelFlags::CapPressure ),
332  seri, sesri, sei,
333  trans,
334  dTrans_dPres,
335  m_pres,
336  m_gravCoef,
337  m_phaseMob, m_dPhaseMob,
338  m_phaseVolFrac, m_dPhaseVolFrac,
339  m_phaseCompFrac, m_dPhaseCompFrac,
341  m_phaseMassDens, m_dPhaseMassDens,
342  m_phaseCapPressure, m_dPhaseCapPressure_dPhaseVolFrac,
343  k_up,
344  potGrad,
345  phaseFlux,
346  dPhaseFlux_dP,
347  dPhaseFlux_dC,
348  compFlux,
349  dCompFlux_dP,
350  dCompFlux_dC );
351  }
352 
353  // call the lambda in the phase loop to allow the reuse of the phase fluxes and their derivatives
354  // possible use: assemble the derivatives wrt temperature, and the flux term of the energy equation for this phase
355  compFluxKernelOp( ip, k, seri, sesri, sei, connectionIndex,
356  k_up, seri[k_up], sesri[k_up], sei[k_up], potGrad,
357  phaseFlux, dPhaseFlux_dP, dPhaseFlux_dC );
358 
359  } // loop over phases
360 
362  for( integer ic = 0; ic < numComp; ++ic )
363  {
364  integer const eqIndex0 = k[0] * numEqn + ic;
365  integer const eqIndex1 = k[1] * numEqn + ic;
366 
367  stack.localFlux[eqIndex0] += m_dt * compFlux[ic];
368  stack.localFlux[eqIndex1] -= m_dt * compFlux[ic];
369 
370  for( integer ke = 0; ke < numFluxSupportPoints; ++ke )
371  {
372  localIndex const localDofIndexPres = k[ke] * numDof;
373  stack.localFluxJacobian[eqIndex0][localDofIndexPres] += m_dt * dCompFlux_dP[ke][ic];
374  stack.localFluxJacobian[eqIndex1][localDofIndexPres] -= m_dt * dCompFlux_dP[ke][ic];
375 
376  for( integer jc = 0; jc < numComp; ++jc )
377  {
378  localIndex const localDofIndexComp = localDofIndexPres + jc + 1;
379  stack.localFluxJacobian[eqIndex0][localDofIndexComp] += m_dt * dCompFlux_dC[ke][ic][jc];
380  stack.localFluxJacobian[eqIndex1][localDofIndexComp] -= m_dt * dCompFlux_dC[ke][ic][jc];
381  }
382  }
383  }
384  connectionIndex++;
385  } // loop over k[1]
386  } // loop over k[0]
387 
388  }
389 
395  template< typename FUNC = NoOpFunc >
397  inline
398  void complete( localIndex const iconn,
399  StackVariables & stack,
400  FUNC && assemblyKernelOp = NoOpFunc{} ) const
401  {
402  using namespace compositionalMultiphaseUtilities;
403 
404  if( m_kernelFlags.isSet( KernelFlags::TotalMassEquation ) )
405  {
406  // Apply equation/variable change transformation(s)
408  shiftBlockRowsAheadByOneAndReplaceFirstRowWithColumnSum( numComp, numEqn, numDof * stack.stencilSize, stack.numConnectedElems,
409  stack.localFluxJacobian, work );
410  shiftBlockElementsAheadByOneAndReplaceFirstElementWithSum( numComp, numEqn, stack.numConnectedElems,
411  stack.localFlux );
412  }
413 
414  // add contribution to residual and jacobian into:
415  // - the component mass balance equations (i = 0 to i = numComp-1)
416  // note that numDof includes derivatives wrt temperature if this class is derived in ThermalKernels
417  for( integer i = 0; i < stack.numConnectedElems; ++i )
418  {
419  if( m_ghostRank[m_seri( iconn, i )][m_sesri( iconn, i )][m_sei( iconn, i )] < 0 )
420  {
421  globalIndex const globalRow = m_dofNumber[m_seri( iconn, i )][m_sesri( iconn, i )][m_sei( iconn, i )];
422  localIndex const localRow = LvArray::integerConversion< localIndex >( globalRow - m_rankOffset );
423  GEOS_ASSERT_GE( localRow, 0 );
424  GEOS_ASSERT_GT( m_localMatrix.numRows(), localRow + numComp );
425 
426  for( integer ic = 0; ic < numComp; ++ic )
427  {
428  RAJA::atomicAdd( parallelDeviceAtomic{}, &m_localRhs[localRow + ic],
429  stack.localFlux[i * numEqn + ic] );
430  m_localMatrix.addToRowBinarySearchUnsorted< parallelDeviceAtomic >
431  ( localRow + ic,
432  stack.dofColIndices.data(),
433  stack.localFluxJacobian[i * numEqn + ic].dataIfContiguous(),
434  stack.stencilSize * numDof );
435  }
436 
437  // call the lambda to assemble additional terms, such as thermal terms
438  assemblyKernelOp( i, localRow );
439  }
440  }
441  }
442 
450  template< typename POLICY, typename KERNEL_TYPE >
451  static void
452  launch( localIndex const numConnections,
453  KERNEL_TYPE const & kernelComponent )
454  {
456  forAll< POLICY >( numConnections, [=] GEOS_HOST_DEVICE ( localIndex const iconn )
457  {
458  typename KERNEL_TYPE::StackVariables stack( kernelComponent.stencilSize( iconn ),
459  kernelComponent.numPointsInFlux( iconn ) );
460 
461  kernelComponent.setup( iconn, stack );
462  kernelComponent.computeFlux( iconn, stack );
463  kernelComponent.complete( iconn, stack );
464  } );
465  }
466 
467 protected:
468 
471  ElementViewConst< arrayView3d< real64 const > > const m_dPerm_dPres;
472 
476 
480 
484 
485  // Stencil information
486 
488  STENCILWRAPPER const m_stencilWrapper;
489 
491  typename STENCILWRAPPER::IndexContainerViewConstType const m_seri;
492  typename STENCILWRAPPER::IndexContainerViewConstType const m_sesri;
493  typename STENCILWRAPPER::IndexContainerViewConstType const m_sei;
494 
495 };
496 
501 {
502 public:
503 
520  template< typename POLICY, typename STENCILWRAPPER >
521  static void
522  createAndLaunch( integer const numComps,
523  integer const numPhases,
524  globalIndex const rankOffset,
525  string const & dofKey,
526  integer const hasCapPressure,
527  integer const useTotalMassEquation,
528  UpwindingParameters upwindingParams,
529  string const & solverName,
530  ElementRegionManager const & elemManager,
531  STENCILWRAPPER const & stencilWrapper,
532  real64 const dt,
533  CRSMatrixView< real64, globalIndex const > const & localMatrix,
534  arrayView1d< real64 > const & localRhs )
535  {
536  isothermalCompositionalMultiphaseBaseKernels::internal::kernelLaunchSelectorCompSwitch( numComps, [&]( auto NC )
537  {
538  integer constexpr NUM_COMP = NC();
539  integer constexpr NUM_DOF = NC() + 1;
540 
542  elemManager.constructArrayViewAccessor< globalIndex, 1 >( dofKey );
543  dofNumberAccessor.setName( solverName + "/accessors/" + dofKey );
544 
545  BitFlags< KernelFlags > kernelFlags;
546  if( hasCapPressure )
547  kernelFlags.set( KernelFlags::CapPressure );
548  if( useTotalMassEquation )
549  kernelFlags.set( KernelFlags::TotalMassEquation );
550  if( upwindingParams.upwindingScheme == UpwindingScheme::C1PPU &&
551  isothermalCompositionalMultiphaseFVMKernelUtilities::epsC1PPU > 0 )
552  kernelFlags.set( KernelFlags::C1PPU );
553  else if( upwindingParams.upwindingScheme == UpwindingScheme::IHU )
554  kernelFlags.set( KernelFlags::IHU );
555 
556 
558  typename kernelType::CompFlowAccessors compFlowAccessors( elemManager, solverName );
559  typename kernelType::MultiFluidAccessors multiFluidAccessors( elemManager, solverName );
560  typename kernelType::CapPressureAccessors capPressureAccessors( elemManager, solverName );
561  typename kernelType::PermeabilityAccessors permeabilityAccessors( elemManager, solverName );
562 
563  kernelType kernel( numPhases, rankOffset, stencilWrapper, dofNumberAccessor,
564  compFlowAccessors, multiFluidAccessors, capPressureAccessors, permeabilityAccessors,
565  dt, localMatrix, localRhs, kernelFlags );
566  kernelType::template launch< POLICY >( stencilWrapper.size(), kernel );
567  } );
568  }
569 };
570 
571 } // namespace isothermalCompositionalMultiphaseFVMKernels
572 
573 } // namespace geos
574 
575 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNEL_HPP
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
#define GEOS_ASSERT_GT(lhs, rhs)
Assert that one value compares greater than the other in debug builds.
Definition: Logger.hpp:440
#define GEOS_ASSERT_GE(lhs, rhs)
Assert that one value compares greater than or equal to the other in debug builds.
Definition: Logger.hpp:455
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
ElementViewAccessor< ArrayView< T const, NDIM, getUSD< PERM > > > constructArrayViewAccessor(string const &name, string const &neighborName=string()) const
This is a function to construct a ElementViewAccessor to access array data registered on the mesh.
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
A struct to automatically construct and store element view accessors.
A struct to automatically construct and store element view accessors.
Base class for FluxComputeKernel that holds all data not dependent on template parameters (like stenc...
ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const m_phaseVolFrac
Views on phase volume fractions.
ElementViewConst< arrayView1d< globalIndex const > > const m_dofNumber
Views on dof numbers.
ElementViewConst< arrayView1d< real64 const > > const m_pres
Views on pressure.
ElementViewConst< arrayView1d< integer const > > const m_ghostRank
Views on ghost rank numbers and gravity coefficients.
ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > > const m_phaseCompFrac
Views on phase component fractions.
CRSMatrixView< real64, globalIndex const > const m_localMatrix
View on the local CRS matrix.
ElementRegionManager::ElementViewConst< VIEWTYPE > ElementViewConst
The type for element-based data. Consists entirely of ArrayView's.
ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const m_dCompFrac_dCompDens
Views on derivatives of comp fractions.
static void createAndLaunch(integer const numComps, integer const numPhases, globalIndex const rankOffset, string const &dofKey, integer const hasCapPressure, integer const useTotalMassEquation, UpwindingParameters upwindingParams, string const &solverName, ElementRegionManager const &elemManager, STENCILWRAPPER const &stencilWrapper, real64 const dt, 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 flux terms.
static constexpr localIndex maxStencilSize
Maximum number of points in the stencil.
GEOS_HOST_DEVICE void computeFlux(localIndex const iconn, StackVariables &stack, FUNC &&compFluxKernelOp=NoOpFunc{}) const
Compute the local flux contributions to the residual and Jacobian.
GEOS_HOST_DEVICE localIndex numPointsInFlux(localIndex const iconn) const
Getter for the number of elements at this connection.
GEOS_HOST_DEVICE void complete(localIndex const iconn, StackVariables &stack, FUNC &&assemblyKernelOp=NoOpFunc{}) const
Performs the complete phase for the kernel.
static constexpr integer numFluxSupportPoints
Number of flux support points (hard-coded for TFPA)
static constexpr integer numEqn
Compute time value for the number of equations (all of them, except the volume balance equation)
GEOS_HOST_DEVICE localIndex stencilSize(localIndex const iconn) const
Getter for the stencil size at this connection.
static constexpr integer numComp
Compile time value for the number of components.
ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > > const m_phaseMassDens
Views on phase mass densities.
ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const m_phaseMob
Views on phase mobilities.
STENCILWRAPPER::IndexContainerViewConstType const m_seri
Connection to element maps.
static constexpr localIndex maxNumElems
Maximum number of elements at the face.
FluxComputeKernel(integer const numPhases, globalIndex const rankOffset, STENCILWRAPPER const &stencilWrapper, DofNumberAccessor const &dofNumberAccessor, CompFlowAccessors const &compFlowAccessors, MultiFluidAccessors const &multiFluidAccessors, CapPressureAccessors const &capPressureAccessors, PermeabilityAccessors const &permeabilityAccessors, real64 const dt, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, BitFlags< KernelFlags > kernelFlags)
Constructor for the kernel interface.
ElementViewConst< arrayView3d< real64 const, constitutive::cappres::USD_CAPPRES > > const m_phaseCapPressure
Views on phase capillary pressure.
static constexpr integer numDof
Compute time value for the number of degrees of freedom.
ElementViewConst< arrayView3d< real64 const > > const m_permeability
Views on permeability.
STENCILWRAPPER const m_stencilWrapper
Reference to the stencil wrapper.
GEOS_HOST_DEVICE void setup(localIndex const iconn, StackVariables &stack) const
Performs the setup phase for the kernel.
static void launch(localIndex const numConnections, KERNEL_TYPE const &kernelComponent)
Performs the kernel launch.
static constexpr localIndex maxNumConns
Maximum number of connections at the face.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
StackArray< T, 2, MAXSIZE > stackArray2d
Alias for 2D stack array.
Definition: DataTypes.hpp:204
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:310
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:88
StackArray< T, 1, MAXSIZE > stackArray1d
Alias for 1D stack array.
Definition: DataTypes.hpp:188
@ C1PPU
C1-PPU upwinding from https://doi.org/10.1016/j.advwatres.2017.07.028.
@ IHU
IHU as in https://link.springer.com/content/pdf/10.1007/s10596-019-09835-6.pdf.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
UpwindingScheme upwindingScheme
PPU or C1-PPU or IHU.
Kernel variables (dof numbers, jacobian and residual) located on the stack.
real64 dTrans_dPres[maxNumConns][numFluxSupportPoints]
Derivatives of transmissibility with respect to pressure.
stackArray1d< globalIndex, maxNumElems *numDof > dofColIndices
Indices of the matrix rows/columns corresponding to the dofs in this face.
stackArray2d< real64, maxNumElems *numEqn *maxStencilSize *numDof > localFluxJacobian
Storage for the face local Jacobian matrix.
stackArray1d< real64, maxNumElems *numEqn > localFlux
Storage for the face local residual vector (all equations except volume balance)
localIndex const numConnectedElems
Number of elements connected at a given connection.
real64 transmissibility[maxNumConns][numFluxSupportPoints]
Transmissibility.
GEOS_HOST_DEVICE StackVariables(localIndex const size, localIndex numElems)
Constructor for the stack variables.