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 "StructureAcousticInterface.h" 11 : #include "MooseVariableFE.h" 12 : 13 : registerMooseObject("FsiApp", StructureAcousticInterface); 14 : 15 : InputParameters 16 164 : StructureAcousticInterface::validParams() 17 : { 18 164 : InputParameters params = InterfaceKernel::validParams(); 19 164 : params.addClassDescription("Enforces displacement and stress/pressure continuity " 20 : "between the fluid and structural domains. Element " 21 : "is always the structure and neighbor is always the" 22 : " fluid."); 23 328 : params.addParam<MaterialPropertyName>("D", "D", "Fluid density."); 24 328 : params.addRequiredRangeCheckedParam<unsigned int>( 25 : "component", "component < 3", "The desired component of displacement."); 26 164 : return params; 27 0 : } 28 : 29 88 : StructureAcousticInterface::StructureAcousticInterface(const InputParameters & parameters) 30 : : InterfaceKernel(parameters), 31 88 : _D(getMaterialProperty<Real>("D")), 32 88 : _neighbor_dotdot(_neighbor_var.uDotDotNeighbor()), 33 88 : _neighbor_dotdot_du(_neighbor_var.duDotDotDuNeighbor()), 34 264 : _component(getParam<unsigned int>("component")) 35 : { 36 88 : } 37 : 38 : Real 39 254012 : StructureAcousticInterface::computeQpResidual(Moose::DGResidualType type) 40 : { 41 254012 : switch (type) 42 : { 43 127006 : case Moose::Element: // Element is fluid 44 127006 : return _test[_i][_qp] * _D[_qp] * _neighbor_dotdot[_qp] * _normals[_qp](_component); 45 : 46 127006 : case Moose::Neighbor: // Neighbor is structure 47 127006 : return _test_neighbor[_i][_qp] * -_u[_qp] * _normals[_qp](_component); 48 : } 49 : return 0.0; 50 : } 51 : 52 : Real 53 2544544 : StructureAcousticInterface::computeQpJacobian(Moose::DGJacobianType type) 54 : { 55 2544544 : switch (type) 56 : { 57 : case Moose::ElementElement: 58 : break; 59 : case Moose::NeighborNeighbor: 60 : break; 61 636136 : case Moose::ElementNeighbor: 62 636136 : return _test[_i][_qp] * _D[_qp] * _phi_neighbor[_j][_qp] * _neighbor_dotdot_du[_qp] * 63 636136 : _normals[_qp](_component); 64 636136 : case Moose::NeighborElement: 65 636136 : return _test_neighbor[_i][_qp] * -_phi[_j][_qp] * _normals[_qp](_component); 66 : } 67 : return 0.0; 68 : }