www.mooseframework.org
LevelSetVelocityInterface.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #pragma once
11 
12 // MOOSE includes
13 #include "InputParameters.h"
14 #include "MooseVariableBase.h"
15 #include "Kernel.h"
16 
17 template <typename T = Kernel>
19 
20 template <>
21 InputParameters validParams<LevelSetVelocityInterface<>>();
22 
27 template <class T>
28 class LevelSetVelocityInterface : public T
29 {
30 public:
31  LevelSetVelocityInterface(const InputParameters & parameters);
32 
33 protected:
38  void computeQpVelocity();
39 
42  const VariableValue & _velocity_x;
43  const VariableValue & _velocity_y;
44  const VariableValue & _velocity_z;
46 
49  const unsigned int _x_vel_var;
50  const unsigned int _y_vel_var;
51  const unsigned int _z_vel_var;
53 
55  RealVectorValue _velocity;
56 };
57 
58 template <class T>
59 void
61 {
62  _velocity(0) = _velocity_x[T::_qp];
63  _velocity(1) = _velocity_y[T::_qp];
64  _velocity(2) = _velocity_z[T::_qp];
65 }
66 
67 template <class T>
69  : T(parameters),
70  _velocity_x(T::coupledValue("velocity_x")),
71  _velocity_y(T::coupledValue("velocity_y")),
72  _velocity_z(T::coupledValue("velocity_z")),
73  _x_vel_var(T::coupled("velocity_x")),
74  _y_vel_var(T::coupled("velocity_y")),
75  _z_vel_var(T::coupled("velocity_z"))
76 {
77 }
78 
LevelSetVelocityInterface::_y_vel_var
const unsigned int _y_vel_var
Definition: LevelSetVelocityInterface.h:50
LevelSetVelocityInterface::_velocity
RealVectorValue _velocity
Storage for velocity vector.
Definition: LevelSetVelocityInterface.h:55
LevelSetVelocityInterface
A helper class for defining the velocity as coupled variables for the levelset equation.
Definition: LevelSetVelocityInterface.h:18
LevelSetVelocityInterface::_z_vel_var
const unsigned int _z_vel_var
Definition: LevelSetVelocityInterface.h:51
LevelSetVelocityInterface::LevelSetVelocityInterface
LevelSetVelocityInterface(const InputParameters &parameters)
Definition: LevelSetVelocityInterface.h:68
LevelSetVelocityInterface::_velocity_y
const VariableValue & _velocity_y
Definition: LevelSetVelocityInterface.h:43
LevelSetVelocityInterface::_velocity_x
const VariableValue & _velocity_x
Definition: LevelSetVelocityInterface.h:42
LevelSetVelocityInterface::_velocity_z
const VariableValue & _velocity_z
Definition: LevelSetVelocityInterface.h:44
LevelSetVelocityInterface::_x_vel_var
const unsigned int _x_vel_var
Definition: LevelSetVelocityInterface.h:49
LevelSetVelocityInterface::computeQpVelocity
void computeQpVelocity()
This method should be called when the velocity vector needs to be updated, this is not done automatic...
Definition: LevelSetVelocityInterface.h:60