Skip to content

Commit

Permalink
Merge pull request idaholab#4666 from dschwen/limith_4665
Browse files Browse the repository at this point in the history
Limit SwitchingFunctionMaterial
  • Loading branch information
Michael Tonks committed Feb 12, 2015
2 parents daab12f + 296ee1b commit c609ef9
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions modules/phase_field/src/materials/SwitchingFunctionMaterial.C
Expand Up @@ -21,22 +21,21 @@ SwitchingFunctionMaterial::SwitchingFunctionMaterial(const std::string & name,
void
SwitchingFunctionMaterial::computeQpProperties()
{
Real n = _eta[_qp];
n = n>1 ? 1 : (n<0 ? 0 : n);

switch (_h_order)
{
case 0: // SIMPLE
_prop_f[_qp] = 3.0 * _eta[_qp]*_eta[_qp]
- 2.0 * _eta[_qp]*_eta[_qp]*_eta[_qp];
_prop_df[_qp] = 6.0 * _eta[_qp]
- 6.0 * _eta[_qp]*_eta[_qp];
_prop_d2f[_qp] = 6.0 - 12.0 * _eta[_qp];
_prop_f[_qp] = 3.0 * n*n - 2.0 * n*n*n;
_prop_df[_qp] = 6.0 * n - 6.0 * n*n;
_prop_d2f[_qp] = 6.0 - 12.0 * n;
break;

case 1: // HIGH
_prop_f[_qp] = _eta[_qp]*_eta[_qp]*_eta[_qp]
* (6.0 * _eta[_qp]*_eta[_qp] - 15.0 * _eta[_qp] + 10.0);
_prop_df[_qp] = 30.0 * _eta[_qp]*_eta[_qp]
* (_eta[_qp]*_eta[_qp] - 2.0 * _eta[_qp] + 1.0);
_prop_d2f[_qp] = _eta[_qp] * (120.0 * _eta[_qp]*_eta[_qp] - 180.0 * _eta[_qp] + 60.0);
_prop_f[_qp] = n*n*n * (6.0 * n*n - 15.0 * n + 10.0);
_prop_df[_qp] = 30.0 * n*n * (n*n - 2.0 * n + 1.0);
_prop_d2f[_qp] = n * (120.0 * n*n - 180.0 * n + 60.0);
break;

default:
Expand Down

0 comments on commit c609ef9

Please sign in to comment.