www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
LevelSetOlssonVortex Class Reference

Defines a vortex velocity field in the x-y plane. More...

#include <LevelSetOlssonVortex.h>

Inheritance diagram for LevelSetOlssonVortex:
[legend]

Public Member Functions

 LevelSetOlssonVortex (const InputParameters &parameters)
 
Real value (Real t, const Point &p) const override
 
RealVectorValue vectorValue (Real t, const Point &p) const override
 

Protected Attributes

const Real & _reverse_time
 Total time for the velocity field to complete reverse. More...
 
const MooseEnum & _reverse_type
 Type of reverse (instantaneous or smooth) More...
 
const MooseEnum & _component
 The vector component to return. More...
 
const Real _pi
 

Detailed Description

Defines a vortex velocity field in the x-y plane.

Definition at line 23 of file LevelSetOlssonVortex.h.

Constructor & Destructor Documentation

◆ LevelSetOlssonVortex()

LevelSetOlssonVortex::LevelSetOlssonVortex ( const InputParameters &  parameters)

Definition at line 32 of file LevelSetOlssonVortex.C.

33  : Function(parameters),
34  _reverse_time(getParam<Real>("reverse_time")),
35  _reverse_type(getParam<MooseEnum>("reverse_type")),
36  _component(getParam<MooseEnum>("component")),
37  _pi(libMesh::pi)
38 {
39 }

Member Function Documentation

◆ value()

Real LevelSetOlssonVortex::value ( Real  t,
const Point &  p 
) const
override

Definition at line 42 of file LevelSetOlssonVortex.C.

43 {
44  return vectorValue(t, p)(_component);
45 }

◆ vectorValue()

RealVectorValue LevelSetOlssonVortex::vectorValue ( Real  t,
const Point &  p 
) const
override

Definition at line 48 of file LevelSetOlssonVortex.C.

49 {
50  // Compute the velocity field
51  RealVectorValue output;
52  output(0) = std::sin(_pi * p(0)) * std::sin(_pi * p(0)) * std::sin(2 * _pi * p(1));
53  output(1) = -std::sin(_pi * p(1)) * std::sin(_pi * p(1)) * std::sin(2 * _pi * p(0));
54 
55  // Compute the coefficient used to reverse the flow
56  Real reverse_coefficient = 1.0;
57  if (_reverse_type == 0 && t > _reverse_time / 2.)
58  reverse_coefficient = -1.0;
59  else if (_reverse_type == 1)
60  reverse_coefficient = std::cos(_pi * t / _reverse_time);
61  return reverse_coefficient * output;
62 }

Referenced by value().

Member Data Documentation

◆ _component

const MooseEnum& LevelSetOlssonVortex::_component
protected

The vector component to return.

Definition at line 40 of file LevelSetOlssonVortex.h.

Referenced by value().

◆ _pi

const Real LevelSetOlssonVortex::_pi
protected

Definition at line 43 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

◆ _reverse_time

const Real& LevelSetOlssonVortex::_reverse_time
protected

Total time for the velocity field to complete reverse.

Definition at line 34 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

◆ _reverse_type

const MooseEnum& LevelSetOlssonVortex::_reverse_type
protected

Type of reverse (instantaneous or smooth)

Definition at line 37 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().


The documentation for this class was generated from the following files:
LevelSetOlssonVortex::_pi
const Real _pi
Definition: LevelSetOlssonVortex.h:43
LevelSetOlssonVortex::vectorValue
RealVectorValue vectorValue(Real t, const Point &p) const override
Definition: LevelSetOlssonVortex.C:48
LevelSetOlssonVortex::_component
const MooseEnum & _component
The vector component to return.
Definition: LevelSetOlssonVortex.h:40
LevelSetOlssonVortex::_reverse_type
const MooseEnum & _reverse_type
Type of reverse (instantaneous or smooth)
Definition: LevelSetOlssonVortex.h:37
LevelSetOlssonVortex::_reverse_time
const Real & _reverse_time
Total time for the velocity field to complete reverse.
Definition: LevelSetOlssonVortex.h:34