LCOV - code coverage report
Current view: top level - src/materials - ThinFilmInterfaceEnergyDensity.C (source / functions) Hit Total Coverage
Test: coverage.info Lines: 33 34 97.1 %
Date: 2025-02-21 01:06:12 Functions: 3 3 100.0 %

          Line data    Source code
       1             : //* This file is part of the RACCOON application
       2             : //* being developed at Dolbow lab at Duke University
       3             : //* http://dolbow.pratt.duke.edu
       4             : 
       5             : #include "ThinFilmInterfaceEnergyDensity.h"
       6             : 
       7             : registerMooseObject("raccoonApp", ThinFilmInterfaceEnergyDensity);
       8             : 
       9             : InputParameters
      10         142 : ThinFilmInterfaceEnergyDensity::validParams()
      11             : {
      12         142 :   InputParameters params = Material::validParams();
      13         142 :   params += BaseNameInterface::validParams();
      14         142 :   params.addClassDescription(
      15             :       "This class compute the interface energy density corresponding to a shear-lag model, "
      16             :       "i.e. $\\psi^i = 0.5 c \\bs{u} \\cdot \\bs{u}$.");
      17             : 
      18         284 :   params.addRequiredParam<MaterialPropertyName>(
      19             :       "shear_lag_coef",
      20             :       "The coefficient describing the mismatch between the film and the substrate");
      21         284 :   params.addRequiredCoupledVar(
      22             :       "displacements",
      23             :       "The displacements appropriate for the simulation geometry and coordinate system");
      24             : 
      25         284 :   params.addRequiredCoupledVar("phase_field", "Name of the phase-field (damage) variable");
      26         284 :   params.addParam<MaterialPropertyName>(
      27             :       "interface_energy_density", "psii", "Name of the interfacial energy density");
      28         284 :   params.addParam<MaterialPropertyName>("degradation_function", "g", "The degradation function");
      29             : 
      30         142 :   return params;
      31           0 : }
      32             : 
      33           3 : ThinFilmInterfaceEnergyDensity::ThinFilmInterfaceEnergyDensity(const InputParameters & parameters)
      34             :   : Material(parameters),
      35             :     DerivativeMaterialPropertyNameInterface(),
      36             :     BaseNameInterface(parameters),
      37           6 :     _coef(getADMaterialProperty<Real>(prependBaseName("shear_lag_coef", true))),
      38           3 :     _ndisp(coupledComponents("displacements")),
      39           3 :     _disp(3),
      40             : 
      41           6 :     _d_name(getVar("phase_field", 0)->name()),
      42             : 
      43             :     // The strain energy density and its derivatives
      44           3 :     _psii_name(prependBaseName("interface_energy_density", true)),
      45           3 :     _psii(declareADProperty<Real>(_psii_name)),
      46           3 :     _psii_active(declareADProperty<Real>(_psii_name + "_active")),
      47           6 :     _dpsii_dd(declareADProperty<Real>(derivativePropertyName(_psii_name, {_d_name}))),
      48             : 
      49             :     // The degradation function and its derivatives
      50           3 :     _g_name(prependBaseName("degradation_function", true)),
      51           3 :     _g(getADMaterialProperty<Real>(_g_name)),
      52          12 :     _dg_dd(getADMaterialProperty<Real>(derivativePropertyName(_g_name, {_d_name})))
      53             : {
      54           9 :   for (unsigned int i = 0; i < _ndisp; ++i)
      55           6 :     _disp[i] = &adCoupledValue("displacements", i);
      56             : 
      57             :   // set unused dimensions to zero
      58           6 :   for (unsigned i = _ndisp; i < 3; ++i)
      59           3 :     _disp[i] = &_ad_zero;
      60           9 : }
      61             : 
      62             : void
      63     7520000 : ThinFilmInterfaceEnergyDensity::computeQpProperties()
      64             : {
      65     7520000 :   ADRealVectorValue u((*_disp[0])[_qp], (*_disp[1])[_qp], (*_disp[2])[_qp]);
      66    15040000 :   _psii_active[_qp] = 0.5 * _coef[_qp] * u * u;
      67    15040000 :   _psii[_qp] = _g[_qp] * _psii_active[_qp];
      68    15040000 :   _dpsii_dd[_qp] = _dg_dd[_qp] * _psii_active[_qp];
      69     7520000 : }

Generated by: LCOV version 1.16