https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
41{
42 return _test[_i][_qp] * (0.75 * _epsilon * _epsilon / _lambda) * _sigma *
43 std::cos(_contactangle) * (1 - _pf[_qp] * _pf[_qp]);
44}
registerMooseObject("PhaseFieldApp", ADPhaseFieldContactAngleBC)
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
const ADTemplateVariableTestValue< T > & _test
Implements a simple constant Neumann BC where grad(u)=alpha * v on the boundary.
const Real & _lambda
Mixing energy density.
const ADVariableValue & _pf
reference to coupled variable, pf here
const Real & _epsilon
Interface width.
ADPhaseFieldContactAngleBC(const InputParameters &parameters)
const Real & _sigma
Surface tension coefficient.
virtual ADReal computeQpResidual() override
static InputParameters validParams()
const Real & _contactangle
Contact angle of the fluid with the wall boundary in Radians.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp