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 24 of file INSExplicitTimestepSelector.h.

Constructor & Destructor Documentation

◆ INSExplicitTimestepSelector()

INSExplicitTimestepSelector::INSExplicitTimestepSelector ( const InputParameters &  parameters)

Definition at line 39 of file INSExplicitTimestepSelector.C.

40  : ElementPostprocessor(parameters),
41  _vel_mag(coupledValue("vel_mag")),
42 
43  // Other parameters
44  _beta(getParam<Real>("beta")),
45 
46  // Material properties
47  _mu(getMaterialProperty<Real>("mu_name")),
48  _rho(getMaterialProperty<Real>("rho_name"))
49 {
50 }
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::~INSExplicitTimestepSelector ( )
virtual

Definition at line 52 of file INSExplicitTimestepSelector.C.

52 {}

Member Function Documentation

◆ execute()

void INSExplicitTimestepSelector::execute ( )
virtual

Definition at line 61 of file INSExplicitTimestepSelector.C.

62 {
63  Real h_min = _current_elem->hmin();
64 
65  // The space dimension plays a role in the diffusive dt limit. The more
66  // space dimensions there are, the smaller this limit is.
67  Real dim = static_cast<Real>(_current_elem->dim());
68 
69  for (unsigned qp = 0; qp < _qrule->n_points(); ++qp)
70  {
71  // Don't divide by zero...
72  Real vel_mag = std::max(_vel_mag[qp], std::numeric_limits<Real>::epsilon());
73 
74  // For explicit Euler, we always have to satisfy the Courant condition for stability.
75  Real courant_limit_dt = h_min / vel_mag;
76 
77  // But we also have to obey the diffusive time restriction,
78  // dt <= 1/(2*nu)*(1/h1^2 + 1/h2^2 + 1/h3^2)^(-1) <=
79  // <= h_min^2 / n_dim / (2*nu)
80  Real diffusive_limit_dt = 0.5 * h_min * h_min / (_mu[qp] / _rho[qp]) / dim;
81 
82  // And the "combined" condition, dt <= 2*nu/|u|^2
83  Real combined_limit_dt = 2. * (_mu[qp] / _rho[qp]) / vel_mag / vel_mag;
84 
85  // // Debugging:
86  // Moose::out << "courant_limit_dt = " << courant_limit_dt << "\n"
87  // << "diffusive_limit_dt = " << diffusive_limit_dt << "\n"
88  // << "combined_limit_dt = " << combined_limit_dt
89  // << std::endl;
90 
91  _value = std::min(
92  _value,
93  _beta * std::min(std::min(courant_limit_dt, diffusive_limit_dt), combined_limit_dt));
94  }
95 }
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)

◆ getValue()

Real INSExplicitTimestepSelector::getValue ( )
virtual

Definition at line 98 of file INSExplicitTimestepSelector.C.

99 {
100  _communicator.min(_value);
101  return _value;
102 }
Real _value
The value of dt (NOTE: _dt member variable is already defined)

◆ initialize()

void INSExplicitTimestepSelector::initialize ( )
virtual

Definition at line 55 of file INSExplicitTimestepSelector.C.

56 {
57  _value = std::numeric_limits<Real>::max();
58 }
Real _value
The value of dt (NOTE: _dt member variable is already defined)

◆ threadJoin()

void INSExplicitTimestepSelector::threadJoin ( const UserObject &  uo)
virtual

Definition at line 105 of file INSExplicitTimestepSelector.C.

106 {
107  const INSExplicitTimestepSelector & pps = dynamic_cast<const INSExplicitTimestepSelector &>(uo);
108  _value = std::min(_value, pps._value);
109 }
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

◆ _beta

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 47 of file INSExplicitTimestepSelector.h.

Referenced by execute().

◆ _mu

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 51 of file INSExplicitTimestepSelector.h.

Referenced by execute().

◆ _rho

const MaterialProperty<Real>& INSExplicitTimestepSelector::_rho
protected

Definition at line 52 of file INSExplicitTimestepSelector.h.

Referenced by execute().

◆ _value

Real INSExplicitTimestepSelector::_value
protected

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

Definition at line 37 of file INSExplicitTimestepSelector.h.

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

◆ _vel_mag

const VariableValue& INSExplicitTimestepSelector::_vel_mag
protected

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

Definition at line 40 of file INSExplicitTimestepSelector.h.

Referenced by execute().


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