https://mooseframework.inl.gov
DensityScaling.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "DensityScaling.h"
11 #include "libmesh/utility.h"
12 
13 registerMooseObject("SolidMechanicsApp", DensityScaling);
14 
17 {
19  params.addClassDescription(
20  "Computes the scaled inertial density needed to enable stable explicit time-stepping using "
21  "the "
22  "desired_time_step in solid-mechanics problems. Note that if this inertial density is used "
23  "in input files (for instance, in the mass matrix) it will impact the dynamics of the "
24  "system, largely eliminating high-frequency oscillations, and impacting low-frequency "
25  "dynamics. Hence, use with caution.");
26  params.addRequiredParam<MaterialPropertyName>(
27  "true_density",
28  "Name of Material Property defining the true inertial density of the material.");
29  params.addRequiredParam<MaterialPropertyName>(
30  "scaled_density", "Name of the scaled density property that this Material computes.");
31  params.addParam<MaterialPropertyName>(
32  "additional_density",
33  "additional_density",
34  "Name of the additional density property that this Material computes");
35  params.addRequiredParam<Real>("desired_time_step", "The desired time step.");
36  params.addRangeCheckedParam<Real>(
37  "safety_factor",
38  0.7,
39  "(safety_factor>0) & (safety_factor<=1)",
40  "The scaled density that this Material produces will potentially allow stable time-step "
41  "sizes of desired_time_step / safety_factor. In practice, however, using such a time step "
42  "might result in instabilities, because of time-step lagging and the approximate critical "
43  "time-step formula used by this Material. Hence, safety_factor allows for a safety margin.");
44  return params;
45 }
46 
48  : Material(parameters),
49  _desired_time_step(getParam<Real>("desired_time_step")),
50  _density_scaled(declareProperty<Real>(getParam<MaterialPropertyName>("scaled_density"))),
51  _additional_density(
52  declareProperty<Real>(getParam<MaterialPropertyName>("additional_density"))),
53  _material_density(getMaterialProperty<Real>("true_density")),
54  _sqrt_effective_stiffness(getMaterialPropertyByName<Real>("effective_stiffness")),
55  _safety_factor(getParam<Real>("safety_factor"))
56 {
57 }
58 
59 void
61 {
62  const Real stable_density = Utility::pow<2>(_sqrt_effective_stiffness[_qp] * _desired_time_step /
63  _safety_factor / _current_elem->hmin());
64 
65  _density_scaled[_qp] = std::max(stable_density, _material_density[_qp]);
67 }
DensityScaling(const InputParameters &parameters)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const Real _desired_time_step
User-prescribed desired time step.
const MaterialProperty< Real > & _material_density
The true inertial density of the material.
const MaterialProperty< Real > & _sqrt_effective_stiffness
Square root of effective stiffness of element.
virtual void computeQpProperties()
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
This material computes a density that is scaled to enable stable explicit time stepping with steps la...
unsigned int _qp
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MaterialProperty< Real > & _additional_density
Scaled density minus true density.
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
MaterialProperty< Real > & _density_scaled
The scaled density.
const Real & _safety_factor
User-defined safety factor that the minimum density required for stability is divided by...
const Elem *const & _current_elem
registerMooseObject("SolidMechanicsApp", DensityScaling)