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 "XFEMPhaseTransitionMovingInterfaceVelocity.h" 11 : 12 : registerMooseObject("XFEMApp", XFEMPhaseTransitionMovingInterfaceVelocity); 13 : 14 : InputParameters 15 24 : XFEMPhaseTransitionMovingInterfaceVelocity::validParams() 16 : { 17 24 : InputParameters params = XFEMMovingInterfaceVelocityBase::validParams(); 18 48 : params.addRequiredParam<Real>("diffusivity_at_positive_level_set", 19 : "Diffusivity for level set positive region."); 20 48 : params.addRequiredParam<Real>("diffusivity_at_negative_level_set", 21 : "Diffusivity for level set negative region."); 22 48 : params.addRequiredParam<Real>("equilibrium_concentration_jump", 23 : "The jump of the equilibrium concentration at the interface."); 24 24 : params.addClassDescription( 25 : "calculate the interface velocity for a simple phase transition problem."); 26 24 : return params; 27 0 : } 28 : 29 12 : XFEMPhaseTransitionMovingInterfaceVelocity::XFEMPhaseTransitionMovingInterfaceVelocity( 30 12 : const InputParameters & parameters) 31 : : XFEMMovingInterfaceVelocityBase(parameters), 32 12 : _diffusivity_at_positive_level_set(getParam<Real>("diffusivity_at_positive_level_set")), 33 24 : _diffusivity_at_negative_level_set(getParam<Real>("diffusivity_at_negative_level_set")), 34 36 : _equilibrium_concentration_jump(getParam<Real>("equilibrium_concentration_jump")) 35 : { 36 12 : } 37 : 38 : Real 39 3312 : XFEMPhaseTransitionMovingInterfaceVelocity::computeMovingInterfaceVelocity( 40 : dof_id_type point_id, RealVectorValue normal) const 41 : { 42 3312 : Real value_positive = _value_at_interface_uo->getValueAtPositiveLevelSet()[point_id]; 43 6624 : Real value_negative = _value_at_interface_uo->getValueAtNegativeLevelSet()[point_id]; 44 6624 : RealVectorValue grad_positive = _value_at_interface_uo->getGradientAtPositiveLevelSet()[point_id]; 45 6624 : RealVectorValue grad_negative = _value_at_interface_uo->getGradientAtNegativeLevelSet()[point_id]; 46 : 47 3312 : return std::abs((_diffusivity_at_positive_level_set * grad_positive - 48 : _diffusivity_at_negative_level_set * grad_negative) * 49 3312 : normal / (value_positive - value_negative + _equilibrium_concentration_jump)); 50 : }