Skip to content

Commit

Permalink
Add test for controlling the pressure action
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud committed Dec 23, 2024
1 parent 6a07108 commit dfdaab3
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 0 deletions.
Binary file not shown.
142 changes: 142 additions & 0 deletions modules/solid_mechanics/test/tests/pressure/pressure_control_test.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
[Mesh]
type = FileMesh
file = pressure_test.e
displacements = 'disp_x disp_y disp_z'
[]

[Functions]
[rampConstant]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 1. 1.'
scale_factor = 1.0
[]
[zeroRamp]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 0. 1.'
scale_factor = 1.0
[]
[rampUnramp]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 1. 0.'
scale_factor = 10.0
[]
[]

[Variables]
[disp_x]
order = FIRST
family = LAGRANGE
[]
[disp_y]
order = FIRST
family = LAGRANGE
[]
[disp_z]
order = FIRST
family = LAGRANGE
[]
[]

[Kernels]
[SolidMechanics]
displacements = 'disp_x disp_y disp_z'
[]
[]

[BCs]
[no_x]
type = DirichletBC
variable = disp_x
boundary = 4
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = 5
value = 0.0
[]
[no_z]
type = DirichletBC
variable = disp_z
boundary = 6
value = 0.0
[]
[Pressure]
[Side1]
boundary = 1
function = rampConstant
displacements = 'disp_x disp_y disp_z'
control_tags = 'tag_pressure'
[]
[Side2]
boundary = 2
function = zeroRamp
displacements = 'disp_x disp_y disp_z'
factor = 2.0
control_tags = 'tag_pressure'
[]
[Side3]
boundary = 3
function = rampUnramp
displacements = 'disp_x disp_y disp_z'
control_tags = 'tag_pressure'
[]
[]
[]

[Materials]
[Elasticity_tensor]
type = ComputeElasticityTensor
block = 1
fill_method = symmetric_isotropic
C_ijkl = '0 0.5e6'
[]
[strain]
type = ComputeSmallStrain
displacements = 'disp_x disp_y disp_z'
block = 1
[]
[stress]
type = ComputeLinearElasticStress
block = 1
[]
[]

[Controls]
# Turn Pressure on some boundaries for step 2, off at step 3
[pressure_crank]
type = TimePeriod
enable_objects = 'BCs/Pressure/Side1'
disable_objects = 'BCs/Pressure/Side2 BCs/Pressure/Side3'
start_time = 1
end_time = 2
# All Pressure are controlled outside of the period as well
reverse_on_false = true
[]
[]

[Executioner]
type = Transient
solve_type = PJFNK
nl_abs_tol = 1e-10
l_max_its = 20
start_time = 0.0
dt = 1.0
num_steps = 3
end_time = 2.0
[]

[Outputs]
[out]
type = Exodus
elemental_as_nodal = true
[]
[controls]
type = ControlOutput
show_active_objects = false
[]
[]

0 comments on commit dfdaab3

Please sign in to comment.