Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ 4 : /* */ 5 : /* Copyright 2017 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #include "PolarPFMInterfaceIC.h" 10 : #include "FEProblemBase.h" 11 : #include "libmesh/utility.h" 12 : 13 : registerMooseObject("MagpieApp", PolarPFMInterfaceIC); 14 : 15 : InputParameters 16 9 : PolarPFMInterfaceIC::validParams() 17 : { 18 9 : InputParameters params = InitialCondition::validParams(); 19 9 : params.addClassDescription("Upsilon IC, eq. (50) from Physical Review B 89, 184102 (2014)"); 20 18 : params.addRequiredCoupledVar("theta", "Theta order parameter"); 21 18 : params.addRequiredParam<Real>("a_beta", "Interpolation coefficient a_beta"); 22 18 : params.addRequiredParam<Real>("beta10", "Gradient energy coefficient between solid 1 and melt"); 23 18 : params.addRequiredParam<Real>("beta20", "Gradient energy coefficient between solid 2 and melt"); 24 18 : params.addParam<Real>("p", 1.0, "Interface parameter"); 25 9 : return params; 26 0 : } 27 : 28 5 : PolarPFMInterfaceIC::PolarPFMInterfaceIC(const InputParameters & parameters) 29 : : InitialCondition(parameters), 30 5 : _theta(coupledValue("theta")), 31 10 : _a_beta(getParam<Real>("a_beta")), 32 10 : _beta10(getParam<Real>("beta10")), 33 10 : _beta20(getParam<Real>("beta20")), 34 10 : _p(getParam<Real>("p")), 35 5 : _xmin(_fe_problem.mesh().getMinInDimension(0)), 36 10 : _xmax(_fe_problem.mesh().getMaxInDimension(0)) 37 : { 38 5 : } 39 : 40 : Real 41 1200 : PolarPFMInterfaceIC::value(const Point & r) 42 : { 43 : /// switching function 44 1200 : const Real q = _a_beta * Utility::pow<2>(_theta[_qp]) - 45 1200 : 2.0 * (_a_beta - 2.0) * Utility::pow<3>(_theta[_qp]) + 46 1200 : (_a_beta - 3.0) * Utility::pow<4>(_theta[_qp]); 47 : 48 : // solid-melt gradient energy coefficient (7) 49 1200 : const Real betaS0 = _beta10 + (_beta20 - _beta10) * q; 50 : 51 : // sample width and position 52 1200 : const Real W = _xmax - _xmin; 53 1200 : const Real x = r(0) - _xmin; 54 : 55 1200 : const Real ds0 = _p * sqrt(betaS0); 56 1200 : return 1.0 - 1.0 / (1.0 + std::exp(-_p / ds0 * (x - W / 4.0))) + 57 1200 : 1.0 / (1.0 + std::exp(-_p / ds0 * (x - 3 * W / 4.0))); 58 : }