Line data Source code
1 : /****************************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* */ 4 : /* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */ 5 : /* */ 6 : /* Copyright 2021 - 2024, Battelle Energy Alliance, LLC */ 7 : /* ALL RIGHTS RESERVED */ 8 : /****************************************************************************/ 9 : 10 : #include "LevelSetPhaseChangeSUPG.h" 11 : 12 : registerMooseObject("MalamuteApp", LevelSetPhaseChangeSUPG); 13 : 14 : InputParameters 15 6 : LevelSetPhaseChangeSUPG::validParams() 16 : { 17 6 : InputParameters params = ADKernelGrad::validParams(); 18 6 : params.addClassDescription("Computes SUPG term for interface velocity due to phase change."); 19 12 : params.addRequiredParam<Real>("rho_l", "Liquid density."); 20 12 : params.addRequiredParam<Real>("rho_g", "Gas density."); 21 12 : params.addRequiredCoupledVar("velocity", "Velocity vector variable."); 22 6 : return params; 23 0 : } 24 : 25 3 : LevelSetPhaseChangeSUPG::LevelSetPhaseChangeSUPG(const InputParameters & parameters) 26 : : ADKernelGrad(parameters), 27 3 : _delta_function(getADMaterialProperty<Real>("delta_function")), 28 6 : _heaviside_function(getADMaterialProperty<Real>("heaviside_function")), 29 6 : _melt_pool_mass_rate(getADMaterialProperty<Real>("melt_pool_mass_rate")), 30 6 : _rho_l(getParam<Real>("rho_l")), 31 6 : _rho_g(getParam<Real>("rho_g")), 32 6 : _velocity(adCoupledVectorValue("velocity")) 33 : { 34 3 : } 35 : 36 : ADRealVectorValue 37 150000 : LevelSetPhaseChangeSUPG::precomputeQpResidual() 38 : { 39 : ADReal tau = 40 300000 : _current_elem->hmin() / 41 300000 : (2 * (_velocity[_qp] + RealVectorValue(libMesh::TOLERANCE * libMesh::TOLERANCE)).norm()); 42 : 43 300000 : return tau * _velocity[_qp] * 44 450000 : (-(_heaviside_function[_qp] / _rho_g + (1 - _heaviside_function[_qp]) / _rho_l) * 45 300000 : _melt_pool_mass_rate[_qp] * _delta_function[_qp]); 46 : }