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 "PressureDensity.h" 6 : 7 : registerMooseObject("raccoonApp", PressureDensity); 8 : 9 : InputParameters 10 146 : PressureDensity::validParams() 11 : { 12 146 : InputParameters params = Material::validParams(); 13 146 : params += BaseNameInterface::validParams(); 14 146 : params.addClassDescription("This class computes the effective pressure density $p \\norm{\\grad " 15 : "d} I(d)$, where $I(d)$ is the indicator function."); 16 : 17 292 : params.addParam<MaterialPropertyName>( 18 : "effective_pressure_density", "p_density", "Name of the pressure density"); 19 : 20 292 : params.addRequiredCoupledVar("phase_field", "The phase-field variable"); 21 292 : params.addRequiredParam<MaterialPropertyName>("pressure", "Material property name for pressure"); 22 292 : params.addParam<MaterialPropertyName>("indicator_function", 23 : "I" 24 : "The indicator function"); 25 : 26 146 : return params; 27 0 : } 28 : 29 6 : PressureDensity::PressureDensity(const InputParameters & parameters) 30 : : Material(parameters), 31 : BaseNameInterface(parameters), 32 : DerivativeMaterialPropertyNameInterface(), 33 6 : _p_density(declareADProperty<Real>(prependBaseName("effective_pressure_density", true))), 34 6 : _grad_d(adCoupledGradient("phase_field")), 35 12 : _p(getADMaterialProperty<Real>(prependBaseName("pressure", true))), 36 24 : _dI_dd(getADMaterialProperty<Real>(derivativePropertyNameFirst( 37 12 : getParam<MaterialPropertyName>("indicator_function"), getVar("phase_field", 0)->name()))) 38 : { 39 6 : } 40 : 41 : void 42 272800 : PressureDensity::computeQpProperties() 43 : { 44 545600 : _p_density[_qp] = _p[_qp] * _grad_d[_qp].norm() * _dI_dd[_qp]; 45 272800 : }