LCOV - code coverage report
Current view: top level - src/kernels - PoroFullSatTimeDerivative.C (source / functions) Hit Total Coverage
Test: idaholab/moose richards: #31405 (292dce) with base fef103 Lines: 0 35 0.0 %
Date: 2025-09-04 07:56:35 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             : #include "PoroFullSatTimeDerivative.h"
      11             : 
      12             : registerMooseObject("RichardsApp", PoroFullSatTimeDerivative);
      13             : 
      14             : InputParameters
      15           0 : PoroFullSatTimeDerivative::validParams()
      16             : {
      17           0 :   InputParameters params = TimeDerivative::validParams();
      18           0 :   params.addRequiredCoupledVar(
      19             :       "displacements",
      20             :       "The displacements appropriate for the simulation geometry and coordinate system");
      21           0 :   params.addClassDescription("Kernel = biot_coefficient*d(volumetric_strain)/dt + "
      22             :                              "(1/biot_modulus)*d(porepressure)/dt.  This is the time-derivative "
      23             :                              "for poromechanics for a single-phase, fully-saturated fluid with "
      24             :                              "constant bulk modulus");
      25           0 :   return params;
      26           0 : }
      27             : 
      28           0 : PoroFullSatTimeDerivative::PoroFullSatTimeDerivative(const InputParameters & parameters)
      29             :   : DerivativeMaterialInterface<TimeDerivative>(parameters),
      30           0 :     _u_old(valueOld()),
      31           0 :     _volstrain(getMaterialProperty<Real>("volumetric_strain")),
      32           0 :     _volstrain_old(getMaterialPropertyOld<Real>("volumetric_strain")),
      33             : 
      34           0 :     _ndisp(coupledComponents("displacements")),
      35           0 :     _disp_var_num(_ndisp),
      36             : 
      37           0 :     _alpha(getMaterialProperty<Real>("biot_coefficient")),
      38             : 
      39           0 :     _one_over_biot_modulus(getMaterialProperty<Real>("one_over_biot_modulus")),
      40           0 :     _done_over_biot_modulus_dP(
      41           0 :         getMaterialPropertyDerivative<Real>("one_over_biot_modulus", _var.name())),
      42           0 :     _done_over_biot_modulus_dep(
      43           0 :         getMaterialPropertyDerivative<Real>("one_over_biot_modulus", "volumetric_strain"))
      44             : {
      45           0 :   for (unsigned i = 0; i < _ndisp; ++i)
      46           0 :     _disp_var_num[i] = coupled("displacements", i);
      47           0 : }
      48             : 
      49             : Real
      50           0 : PoroFullSatTimeDerivative::computeQpResidual()
      51             : {
      52             :   // here, "_u" is the porepressure
      53           0 :   Real res = _one_over_biot_modulus[_qp] * (_u[_qp] - _u_old[_qp]);
      54           0 :   res += _alpha[_qp] * (_volstrain[_qp] - _volstrain_old[_qp]);
      55           0 :   return _test[_i][_qp] * res / _dt;
      56             : }
      57             : 
      58             : Real
      59           0 : PoroFullSatTimeDerivative::computeQpJacobian()
      60             : {
      61           0 :   Real jac = _one_over_biot_modulus[_qp] * _phi[_j][_qp];
      62           0 :   jac += _done_over_biot_modulus_dP[_qp] * _phi[_j][_qp] * (_u[_qp] - _u_old[_qp]);
      63           0 :   return _test[_i][_qp] * jac / _dt;
      64             : }
      65             : 
      66             : Real
      67           0 : PoroFullSatTimeDerivative::computeQpOffDiagJacobian(unsigned int jvar)
      68             : {
      69             :   Real jac = 0;
      70           0 :   for (unsigned i = 0; i < _ndisp; ++i)
      71           0 :     if (jvar == _disp_var_num[i])
      72           0 :       jac = _grad_phi[_j][_qp](i);
      73             : 
      74           0 :   jac *= _done_over_biot_modulus_dep[_qp] * (_u[_qp] - _u_old[_qp]) + _alpha[_qp];
      75             : 
      76           0 :   return _test[_i][_qp] * jac / _dt;
      77             : }

Generated by: LCOV version 1.14