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,
76 integer const temperatureOffset )
77 :
Base( allowCompDensChopping,
78 allowNegativePressure,
83 pressureScalingFactor,
84 compDensScalingFactor,
109 if( newTemp < minTemperature )
111 stack.localMinVal = 0;
148 template<
typename POLICY >
151 integer const allowNegativePressure,
153 real64 const scalingFactor,
167 SolutionCheckKernel kernel( allowCompDensChopping, allowNegativePressure, scalingType, scalingFactor,
168 pressure, temperature, compDens, pressureScalingFactor, compDensScalingFactor, temperatureScalingFactor,
169 rankOffset, numComp, dofKey, subRegion, localSolution,
171 return SolutionCheckKernel::launch< POLICY >( subRegion.
size(), kernel );
#define GEOS_HOST_DEVICE
Marks a host-device function.
ScalingType
Solution scaling type.
@ Local
Scale the Newton update locally (modifies the Newton direction)
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
CompositionalMultiphaseFVM::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::StackVariables createAndLaunch(integer const allowCompDensChopping, integer const allowNegativePressure, CompositionalMultiphaseFVM::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, 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, CompositionalMultiphaseFVM::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, 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).
std::int32_t integer
Signed integer type.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Kernel variables located on the stack.