GEOSX
FixedStressThermoPoromechanics.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_FIXEDSTRESSTHERMOPOROMECHANICS_HPP_
20 #define GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_FIXEDSTRESSTHERMOPOROMECHANICS_HPP_
21 
23 
24 namespace geos
25 {
26 
27 namespace solidMechanicsLagrangianFEMKernels
28 {
29 
44 template< typename SUBREGION_TYPE,
45  typename CONSTITUTIVE_TYPE,
46  typename FE_TYPE >
48  public finiteElement::ImplicitKernelBase< SUBREGION_TYPE,
49  CONSTITUTIVE_TYPE,
50  FE_TYPE,
51  3,
52  3 >
53 {
54 public:
56  using Base = finiteElement::ImplicitKernelBase< SUBREGION_TYPE,
57  CONSTITUTIVE_TYPE,
58  FE_TYPE,
59  3,
60  3 >;
61 
68  using Base::m_dofNumber;
70  using Base::m_matrix;
71  using Base::m_rhs;
75  using Base::m_meshData;
76  using Base::m_dt;
77 
83  FixedStressThermoPoromechanics( NodeManager const & nodeManager,
84  EdgeManager const & edgeManager,
85  FaceManager const & faceManager,
86  localIndex const targetRegionIndex,
87  SUBREGION_TYPE const & elementSubRegion,
88  FE_TYPE const & finiteElementSpace,
89  CONSTITUTIVE_TYPE & inputConstitutiveType,
90  arrayView1d< globalIndex const > const inputDofNumber,
91  globalIndex const rankOffset,
93  arrayView1d< real64 > const inputRhs,
94  real64 const inputDt,
95  real64 const (&inputGravityVector)[3] );
96 
97  //*****************************************************************************
106  {
107 public:
108 
112  Base::StackVariables(),
113  xLocal(),
114  u_local(),
115  uhat_local(),
117  {}
118 
119 #if !defined(CALC_FEM_SHAPE_IN_KERNEL)
121  int xLocal;
122 #else
124  real64 xLocal[ numNodesPerElem ][ 3 ];
125 #endif
126 
129 
132 
135  };
136  //*****************************************************************************
137 
147  void setup( localIndex const k,
148  StackVariables & stack ) const;
149 
157  void quadraturePointKernel( localIndex const k,
158  localIndex const q,
159  StackVariables & stack ) const;
160 
166  real64 complete( localIndex const k,
167  StackVariables & stack ) const;
168 
172  template< typename POLICY,
173  typename KERNEL_TYPE >
174  static real64
175  kernelLaunch( localIndex const numElems,
176  KERNEL_TYPE const & kernelComponent );
177 
178 protected:
181 
184 
187 
190 
193 
196  arrayView1d< real64 const > const m_pressure_n;
197 
200 
203  arrayView1d< real64 const > const m_temperature_n;
204 
214  {
215  // TODO: generalize this to other constitutive models (currently we assume linear elasticity).
216  return 2.0 * m_constitutiveUpdate.getShearModulus( k );
217  }
218 };
219 
223  globalIndex,
225  arrayView1d< real64 > const,
226  real64 const,
227  real64 const (&)[3] >;
228 
229 } // namespace solidMechanicsLagrangianFEMKernels
230 
231 } // namespace geos
232 
234 
235 #endif // GEOS_PHYSICSSOLVERS_SOLIDMECHANICS_KERNELS_FIXEDSTRESSTHERMOPOROMECHANICS_HPP_
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:48
#define GEOS_FORCE_INLINE
Marks a function or lambda for inlining.
Definition: GeosxMacros.hpp:50
This class provides an interface to ObjectManagerBase in order to manage edge data.
Definition: EdgeManager.hpp:42
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:43
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
Definition: NodeManager.hpp:45
Define the base interface for implicit finite element kernels.
traits::ViewTypeConst< typename SUBREGION_TYPE::NodeMapType::base_type > const m_elemsToNodes
The element to nodes map.
Definition: KernelBase.hpp:256
CRSMatrixView< real64, globalIndex const > const m_matrix
The global Jacobian matrix.
FE_TYPE::template MeshData< SUBREGION_TYPE > m_meshData
Data structure containing mesh data used to setup the finite element.
arrayView1d< globalIndex const > const m_dofNumber
The global degree of freedom number.
CONSTITUTIVE_TYPE::KernelWrapper const m_constitutiveUpdate
Definition: KernelBase.hpp:263
Used to forward arguments to a class that implements the KernelBase interface.
Definition: KernelBase.hpp:281
Implements kernels for solving the solid part of the fixed-stress thermoporomechanics problem.
GEOS_HOST_DEVICE GEOS_FORCE_INLINE real64 computeStabilizationScaling(localIndex const k) const
Get a parameter representative of the stiffness, used as physical scaling for the stabilization matri...
static real64 kernelLaunch(localIndex const numElems, KERNEL_TYPE const &kernelComponent)
Kernel Launcher.
GEOS_HOST_DEVICE void setup(localIndex const k, StackVariables &stack) const
Copy global values from primary field to a local stack array.
GEOS_HOST_DEVICE GEOS_FORCE_INLINE real64 complete(localIndex const k, StackVariables &stack) const
Performs the complete phase for the kernel.
arrayView1d< real64 const > const m_pressure
The rank-global fluid pressure arrays.
FixedStressThermoPoromechanics(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 inputDofNumber, globalIndex const rankOffset, CRSMatrixView< real64, globalIndex const > const inputMatrix, arrayView1d< real64 > const inputRhs, real64 const inputDt, real64 const (&inputGravityVector)[3])
Constructor.
arrayView2d< real64 const, nodes::TOTAL_DISPLACEMENT_USD > const m_disp
The rank-global displacement array.
arrayView2d< real64 const > const m_bulkDensity
The rank global bulk density.
GEOS_HOST_DEVICE void quadraturePointKernel(localIndex const k, localIndex const q, StackVariables &stack) const
Performs a state update at a quadrature point.
arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const m_X
The array containing the nodal position array.
arrayView1d< real64 const > const m_initialTemperature
The rank-global initial temperature array.
arrayView1d< real64 const > const m_temperature
The rank-global temperature arrays.
arrayView2d< real64 const, nodes::INCR_DISPLACEMENT_USD > const m_uhat
The rank-global incremental displacement array.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:220
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:350
double real64
64-bit floating point type.
Definition: DataTypes.hpp:139
GEOSX_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:128
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:236
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
Kernel variables allocated on the stack.
Definition: KernelBase.hpp:136
real64 u_local[numNodesPerElem][numDofPerTrialSupportPoint]
Stack storage for the element local nodal displacement.
real64 uhat_local[numNodesPerElem][numDofPerTrialSupportPoint]
Stack storage for the element local nodal incremental displacement.
real64 constitutiveStiffness[6][6]
Stack storage for the constitutive stiffness at a quadrature point.