20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNELBASE_HPP 
   21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNELBASE_HPP 
   25 #include "common/GEOS_RAJA_Interface.hpp" 
   26 #include "constitutive/capillaryPressure/CapillaryPressureFields.hpp" 
   27 #include "constitutive/capillaryPressure/CapillaryPressureBase.hpp" 
   28 #include "constitutive/fluid/multifluid/MultiFluidBase.hpp" 
   29 #include "constitutive/fluid/multifluid/MultiFluidFields.hpp" 
   30 #include "constitutive/permeability/PermeabilityBase.hpp" 
   31 #include "constitutive/permeability/PermeabilityFields.hpp" 
   41 namespace isothermalCompositionalMultiphaseFVMKernels
 
   53   TotalMassEquation = 1 << 3, 
 
   80   template< 
typename VIEWTYPE >
 
   87                       fields::flow::gravityCoefficient,
 
   88                       fields::flow::pressure,
 
   89                       fields::flow::dGlobalCompFraction_dGlobalCompDensity,
 
   90                       fields::flow::phaseVolumeFraction,
 
   91                       fields::flow::dPhaseVolumeFraction,
 
   92                       fields::flow::phaseMobility,
 
   93                       fields::flow::dPhaseMobility >;
 
   96                               fields::multifluid::phaseDensity,
 
   97                               fields::multifluid::dPhaseDensity,
 
   98                               fields::multifluid::phaseMassDensity,
 
   99                               fields::multifluid::dPhaseMassDensity,
 
  100                               fields::multifluid::phaseCompFraction,
 
  101                               fields::multifluid::dPhaseCompFraction >;
 
  105                               fields::cappres::phaseCapPressure,
 
  106                               fields::cappres::dPhaseCapPressure_dPhaseVolFraction >;
 
  110                               fields::permeability::permeability,
 
  111                               fields::permeability::dPerm_dPressure >;
 
  127                          DofNumberAccessor 
const & dofNumberAccessor,
 
  133                          BitFlags< KernelFlags > kernelFlags );
 
  176   BitFlags< KernelFlags > 
const m_kernelFlags;
 
  181 template< 
typename VIEWTYPE >
 
  184 template< localIndex numComp, localIndex numFluxSupportPo
ints >
 
  186 static void calculateMeanDensity( 
localIndex const ip,
 
  187                                   localIndex const (&seri)[numFluxSupportPoints],
 
  188                                   localIndex const (&sesri)[numFluxSupportPoints],
 
  189                                   localIndex const (&sei)[numFluxSupportPoints],
 
  190                                   integer const checkPhasePresenceInGravity,
 
  195                                   real64 & densMean, 
real64 (& dDensMean_dPres)[numFluxSupportPoints], 
real64 (& dDensMean_dComp)[numFluxSupportPoints][numComp] )
 
  197   using Deriv = constitutive::multifluid::DerivativeOffset;
 
  201   real64 dDens_dC[numComp]{};
 
  202   for( 
localIndex i = 0; i < numFluxSupportPoints; ++i )
 
  208     bool const phaseExists = (phaseVolFrac[er][esr][ei][ip] > 0);
 
  209     if( checkPhasePresenceInGravity && !phaseExists )
 
  211       dDensMean_dPres[i] = 0.0;
 
  214         dDensMean_dComp[i][jc] = 0.0;
 
  220     real64 const density = phaseMassDens[er][esr][ei][0][ip];
 
  221     real64 const dDens_dPres = dPhaseMassDens[er][esr][ei][0][ip][Deriv::dP];
 
  223     applyChainRule( numComp,
 
  224                     dCompFrac_dCompDens[er][esr][ei],
 
  225                     dPhaseMassDens[er][esr][ei][0][ip],
 
  231     dDensMean_dPres[i] = dDens_dPres;
 
  234       dDensMean_dComp[i][jc] = dDens_dC[jc];
 
  241     for( 
localIndex i = 0; i < numFluxSupportPoints; ++i )
 
  243       dDensMean_dPres[i] /= denom;
 
  244       for( 
integer jc = 0; jc < numComp; ++jc )
 
  246         dDensMean_dComp[i][jc] /= denom;
 
#define GEOS_HOST_DEVICE
Marks a host-device function.
 
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
 
typename ElementViewAccessor< VIEWTYPE >::NestedViewTypeConst ElementViewConst
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
 
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.
 
real64 const m_dt
Time step size.
 
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.
 
arrayView1d< real64 > const m_localRhs
View on the local RHS.
 
ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > > const m_phaseCompFrac
Views on phase component fractions.
 
globalIndex const m_rankOffset
Offset for my MPI rank.
 
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.
 
FluxComputeKernelBase(integer const numPhases, globalIndex const rankOffset, DofNumberAccessor const &dofNumberAccessor, CompFlowAccessors const &compFlowAccessors, MultiFluidAccessors const &multiFluidAccessors, real64 const dt, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, BitFlags< KernelFlags > kernelFlags)
Constructor for the kernel interface.
 
integer const m_numPhases
Number of fluid phases.
 
@ Dispersion
Flag to specify whether dispersion is used or not.
 
@ C1PPU
Flag indicating whether C1-PPU is used or not.
 
@ CheckPhasePresenceInGravity
Flag indicating whether gravity treatment is checking phase presence or not.
 
@ CapPressure
Flag to specify whether capillary pressure is used or not.
 
@ HU2PH
Flag indicating whether HU 2-phase simplified version is used or not.
 
@ Diffusion
Flag to specify whether diffusion is used or not.
 
@ IHU
Flag indicating whether IHU is used or not.
 
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, 4, USD > arrayView4d
Alias for 4D array view.
 
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.
 
Trait struct for ghostRank data.