LCOV - code coverage report
Current view: top level - src/kernels - ACInterfaceCleavageFracture.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31405 (292dce) with base fef103 Lines: 0 26 0.0 %
Date: 2025-09-04 07:55:36 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : /// Considers cleavage plane anisotropy in the crack propagation
      11             : 
      12             : #include "ACInterfaceCleavageFracture.h"
      13             : 
      14             : registerMooseObject("PhaseFieldApp", ACInterfaceCleavageFracture);
      15             : 
      16             : InputParameters
      17           0 : ACInterfaceCleavageFracture::validParams()
      18             : {
      19           0 :   InputParameters params = ACInterface::validParams();
      20           0 :   params.addClassDescription("Gradient energy Allen-Cahn Kernel where crack propagation along weak"
      21             :                              "cleavage plane is preferred");
      22           0 :   params.addRequiredParam<Real>(
      23             :       "beta_penalty",
      24             :       "penalty to penalize fracture on planes not normal to one cleavage plane normal which is "
      25             :       "normal to weak cleavage plane. Setting beta=0 results in isotropic damage.");
      26           0 :   params.addRequiredParam<RealVectorValue>("cleavage_plane_normal",
      27             :                                            "Normal to the weak cleavage plane");
      28           0 :   return params;
      29           0 : }
      30             : 
      31           0 : ACInterfaceCleavageFracture::ACInterfaceCleavageFracture(const InputParameters & parameters)
      32             :   : ACInterface(parameters),
      33           0 :     _beta_penalty(getParam<Real>("beta_penalty")),
      34           0 :     _cleavage_plane_normal(getParam<RealVectorValue>("cleavage_plane_normal"))
      35             : {
      36           0 : }
      37             : 
      38             : Real
      39           0 : ACInterfaceCleavageFracture::betaNablaPsi()
      40             : {
      41           0 :   return _beta_penalty * _L[_qp] * _kappa[_qp] * (_grad_u[_qp] * _cleavage_plane_normal) *
      42           0 :          (_grad_test[_i][_qp] * _cleavage_plane_normal);
      43             : }
      44             : 
      45             : Real
      46           0 : ACInterfaceCleavageFracture::computeQpResidual()
      47             : {
      48           0 :   return (1 + _beta_penalty) * _grad_u[_qp] * kappaNablaLPsi() - betaNablaPsi();
      49             : }
      50             : 
      51             : Real
      52           0 : ACInterfaceCleavageFracture::computeQpJacobian()
      53             : {
      54             :   /// dsum is the derivative \f$ \frac\partial{\partial \eta} \left( \nabla
      55             :   /// (L\psi) \right) \f$
      56             :   RealGradient dsum =
      57           0 :       (_dkappadop[_qp] * _L[_qp] + _kappa[_qp] * _dLdop[_qp]) * _phi[_j][_qp] * _grad_test[_i][_qp];
      58             : 
      59             :   /// compute the derivative of the gradient of the mobility
      60           0 :   if (_variable_L)
      61             :   {
      62             :     RealGradient dgradL =
      63           0 :         _grad_phi[_j][_qp] * _dLdop[_qp] + _grad_u[_qp] * _phi[_j][_qp] * _d2Ldop2[_qp];
      64             : 
      65           0 :     for (unsigned int i = 0; i < _n_args; ++i)
      66           0 :       dgradL += (*_gradarg[i])[_qp] * _phi[_j][_qp] * (*_d2Ldargdop[i])[_qp];
      67             : 
      68           0 :     dsum += (_kappa[_qp] * dgradL + _dkappadop[_qp] * _phi[_j][_qp] * gradL()) * _test[_i][_qp];
      69             :   }
      70             : 
      71           0 :   return (1 + _beta_penalty) * _grad_phi[_j][_qp] * kappaNablaLPsi() + _grad_u[_qp] * dsum -
      72           0 :          _beta_penalty * _L[_qp] * _kappa[_qp] * (_grad_u[_qp] * _cleavage_plane_normal) *
      73           0 :              (_grad_phi[_j][_qp] * _cleavage_plane_normal);
      74             : }

Generated by: LCOV version 1.14