https://mooseframework.inl.gov
ADPhaseFieldContactAngleBC.C
Go to the documentation of this file.
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 
11 
13 
16 {
18  params.addClassDescription("Enforce contact angle BC using phase field variable");
19  params.addRequiredCoupledVar("pf", "phase field variable");
20  params.addRequiredParam<Real>("epsilon", "Interface width");
21  params.addRequiredParam<Real>("lambda", "Mixing energy density");
22  params.addRequiredParam<Real>("sigma", "Surface tension coefficient");
23  params.addRequiredParam<Real>("contactangle",
24  "Contact angle of the fluid with the wall boundary in Radians");
25  return params;
26 }
27 
29  : ADIntegratedBC(params),
30  _pf(adCoupledValue("pf")),
31  _grad_pf(adCoupledGradient("pf")),
32  _epsilon(getParam<Real>("epsilon")),
33  _lambda(getParam<Real>("lambda")),
34  _sigma(getParam<Real>("sigma")),
35  _contactangle(getParam<Real>("contactangle"))
36 {
37 }
38 
39 ADReal
41 {
42  return _test[_i][_qp] * (0.75 * _epsilon * _epsilon / _lambda) * _sigma *
43  std::cos(_contactangle) * (1 - _pf[_qp] * _pf[_qp]);
44 }
const Real & _contactangle
Contact angle of the fluid with the wall boundary in Radians.
ADPhaseFieldContactAngleBC(const InputParameters &parameters)
const ADVariableValue & _pf
reference to coupled variable, pf here
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
const Real & _sigma
Surface tension coefficient.
const Real & _epsilon
Interface width.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const ADTemplateVariableTestValue< T > & _test
const Real & _lambda
Mixing energy density.
void addClassDescription(const std::string &doc_string)
virtual ADReal computeQpResidual() override
Implements a simple constant Neumann BC where grad(u)=alpha * v on the boundary.
registerMooseObject("PhaseFieldApp", ADPhaseFieldContactAngleBC)
static InputParameters validParams()