https://mooseframework.inl.gov
ObtainAvgContactAngle.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 
10 #include "ObtainAvgContactAngle.h"
11 
12 #include "libmesh/quadrature.h"
13 
15 
18 {
20  params.addClassDescription("Obtain contact angle");
21  params.addRequiredCoupledVar("pf", "phase field variable");
22  return params;
23 }
24 
26  : SidePostprocessor(parameters), _pf(coupledValue("pf")), _grad_pf(coupledGradient("pf"))
27 {
28 }
29 
30 void
32 {
33  _cos_theta_val = 0.0;
34  _total_weight = 0.0;
35 }
36 
37 void
39 {
40 
41  for (unsigned int qp = 0; qp < _qrule->n_points(); qp++)
42  {
43  if (std::abs(_pf[qp]) < 0.5) // Operating only within the interface
44  {
45  // Real tol_val = libMesh::TOLERANCE * libMesh::TOLERANCE;
46  const Real weight = _grad_pf[qp].norm();
48  _grad_pf[qp] * _normals[qp]; // weight * (_grad_pf[qp]/_grad_pf[qp].norm()) * _normals[qp]
50  }
51  }
52 }
53 
54 Real
56 {
57  return _contact_angle;
58 }
59 
60 void
62 {
63  const ObtainAvgContactAngle & pps = static_cast<const ObtainAvgContactAngle &>(y);
66 }
67 
68 void
70 {
74 }
virtual Real getValue() const override
static InputParameters validParams()
virtual void initialize() override
const std::vector< double > y
const VariableGradient & _grad_pf
Gradient of coupled variable.
ObtainAvgContactAngle(const InputParameters &parameters)
Real _cos_theta_val
cos theta value
const VariableValue & _pf
Gradient of coupled variable.
virtual void threadJoin(const UserObject &y) override
void gatherSum(T &value)
dof_id_type weight(const MeshBase &mesh, const processor_id_type pid)
virtual void finalize() override
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This postprocessor computes displacements normal to a provided set of boundaries. ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _contact_angle
Average contact angle.
static InputParameters validParams()
const QBase *const & _qrule
const MooseArray< Point > & _normals
void addClassDescription(const std::string &doc_string)
virtual void execute() override
registerMooseObject("PhaseFieldApp", ObtainAvgContactAngle)
const Real pi
Real _total_weight
total weight