Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
40 changes: 40 additions & 0 deletions examples/single/implicit-dynamic-solid/pressure-bc-can/can.jou
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
reset
logging off
${set_warning_count(0)}

${radius_large = 0.5}
${height_large = 2.0}
${radius_small = 0.3}
${height_small = 1.8}
${h = 0.1}
${intervals = 10}

# volume 1
create cylinder radius {radius_large} z {height_large}
webcut volume 1 cylinder radius {radius_small} axis z
delete volume 2
create cylinder radius {radius_large} z {height_large - height_small}
move volume 3 z {height_large/2 + 0.1} include_merged
create cylinder radius {radius_large} z {height_large - height_small}
move volume 4 z {-height_large/2 - 0.1} include_merged
merge volume all
unite volume 1 3 4
volume all scheme tetmesh
volume all size {h}
volume all sizing function constant
mesh volume all
block 1 volume all
#block 1 element type tetra10
block 1 name "can"
nodeset 1 surface 12
nodeset 1 name "top"
nodeset 2 surface 14
nodeset 2 name "bottom"
sideset 1 surface 4 16 17
sideset 1 name "interior_ss"
set large exodus file off
export mesh "can.g" overwrite




52 changes: 52 additions & 0 deletions examples/single/implicit-dynamic-solid/pressure-bc-can/can.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
type: single
input mesh file: can.g
output mesh file: can.e
Exodus output interval: 1
CSV output interval: 0
model:
type: solid mechanics
material:
blocks:
can: elastic
elastic:
model: neohookean
elastic modulus: 200.0e+09
Poisson's ratio: 0.25
density: 7800.0
time integrator:
type: Newmark
initial time: 0.0
final time: 10.0
time step: 1.0
β: 0.25
γ: 0.5
boundary conditions:
Dirichlet:
- node set: top
component: x
function: "0.0"
- node set: top
component: y
function: "0.0"
- node set: top
component: z
function: "0.0"
- node set: bottom
component: x
function: "0.0"
- node set: bottom
component: y
function: "0.0"
- node set: bottom
component: z
function: "0.0"
Neumann pressure:
- side set: interior_ss
function: "-1.0e+08 * t"
solver:
type: Hessian minimizer
step: full Newton
minimum iterations: 1
maximum iterations: 16
relative tolerance: 1.0e-10
absolute tolerance: 1.0e-06
Binary file not shown.
26 changes: 26 additions & 0 deletions examples/single/implicit-dynamic-solid/pressure-bc-expand/cube.jou
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## /usr/local/cubit-14.1/bin/clarox
## Cubit Version 14.1
## Cubit Build 389326
## Revised 2013-11-07 16:00:31 -0700 (Thu, 07 Nov 2013)
## Running 03/13/2014 03:10:55 PM
## Command Options:
## -warning = On
## -information = On
undo on
create brick x 1.0 y 1.0 z 1.0
#volume 1 size 0.125
#volume 1 size 0.5
volume 1 size 1.0
mesh volume 1
block 1 volume 1
block 1 name "fine"
nodeset 1 surface 4
nodeset 2 surface 6
nodeset 3 surface 3
nodeset 4 surface 5
nodeset 5 surface 2
nodeset 6 surface 1
sideset 1 surface 1 2 3 4 5 6
sideset 1 name "all"
set large exodus file off
export mesh "cube-pnbc.g" overwrite
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
type: single
input mesh file: cube.g
output mesh file: cube.e
Exodus output interval: 1
CSV output interval: 0
model:
type: solid mechanics
material:
blocks:
fine: elastic
elastic:
model: linear elastic
elastic modulus: 1.0e+09
Poisson's ratio: 0.25
density: 1000.0
time integrator:
type: Newmark
initial time: 0.0
final time: 10.0
time step: 1.0
β: 0.25
γ: 0.5
boundary conditions:
Neumann pressure:
- side set: all
function: "1.0e+08 * t"
solver:
type: Hessian minimizer
step: full Newton
minimum iterations: 1
maximum iterations: 16
relative tolerance: 1.0e-10
absolute tolerance: 1.0e-06
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
${side = 1.0}
${h_size = 0.5}

create brick x {side} y {side} z {side}
volume all size {h_size}
mesh volume all
block 1 volume 1
block 1 name "cube"
nodeset 1 surface with x_coord < 0
nodeset 1 name "nsx-"
nodeset 2 surface with x_coord > 0
nodeset 2 name "nsx+"
nodeset 3 surface with y_coord < 0
nodeset 3 name "nsy-"
nodeset 4 surface with y_coord > 0
nodeset 4 name "nsy+"
nodeset 5 surface with z_coord < 0
nodeset 5 name "nsz-"
nodeset 6 surface with z_coord > 0
nodeset 6 name "nsz+"
sideset 1 surface with x_coord < 0
sideset 1 name "ssx-"
sideset 2 surface with x_coord > 0
sideset 2 name "ssx+"
sideset 3 surface with y_coord < 0
sideset 3 name "ssy-"
sideset 4 surface with y_coord < 0
sideset 4 name "ssy+"
sideset 5 surface with z_coord < 0
sideset 5 name "ssz-"
sideset 6 surface with z_coord > 0
sideset 6 name "ssz+"
set large exodus file off
export mesh "cube.g" overwrite
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
type: single
input mesh file: cube.g
output mesh file: cube.e
Exodus output interval: 1
CSV output interval: 0
model:
type: solid mechanics
material:
blocks:
cube: elastic
elastic:
model: linear elastic
elastic modulus: 1.0e+09
Poisson's ratio: 0.25
density: 1000.0
time integrator:
type: Newmark
initial time: 0.0
final time: 1.0
time step: 0.1
β: 0.25
γ: 0.5
boundary conditions:
Dirichlet:
- node set: nsx-
component: x
function: "0.0"
- node set: nsy-
component: y
function: "0.0"
- node set: nsz-
component: z
function: "0.0"
Neumann pressure:
- side set: ssz+
function: "1.0e9 * t"
solver:
type: Hessian minimizer
step: full Newton
minimum iterations: 1
maximum iterations: 16
relative tolerance: 1.0e-10
absolute tolerance: 1.0e-06
3 changes: 1 addition & 2 deletions src/interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ function get_side_set_nodal_pressure(nodal_coord::Matrix{Float64}, pressure_fun:
point_coord = nodal_coord * Nₚ
txzy = (time, point_coord[1], point_coord[2], point_coord[3])
pressure_val = pressure_fun(txzy...)
nodal_force_component_vector = LinearAlgebra.kron(pressure_val * Nₚ * j * wₚ, normal)
nodal_force_component += reshape(nodal_force_component_vector, (3, num_side_nodes))
nodal_force_component += normal * (pressure_val * Nₚ * j * wₚ)'
end
return nodal_force_component
end
Expand Down
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ const indexed_test_files = [
(40, "schwarz-ahead-nonoverlap-dynamic-plate.jl"),
(41, "schwarz-ahead-nonoverlap-dynamic-bracket.jl"),
(42, "single-static-solid-pressure-bc.jl"),
(43, "utils.jl"), # Must go last due to FPE traps
(43, "single-implicit-dynamic-solid-cube-pressure-nbc-stretch.jl"),
(44, "single-implicit-dynamic-solid-cube-pressure-nbc-expand.jl"),
(45, "single-implicit-dynamic-solid-can-pressure-nbc.jl"),
(46, "utils.jl"), # Must go last due to FPE traps
]

# Extract test file names
Expand Down
26 changes: 26 additions & 0 deletions test/single-implicit-dynamic-solid-can-pressure-nbc.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Norma: Copyright 2025 National Technology & Engineering Solutions of
# Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS,
# the U.S. Government retains certain rights in this software. This software
# is released under the BSD license detailed in the file license.txt in the
# top-level Norma.jl directory.
@testset "Single Implicit Dynamic Solid Can Pressure BC" begin
cp("../examples/single/implicit-dynamic-solid/pressure-bc-can/can.yaml", "can.yaml"; force=true)
cp("../examples/single/implicit-dynamic-solid/pressure-bc-can/can.g", "can.g"; force=true)
simulation = Norma.run("can.yaml")
integrator = simulation.integrator
model = simulation.model
rm("can.yaml")
rm("can.g")
rm("can.e")
avg_disp = average_components(integrator.displacement)
avg_stress = average_components(model.stress)
@test avg_disp[1] ≈ 9.042916992588757e-6 atol = 1.0e-06
@test avg_disp[2] ≈ 1.1433688342508286e-5 atol = 1.0e-06
@test avg_disp[3] ≈ -7.136350840569688e-7 rtol = 1.0e-06
@test avg_stress[1] ≈ 3.6281556858938783e8 atol = 1.0e-06
@test avg_stress[2] ≈ 3.745392952723529e8 atol = 1.0e-06
@test avg_stress[3] ≈ 1.474209981070922e8 atol = 1.0e-06
@test avg_stress[4] ≈ -134646.4674700197 atol = 1.0e-06
@test avg_stress[5] ≈ 356235.66342965094 atol = 1.0e-06
@test avg_stress[6] ≈ 1.060198839489482e6 atol = 1.0e-06
end
26 changes: 26 additions & 0 deletions test/single-implicit-dynamic-solid-cube-pressure-nbc-expand.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Norma: Copyright 2025 National Technology & Engineering Solutions of
# Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS,
# the U.S. Government retains certain rights in this software. This software
# is released under the BSD license detailed in the file license.txt in the
# top-level Norma.jl directory.
@testset "Single Implicit Dynamic Solid Cube Pressure BC Expand" begin
cp("../examples/single/implicit-dynamic-solid/pressure-bc-expand/cube.yaml", "cube.yaml"; force=true)
cp("../examples/single/implicit-dynamic-solid/pressure-bc-expand/cube.g", "cube.g"; force=true)
simulation = Norma.run("cube.yaml")
integrator = simulation.integrator
model = simulation.model
rm("cube.yaml")
rm("cube.g")
rm("cube.e")
avg_disp = average_components(integrator.displacement)
avg_stress = average_components(model.stress)
@test avg_disp[1] ≈ 0.0 atol = 1.0e-06
@test avg_disp[2] ≈ 0.0 atol = 1.0e-06
@test avg_disp[3] ≈ -7.396860901565105e-15 rtol = 1.0e-06
@test avg_stress[1] ≈ 1.0000001666648064e9 atol = 1.0e-06
@test avg_stress[2] ≈ 1.0000001666648064e9 atol = 1.0e-06
@test avg_stress[3] ≈ 1.0000001666648064e9 atol = 1.0e-06
@test avg_stress[4] ≈ 0.0 atol = 1.0e-06
@test avg_stress[5] ≈ 0.0 atol = 1.0e-06
@test avg_stress[6] ≈ 0.0 atol = 1.0e-06
end
26 changes: 26 additions & 0 deletions test/single-implicit-dynamic-solid-cube-pressure-nbc-stretch.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Norma: Copyright 2025 National Technology & Engineering Solutions of
# Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS,
# the U.S. Government retains certain rights in this software. This software
# is released under the BSD license detailed in the file license.txt in the
# top-level Norma.jl directory.
@testset "Single Implicit Dynamic Solid Cube Pressure BC Stretch" begin
cp("../examples/single/implicit-dynamic-solid/pressure-bc-stretch/cube.yaml", "cube.yaml"; force=true)
cp("../examples/single/implicit-dynamic-solid/pressure-bc-stretch/cube.g", "cube.g"; force=true)
simulation = Norma.run("cube.yaml")
integrator = simulation.integrator
model = simulation.model
rm("cube.yaml")
rm("cube.g")
rm("cube.e")
avg_disp = average_components(integrator.displacement)
avg_stress = average_components(model.stress)
@test avg_disp[1] ≈ -0.1250304399154171 rtol = 1.0e-06
@test avg_disp[2] ≈ -0.12503043991541707 rtol = 1.0e-06
@test avg_disp[3] ≈ 0.5000809368243189 rtol = 1.0e-06
@test avg_stress[1] ≈ -32774.51499193255 atol = 1.0e-06
@test avg_stress[2] ≈ -32774.514991994016 atol = 1.0e-06
@test avg_stress[3] ≈ 1.00013184461106e9 rtol = 1.0e-03
@test avg_stress[4] ≈ 1433.1287287250655 atol = 1.0e-06
@test avg_stress[5] ≈ 1433.1287287160662 atol = 1.0e-06
@test avg_stress[6] ≈ -724.3872738532795 atol = 1.0e-06
end
2 changes: 1 addition & 1 deletion test/single-static-solid-pressure-bc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# the U.S. Government retains certain rights in this software. This software
# is released under the BSD license detailed in the file license.txt in the
# top-level Norma.jl directory.
@testset "Single Static Solid Pressure Neumann Bc" begin
@testset "Single Static Solid Pressure Neumann BC" begin
cp("../examples/single/static-solid/pressure-bc/cube.yaml", "cube.yaml"; force=true)
cp("../examples/single/static-solid/pressure-bc/cube.g", "cube.g"; force=true)
simulation = Norma.run("cube.yaml")
Expand Down
Loading