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

Postprocessor that computes the minimum value of h_min/|u|, where |u| is coupled in as an aux variable. More...

#include <INSExplicitTimestepSelector.h>

Inheritance diagram for INSExplicitTimestepSelector:
[legend]

Public Member Functions

 INSExplicitTimestepSelector (const InputParameters &parameters)
 
virtual ~INSExplicitTimestepSelector ()
 
virtual void initialize ()
 
virtual void execute ()
 
virtual Real getValue ()
 
virtual void threadJoin (const UserObject &uo)
 

Protected Attributes

Real _value
 The value of dt (NOTE: _dt member variable is already defined) More...
 
const VariableValue & _vel_mag
 Velocity magnitude. Hint: Use VectorMagnitudeAux in Moose for this. More...
 
Real _beta
 We can compute maximum stable timesteps based on the linearized theory, but even those timesteps are sometimes still too large for explicit timestepping in a "real" problem. More...
 
const MaterialProperty< Real > & _mu
 Material properties: the explicit time scheme limit for the viscous problem also depends on the kinematic viscosity. More...
 
const MaterialProperty< Real > & _rho
 

Detailed Description

Postprocessor that computes the minimum value of h_min/|u|, where |u| is coupled in as an aux variable.

Definition at line 21 of file INSExplicitTimestepSelector.h.

Constructor & Destructor Documentation

INSExplicitTimestepSelector::INSExplicitTimestepSelector ( const InputParameters &  parameters)

Definition at line 35 of file INSExplicitTimestepSelector.C.

36  : ElementPostprocessor(parameters),
37  _vel_mag(coupledValue("vel_mag")),
38 
39  // Other parameters
40  _beta(getParam<Real>("beta")),
41 
42  // Material properties
43  _mu(getMaterialProperty<Real>("mu_name")),
44  _rho(getMaterialProperty<Real>("rho_name"))
45 {
46 }
Real _beta
We can compute maximum stable timesteps based on the linearized theory, but even those timesteps are ...
const MaterialProperty< Real > & _mu
Material properties: the explicit time scheme limit for the viscous problem also depends on the kinem...
const MaterialProperty< Real > & _rho
const VariableValue & _vel_mag
Velocity magnitude. Hint: Use VectorMagnitudeAux in Moose for this.
INSExplicitTimestepSelector::~INSExplicitTimestepSelector ( )
virtual

Definition at line 48 of file INSExplicitTimestepSelector.C.

48 {}

Member Function Documentation

void INSExplicitTimestepSelector::execute ( )
virtual

Definition at line 57 of file INSExplicitTimestepSelector.C.

58 {
59  Real h_min = _current_elem->hmin();
60 
61  // The space dimension plays a role in the diffusive dt limit. The more
62  // space dimensions there are, the smaller this limit is.
63  Real dim = static_cast<Real>(_current_elem->dim());
64 
65  for (unsigned qp = 0; qp < _qrule->n_points(); ++qp)
66  {
67  // Don't divide by zero...
68  Real vel_mag = std::max(_vel_mag[qp], std::numeric_limits<Real>::epsilon());
69 
70  // For explicit Euler, we always have to satisfy the Courant condition for stability.
71  Real courant_limit_dt = h_min / vel_mag;
72 
73  // But we also have to obey the diffusive time restriction,
74  // dt <= 1/(2*nu)*(1/h1^2 + 1/h2^2 + 1/h3^2)^(-1) <=
75  // <= h_min^2 / n_dim / (2*nu)
76  Real diffusive_limit_dt = 0.5 * h_min * h_min / (_mu[qp] / _rho[qp]) / dim;
77 
78  // And the "combined" condition, dt <= 2*nu/|u|^2
79  Real combined_limit_dt = 2. * (_mu[qp] / _rho[qp]) / vel_mag / vel_mag;
80 
81  // // Debugging:
82  // Moose::out << "courant_limit_dt = " << courant_limit_dt << "\n"
83  // << "diffusive_limit_dt = " << diffusive_limit_dt << "\n"
84  // << "combined_limit_dt = " << combined_limit_dt
85  // << std::endl;
86 
87  _value = std::min(
88  _value,
89  _beta * std::min(std::min(courant_limit_dt, diffusive_limit_dt), combined_limit_dt));
90  }
91 }
Real _beta
We can compute maximum stable timesteps based on the linearized theory, but even those timesteps are ...
const MaterialProperty< Real > & _mu
Material properties: the explicit time scheme limit for the viscous problem also depends on the kinem...
const MaterialProperty< Real > & _rho
const VariableValue & _vel_mag
Velocity magnitude. Hint: Use VectorMagnitudeAux in Moose for this.
Real _value
The value of dt (NOTE: _dt member variable is already defined)
Real INSExplicitTimestepSelector::getValue ( )
virtual

Definition at line 94 of file INSExplicitTimestepSelector.C.

95 {
96  _communicator.min(_value);
97  return _value;
98 }
Real _value
The value of dt (NOTE: _dt member variable is already defined)
void INSExplicitTimestepSelector::initialize ( )
virtual

Definition at line 51 of file INSExplicitTimestepSelector.C.

52 {
53  _value = std::numeric_limits<Real>::max();
54 }
Real _value
The value of dt (NOTE: _dt member variable is already defined)
void INSExplicitTimestepSelector::threadJoin ( const UserObject &  uo)
virtual

Definition at line 101 of file INSExplicitTimestepSelector.C.

102 {
103  const INSExplicitTimestepSelector & pps = dynamic_cast<const INSExplicitTimestepSelector &>(uo);
104  _value = std::min(_value, pps._value);
105 }
Postprocessor that computes the minimum value of h_min/|u|, where |u| is coupled in as an aux variabl...
Real _value
The value of dt (NOTE: _dt member variable is already defined)

Member Data Documentation

Real INSExplicitTimestepSelector::_beta
protected

We can compute maximum stable timesteps based on the linearized theory, but even those timesteps are sometimes still too large for explicit timestepping in a "real" problem.

Therefore, we provide an additional "fudge" factor, 0 < beta < 1, that can be used to reduce the selected timestep even further.

Definition at line 44 of file INSExplicitTimestepSelector.h.

Referenced by execute().

const MaterialProperty<Real>& INSExplicitTimestepSelector::_mu
protected

Material properties: the explicit time scheme limit for the viscous problem also depends on the kinematic viscosity.

Definition at line 48 of file INSExplicitTimestepSelector.h.

Referenced by execute().

const MaterialProperty<Real>& INSExplicitTimestepSelector::_rho
protected

Definition at line 49 of file INSExplicitTimestepSelector.h.

Referenced by execute().

Real INSExplicitTimestepSelector::_value
protected

The value of dt (NOTE: _dt member variable is already defined)

Definition at line 34 of file INSExplicitTimestepSelector.h.

Referenced by execute(), getValue(), initialize(), and threadJoin().

const VariableValue& INSExplicitTimestepSelector::_vel_mag
protected

Velocity magnitude. Hint: Use VectorMagnitudeAux in Moose for this.

Definition at line 37 of file INSExplicitTimestepSelector.h.

Referenced by execute().


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