-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25203 from BoZeng1997/strainenergydensity_stressname
Allow user-defined stress name in StrainEnergyDensity
- Loading branch information
Showing
5 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
modules/tensor_mechanics/test/tests/strain_energy_density/gold/tot_model_stress_name_out.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
time,epxx,epyy,epzz,sigxx,sigyy,sigzz,test_SED | ||
0,0,0,0,0,0,0,0 | ||
1,-1.2999983100025e-06,3.0333293900057e-06,0,-3.8440362004621e-12,99.999870000185,29.999961000054,-6.4999915499772e-05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 153 additions & 0 deletions
153
modules/tensor_mechanics/test/tests/strain_energy_density/tot_model_stress_name.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
# Single element test to check the strain energy density calculation | ||
|
||
[GlobalParams] | ||
displacements = 'disp_x disp_y' | ||
volumetric_locking_correction = true | ||
[] | ||
|
||
[Mesh] | ||
type = GeneratedMesh | ||
dim = 2 | ||
nx = 1 | ||
ny = 1 | ||
xmin = 0 | ||
xmax = 1 | ||
ymin = 0 | ||
ymax = 2 | ||
[] | ||
|
||
[AuxVariables] | ||
[SED] | ||
order = CONSTANT | ||
family = MONOMIAL | ||
[] | ||
[] | ||
|
||
[Functions] | ||
[rampConstantUp] | ||
type = PiecewiseLinear | ||
x = '0. 1.' | ||
y = '0. 1.' | ||
scale_factor = -100 | ||
[] | ||
[] | ||
|
||
[Modules/TensorMechanics/Master] | ||
[master] | ||
strain = SMALL | ||
add_variables = true | ||
incremental = false | ||
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress strain_xx strain_yy strain_zz' | ||
planar_formulation = PLANE_STRAIN | ||
[] | ||
[] | ||
|
||
[AuxKernels] | ||
[SED] | ||
type = MaterialRealAux | ||
variable = SED | ||
property = strain_energy_density | ||
execute_on = timestep_end | ||
[] | ||
[] | ||
|
||
[BCs] | ||
[no_x] | ||
type = DirichletBC | ||
variable = disp_x | ||
boundary = 'left' | ||
value = 0.0 | ||
[] | ||
[no_y] | ||
type = DirichletBC | ||
variable = disp_y | ||
boundary = 'bottom' | ||
value = 0.0 | ||
[] | ||
[Pressure] | ||
[top] | ||
boundary = 'top' | ||
function = rampConstantUp | ||
[] | ||
[] | ||
[] | ||
|
||
[Materials] | ||
[elasticity_tensor] | ||
type = ComputeIsotropicElasticityTensor | ||
youngs_modulus = 30e+6 | ||
poissons_ratio = 0.3 | ||
[] | ||
[elastic_stress] | ||
type = ComputeLinearElasticStress | ||
[] | ||
[tensor] | ||
type = GenericConstantRankTwoTensor | ||
tensor_name = test_stress | ||
tensor_values = '100 0 0 100 0 0 0 0 0' | ||
[] | ||
[strain_energy_density] | ||
type = StrainEnergyDensity | ||
incremental = false | ||
stress_name = 'test_stress' | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Transient | ||
|
||
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter' | ||
petsc_options_value = '201 hypre boomeramg 4' | ||
|
||
line_search = 'none' | ||
|
||
l_max_its = 50 | ||
nl_max_its = 20 | ||
nl_abs_tol = 3e-7 | ||
nl_rel_tol = 1e-12 | ||
l_tol = 1e-2 | ||
|
||
start_time = 0.0 | ||
dt = 1 | ||
|
||
end_time = 1 | ||
num_steps = 1 | ||
[] | ||
|
||
[Postprocessors] | ||
[epxx] | ||
type = ElementalVariableValue | ||
variable = strain_xx | ||
elementid = 0 | ||
[] | ||
[epyy] | ||
type = ElementalVariableValue | ||
variable = strain_yy | ||
elementid = 0 | ||
[] | ||
[epzz] | ||
type = ElementalVariableValue | ||
variable = strain_zz | ||
elementid = 0 | ||
[] | ||
[sigxx] | ||
type = ElementAverageValue | ||
variable = stress_xx | ||
[] | ||
[sigyy] | ||
type = ElementAverageValue | ||
variable = stress_yy | ||
[] | ||
[sigzz] | ||
type = ElementAverageValue | ||
variable = stress_zz | ||
[] | ||
[test_SED] | ||
type = ElementAverageValue | ||
variable = SED | ||
[] | ||
[] | ||
|
||
[Outputs] | ||
csv = true | ||
[] |