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 "ADPhaseFieldTwoPhaseSurfaceTension.h" 11 : 12 : registerMooseObject("PhaseFieldApp", ADPhaseFieldTwoPhaseSurfaceTension); 13 : 14 : InputParameters 15 0 : ADPhaseFieldTwoPhaseSurfaceTension::validParams() 16 : { 17 0 : InputParameters params = ADKernelValue::validParams(); 18 0 : params.addClassDescription("Phase field surface tension force for the Navier-Stokes equations."); 19 0 : params.addRequiredCoupledVar("auxpf", "Auxillary variable in phase field formulation"); 20 0 : params.addRequiredCoupledVar("pf", "phase field variable"); 21 0 : params.addRequiredParam<Real>("coeff", "prefactor relating chemical potential and psi"); 22 0 : return params; 23 0 : } 24 : 25 0 : ADPhaseFieldTwoPhaseSurfaceTension::ADPhaseFieldTwoPhaseSurfaceTension( 26 0 : const InputParameters & parameters) 27 : : ADVectorKernelValue(parameters), 28 0 : _auxpf(adCoupledValue("auxpf")), 29 0 : _grad_pf(adCoupledGradient("pf")), 30 0 : _coeff(getParam<Real>("coeff")) 31 : { 32 0 : } 33 : 34 : ADRealVectorValue 35 0 : ADPhaseFieldTwoPhaseSurfaceTension::precomputeQpResidual() 36 : { 37 0 : return -_coeff * _auxpf[_qp] * _grad_pf[_qp]; 38 : }