LCOV - code coverage report
Current view: top level - src/bcs - ADPhaseFieldContactAngleBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose phase_field: #31706 (f8ed4a) with base bb0a08 Lines: 20 21 95.2 %
Date: 2025-11-03 17:26:54 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://www.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 "ADPhaseFieldContactAngleBC.h"
      11             : 
      12             : registerMooseObject("PhaseFieldApp", ADPhaseFieldContactAngleBC);
      13             : 
      14             : InputParameters
      15         408 : ADPhaseFieldContactAngleBC::validParams()
      16             : {
      17         408 :   InputParameters params = ADIntegratedBC::validParams();
      18         408 :   params.addClassDescription("Enforce contact angle BC using phase field variable");
      19         816 :   params.addRequiredCoupledVar("pf", "phase field variable");
      20         816 :   params.addRequiredParam<Real>("epsilon", "Interface width");
      21         816 :   params.addRequiredParam<Real>("lambda", "Mixing energy density");
      22         816 :   params.addRequiredParam<Real>("sigma", "Surface tension coefficient");
      23         816 :   params.addRequiredParam<Real>("contactangle",
      24             :                                 "Contact angle of the fluid with the wall boundary in Radians");
      25         408 :   return params;
      26           0 : }
      27             : 
      28         216 : ADPhaseFieldContactAngleBC::ADPhaseFieldContactAngleBC(const InputParameters & params)
      29             :   : ADIntegratedBC(params),
      30         216 :     _pf(adCoupledValue("pf")),
      31         216 :     _grad_pf(adCoupledGradient("pf")),
      32         432 :     _epsilon(getParam<Real>("epsilon")),
      33         432 :     _lambda(getParam<Real>("lambda")),
      34         432 :     _sigma(getParam<Real>("sigma")),
      35         648 :     _contactangle(getParam<Real>("contactangle"))
      36             : {
      37         216 : }
      38             : 
      39             : ADReal
      40     1261386 : ADPhaseFieldContactAngleBC::computeQpResidual()
      41             : {
      42     1261386 :   return _test[_i][_qp] * (0.75 * _epsilon * _epsilon / _lambda) * _sigma *
      43     3784158 :          std::cos(_contactangle) * (1 - _pf[_qp] * _pf[_qp]);
      44             : }

Generated by: LCOV version 1.14