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 5d4a60b
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 18 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
24 changes: 12 additions & 12 deletions src/materials/ConcreteThermalMoisture.C
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ConcreteThermalMoisture::validParams()
params.addParam<MooseEnum>(
"cement_type", cement_type, "cement type input for moisture capacity calculations");
params.addParam<MooseEnum>(
"aggregate_pore_type", aggregate_pore_type, "aggregate pore structure");
"aggregate_pore_type", aggregate_pore_type, "aggregate pore structure");

MooseEnum moisture_diffusivity_model("Bazant Xi Mensi", "Bazant");
params.addParam<MooseEnum>(
Expand Down Expand Up @@ -295,7 +295,7 @@ ConcreteThermalMoisture::computeProperties()
break;

default:
mooseError("Unknown aggregate types");
mooseAssert(false, "Unknown aggregate types");
break;
}
break;
Expand Down Expand Up @@ -340,7 +340,7 @@ ConcreteThermalMoisture::computeProperties()
break;

default:
mooseError("Unknown aggregate types");
mooseAssert(false, "Unknown aggregate types");
break;
}
break;
Expand Down Expand Up @@ -373,7 +373,7 @@ ConcreteThermalMoisture::computeProperties()
break;

default:
mooseError("Unknown thermal capacity model");
mooseAssert(false, "Unknown thermal capacity model");
break;
}

Expand Down Expand Up @@ -403,7 +403,7 @@ ConcreteThermalMoisture::computeProperties()
break;

default:
mooseError("Unknown aggregate types");
mooseAssert(false, "Unknown aggregate types");
break;
}
break;
Expand All @@ -428,7 +428,7 @@ ConcreteThermalMoisture::computeProperties()
break;

default:
mooseError("Unknown aggregate types");
mooseAssert(false, "Unknown aggregate types");
break;
}
break;
Expand All @@ -452,7 +452,7 @@ ConcreteThermalMoisture::computeProperties()
break;

default:
mooseError("Unknown thermal conductivity model");
mooseAssert(false, "Unknown thermal conductivity model");
break;
}

Expand Down Expand Up @@ -492,7 +492,7 @@ ConcreteThermalMoisture::computeProperties()
N_ct = 1.5;
break;
default:
mooseError("Unknown cement type in mositure capacity calculations");
mooseAssert(false, "Unknown cement type in mositure capacity calculations");
break;
}

Expand Down Expand Up @@ -532,7 +532,7 @@ ConcreteThermalMoisture::computeProperties()
V_ct = 0.6;
break;
default:
mooseError("Unknown cement type in mositure capacity calculations");
mooseAssert(false, "Unknown cement type in mositure capacity calculations");
break;
}

Expand Down Expand Up @@ -567,7 +567,7 @@ ConcreteThermalMoisture::computeProperties()
n_agg = 2.0;
break;
default:
mooseError("unknown aggregate pore sturtures");
mooseAssert(false, "Unknown aggregate pore structure");
break;
}

Expand All @@ -588,7 +588,7 @@ ConcreteThermalMoisture::computeProperties()
V_agg = 0.10;
break;
default:
mooseError("unknown aggregate pore sturtures");
mooseAssert(false, "Unknown aggregate pore structure");
break;
}

Expand Down Expand Up @@ -661,7 +661,7 @@ ConcreteThermalMoisture::computeProperties()
Dh0 = A * std::exp(B * C1);
break;
default:
mooseError("unknown moisture diffusivity models");
mooseAssert(false, "Unknown moisture diffusivity model");
break;
}

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="1 1 1 1 1 1 1 1 1"'
allow_test_objects = True
requirement = 'The ConcreteExpansionMicrocrackingDamage model shall generate an error if used with a material that is not guaranteed isotropic'
[]
[]
11 changes: 9 additions & 2 deletions test/tests/concrete_sulfide_attack/tests
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
[Tests]
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'
[]
[]
7 changes: 7 additions & 0 deletions test/tests/mazars_damage/tests
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@
detail = 'and in compression.'
[]
[]
[mazars_damage_isotropic_error]
type = 'RunException'
input = 'mazars.i'
expect_err = 'MazarsDamage requires that the elasticity tensor be guaranteed isotropic'
cli_args = 'Materials/inactive=elasticity Materials/aniso/type=ComputeElasticityTensor Materials/aniso/fill_methode=orthotropic Materials/aniso/C_ijkl="1 1 1 1 1 1 1 1 1"'
requirement = 'The MazarsDamage model shref #210all generate an error if used with a material that is not guaranteed isotropic'
[]
[]

0 comments on commit 5d4a60b

Please sign in to comment.