https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13registerMooseObject("SolidMechanicsApp", DensityScaling);
14
17{
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
59void
61{
62 const Real stable_density = Utility::pow<2>(_sqrt_effective_stiffness[_qp] * _desired_time_step /
64
65 _density_scaled[_qp] = std::max(stable_density, _material_density[_qp]);
67}
registerMooseObject("SolidMechanicsApp", DensityScaling)
This material computes a density that is scaled to enable stable explicit time stepping with steps la...
const MaterialProperty< Real > & _material_density
The true inertial density of the material.
MaterialProperty< Real > & _additional_density
Scaled density minus true density.
const Real & _safety_factor
User-defined safety factor that the minimum density required for stability is divided by.
static InputParameters validParams()
const MaterialProperty< Real > & _sqrt_effective_stiffness
Square root of effective stiffness of element.
virtual void computeQpProperties()
const Real _desired_time_step
User-prescribed desired time step.
DensityScaling(const InputParameters &parameters)
MaterialProperty< Real > & _density_scaled
The scaled density.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
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)
unsigned int _qp
static InputParameters validParams()
const Elem *const & _current_elem