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) override
 
RealVectorValue vectorValue (Real t, const Point &p) 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...
 
RealVectorValue _output
 The velocity field computed. More...
 
Real _reverse_coefficient
 The time reversal coefficient. More...
 
const Real _pi
 

Detailed Description

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

Definition at line 22 of file LevelSetOlssonVortex.h.

Constructor & Destructor Documentation

LevelSetOlssonVortex::LevelSetOlssonVortex ( const InputParameters &  parameters)

Definition at line 28 of file LevelSetOlssonVortex.C.

29  : Function(parameters),
30  _reverse_time(getParam<Real>("reverse_time")),
31  _reverse_type(getParam<MooseEnum>("reverse_type")),
32  _component(getParam<MooseEnum>("component")),
33  _pi(libMesh::pi)
34 {
35 }
const MooseEnum & _reverse_type
Type of reverse (instantaneous or smooth)
const MooseEnum & _component
The vector component to return.
const Real & _reverse_time
Total time for the velocity field to complete reverse.

Member Function Documentation

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

Definition at line 38 of file LevelSetOlssonVortex.C.

39 {
40  return vectorValue(t, p)(_component);
41 }
RealVectorValue vectorValue(Real t, const Point &p) override
const MooseEnum & _component
The vector component to return.
RealVectorValue LevelSetOlssonVortex::vectorValue ( Real  t,
const Point &  p 
)
override

Definition at line 44 of file LevelSetOlssonVortex.C.

Referenced by value().

45 {
46  // Compute the velocity field
47  _output(0) = std::sin(_pi * p(0)) * std::sin(_pi * p(0)) * std::sin(2 * _pi * p(1));
48  _output(1) = -std::sin(_pi * p(1)) * std::sin(_pi * p(1)) * std::sin(2 * _pi * p(0));
49 
50  // Compute the coefficient used to reverse the flow
52  if (_reverse_type == 0 && t > _reverse_time / 2.)
53  _reverse_coefficient = -1.0;
54  else if (_reverse_type == 1)
55  _reverse_coefficient = std::cos(_pi * t / _reverse_time);
57 }
Real _reverse_coefficient
The time reversal coefficient.
RealVectorValue _output
The velocity field computed.
const MooseEnum & _reverse_type
Type of reverse (instantaneous or smooth)
const Real & _reverse_time
Total time for the velocity field to complete reverse.

Member Data Documentation

const MooseEnum& LevelSetOlssonVortex::_component
protected

The vector component to return.

Definition at line 39 of file LevelSetOlssonVortex.h.

Referenced by value().

RealVectorValue LevelSetOlssonVortex::_output
protected

The velocity field computed.

Definition at line 42 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

const Real LevelSetOlssonVortex::_pi
protected

Definition at line 48 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

Real LevelSetOlssonVortex::_reverse_coefficient
protected

The time reversal coefficient.

Definition at line 45 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

const Real& LevelSetOlssonVortex::_reverse_time
protected

Total time for the velocity field to complete reverse.

Definition at line 33 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

const MooseEnum& LevelSetOlssonVortex::_reverse_type
protected

Type of reverse (instantaneous or smooth)

Definition at line 36 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().


The documentation for this class was generated from the following files: