LCOV - code coverage report
Current view: top level - src/materials - PolarPFMPsiL.C (source / functions) Hit Total Coverage
Test: idaholab/magpie: 5710af Lines: 36 37 97.3 %
Date: 2025-07-21 23:34:39 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          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 "PolarPFMPsiL.h"
      10             : 
      11             : registerMooseObject("MagpieApp", PolarPFMPsiL);
      12             : 
      13             : InputParameters
      14          38 : PolarPFMPsiL::validParams()
      15             : {
      16          38 :   InputParameters params = DerivativeParsedMaterialHelper::validParams();
      17          38 :   params.addClassDescription("Bulk Helmholtz energy");
      18          76 :   params.addRequiredCoupledVar("upsilon", "Upsilon order parameter");
      19          76 :   params.addRequiredCoupledVar("theta", "Theta order parameter");
      20          76 :   params.addRequiredParam<Real>("G0", "Thermal energy of the melt");
      21          76 :   params.addRequiredParam<Real>("a_theta", "Interpolation coefficient a_theta");
      22          76 :   params.addRequiredParam<Real>("a_A", "Interpolation coefficient a_A");
      23          76 :   params.addRequiredParam<Real>("A10", "Barrier coefficient solid 1 and melt");
      24          76 :   params.addRequiredParam<Real>("A20", "Barrier coefficient solid 2 and melt");
      25          76 :   params.addRequiredParam<Real>("A21", "Barrier coefficient solid 2 and solid 1");
      26          76 :   params.addRequiredParam<Real>("DeltaG10",
      27             :                                 "Difference in thermal energy between solid 1 and melt");
      28          76 :   params.addRequiredParam<Real>("DeltaG20",
      29             :                                 "Difference in thermal energy between solid 2 and melt");
      30          38 :   return params;
      31           0 : }
      32             : 
      33          30 : PolarPFMPsiL::PolarPFMPsiL(const InputParameters & parameters)
      34             :   : DerivativeParsedMaterialHelper(parameters),
      35          30 :     _upsilon("upsilon"),
      36          30 :     _theta("theta"),
      37          60 :     _g0(getParam<Real>("G0")),
      38          60 :     _a_theta(getParam<Real>("a_theta")),
      39          60 :     _a_A(getParam<Real>("a_A")),
      40          60 :     _deltaG10(getParam<Real>("DeltaG10")),
      41          60 :     _deltaG20(getParam<Real>("DeltaG20")),
      42          30 :     _deltaG21(_deltaG20 - _deltaG10),
      43          60 :     _a10(getParam<Real>("A10")),
      44          60 :     _a20(getParam<Real>("A20")),
      45          90 :     _a21(getParam<Real>("A21"))
      46             : {
      47             :   // All equation numbers from Physical Review B 89, 184102 (2014)
      48             : 
      49             :   // interpolating function (8)
      50          30 :   EBFunction q;
      51          30 :   EBTerm y("y"), a("a");
      52          60 :   q(y, a) = a * y * y - 2 * (a - 2) * y * y * y + (a - 3) * y * y * y * y;
      53             : 
      54             :   // change in thermal energy of the phases (5)
      55          30 :   EBTerm DeltaG = _deltaG10 + _deltaG21 * q(_theta, 0);
      56             : 
      57             :   // solid-melt energy barrier coefficient (6)
      58          30 :   EBTerm AS0 = _a10 + (_a20 - _a10) * q(_theta, _a_theta);
      59             : 
      60             :   // energy barrier (3)
      61          60 :   EBTerm psiB = AS0 * _upsilon * _upsilon * (1 - _upsilon) * (1 - _upsilon) +
      62          90 :                 _a21 * _theta * _theta * (1 - _theta) * (1 - _theta) * q(_upsilon, _a_A);
      63             : 
      64             :   // thermal energy (2)
      65          30 :   EBTerm psi = _g0 + DeltaG * q(_upsilon, 0);
      66             : 
      67          90 :   functionParse(psi + psiB);
      68          30 : }

Generated by: LCOV version 1.14