Skip to content

Commit

Permalink
improving coverage for ConcreteExpansionEigenstrainBase (ref idaholab…
Browse files Browse the repository at this point in the history
  • Loading branch information
jain651 authored and jain651 committed Dec 3, 2021
1 parent c4328fc commit c5ebc34
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 54 deletions.
4 changes: 2 additions & 2 deletions src/materials/ConcreteASREigenstrain.C
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ ConcreteASREigenstrain::computeResidual(unsigned qp, Real scalar)
{
f = 1.0 + _alpha * I_sigma / (3.0 * -_f_compress);
if (f < 1.0)
mooseError("Wrong retardation for ASR latency time calculation!");
mooseAssert("f < 1.0", "Wrong retardation for ASR latency time calculation!");
}
}
else
Expand Down Expand Up @@ -302,7 +302,7 @@ ConcreteASREigenstrain::computeDerivative(unsigned qp, Real scalar)
{
f = 1.0 + _alpha * I_sigma / (3.0 * -_f_compress);
if (f < 1.0)
mooseError("Wrong retardation for ASR latency time calculation!");
mooseAssert("f < 1.0", "Wrong retardation for ASR latency time calculation!");
}
}
else
Expand Down
29 changes: 20 additions & 9 deletions src/materials/ConcreteExpansionEigenstrainBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ ConcreteExpansionEigenstrainBase::ConcreteExpansionEigenstrainBase(
if (_expansion_type == ExpansionType::Anisotropic)
{
if (!parameters.isParamSetByUser("compressive_strength"))
paramError("compressive_strength", "parameter is required for expansion_type = Anisotropic");
paramError("compressive_strength",
"compressive_strength is required for expansion_type = Anisotropic");
if (!parameters.isParamSetByUser("expansion_stress_limit"))
paramError("expansion_stress_limit",
"parameter is required for expansion_type = Anisotropic");
"expansion_stress_limit is required for expansion_type = Anisotropic");
if (!parameters.isParamSetByUser("tensile_strength"))
paramError("tensile_strength", "parameter is required for expansion_type = Anisotropic");
paramError("tensile_strength",
"tensile_strength is required for expansion_type = Anisotropic");
}

// Initialize triaxial weight table
Expand Down Expand Up @@ -172,10 +174,13 @@ ConcreteExpansionEigenstrainBase::findNeighborIndex(Real sig)
return 2;
else if (sig > -_sigma_u && sig <= 0)
return 1;
else if (sig > 0)
return 0;
else
mooseError("Invalid value for sig.");
return 0;
// else if (sig > 0)
// return 0;
// else
// mooseAssert("Invalid value for sig.");
mooseAssert("sig not real", "sig not real");
}

Real
Expand All @@ -189,10 +194,16 @@ ConcreteExpansionEigenstrainBase::computeAB(const Real ab1,
ab = ab1;
else if (pbound == 1)
ab = ab2;
else if (pbound == 2)
ab = ab3;
else
mooseError("Invalid value for pbound. Got ", pbound, ", expected 0, 1, or 2.");
ab = ab3;

// else if (pbound == 2)
// ab = ab3;
// else
// mooseAssert("Invalid value for pbound. Got ", pbound, ", expected 0, 1, or 2.");

// mooseAssert("pbound > 2 or pbound < 0", "pbound can only be 0 1 2");

return ab;
}

Expand Down
18 changes: 16 additions & 2 deletions test/tests/concrete_ASR_swelling/tests
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
custom_cmp = 'asr_confined.cmp'
detail = 'with anisotropic expansion strains, '
[]

[test_strip_isotropic]
type = 'Exodiff'
input = 'asr_confined.i'
Expand All @@ -24,7 +23,12 @@
custom_cmp = 'asr_confined.cmp'
detail = 'with isotropic expansion strains, '
[]

[test_strip_in_tension]
type = 'RunApp'
input = 'asr_confined.i'
cli_args = 'BCs/axial_load/value=10e6 '
detail = 'with uniaxial tenile loading, '
[]
[test_full]
type = 'Exodiff'
input = 'asr_confined.i'
Expand All @@ -36,4 +40,14 @@
detail = 'and with a mesh that captures a larger axial region of the cylinder.'
[]
[]
[ASR_swelling_error_check]
requirement = 'Blackbear shall produce an error message when number of iterations exceeds max_its during the volumeteric strain residual calculation '
[max_it_error]
type = 'RunException'
input = 'asr_confined.i'
max_time = 5
cli_args = 'Materials/ASR_expansion/max_its=2 Materials/ASR_expansion/_output_iteration_info_on_error=true Materials/ASR_expansion/_output_iteration_info=true'
expect_err = "Max material iteration hit during nonlinear constitutive model solve!"
[]
[]
[]
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@
boundary = back
value = 0
[../]

[./load_x]
type = NeumannBC
variable = disp_x
Expand All @@ -199,28 +198,21 @@
[stress]
type = ComputeLinearElasticStress
[]

[./concrete]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 30e9
poissons_ratio = 0.2
[../]

[./strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
eigenstrain_names = 'concrete_expansion'
[../]

[concrete_expansion]
type = TestConcreteExpansionEigenstrain
expansion_type = Anisotropic
function = expansion_vs_time
eigenstrain_name = concrete_expansion

compressive_strength = 30e6
tensile_strength = 3e6
expansion_stress_limit = 10e6
[]
[]

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
time,expansion_strain_xx,expansion_strain_yy,expansion_strain_zz,expansion_vol_strain,strain_xx,strain_yy,strain_zz,stress_xx,stress_yy,stress_zz
0,0,0,0,0,0,0,0,0,0,0
0.0001,0,0,0,0,-0.0016655568500029,0.00033311137000059,0.00033311137000059,-49966705.500088,1.1641532182693e-09,1.3969838619232e-09
0.0002,4.0407154020135e-37,5e-05,5e-05,0.0001,-0.0016653904730541,0.00038307809461086,0.00038307809461086,-49961714.191624,1.1996598914266e-06,1.2002419680357e-06
0.0003,8.8894966257367e-37,0.0001,0.0001,0.0002,-0.0016652241210173,0.00043304482420349,0.00043304482420349,-49956723.630519,1.1994270607829e-06,1.1990778148174e-06
0.0004,3.5254263760279e-36,0.00015,0.00015,0.0003,-0.0016650577938874,0.00048301155877751,0.00048301155877751,-49951733.816622,1.2001255527139e-06,1.200707629323e-06
0.0005,4.3078694856466e-36,0.0002,0.0002,0.0004,-0.0016648914916595,0.00053297829833194,0.00053297829833194,-49946744.749786,1.1991360224783e-06,1.1972151696682e-06
0.0006,5.0447289533329e-36,0.00025,0.00025,0.0005,-0.0016647252143287,0.00058294504286576,0.00058294504286576,-49941756.42986,1.2006494216621e-06,1.2002419680357e-06
0.0007,6.0356005287523e-36,0.0003,0.0003,0.0006,-0.0016645589618899,0.000632911792378,0.000632911792378,-49936768.856696,1.2008240446448e-06,1.1993106454611e-06
0.0008,7.1415772009698e-36,0.00035,0.00035,0.0007,-0.0016643927343382,0.00068287854686766,0.00068287854686766,-49931782.030144,1.2018135748804e-06,1.2016389518976e-06
0.0009,7.9626511844921e-36,0.0004,0.0004,0.0008,-0.0016642265316686,0.00073284530633375,0.00073284530633375,-49926795.950057,1.1936645023525e-06,1.1934898793697e-06
0.001,8.7016754749121e-36,0.00045,0.00045,0.0009,-0.0016640603538762,0.00078281207077527,0.00078281207077527,-49921810.616285,1.1992524378002e-06,1.1960510164499e-06
0.0011,9.8374790946429e-36,0.0005,0.0005,0.001,-0.001663894200956,0.00083277884019123,0.00083277884019123,-49916826.028679,1.2004747986794e-06,1.1988449841738e-06
93 changes: 73 additions & 20 deletions test/tests/concrete_anisotropic_eigenstrain/tests
Original file line number Diff line number Diff line change
Expand Up @@ -12,73 +12,126 @@
input = 'concrete_anisotropic_eigenstrain.i'
csvdiff = 'concrete_free_expansion_out.csv'
abs_zero = 1e-5
cli_args = 'Outputs/file_base=concrete_free_expansion_out'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6
Outputs/file_base=concrete_free_expansion_out'
allow_test_objects = True
detail = 'under free expansion conditions, '
[]

[concrete_expansion_load_5]
type = 'CSVDiff'
input = 'concrete_anisotropic_eigenstrain.i'
csvdiff = 'concrete_expansion_load_5_out.csv'
abs_zero = 1e-5
cli_args = 'BCs/load_x/value=-5e6 Outputs/file_base=concrete_expansion_load_5_out'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6
BCs/load_x/value=-5e6
Outputs/file_base=concrete_expansion_load_5_out'
allow_test_objects = True
detail = 'with a 5 MPa compressive pressure in the x direction, '
[]

[concrete_expansion_load_10]
[concrete_expansion_load_50]
type = 'CSVDiff'
input = 'concrete_anisotropic_eigenstrain.i'
csvdiff = 'concrete_expansion_load_10_out.csv'
csvdiff = 'concrete_expansion_load_50_out.csv'
abs_zero = 1e-5
cli_args = 'BCs/load_x/value=-10e6 Outputs/file_base=concrete_expansion_load_10_out'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6
BCs/load_x/value=-50e6
Outputs/file_base=concrete_expansion_load_50_out'
allow_test_objects = True
detail = 'with a 10 MPa compressive pressure in the x direction, '
detail = 'with a 50 MPa compressive pressure in the x direction, '
[]

[concrete_expansion_load_5_5]
type = 'CSVDiff'
input = 'concrete_anisotropic_eigenstrain.i'
csvdiff = 'concrete_expansion_load_5_5_out.csv'
abs_zero = 1e-5
cli_args = 'BCs/load_x/value=-5e6 BCs/load_y/value=-5e6 '
'Outputs/file_base=concrete_expansion_load_5_5_out'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6
BCs/load_x/value=-5e6
BCs/load_y/value=-5e6
Outputs/file_base=concrete_expansion_load_5_5_out'
allow_test_objects = True
detail = 'with 5 MPa compressive pressure in the x and y directions, '
[]

[concrete_expansion_load_10_10]
type = 'CSVDiff'
input = 'concrete_anisotropic_eigenstrain.i'
csvdiff = 'concrete_expansion_load_10_10_out.csv'
abs_zero = 1e-6
cli_args = 'BCs/load_x/value=-10e6 BCs/load_y/value=-10e6 '
'Outputs/file_base=concrete_expansion_load_10_10_out'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6
BCs/load_x/value=-10e6
BCs/load_y/value=-10e6
Outputs/file_base=concrete_expansion_load_10_10_out'
allow_test_objects = True
detail = 'with 10 MPa compressive pressure in the x and y directions, '
[]

[concrete_expansion_load_5_5_5]
type = 'CSVDiff'
input = 'concrete_anisotropic_eigenstrain.i'
csvdiff = 'concrete_expansion_load_5_5_5_out.csv'
abs_zero = 1e-6
cli_args = 'BCs/load_x/value=-5e6 BCs/load_y/value=-5e6 BCs/load_z/value=-5e6 '
'Outputs/file_base=concrete_expansion_load_5_5_5_out'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6
BCs/load_x/value=-5e6
BCs/load_y/value=-5e6
BCs/load_z/value=-5e6
Outputs/file_base=concrete_expansion_load_5_5_5_out'
allow_test_objects = True
detail = 'with 5 MPa compressive pressure in the x, y, and z directions, '
[]

[concrete_expansion_load_10_10_10]
type = 'CSVDiff'
input = 'concrete_anisotropic_eigenstrain.i'
csvdiff = 'concrete_expansion_load_10_10_10_out.csv'
abs_zero = 1e-6
cli_args = 'BCs/load_x/value=-10e6 BCs/load_y/value=-10e6 BCs/load_z/value=-10e6 '
'Outputs/file_base=concrete_expansion_load_10_10_10_out'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6
BCs/load_x/value=-10e6
BCs/load_y/value=-10e6
BCs/load_z/value=-10e6
Outputs/file_base=concrete_expansion_load_10_10_10_out'
allow_test_objects = True
detail = 'and with 10 MPa compressive pressure in the x, y, and z directions.'
[]
[]
[error_message_check]
requirement = 'Blackbear shall produce an error message when parameter(s) required for the anisotropic expansion_type are not set by user:'
[compressive_strength]
type = 'RunException'
input = 'concrete_anisotropic_eigenstrain.i'
cli_args = 'Materials/concrete_expansion/tensile_strength=3e6
Materials/concrete_expansion/expansion_stress_limit=10e6'
expect_err = "compressive_strength is required for expansion_type = Anisotropic"
allow_test_objects = True
detail = "Anisotropic expansion_type shall generate error if compressive_strength is not set by user."
[]
[expansion_stress_limit]
type = 'RunException'
input = 'concrete_anisotropic_eigenstrain.i'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/tensile_strength=3e6'
expect_err = "expansion_stress_limit is required for expansion_type = Anisotropic"
allow_test_objects = True
detail = "Anisotropic expansion_type shall generate error if expansion_stress_limit is not set by user."
[]
[tensile_strength]
type = 'RunException'
input = 'concrete_anisotropic_eigenstrain.i'
cli_args = 'Materials/concrete_expansion/compressive_strength=30e6
Materials/concrete_expansion/expansion_stress_limit=10e6'
expect_err = "tensile_strength is required for expansion_type = Anisotropic"
allow_test_objects = True
detail = "Anisotropic expansion_type shall generate error if tensile_strength is not set by user."
[]
[]
[]

0 comments on commit c5ebc34

Please sign in to comment.