20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_THERMALSOLUTIONCHECKKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_THERMALSOLUTIONCHECKKERNEL_HPP
28 namespace thermalCompositionalMultiphaseBaseKernels
46 static real64 constexpr minTemperature = constants::zeroDegreesCelsiusInKelvin;
62 integer const allowNegativePressure,
64 real64 const scalingFactor,
79 integer const temperatureOffset )
80 :
Base( allowCompDensChopping,
81 allowNegativePressure,
86 pressureScalingFactor,
87 compDensScalingFactor,
112 bool const localScaling =
m_scalingType == compositionalMultiphaseUtilities::ScalingType::Local;
115 if( newTemp < minTemperature )
117 stack.localMinVal = 0;
154 template<
typename POLICY >
157 integer const allowNegativePressure,
159 real64 const scalingFactor,
176 SolutionCheckKernel kernel( allowCompDensChopping, allowNegativePressure, scalingType, scalingFactor,
177 pressure, temperature, compDens, pressureScalingFactor, compDensScalingFactor,
178 temperatureScalingFactor, rankOffset, numComp, dofKey, subRegion, localSolution,
179 negPressureIds, negDensityIds, negTotalDensityIds, temperatureOffset );
180 return SolutionCheckKernel::launch< POLICY >( subRegion.
size(), kernel );
ScalingType
Solution scaling type, used in CompositionalMultiphaseFVM.
#define GEOS_HOST_DEVICE
Marks a host-device function.
Collects and reports elements ids and data using an atomic counter. This class provides functionality...
localIndex size() const
Get the "size" of the group, which determines the number of elements in resizable wrappers.
Define the kernel for checking the updated solution.
GEOS_HOST_DEVICE void computeSolutionCheck(localIndex const ei, StackVariables &stack, FUNC &&kernelOp=NoOpFunc{}) const
Compute the local value of the check.
real64 const m_scalingFactor
scaling factor
compositionalMultiphaseUtilities::ScalingType const m_scalingType
scaling type (global or local)
arrayView1d< real64 const > const m_localSolution
View on the local residual.
real64 const m_numComp
Number of components.
static SolutionCheckKernel::KernelStats createAndLaunch(integer const allowCompDensChopping, integer const allowNegativePressure, compositionalMultiphaseUtilities::ScalingType const scalingType, real64 const scalingFactor, arrayView1d< real64 const > const pressure, arrayView1d< real64 const > const temperature, arrayView2d< real64 const, compflow::USD_COMP > const compDens, arrayView1d< real64 > pressureScalingFactor, arrayView1d< real64 > temperatureScalingFactor, arrayView1d< real64 > compDensScalingFactor, globalIndex const rankOffset, integer const numComp, string const dofKey, ElementSubRegionBase &subRegion, arrayView1d< real64 const > const localSolution, ElementsReporterCollector const &negPressureIds, ElementsReporterCollector const &negDensityIds, ElementsReporterCollector const &negTotalDensityIds, integer temperatureOffset)
Create a new kernel and launch.
Define the kernel for checking the updated solution.
arrayView1d< real64 const > const m_temperatureScalingFactor
View on the scaling factor.
arrayView1d< real64 const > const m_temperature
View on the primary variables.
SolutionCheckKernel(integer const allowCompDensChopping, integer const allowNegativePressure, compositionalMultiphaseUtilities::ScalingType const scalingType, real64 const scalingFactor, arrayView1d< real64 const > const pressure, arrayView1d< real64 const > const temperature, arrayView2d< real64 const, compflow::USD_COMP > const compDens, arrayView1d< real64 > pressureScalingFactor, arrayView1d< real64 > compDensScalingFactor, arrayView1d< real64 > temperatureScalingFactor, globalIndex const rankOffset, integer const numComp, string const dofKey, ElementSubRegionBase const &subRegion, arrayView1d< real64 const > const localSolution, ElementsReporterCollector const &negPressureIds, ElementsReporterCollector const &negDensityIds, ElementsReporterCollector const &negTotalDensityIds, integer const temperatureOffset)
Create a new kernel instance.
integer m_temperatureOffset
Offset to temperature variable.
GEOS_HOST_DEVICE void computeSolutionCheck(localIndex const ei, StackVariables &stack) const
Compute the local value of the solution check.
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).
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
int integer
Signed integer type.
Kernel variables located on the stack.
Kernel variables located on the stack.