www.mooseframework.org
LevelSetOlssonReinitialization.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 // MOOSE includes
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Kernel>();
16  params.addClassDescription("The re-initialization equation defined by Olsson et. al. (2007).");
17  params.addRequiredCoupledVar(
18  "phi_0", "The level set variable to be reinitialized as signed distance function.");
19  params.addRequiredParam<PostprocessorName>(
20  "epsilon", "The epsilon coefficient to be used in the reinitialization calculation.");
21  return params;
22 }
23 
25  : Kernel(parameters),
26  _grad_levelset_0(coupledGradient("phi_0")),
27  _epsilon(getPostprocessorValue("epsilon"))
28 {
29 }
30 
31 Real
33 {
34  _s = _grad_levelset_0[_qp].norm() + std::numeric_limits<Real>::epsilon();
35  _n_hat = _grad_levelset_0[_qp] / _s;
36  _f = _u[_qp] * (1 - _u[_qp]) * _n_hat;
37  return _grad_test[_i][_qp] * (-_f + _epsilon * (_grad_u[_qp] * _n_hat) * _n_hat);
38 }
39 
40 Real
42 {
43  _s = _grad_levelset_0[_qp].norm() + std::numeric_limits<Real>::epsilon();
44  _n_hat = _grad_levelset_0[_qp] / _s;
45  return _grad_test[_i][_qp] * _n_hat *
46  ((2 * _u[_qp] - 1) * _phi[_j][_qp] + _epsilon * (_grad_phi[_j][_qp] * _n_hat));
47 }
const VariableGradient & _grad_levelset_0
Gradient of the level set variable at time, = 0.
const PostprocessorValue & _epsilon
Interface thickness.
LevelSetOlssonReinitialization(const InputParameters &parameters)
InputParameters validParams< LevelSetOlssonReinitialization >()