Skip to content

Commit

Permalink
Clean up errors and add error tests ref idaholab#210
Browse files Browse the repository at this point in the history
  • Loading branch information
bwspenc committed Apr 23, 2021
1 parent 0c19818 commit 02f1010
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/materials/ConcreteASREigenstrain.C
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ ConcreteASREigenstrain::ConcreteASREigenstrain(const InputParameters & parameter
else if (temperature_unit == "Kelvin")
_temp_offset = 0.0;
else
mooseError("Unsupported temperature unit");
mooseAssert(false, "Unsupported temperature unit");

// Convert input value of reference temperature to Kelvin
_ref_temp += _temp_offset;
Expand Down Expand Up @@ -271,7 +271,7 @@ ConcreteASREigenstrain::computeResidual(unsigned qp, Real scalar)
}
}
else
mooseError("Invalid expansion type");
mooseAssert(false, "Invalid expansion type");

// Convert current temperature to Kelvin
const Real T = _temperature[qp] + _temp_offset;
Expand Down Expand Up @@ -306,7 +306,7 @@ ConcreteASREigenstrain::computeDerivative(unsigned qp, Real scalar)
}
}
else
mooseError("Invalid expansion type");
mooseAssert(false, "Invalid expansion type");

// Convert current temperature to Kelvin
const Real T = _temperature[qp] + _temp_offset;
Expand Down
2 changes: 1 addition & 1 deletion src/materials/ConcreteExpansionEigenstrainBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ ConcreteExpansionEigenstrainBase::computeQpEigenstrain()
_eigenstrain[_qp] = _eigenstrain_old[_qp] + inc_weighted_strain;
}
else
mooseError("Invalid expansion type");
mooseAssert(false, "Invalid expansion type");
}

Real
Expand Down
8 changes: 8 additions & 0 deletions test/tests/concrete_expansion_microcracking/tests
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,12 @@
detail = 'and with a 10 MPa compressive pressure in the x, y, and z directions.'
[]
[]
[concrete_microcracking_damage_isotropic_error]
type = 'RunException'
input = 'concrete_expansion_microcracking.i'
expect_err = 'ConcreteExpansionMicrocrackingDamage requires that the elasticity tensor be guaranteed isotropic'
cli_args = 'Materials/inactive=concrete Materials/aniso/type=ComputeElasticityTensor Materials/aniso/fill_methode=orthotropic Materials/aniso/C_ijkl="2.0e5 2.0e5 2.0e5 0.71428571e5 0.71428571e5 0.71428571e5 0.4 0.4 0.4"'
allow_test_objects = True
requirement = 'The ConcreteExpansionMicrocrackingDamage model shall generate an error if used with a material that is not guaranteed isotropic'
[]
[]
1 change: 0 additions & 1 deletion test/tests/concrete_moisture_heat_transfer/tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
type = 'Exodiff'
input = 'maqbeth.i'
exodiff = 'maqbeth_out.e'
skip = 'temporary - avoid failure in debug tests'
[]
[]
8 changes: 8 additions & 0 deletions test/tests/concrete_sulfide_attack/tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
issues = '#171'
design = 'ConcreteThermalMoisture.md ReactionNetwork/index.md'
[./test]
[test]
type = 'Exodiff'
input = 'sulfide_attack.i'
exodiff = 'sulfide_attack_out.e'
requirement = 'Blackbear shall model the migration and reactions between chemical species involved in sulfide attack on concrete'
[]
[aqueous_speciations_syntax]
type = 'RunException'
input = 'sulfide_attack.i'
cli_args = 'ReactionNetwork/aqueous_speciations="(1.0)ca / (1.0)cl = (1.0)cacl -0.7"'
expect_err = 'Error parsing term: /'
requirement = 'The ReactionNetwork model shall generate an error if an incorrect form is provided for aqueous speciacions'
[../]
[]

0 comments on commit 02f1010

Please sign in to comment.