OGS
ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim > Class Template Reference

Detailed Description

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int GlobalDim>
class ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >

Definition at line 30 of file HydroMechanicsLocalAssemblerFracture.h.

#include <HydroMechanicsLocalAssemblerFracture.h>

Inheritance diagram for ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >:
[legend]

Public Member Functions

 HydroMechanicsLocalAssemblerFracture (HydroMechanicsLocalAssemblerFracture const &)=delete
 
 HydroMechanicsLocalAssemblerFracture (HydroMechanicsLocalAssemblerFracture &&)=delete
 
 HydroMechanicsLocalAssemblerFracture (MeshLib::Element const &e, std::size_t const local_matrix_size, std::vector< unsigned > const &dofIndex_to_localIndex, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, HydroMechanicsProcessData< GlobalDim > &process_data)
 
void preTimestepConcrete (std::vector< double > const &, double const, double const) override
 
void postTimestepConcreteWithVector (const double t, double const dt, Eigen::VectorXd const &local_x) override
 
std::vector< double > const & getIntPtSigma (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtEpsilon (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtDarcyVelocity (const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtFractureVelocity (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtFractureStress (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtFractureAperture (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtFracturePermeability (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point.
 
- Public Member Functions inherited from ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface
 HydroMechanicsLocalAssemblerInterface (MeshLib::Element const &element, bool const is_axially_symmetric, NumLib::GenericIntegrationMethod const &integration_method, std::size_t n_local_size, std::vector< unsigned > dofIndex_to_localIndex)
 
void assemble (double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
 
void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x_, std::vector< double > const &local_x_prev_, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
 
void postTimestepConcrete (Eigen::VectorXd const &local_x_, Eigen::VectorXd const &, const double t, double const dt, int const) override
 
- Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
 
virtual void setInitialConditions (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
 
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
virtual void preAssemble (double const, double const, std::vector< double > const &)
 
virtual void assembleForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
 
virtual void assembleWithJacobianForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
 
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
 
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
 
void postNonLinearSolver (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double > > const &) const
 Fits to staggered scheme.
 
- Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default
 

Private Types

using ShapeMatricesTypeDisplacement
 
using HMatricesType
 
using HMatrixType = typename HMatricesType::HMatrixType
 
using ShapeMatricesTypePressure
 
using IntegrationPointDataType
 
using GlobalDimVectorType = Eigen::Matrix<double, GlobalDim, 1>
 

Private Member Functions

void assembleWithJacobianConcrete (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, Eigen::VectorXd &local_b, Eigen::MatrixXd &local_J) override
 
void assembleBlockMatricesWithJacobian (double const t, double const dt, Eigen::Ref< const Eigen::VectorXd > const &p, Eigen::Ref< const Eigen::VectorXd > const &p_prev, Eigen::Ref< const Eigen::VectorXd > const &g, Eigen::Ref< const Eigen::VectorXd > const &g_prev, Eigen::Ref< Eigen::VectorXd > rhs_p, Eigen::Ref< Eigen::VectorXd > rhs_g, Eigen::Ref< Eigen::MatrixXd > J_pp, Eigen::Ref< Eigen::MatrixXd > J_pg, Eigen::Ref< Eigen::MatrixXd > J_gg, Eigen::Ref< Eigen::MatrixXd > J_gp)
 

Private Attributes

HydroMechanicsProcessData< GlobalDim > & _process_data
 
std::vector< IntegrationPointDataType, Eigen::aligned_allocator< IntegrationPointDataType > > _ip_data
 
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > _secondary_data
 

Static Private Attributes

static const int pressure_index = 0
 
static const int pressure_size = ShapeFunctionPressure::NPOINTS
 
static const int displacement_index = ShapeFunctionPressure::NPOINTS
 
static const int displacement_size
 

Additional Inherited Members

- Protected Member Functions inherited from ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface
- Protected Attributes inherited from ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface
MeshLib::Element const & _element
 
bool const _is_axially_symmetric
 
NumLib::GenericIntegrationMethod const & _integration_method
 

Member Typedef Documentation

◆ GlobalDimVectorType

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
using ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::GlobalDimVectorType = Eigen::Matrix<double, GlobalDim, 1>
private

Definition at line 158 of file HydroMechanicsLocalAssemblerFracture.h.

◆ HMatricesType

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
using ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HMatricesType
private
Initial value:
HMatrixPolicyType<ShapeFunctionDisplacement, GlobalDim>

Definition at line 144 of file HydroMechanicsLocalAssemblerFracture.h.

◆ HMatrixType

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
using ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HMatrixType = typename HMatricesType::HMatrixType
private

Definition at line 146 of file HydroMechanicsLocalAssemblerFracture.h.

◆ IntegrationPointDataType

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
using ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::IntegrationPointDataType
private
Initial value:
IntegrationPointDataFracture<HMatricesType,
ShapeMatrixPolicyType< ShapeFunctionDisplacement, GlobalDim > ShapeMatricesTypeDisplacement
ShapeMatrixPolicyType< ShapeFunctionPressure, GlobalDim > ShapeMatricesTypePressure

Definition at line 153 of file HydroMechanicsLocalAssemblerFracture.h.

◆ ShapeMatricesTypeDisplacement

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
using ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::ShapeMatricesTypeDisplacement
private

◆ ShapeMatricesTypePressure

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
using ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::ShapeMatricesTypePressure
private

Constructor & Destructor Documentation

◆ HydroMechanicsLocalAssemblerFracture() [1/3]

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerFracture ( HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim > const & )
delete

◆ HydroMechanicsLocalAssemblerFracture() [2/3]

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerFracture ( HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim > && )
delete

◆ HydroMechanicsLocalAssemblerFracture() [3/3]

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::HydroMechanicsLocalAssemblerFracture ( MeshLib::Element const & e,
std::size_t const local_matrix_size,
std::vector< unsigned > const & dofIndex_to_localIndex,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
HydroMechanicsProcessData< GlobalDim > & process_data )

Definition at line 40 of file HydroMechanicsLocalAssemblerFracture-impl.h.

49 e, is_axially_symmetric, integration_method,
50 ShapeFunctionDisplacement::NPOINTS * GlobalDim +
51 ShapeFunctionPressure::NPOINTS,
52 dofIndex_to_localIndex),
53 _process_data(process_data)
54{
55 assert(e.getDimension() == GlobalDim - 1);
56
57 unsigned const n_integration_points =
58 integration_method.getNumberOfPoints();
59
60 _ip_data.reserve(n_integration_points);
61 _secondary_data.N.resize(n_integration_points);
62
63 auto const shape_matrices_u =
64 NumLib::initShapeMatrices<ShapeFunctionDisplacement,
66 e, is_axially_symmetric, integration_method);
67
68 auto const shape_matrices_p =
69 NumLib::initShapeMatrices<ShapeFunctionPressure,
70 ShapeMatricesTypePressure, GlobalDim>(
71 e, is_axially_symmetric, integration_method);
72
73 auto const& frac_prop = *_process_data.fracture_property;
74
75 // Get element nodes for aperture0 interpolation from nodes to integration
76 // point. The aperture0 parameter is time-independent.
78 aperture0_node_values = frac_prop.aperture0.getNodalValuesOnElement(
79 e, /*time independent*/ 0);
80
82 x_position.setElementID(e.getID());
83 for (unsigned ip = 0; ip < n_integration_points; ip++)
84 {
85 x_position.setIntegrationPoint(ip);
86
87 _ip_data.emplace_back(*_process_data.fracture_model);
88 auto const& sm_u = shape_matrices_u[ip];
89 auto const& sm_p = shape_matrices_p[ip];
90 auto& ip_data = _ip_data[ip];
91 ip_data.integration_weight =
92 sm_u.detJ * sm_u.integralMeasure *
93 integration_method.getWeightedPoint(ip).getWeight();
94
95 ip_data.H_u.setZero(GlobalDim,
96 ShapeFunctionDisplacement::NPOINTS * GlobalDim);
98 GlobalDim, ShapeFunctionDisplacement::NPOINTS,
100 HMatrixType>(sm_u.N, ip_data.H_u);
101 ip_data.N_p = sm_p.N;
102 ip_data.dNdx_p = sm_p.dNdx;
103
104 _secondary_data.N[ip] = sm_u.N;
105
106 // Initialize current time step values
107 ip_data.w.setZero(GlobalDim);
108 ip_data.sigma_eff.setZero(GlobalDim);
109
110 // Previous time step values are not initialized and are set later.
111 ip_data.w_prev.resize(GlobalDim);
112 ip_data.sigma_eff_prev.resize(GlobalDim);
113
114 ip_data.C.resize(GlobalDim, GlobalDim);
115
116 ip_data.aperture0 = aperture0_node_values.dot(sm_u.N);
117 ip_data.aperture = ip_data.aperture0;
118
119 ip_data.permeability_state =
120 frac_prop.permeability_model->getNewState();
121
122 auto const initial_effective_stress =
123 _process_data.initial_fracture_effective_stress(0, x_position);
124 for (int i = 0; i < GlobalDim; i++)
125 {
126 ip_data.sigma_eff[i] = initial_effective_stress[i];
127 ip_data.sigma_eff_prev[i] = initial_effective_stress[i];
128 }
129 }
130}
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > _secondary_data
std::vector< IntegrationPointDataType, Eigen::aligned_allocator< IntegrationPointDataType > > _ip_data
HydroMechanicsLocalAssemblerInterface(MeshLib::Element const &element, bool const is_axially_symmetric, NumLib::GenericIntegrationMethod const &integration_method, std::size_t n_local_size, std::vector< unsigned > dofIndex_to_localIndex)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
void computeHMatrix(N_Type const &N, HMatrixType &H)
Fills a H-matrix based on given shape function.
VectorType< ShapeFunction::NPOINTS > NodalVectorType
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N

References ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::_ip_data, ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::_process_data, ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::_secondary_data, ProcessLib::computeHMatrix(), MeshLib::Element::getDimension(), MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), MathLib::WeightedPoint::getWeight(), NumLib::GenericIntegrationMethod::getWeightedPoint(), NumLib::initShapeMatrices(), ProcessLib::LIE::HydroMechanics::SecondaryData< ShapeMatrixType >::N, ParameterLib::SpatialPosition::setElementID(), and ParameterLib::SpatialPosition::setIntegrationPoint().

Member Function Documentation

◆ assembleBlockMatricesWithJacobian()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
void ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::assembleBlockMatricesWithJacobian ( double const t,
double const dt,
Eigen::Ref< const Eigen::VectorXd > const & p,
Eigen::Ref< const Eigen::VectorXd > const & p_prev,
Eigen::Ref< const Eigen::VectorXd > const & g,
Eigen::Ref< const Eigen::VectorXd > const & g_prev,
Eigen::Ref< Eigen::VectorXd > rhs_p,
Eigen::Ref< Eigen::VectorXd > rhs_g,
Eigen::Ref< Eigen::MatrixXd > J_pp,
Eigen::Ref< Eigen::MatrixXd > J_pg,
Eigen::Ref< Eigen::MatrixXd > J_gg,
Eigen::Ref< Eigen::MatrixXd > J_gp )
private

Definition at line 166 of file HydroMechanicsLocalAssemblerFracture-impl.h.

176{
177 auto const& frac_prop = *_process_data.fracture_property;
178 auto const& R = frac_prop.R;
179
180 // the index of a normal (normal to a fracture plane) component
181 // in a displacement vector
182 auto constexpr index_normal = GlobalDim - 1;
183
185 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
187
189 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
191
192 typename ShapeMatricesTypeDisplacement::template MatrixType<
194 Kgp = ShapeMatricesTypeDisplacement::template MatrixType<
197
198 // Projection of the body force vector at the element.
199 Eigen::MatrixXd const global2local_rotation =
200 R.template topLeftCorner<ShapeFunctionPressure::DIM, GlobalDim>();
201
202 GlobalDimVectorType const gravity_vec = global2local_rotation.transpose() *
203 global2local_rotation *
204 _process_data.specific_body_force;
205
207 x_position.setElementID(_element.getID());
208
209 unsigned const n_integration_points = _ip_data.size();
210 for (unsigned ip = 0; ip < n_integration_points; ip++)
211 {
212 x_position.setIntegrationPoint(ip);
213
214 auto& ip_data = _ip_data[ip];
215 auto const& ip_w = ip_data.integration_weight;
216 auto const& N_p = ip_data.N_p;
217 auto const& dNdx_p = ip_data.dNdx_p;
218 auto const& H_g = ip_data.H_u;
219 auto const& identity2 =
221
222 auto& mat = ip_data.fracture_material;
223 auto& effective_stress = ip_data.sigma_eff;
224 auto const& effective_stress_prev = ip_data.sigma_eff_prev;
225 auto& w = ip_data.w;
226 auto const& w_prev = ip_data.w_prev;
227 auto& C = ip_data.C;
228 auto& state = *ip_data.material_state_variables;
229 auto& b_m = ip_data.aperture;
230
231 double const S = frac_prop.specific_storage(t, x_position)[0];
232 double const mu = _process_data.fluid_viscosity(t, x_position)[0];
233 auto const alpha = frac_prop.biot_coefficient(t, x_position)[0];
234 auto const rho_fr = _process_data.fluid_density(t, x_position)[0];
235
236 // displacement jumps in local coordinates
237 w.noalias() = R * H_g * g;
238
239 // aperture
240 b_m = ip_data.aperture0 + w[index_normal];
241 if (b_m < 0.0)
242 {
243 DBUG(
244 "Element {:d}, gp {:d}: Fracture aperture is {:g}, but it must "
245 "be "
246 "non-negative. Setting it to zero.",
247 _element.getID(), ip, b_m);
248 b_m = 0;
249 }
250
251 auto const initial_effective_stress =
252 _process_data.initial_fracture_effective_stress(0, x_position);
253
254 Eigen::Map<typename HMatricesType::ForceVectorType const> const stress0(
255 initial_effective_stress.data(), initial_effective_stress.size());
256
257 // local C, local stress
258 mat.computeConstitutiveRelation(
259 t, x_position, ip_data.aperture0, stress0, w_prev, w,
260 effective_stress_prev, effective_stress, C, state);
261
262 auto& k = ip_data.permeability;
263 k = frac_prop.permeability_model->permeability(
264 ip_data.permeability_state.get(), ip_data.aperture0, b_m);
265
266 // derivative of permeability respect to aperture
267 double const dk_db =
268 frac_prop.permeability_model->dpermeability_daperture(
269 ip_data.permeability_state.get(), ip_data.aperture0, b_m);
270
271 //
272 // displacement equation, displacement jump part
273 //
274 rhs_g.noalias() -=
275 H_g.transpose() * R.transpose() * effective_stress * ip_w;
276 J_gg.noalias() += H_g.transpose() * R.transpose() * C * R * H_g * ip_w;
277
278 //
279 // displacement equation, pressure part
280 //
281 Kgp.noalias() +=
282 H_g.transpose() * R.transpose() * alpha * identity2 * N_p * ip_w;
283
284 //
285 // pressure equation, pressure part.
286 //
287 storage_p.noalias() += N_p.transpose() * b_m * S * N_p * ip_w;
288 laplace_p.noalias() +=
289 dNdx_p.transpose() * b_m * k / mu * dNdx_p * ip_w;
290 rhs_p.noalias() +=
291 dNdx_p.transpose() * b_m * k / mu * rho_fr * gravity_vec * ip_w;
292
293 //
294 // pressure equation, displacement jump part.
295 //
296 GlobalDimVectorType const grad_head_over_mu =
297 (dNdx_p * p + rho_fr * gravity_vec) / mu;
298 Eigen::Matrix<double, 1, displacement_size> const mT_R_Hg =
299 identity2.transpose() * R * H_g;
300 // velocity in global coordinates
301 ip_data.darcy_velocity = -k * grad_head_over_mu;
302 J_pg.noalias() +=
303 N_p.transpose() * S * N_p * (p - p_prev) / dt * mT_R_Hg * ip_w;
304 J_pg.noalias() +=
305 dNdx_p.transpose() * k * grad_head_over_mu * mT_R_Hg * ip_w;
306 J_pg.noalias() += dNdx_p.transpose() * b_m * dk_db * grad_head_over_mu *
307 mT_R_Hg * ip_w;
308 }
309
310 // displacement equation, pressure part
311 J_gp.noalias() -= Kgp;
312
313 // pressure equation, pressure part.
314 J_pp.noalias() += laplace_p + storage_p / dt;
315
316 // pressure equation, displacement jump part.
317 J_pg.noalias() += Kgp.transpose() / dt;
318
319 // pressure equation
320 rhs_p.noalias() -= laplace_p * p + storage_p * (p - p_prev) / dt +
321 Kgp.transpose() * (g - g_prev) / dt;
322
323 // displacement equation
324 rhs_g.noalias() -= -Kgp * p;
325}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType

References DBUG(), ParameterLib::SpatialPosition::setElementID(), and ParameterLib::SpatialPosition::setIntegrationPoint().

◆ assembleWithJacobianConcrete()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
void ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::assembleWithJacobianConcrete ( double const t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
Eigen::VectorXd & local_b,
Eigen::MatrixXd & local_J )
overrideprivatevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 135 of file HydroMechanicsLocalAssemblerFracture-impl.h.

141{
142 auto const p = local_x.segment(pressure_index, pressure_size);
143 auto const p_prev = local_x_prev.segment(pressure_index, pressure_size);
144 auto const g = local_x.segment(displacement_index, displacement_size);
145 auto const g_prev =
146 local_x_prev.segment(displacement_index, displacement_size);
147
148 auto rhs_p = local_b.segment(pressure_index, pressure_size);
149 auto rhs_g = local_b.segment(displacement_index, displacement_size);
150 auto J_pp = local_J.block(pressure_index, pressure_index, pressure_size,
152 auto J_pg = local_J.block(pressure_index, displacement_index, pressure_size,
154 auto J_gp = local_J.block(displacement_index, pressure_index,
156 auto J_gg = local_J.block(displacement_index, displacement_index,
158
159 assembleBlockMatricesWithJacobian(t, dt, p, p_prev, g, g_prev, rhs_p, rhs_g,
160 J_pp, J_pg, J_gg, J_gp);
161}
void assembleBlockMatricesWithJacobian(double const t, double const dt, Eigen::Ref< const Eigen::VectorXd > const &p, Eigen::Ref< const Eigen::VectorXd > const &p_prev, Eigen::Ref< const Eigen::VectorXd > const &g, Eigen::Ref< const Eigen::VectorXd > const &g_prev, Eigen::Ref< Eigen::VectorXd > rhs_p, Eigen::Ref< Eigen::VectorXd > rhs_g, Eigen::Ref< Eigen::MatrixXd > J_pp, Eigen::Ref< Eigen::MatrixXd > J_pg, Eigen::Ref< Eigen::MatrixXd > J_gg, Eigen::Ref< Eigen::MatrixXd > J_gp)

◆ getIntPtDarcyVelocity()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
std::vector< double > const & ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getIntPtDarcyVelocity ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverridevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 81 of file HydroMechanicsLocalAssemblerFracture.h.

86 {
87 cache.resize(0);
88 return cache;
89 }

◆ getIntPtEpsilon()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
std::vector< double > const & ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getIntPtEpsilon ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverridevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 71 of file HydroMechanicsLocalAssemblerFracture.h.

76 {
77 cache.resize(0);
78 return cache;
79 }

◆ getIntPtFractureAperture()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
std::vector< double > const & ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getIntPtFractureAperture ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 482 of file HydroMechanicsLocalAssemblerFracture-impl.h.

488{
491}
std::vector< double > const & getIntegrationPointScalarData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)

References ProcessLib::getIntegrationPointScalarData().

◆ getIntPtFracturePermeability()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
std::vector< double > const & ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getIntPtFracturePermeability ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getIntPtFractureStress()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
std::vector< double > const & ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getIntPtFractureStress ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 458 of file HydroMechanicsLocalAssemblerFracture-impl.h.

464{
465 unsigned const n_integration_points = _ip_data.size();
466 cache.clear();
467 auto cache_matrix = MathLib::createZeroedMatrix<
468 Eigen::Matrix<double, GlobalDim, Eigen::Dynamic, Eigen::RowMajor>>(
469 cache, GlobalDim, n_integration_points);
470
471 for (unsigned ip = 0; ip < n_integration_points; ip++)
472 {
473 cache_matrix.col(ip).noalias() = _ip_data[ip].sigma_eff;
474 }
475
476 return cache;
477}
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)

References MathLib::createZeroedMatrix().

◆ getIntPtFractureVelocity()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
std::vector< double > const & ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getIntPtFractureVelocity ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 434 of file HydroMechanicsLocalAssemblerFracture-impl.h.

440{
441 unsigned const n_integration_points = _ip_data.size();
442 cache.clear();
443 auto cache_matrix = MathLib::createZeroedMatrix<
444 Eigen::Matrix<double, GlobalDim, Eigen::Dynamic, Eigen::RowMajor>>(
445 cache, GlobalDim, n_integration_points);
446
447 for (unsigned ip = 0; ip < n_integration_points; ip++)
448 {
449 cache_matrix.col(ip).noalias() = _ip_data[ip].darcy_velocity;
450 }
451
452 return cache;
453}

References MathLib::createZeroedMatrix().

◆ getIntPtSigma()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
std::vector< double > const & ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getIntPtSigma ( const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inlineoverridevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 61 of file HydroMechanicsLocalAssemblerFracture.h.

66 {
67 cache.resize(0);
68 return cache;
69 }

◆ getShapeMatrix()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
Eigen::Map< const Eigen::RowVectorXd > ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::getShapeMatrix ( const unsigned integration_point) const
inlineoverridevirtual

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 115 of file HydroMechanicsLocalAssemblerFracture.h.

117 {
118 auto const& N = _secondary_data.N[integration_point];
119
120 // assumes N is stored contiguously in memory
121 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
122 }

References ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::_secondary_data, and ProcessLib::LIE::HydroMechanics::SecondaryData< ShapeMatrixType >::N.

◆ postTimestepConcreteWithVector()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
void ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::postTimestepConcreteWithVector ( const double t,
double const dt,
Eigen::VectorXd const & local_x )
overridevirtual

Implements ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerInterface.

Definition at line 331 of file HydroMechanicsLocalAssemblerFracture-impl.h.

334{
335 auto const nodal_g = local_x.segment(displacement_index, displacement_size);
336
337 auto const& frac_prop = *_process_data.fracture_property;
338 auto const& R = frac_prop.R;
339 // the index of a normal (normal to a fracture plane) component
340 // in a displacement vector
341 auto constexpr index_normal = GlobalDim - 1;
342
344 auto const e_id = _element.getID();
345 x_position.setElementID(e_id);
346
347 unsigned const n_integration_points = _ip_data.size();
348 for (unsigned ip = 0; ip < n_integration_points; ip++)
349 {
350 x_position.setIntegrationPoint(ip);
351
352 auto& ip_data = _ip_data[ip];
353 auto const& H_g = ip_data.H_u;
354 auto& mat = ip_data.fracture_material;
355 auto& effective_stress = ip_data.sigma_eff;
356 auto const& effective_stress_prev = ip_data.sigma_eff_prev;
357 auto& w = ip_data.w;
358 auto const& w_prev = ip_data.w_prev;
359 auto& C = ip_data.C;
360 auto& state = *ip_data.material_state_variables;
361 auto& b_m = ip_data.aperture;
362
363 // displacement jumps in local coordinates
364 w.noalias() = R * H_g * nodal_g;
365
366 // aperture
367 b_m = ip_data.aperture0 + w[index_normal];
368 if (b_m < 0.0)
369 {
370 DBUG(
371 "Element {:d}, gp {:d}: Fracture aperture is {:g}, but it is "
372 "expected to be non-negative. Setting it to zero now.",
373 _element.getID(), ip, b_m);
374 b_m = 0;
375 }
376
377 auto const initial_effective_stress =
378 _process_data.initial_fracture_effective_stress(0, x_position);
379
380 Eigen::Map<typename HMatricesType::ForceVectorType const> const stress0(
381 initial_effective_stress.data(), initial_effective_stress.size());
382
383 // local C, local stress
384 mat.computeConstitutiveRelation(
385 t, x_position, ip_data.aperture0, stress0, w_prev, w,
386 effective_stress_prev, effective_stress, C, state);
387 }
388
389 double ele_b = 0;
390 double ele_k = 0;
391 typename HMatricesType::ForceVectorType ele_sigma_eff =
392 HMatricesType::ForceVectorType::Zero(GlobalDim);
393 typename HMatricesType::ForceVectorType ele_w =
394 HMatricesType::ForceVectorType::Zero(GlobalDim);
395 GlobalDimVectorType ele_velocity = GlobalDimVectorType::Zero();
396
397 double ele_Fs = -std::numeric_limits<double>::max();
398 for (auto const& ip : _ip_data)
399 {
400 ele_b += ip.aperture;
401 ele_k += ip.permeability;
402 ele_w += ip.w;
403 ele_sigma_eff += ip.sigma_eff;
404 ele_velocity += ip.darcy_velocity;
405 ele_Fs = std::max(
406 ele_Fs, ip.material_state_variables->getShearYieldFunctionValue());
407 }
408 ele_b /= static_cast<double>(n_integration_points);
409 ele_k /= static_cast<double>(n_integration_points);
410 ele_w /= static_cast<double>(n_integration_points);
411 ele_sigma_eff /= static_cast<double>(n_integration_points);
412 ele_velocity /= static_cast<double>(n_integration_points);
413 auto const element_id = _element.getID();
414 (*_process_data.mesh_prop_b)[element_id] = ele_b;
415 (*_process_data.mesh_prop_k_f)[element_id] = ele_k;
416
417 Eigen::Map<GlobalDimVectorType>(
418 &(*_process_data.element_fracture_stresses)[e_id * GlobalDim]) =
419 ele_sigma_eff;
420
421 Eigen::Map<GlobalDimVectorType>(
422 &(*_process_data.element_fracture_velocities)[e_id * GlobalDim]) =
423 ele_velocity;
424
425 Eigen::Map<GlobalDimVectorType>(
426 &(*_process_data.element_local_jumps)[e_id * GlobalDim]) = ele_w;
427
428 (*_process_data.mesh_prop_fracture_shear_failure)[element_id] = ele_Fs;
429}
VectorType< DisplacementDim > ForceVectorType

References DBUG(), ParameterLib::SpatialPosition::setElementID(), and ParameterLib::SpatialPosition::setIntegrationPoint().

◆ preTimestepConcrete()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
void ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::preTimestepConcrete ( std::vector< double > const & ,
double const ,
double const  )
inlineoverridevirtual

Member Data Documentation

◆ _ip_data

◆ _process_data

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
HydroMechanicsProcessData<GlobalDim>& ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::_process_data
private

◆ _secondary_data

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType> ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::_secondary_data
private

◆ displacement_index

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
const int ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::displacement_index = ShapeFunctionPressure::NPOINTS
staticprivate

Definition at line 168 of file HydroMechanicsLocalAssemblerFracture.h.

◆ displacement_size

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
const int ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::displacement_size
staticprivate
Initial value:
=
ShapeFunctionDisplacement::NPOINTS * GlobalDim

Definition at line 169 of file HydroMechanicsLocalAssemblerFracture.h.

◆ pressure_index

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
const int ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::pressure_index = 0
staticprivate

Definition at line 166 of file HydroMechanicsLocalAssemblerFracture.h.

◆ pressure_size

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int GlobalDim>
const int ProcessLib::LIE::HydroMechanics::HydroMechanicsLocalAssemblerFracture< ShapeFunctionDisplacement, ShapeFunctionPressure, GlobalDim >::pressure_size = ShapeFunctionPressure::NPOINTS
staticprivate

Definition at line 167 of file HydroMechanicsLocalAssemblerFracture.h.


The documentation for this class was generated from the following files: