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 24 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 }
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

◆ value()

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

Definition at line 42 of file LevelSetOlssonVortex.C.

43 {
44  return vectorValue(t, p)(_component);
45 }
RealVectorValue vectorValue(Real t, const Point &p) override
const MooseEnum & _component
The vector component to return.

◆ vectorValue()

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

Definition at line 48 of file LevelSetOlssonVortex.C.

Referenced by value().

49 {
50  // Compute the velocity field
51  _output(0) = std::sin(_pi * p(0)) * std::sin(_pi * p(0)) * std::sin(2 * _pi * p(1));
52  _output(1) = -std::sin(_pi * p(1)) * std::sin(_pi * p(1)) * std::sin(2 * _pi * p(0));
53 
54  // Compute the coefficient used to reverse the flow
56  if (_reverse_type == 0 && t > _reverse_time / 2.)
57  _reverse_coefficient = -1.0;
58  else if (_reverse_type == 1)
59  _reverse_coefficient = std::cos(_pi * t / _reverse_time);
61 }
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

◆ _component

const MooseEnum& LevelSetOlssonVortex::_component
protected

The vector component to return.

Definition at line 41 of file LevelSetOlssonVortex.h.

Referenced by value().

◆ _output

RealVectorValue LevelSetOlssonVortex::_output
protected

The velocity field computed.

Definition at line 44 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

◆ _pi

const Real LevelSetOlssonVortex::_pi
protected

Definition at line 50 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

◆ _reverse_coefficient

Real LevelSetOlssonVortex::_reverse_coefficient
protected

The time reversal coefficient.

Definition at line 47 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 35 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().

◆ _reverse_type

const MooseEnum& LevelSetOlssonVortex::_reverse_type
protected

Type of reverse (instantaneous or smooth)

Definition at line 38 of file LevelSetOlssonVortex.h.

Referenced by vectorValue().


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