20 #ifndef GEOS_PHYSICSSOLVERS_MULTIPHYSICS_SINGLEPHASEPOROMECHANICSDAMAGE_IMPL_HPP_
21 #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_SINGLEPHASEPOROMECHANICSDAMAGE_IMPL_HPP_
23 #include "physicsSolvers/multiphysics/poromechanicsKernels/SinglePhasePoromechanicsDamage.hpp"
28 namespace poromechanicsDamageKernels
31 template<
typename SUBREGION_TYPE,
32 typename CONSTITUTIVE_TYPE,
39 SUBREGION_TYPE
const & elementSubRegion,
40 FE_TYPE
const & finiteElementSpace,
41 CONSTITUTIVE_TYPE & inputConstitutiveType,
47 real64 const (&gravityVector)[3],
48 string const inputFlowDofKey,
49 integer const performStressInitialization,
50 string const fluidModelKey ):
57 inputConstitutiveType,
65 performStressInitialization,
67 m_fluidPressureGradient( elementSubRegion.template getReference<
array2d<
real64 > >(
"pressureGradient" ) )
70 template<
typename SUBREGION_TYPE,
71 typename CONSTITUTIVE_TYPE,
82 real64 dPorosity_dVolStrain = 0.0;
83 real64 dPorosity_dPressure = 0.0;
84 real64 dPorosity_dTemperature = 0.0;
85 real64 dSolidDensity_dPressure = 0.0;
87 real64 fluidPressureGradient[3]{};
91 fluidPressureGradient[i] = m_fluidPressureGradient( k, i );
95 m_constitutiveUpdate.smallStrainUpdatePoromechanics( k, q,
106 m_performStressInitialization,
109 dPorosity_dVolStrain,
111 dPorosity_dTemperature,
112 dSolidDensity_dPressure );
115 m_constitutiveUpdate.computeFractureFlowTerm( k, q,
116 fluidPressureGradient,
121 Base::computeBodyForce( k, q,
123 dPorosity_dVolStrain,
125 dPorosity_dTemperature,
126 dSolidDensity_dPressure,
130 Base::computeFluidIncrement( k, q,
133 dPorosity_dVolStrain,
135 dPorosity_dTemperature,
139 template<
typename SUBREGION_TYPE,
140 typename CONSTITUTIVE_TYPE,
146 real64 const ( &dNdX )[numNodesPerElem][3],
150 using namespace PDEUtilities;
152 constexpr FunctionSpace displacementTrialSpace = FE_TYPE::template getFunctionSpace< numDofPerTrialSupportPoint >();
153 constexpr FunctionSpace displacementTestSpace = displacementTrialSpace;
154 constexpr FunctionSpace pressureTrialSpace = FunctionSpace::P0;
157 LinearFormUtilities::compute< displacementTestSpace,
158 DifferentialOperator::SymmetricGradient >
165 if( m_gravityAcceleration > 0.0 )
167 LinearFormUtilities::compute< displacementTestSpace,
168 DifferentialOperator::Identity >
176 LinearFormUtilities::compute< displacementTestSpace,
177 DifferentialOperator::Identity >
185 BilinearFormUtilities::compute< displacementTestSpace,
186 displacementTrialSpace,
187 DifferentialOperator::SymmetricGradient,
188 DifferentialOperator::SymmetricGradient >
196 if( m_gravityAcceleration > 0.0 )
198 BilinearFormUtilities::compute< displacementTestSpace,
199 displacementTrialSpace,
200 DifferentialOperator::Identity,
201 DifferentialOperator::Divergence >
211 BilinearFormUtilities::compute< displacementTestSpace,
213 DifferentialOperator::SymmetricGradient,
214 DifferentialOperator::Identity >
222 if( m_gravityAcceleration > 0.0 )
224 BilinearFormUtilities::compute< displacementTestSpace,
226 DifferentialOperator::Identity,
227 DifferentialOperator::Identity >
236 BilinearFormUtilities::compute< displacementTestSpace,
238 DifferentialOperator::Identity,
239 DifferentialOperator::Identity >
248 template<
typename SUBREGION_TYPE,
249 typename CONSTITUTIVE_TYPE,
256 StackVariables & stack )
const
260 real64 N[numNodesPerElem]{};
261 real64 dNdX[numNodesPerElem][3]{};
262 FE_TYPE::calcN( q, stack.feStack, N );
263 real64 const detJxW = m_finiteElementSpace.template getGradN< FE_TYPE >( k, q, stack.xLocal,
264 stack.feStack, dNdX );
267 LvArray::tensorOps::fill< 6 >( stack.strainIncrement, 0.0 );
268 FE_TYPE::symmetricGradient( dNdX, stack.uhat_local, stack.strainIncrement );
273 smallStrainUpdate( k, q, stack );
277 assembleMomentumBalanceTerms( N, dNdX, detJxW, stack );
281 Base::assembleElementBasedFlowTerms( dNdX, detJxW, stack );
284 template<
typename SUBREGION_TYPE,
285 typename CONSTITUTIVE_TYPE,
293 real64 const maxForce = Base::complete( k, stack );
298 template<
typename SUBREGION_TYPE,
299 typename CONSTITUTIVE_TYPE,
301 template<
typename POLICY,
302 typename KERNEL_TYPE >
305 KERNEL_TYPE
const & kernelComponent )
310 RAJA::ReduceMax< ReducePolicy< POLICY >,
real64 > maxResidual( 0 );
312 forAll< POLICY >( numElems,
315 typename KERNEL_TYPE::StackVariables stack;
317 kernelComponent.setup( k, stack );
318 for(
integer q=0; q<KERNEL_TYPE::numQuadraturePointsPerElem; ++q )
320 kernelComponent.quadraturePointKernel( k, q, stack );
322 maxResidual.max( kernelComponent.complete( k, stack ) );
324 return maxResidual.get();
#define GEOS_HOST_DEVICE
Marks a host-device function.
#define GEOS_FORCE_INLINE
Marks a function or lambda for inlining.
#define GEOS_MARK_FUNCTION
Mark function with both Caliper and NVTX if enabled.
This class provides an interface to ObjectManagerBase in order to manage edge data.
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Implements kernels for solving quasi-static single-phase poromechanics with phase-field damage.
static real64 kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
GEOS_HOST_DEVICE void smallStrainUpdate(localIndex const k, localIndex const q, StackVariables &stack) const
Helper function to compute 1) the total stress, 2) the body force term, and 3) the fluidMassIncrement...
GEOS_HOST_DEVICE void assembleMomentumBalanceTerms(real64 const (&N)[numNodesPerElem], real64 const (&dNdX)[numNodesPerElem][3], real64 const &detJxW, StackVariables &stack) const
Assemble the local linear momentum balance residual and derivatives using total stress and body force...
GEOS_HOST_DEVICE real64 complete(localIndex const k, StackVariables &stack) const
SinglePhasePoromechanicsDamage(NodeManager const &nodeManager, EdgeManager const &edgeManager, FaceManager const &faceManager, localIndex const targetRegionIndex, SUBREGION_TYPE const &elementSubRegion, FE_TYPE const &finiteElementSpace, CONSTITUTIVE_TYPE &inputConstitutiveType, arrayView1d< globalIndex const > const inputDispDofNumber, globalIndex const rankOffset, CRSMatrixView< real64, globalIndex const > const inputMatrix, arrayView1d< real64 > const inputRhs, real64 const inputDt, real64 const (&gravityVector)[3], string const inputFlowDofKey, integer const performStressInitialization, string const fluidModelKey)
Constructor.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix 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.
real64 dFractureFlowTerm_dPressure[3]
Derivative of the fracture flow term wrt pressure.
real64 fractureFlowTerm[3]
Fracture flow term.
real64(& dLocalResidualMomentum_dDisplacement)[numDispDofPerElem][numDispDofPerElem]
Derivative of linear momentum balance residual wrt displacement.
real64 dBodyForce_dPressure[3]
Derivative of body force wrt pressure.
real64 bodyForce[3]
Body force.
real64 dTotalStress_dTemperature[6]
Derivative of total stress wrt temperature.
CONSTITUTIVE_TYPE::KernelWrapper::DiscretizationOps stiffness
Derivative of total stress wrt displacement.
real64 strainIncrement[6]
Strain increment.
real64 temperature
Temperature.
real64 dLocalResidualMomentum_dPressure[numDispDofPerElem][1]
Derivative of linear momentum balance residual wrt pressure.
real64 dTotalStress_dPressure[6]
Derivative of total stress wrt pressure.
real64 dBodyForce_dVolStrainIncrement[3]
Derivative of body force wrt volumetric strain increment.
real64(& localResidualMomentum)[numDispDofPerElem]
Linear momentum balance residual.
real64 deltaTemperatureFromLastStep
Delta temperature since last time step.
real64 totalStress[6]
Total stress.