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 76 : StructureAcousticInterface::validParams() 17 : { 18 76 : InputParameters params = InterfaceKernel::validParams(); 19 76 : 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 152 : params.addParam<MaterialPropertyName>("D", "D", "Fluid density."); 24 152 : params.addRequiredRangeCheckedParam<unsigned int>( 25 : "component", "component < 3", "The desired component of displacement."); 26 76 : return params; 27 0 : } 28 : 29 40 : StructureAcousticInterface::StructureAcousticInterface(const InputParameters & parameters) 30 : : InterfaceKernel(parameters), 31 40 : _D(getMaterialProperty<Real>("D")), 32 40 : _neighbor_dotdot(_neighbor_var.uDotDotNeighbor()), 33 40 : _neighbor_dotdot_du(_neighbor_var.duDotDotDuNeighbor()), 34 120 : _component(getParam<unsigned int>("component")) 35 : { 36 40 : } 37 : 38 : Real 39 169472 : StructureAcousticInterface::computeQpResidual(Moose::DGResidualType type) 40 : { 41 169472 : switch (type) 42 : { 43 84736 : case Moose::Element: // Element is fluid 44 84736 : return _test[_i][_qp] * _D[_qp] * _neighbor_dotdot[_qp] * _normals[_qp](_component); 45 : 46 84736 : case Moose::Neighbor: // Neighbor is structure 47 84736 : return _test_neighbor[_i][_qp] * -_u[_qp] * _normals[_qp](_component); 48 : } 49 : return 0.0; 50 : } 51 : 52 : Real 53 1697392 : StructureAcousticInterface::computeQpJacobian(Moose::DGJacobianType type) 54 : { 55 1697392 : switch (type) 56 : { 57 : case Moose::ElementElement: 58 : break; 59 : case Moose::NeighborNeighbor: 60 : break; 61 424348 : case Moose::ElementNeighbor: 62 424348 : return _test[_i][_qp] * _D[_qp] * _phi_neighbor[_j][_qp] * _neighbor_dotdot_du[_qp] * 63 424348 : _normals[_qp](_component); 64 424348 : case Moose::NeighborElement: 65 424348 : return _test_neighbor[_i][_qp] * -_phi[_j][_qp] * _normals[_qp](_component); 66 : } 67 : return 0.0; 68 : }