12 #include "libmesh/quadrature.h"
20 InputParameters params = validParams<ElementPostprocessor>();
22 params.addClassDescription(
"Postprocessor that computes the minimum value of h_min/|u|, where "
23 "|u| is coupled in as an aux variable.");
26 params.addRequiredCoupledVar(
"vel_mag",
"Velocity magnitude");
29 params.addRequiredParam<Real>(
"beta",
30 "0 < beta < 1, choose some fraction of the limiting timestep size");
33 params.addParam<MaterialPropertyName>(
"mu_name",
"mu",
"The name of the dynamic viscosity");
34 params.addParam<MaterialPropertyName>(
"rho_name",
"rho",
"The name of the density");
40 : ElementPostprocessor(parameters),
41 _vel_mag(coupledValue(
"vel_mag")),
44 _beta(getParam<Real>(
"beta")),
47 _mu(getMaterialProperty<Real>(
"mu_name")),
48 _rho(getMaterialProperty<Real>(
"rho_name"))
57 _value = std::numeric_limits<Real>::max();
63 Real h_min = _current_elem->hmin();
67 Real dim = static_cast<Real>(_current_elem->dim());
69 for (
unsigned qp = 0; qp < _qrule->n_points(); ++qp)
72 Real vel_mag = std::max(
_vel_mag[qp], std::numeric_limits<Real>::epsilon());
75 Real courant_limit_dt = h_min / vel_mag;
80 Real diffusive_limit_dt = 0.5 * h_min * h_min / (
_mu[qp] /
_rho[qp]) / dim;
83 Real combined_limit_dt = 2. * (
_mu[qp] /
_rho[qp]) / vel_mag / vel_mag;
93 _beta * std::min(std::min(courant_limit_dt, diffusive_limit_dt), combined_limit_dt));
100 _communicator.min(
_value);