Advance V5 nonlinear benchmarks and shell solver

This commit is contained in:
shenw
2026-06-27 16:43:00 +08:00
parent a2a11179d9
commit db68340aaf
84 changed files with 38720 additions and 971 deletions
+40 -12
View File
@@ -1,18 +1,34 @@
# Thick Plate Pressure Smoke Case
# Thick Plate Pressure Benchmark
This folder contains the original NAFEMS LE10 thick-plate reference documents
plus a compact FemLite V4.8 smoke case:
This folder contains a FemLite NAFEMS LE10 thick-plate pressure benchmark based
on `models.sme.thick_plate.pdf`.
- `thick_plate_pressure_smoke.inp`
- `run_case.bat`
- `thick_plate_le10.inp`: generated C3D20 quarter-model benchmark deck.
- `generate_thick_plate_le10.py`: regenerates the benchmark deck.
- `check_thick_plate_results.py`: runs FemLite and checks the D-point stress.
- `run_case.bat`: convenience runner for the generated deck.
The reference benchmark is a quarter elliptical thick plate with an elliptical
hole, steel material, symmetry constraints and a 1 MPa pressure load on the top
surface. The included input keeps the same static thick-solid verification
intent in a small C3D8 quarter-plate surrogate: steel material, symmetry-plane
constraints, an outer support and equivalent nodal pressure loading in the
negative z direction. It is a regression entry for static solid pressure
response, not a full LE10 stress-concentration reproduction.
The PDF benchmark is a quarter elliptical thick plate with an elliptical hole:
- Inner ellipse semiaxes: a = 2.0 m, b = 1.0 m.
- Outer ellipse semiaxes: a = 3.25 m, b = 2.75 m.
- Thickness: 0.6 m, with two elements through thickness.
- Material: E = 210 GPa, nu = 0.3, density = 7850 kg/m3.
- Load: 1 MPa on the top surface in the negative z direction.
- Constraints: symmetry on x = 0 and y = 0, outer ellipse fixed in x and y,
and the outer-ellipse midplane edge fixed in z.
The generated FemLite deck uses 128 C3D20 elements. Because FemLite CSV output
stores element-average stresses, the checker recovers the C3D20 small-strain
stress directly from the solved displacement field at point D `(2, 0, 0.6)`.
Reference comparison:
| Quantity at D | Reference | Value |
|---|---:|---:|
| NAFEMS sigma_y | `models.sme.thick_plate.pdf` | -5.38 MPa |
| COMSOL sigma_y | `models.sme.thick_plate.pdf` | -5.72 MPa |
| FemLite recovered sigma_y | `thick_plate_le10.inp` | about -5.70 MPa |
Run:
@@ -21,3 +37,15 @@ run_case.bat
```
Results are written to `results\auto_run`.
Regenerate:
```powershell
Python\.venv\Scripts\python.exe examples\thick_plate\generate_thick_plate_le10.py
```
Check from the repository root:
```powershell
Python\.venv\Scripts\python.exe examples\thick_plate\check_thick_plate_results.py . build-win-gcc-16\femlite.exe build-win-gcc-16\example_benchmark\thick_plate_le10
```
@@ -0,0 +1,276 @@
from __future__ import annotations
import csv
import re
import shutil
import subprocess
import sys
from pathlib import Path
NAFEMS_S22_D = -5.38e6
def require(condition: bool, message: str) -> None:
if not condition:
raise AssertionError(message)
def parse_marker(text: str, name: str) -> int:
match = re.search(rf"{name}\s*=\s*(\d+)", text)
require(match is not None, f"missing {name} marker in input")
return int(match.group(1))
def clean_output(out_dir: Path) -> None:
out_dir.mkdir(parents=True, exist_ok=True)
for pattern in ("history.csv", "nodes_*.csv", "elements_*.csv", "reactions_*.csv", "result_*.vtk"):
for path in out_dir.glob(pattern):
path.unlink()
contact_dir = out_dir / "contact"
if contact_dir.exists():
shutil.rmtree(contact_dir)
def read_row_by_id(path: Path, key: str, value: int) -> dict[str, str]:
require(path.exists(), f"missing output: {path}")
with path.open(newline="", encoding="utf-8") as handle:
for row in csv.DictReader(handle):
if int(row[key]) == value:
return row
raise AssertionError(f"{path.name} does not contain {key}={value}")
def read_displacements(path: Path) -> dict[int, tuple[float, float, float]]:
require(path.exists(), f"missing output: {path}")
with path.open(newline="", encoding="utf-8") as handle:
return {
int(row["node_id"]): (float(row["ux"]), float(row["uy"]), float(row["uz"]))
for row in csv.DictReader(handle)
}
def read_reaction_sum(path: Path, field: str) -> float:
require(path.exists(), f"missing output: {path}")
with path.open(newline="", encoding="utf-8") as handle:
return sum(float(row[field]) for row in csv.DictReader(handle))
def parse_total_fz(text: str) -> float:
match = re.search(r"total_Fz=([+-]?\d+\.\d+E[+-]\d+)", text)
require(match is not None, "missing total_Fz marker in input")
return float(match.group(1))
def parse_input_mesh(path: Path) -> tuple[dict[int, tuple[float, float, float]], dict[int, list[int]]]:
nodes: dict[int, tuple[float, float, float]] = {}
elements: dict[int, list[int]] = {}
mode = ""
for raw_line in path.read_text(encoding="ascii").splitlines():
line = raw_line.strip()
if not line or line.startswith("**"):
continue
if line.startswith("*"):
upper = line.upper()
if upper.startswith("*NODE"):
mode = "node"
elif upper.startswith("*ELEMENT"):
mode = "element"
else:
mode = ""
continue
parts = [part.strip() for part in line.split(",") if part.strip()]
if mode == "node":
nodes[int(parts[0])] = (float(parts[1]), float(parts[2]), float(parts[3]))
elif mode == "element":
elements[int(parts[0])] = [int(part) for part in parts[1:]]
return nodes, elements
def shape_c3d20_derivatives(r: float, s: float, t: float) -> list[list[float]]:
dndr = [[0.0 for _ in range(20)] for _ in range(3)]
corners = (
(-1.0, -1.0, -1.0),
(1.0, -1.0, -1.0),
(1.0, 1.0, -1.0),
(-1.0, 1.0, -1.0),
(-1.0, -1.0, 1.0),
(1.0, -1.0, 1.0),
(1.0, 1.0, 1.0),
(-1.0, 1.0, 1.0),
)
for index, (xi, eta, zeta) in enumerate(corners):
ar = 1.0 + xi * r
bs = 1.0 + eta * s
ct = 1.0 + zeta * t
q = xi * r + eta * s + zeta * t - 2.0
dndr[0][index] = 0.125 * xi * bs * ct * (q + ar)
dndr[1][index] = 0.125 * eta * ar * ct * (q + bs)
dndr[2][index] = 0.125 * zeta * ar * bs * (q + ct)
def edge_xi(index: int, eta: float, zeta: float) -> None:
bs = 1.0 + eta * s
ct = 1.0 + zeta * t
dndr[0][index] = -0.5 * r * bs * ct
dndr[1][index] = 0.25 * (1.0 - r * r) * eta * ct
dndr[2][index] = 0.25 * (1.0 - r * r) * bs * zeta
def edge_eta(index: int, xi: float, zeta: float) -> None:
ar = 1.0 + xi * r
ct = 1.0 + zeta * t
dndr[0][index] = 0.25 * xi * (1.0 - s * s) * ct
dndr[1][index] = -0.5 * ar * s * ct
dndr[2][index] = 0.25 * ar * (1.0 - s * s) * zeta
def edge_zeta(index: int, xi: float, eta: float) -> None:
ar = 1.0 + xi * r
bs = 1.0 + eta * s
dndr[0][index] = 0.25 * xi * bs * (1.0 - t * t)
dndr[1][index] = 0.25 * ar * eta * (1.0 - t * t)
dndr[2][index] = -0.5 * ar * bs * t
edge_xi(8, -1.0, -1.0)
edge_eta(9, 1.0, -1.0)
edge_xi(10, 1.0, -1.0)
edge_eta(11, -1.0, -1.0)
edge_xi(12, -1.0, 1.0)
edge_eta(13, 1.0, 1.0)
edge_xi(14, 1.0, 1.0)
edge_eta(15, -1.0, 1.0)
edge_zeta(16, -1.0, -1.0)
edge_zeta(17, 1.0, -1.0)
edge_zeta(18, 1.0, 1.0)
edge_zeta(19, -1.0, 1.0)
return dndr
def invert3(matrix: list[list[float]]) -> tuple[list[list[float]], float]:
det = (
matrix[0][0] * (matrix[1][1] * matrix[2][2] - matrix[1][2] * matrix[2][1])
- matrix[0][1] * (matrix[1][0] * matrix[2][2] - matrix[1][2] * matrix[2][0])
+ matrix[0][2] * (matrix[1][0] * matrix[2][1] - matrix[1][1] * matrix[2][0])
)
require(abs(det) > 1.0e-16, "singular D-probe element Jacobian")
inv = [[0.0 for _ in range(3)] for _ in range(3)]
inv[0][0] = (matrix[1][1] * matrix[2][2] - matrix[1][2] * matrix[2][1]) / det
inv[0][1] = -(matrix[0][1] * matrix[2][2] - matrix[0][2] * matrix[2][1]) / det
inv[0][2] = (matrix[0][1] * matrix[1][2] - matrix[0][2] * matrix[1][1]) / det
inv[1][0] = -(matrix[1][0] * matrix[2][2] - matrix[1][2] * matrix[2][0]) / det
inv[1][1] = (matrix[0][0] * matrix[2][2] - matrix[0][2] * matrix[2][0]) / det
inv[1][2] = -(matrix[0][0] * matrix[1][2] - matrix[0][2] * matrix[1][0]) / det
inv[2][0] = (matrix[1][0] * matrix[2][1] - matrix[1][1] * matrix[2][0]) / det
inv[2][1] = -(matrix[0][0] * matrix[2][1] - matrix[0][1] * matrix[2][0]) / det
inv[2][2] = (matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]) / det
return inv, det
def recover_c3d20_stress_at_d(
element_nodes: list[int],
coords: dict[int, tuple[float, float, float]],
disp: dict[int, tuple[float, float, float]],
) -> tuple[float, list[float]]:
dndr = shape_c3d20_derivatives(-1.0, -1.0, 1.0)
jac = [[0.0 for _ in range(3)] for _ in range(3)]
for local, node_id in enumerate(element_nodes):
xyz = coords[node_id]
for i in range(3):
for j in range(3):
jac[i][j] += xyz[i] * dndr[j][local]
inv_jac, det_jac = invert3(jac)
require(det_jac > 0.0, f"D-probe element has non-positive Jacobian: {det_jac:.6E}")
dndx = [[0.0 for _ in range(20)] for _ in range(3)]
for local in range(20):
for i in range(3):
dndx[i][local] = sum(inv_jac[k][i] * dndr[k][local] for k in range(3))
strain = [0.0 for _ in range(6)]
for local, node_id in enumerate(element_nodes):
ux, uy, uz = disp[node_id]
strain[0] += dndx[0][local] * ux
strain[1] += dndx[1][local] * uy
strain[2] += dndx[2][local] * uz
strain[3] += dndx[1][local] * ux + dndx[0][local] * uy
strain[4] += dndx[2][local] * ux + dndx[0][local] * uz
strain[5] += dndx[2][local] * uy + dndx[1][local] * uz
young = 2.10e11
poisson = 0.30
lam = young * poisson / ((1.0 + poisson) * (1.0 - 2.0 * poisson))
mu = young / (2.0 * (1.0 + poisson))
trace = strain[0] + strain[1] + strain[2]
stress = [0.0 for _ in range(6)]
stress[0] = lam * trace + 2.0 * mu * strain[0]
stress[1] = lam * trace + 2.0 * mu * strain[1]
stress[2] = lam * trace + 2.0 * mu * strain[2]
stress[3] = mu * strain[3]
stress[4] = mu * strain[4]
stress[5] = mu * strain[5]
return stress[1], strain
def main() -> int:
if len(sys.argv) != 4:
raise SystemExit("usage: check_thick_plate_results.py REPO_ROOT FEMLITE_EXE OUTPUT_DIR")
repo = Path(sys.argv[1]).resolve()
femlite = Path(sys.argv[2]).resolve()
out_dir = Path(sys.argv[3]).resolve()
inp = repo / "examples" / "thick_plate" / "thick_plate_le10.inp"
text = inp.read_text(encoding="ascii")
require("smoke" not in text.lower(), "thick plate benchmark input still describes a smoke case")
require("NAFEMS LE10" in text, "input does not identify the LE10 benchmark")
d_node = parse_marker(text, "D_NODE")
d_probe = parse_marker(text, "D_PROBE_ELEMENT")
total_fz = parse_total_fz(text)
clean_output(out_dir)
completed = subprocess.run(
[
str(femlite),
str(inp),
"--static-linear",
"--output-dir",
str(out_dir),
"--output-interval",
"1",
],
cwd=repo,
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
print(completed.stdout)
if completed.returncode != 0:
raise RuntimeError(f"{femlite} exited with code {completed.returncode}")
node_row = read_row_by_id(out_dir / "nodes_00000001.csv", "node_id", d_node)
coords, elements = parse_input_mesh(inp)
displacements = read_displacements(out_dir / "nodes_00000001.csv")
s22, _strain = recover_c3d20_stress_at_d(elements[d_probe], coords, displacements)
uz = float(node_row["uz"])
reaction_z = read_reaction_sum(out_dir / "reactions_00000001.csv", "reaction_uz")
rel_error = abs((s22 - NAFEMS_S22_D) / NAFEMS_S22_D)
require(s22 < 0.0, f"D-near s22 should be compressive, got {s22:.6E}")
require(0.0 < abs(s22) < 2.0e7, f"D-near s22 magnitude is outside benchmark bounds: {s22:.6E}")
require(rel_error <= 0.12, f"D-point recovered s22 differs too much from NAFEMS: {rel_error:.3%}")
require(uz < 0.0, f"D-point vertical displacement should be negative, got {uz:.6E}")
require(abs(uz) > 1.0e-8, f"D-point vertical displacement is too small: {uz:.6E}")
require(
abs((reaction_z + total_fz) / total_fz) <= 1.0e-6,
f"vertical reactions do not balance pressure load: reaction_z={reaction_z:.6E}, total_fz={total_fz:.6E}",
)
print(
"thick plate LE10: "
f"s22_D={s22:.6E}, rel_error_vs_NAFEMS={rel_error:.3%}, "
f"uz_D={uz:.6E}, reaction_z={reaction_z:.6E}"
)
return 0
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,330 @@
#!/usr/bin/env python3
"""Generate the NAFEMS LE10 thick-plate solid benchmark deck for FemLite."""
from __future__ import annotations
import math
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Iterable, List, Sequence, Tuple
INNER_A = 2.0
INNER_B = 1.0
OUTER_A = 3.25
OUTER_B = 2.75
THICKNESS = 0.6
YOUNG_MODULUS = 2.10e11
POISSON_RATIO = 0.30
DENSITY = 7850.0
TOP_PRESSURE = 1.0e6
N_RADIAL = 4
N_THETA = 16
N_Z = 2
RADIAL_BIAS = 1.25
SET_LINE_WIDTH = 12
STATIC_INITIAL_INCREMENT = 1.0
STATIC_TOTAL_TIME = 1.0
STATIC_MIN_INCREMENT = 0.1
STATIC_MAX_INCREMENT = 1.0
Point3 = Tuple[float, float, float]
Element = Tuple[int, ...]
Logical = Tuple[int, int, int]
@dataclass
class Mesh:
nodes: Dict[int, Point3]
node_logic: Dict[int, Logical]
elements: List[Element]
d_node: int
d_probe_element: int
top_loads: Dict[int, float]
top_area: float
def biased_radial_fraction(i2: int) -> float:
eta = float(i2) / float(2 * N_RADIAL)
return eta**RADIAL_BIAS
def point_from_logic(i2: int, j2: int, k2: int) -> Point3:
theta = 0.5 * math.pi * float(j2) / float(2 * N_THETA)
radial = biased_radial_fraction(i2)
xi = math.cos(theta)
yi = math.sin(theta)
inner = (INNER_A * xi, INNER_B * yi)
outer = (OUTER_A * xi, OUTER_B * yi)
x = inner[0] + radial * (outer[0] - inner[0])
y = inner[1] + radial * (outer[1] - inner[1])
z = THICKNESS * float(k2) / float(2 * N_Z)
if abs(x) < 1.0e-12:
x = 0.0
if abs(y) < 1.0e-12:
y = 0.0
if abs(z) < 1.0e-12:
z = 0.0
if abs(z - THICKNESS) < 1.0e-12:
z = THICKNESS
return (x, y, z)
def add_node(
nodes: Dict[int, Point3],
node_logic: Dict[int, Logical],
lookup: Dict[Logical, int],
logic: Logical,
) -> int:
existing = lookup.get(logic)
if existing is not None:
return existing
node_id = len(nodes) + 1
lookup[logic] = node_id
nodes[node_id] = point_from_logic(*logic)
node_logic[node_id] = logic
return node_id
def element_nodes(
nodes: Dict[int, Point3],
node_logic: Dict[int, Logical],
lookup: Dict[Logical, int],
i: int,
j: int,
k: int,
) -> Element:
i0 = 2 * i
i1 = 2 * (i + 1)
im = i0 + 1
j0 = 2 * j
j1 = 2 * (j + 1)
jm = j0 + 1
k0 = 2 * k
k1 = 2 * (k + 1)
km = k0 + 1
logic_nodes = (
(i0, j0, k0),
(i1, j0, k0),
(i1, j1, k0),
(i0, j1, k0),
(i0, j0, k1),
(i1, j0, k1),
(i1, j1, k1),
(i0, j1, k1),
(im, j0, k0),
(i1, jm, k0),
(im, j1, k0),
(i0, jm, k0),
(im, j0, k1),
(i1, jm, k1),
(im, j1, k1),
(i0, jm, k1),
(i0, j0, km),
(i1, j0, km),
(i1, j1, km),
(i0, j1, km),
)
return tuple(add_node(nodes, node_logic, lookup, logic) for logic in logic_nodes)
def shape_quad8(r: float, s: float) -> Tuple[List[float], List[float], List[float]]:
n = [
0.25 * (1.0 - r) * (1.0 - s) * (-r - s - 1.0),
0.25 * (1.0 + r) * (1.0 - s) * (r - s - 1.0),
0.25 * (1.0 + r) * (1.0 + s) * (r + s - 1.0),
0.25 * (1.0 - r) * (1.0 + s) * (-r + s - 1.0),
0.5 * (1.0 - r * r) * (1.0 - s),
0.5 * (1.0 + r) * (1.0 - s * s),
0.5 * (1.0 - r * r) * (1.0 + s),
0.5 * (1.0 - r) * (1.0 - s * s),
]
dndr = [
0.25 * (1.0 - s) * (2.0 * r + s),
0.25 * (1.0 - s) * (2.0 * r - s),
0.25 * (1.0 + s) * (2.0 * r + s),
0.25 * (1.0 + s) * (2.0 * r - s),
-r * (1.0 - s),
0.5 * (1.0 - s * s),
-r * (1.0 + s),
-0.5 * (1.0 - s * s),
]
dnds = [
0.25 * (1.0 - r) * (r + 2.0 * s),
0.25 * (1.0 + r) * (-r + 2.0 * s),
0.25 * (1.0 + r) * (r + 2.0 * s),
0.25 * (1.0 - r) * (-r + 2.0 * s),
-0.5 * (1.0 - r * r),
-(1.0 + r) * s,
0.5 * (1.0 - r * r),
-(1.0 - r) * s,
]
return n, dndr, dnds
def cross(a: Point3, b: Point3) -> Point3:
return (
a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] * b[0],
)
def norm(v: Point3) -> float:
return math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2])
def top_face_pressure_loads(nodes: Dict[int, Point3], elements: Sequence[Element]) -> Tuple[Dict[int, float], float]:
gp = [-math.sqrt(3.0 / 5.0), 0.0, math.sqrt(3.0 / 5.0)]
gw = [5.0 / 9.0, 8.0 / 9.0, 5.0 / 9.0]
loads = {node_id: 0.0 for node_id in nodes}
area = 0.0
for elem in elements[(N_Z - 1) * N_THETA * N_RADIAL :]:
face_nodes = [elem[index] for index in (4, 5, 6, 7, 12, 13, 14, 15)]
coords = [nodes[node_id] for node_id in face_nodes]
for r, wr in zip(gp, gw):
for s, ws in zip(gp, gw):
n, dndr, dnds = shape_quad8(r, s)
tangent_r = (
sum(dndr[a] * coords[a][0] for a in range(8)),
sum(dndr[a] * coords[a][1] for a in range(8)),
sum(dndr[a] * coords[a][2] for a in range(8)),
)
tangent_s = (
sum(dnds[a] * coords[a][0] for a in range(8)),
sum(dnds[a] * coords[a][1] for a in range(8)),
sum(dnds[a] * coords[a][2] for a in range(8)),
)
jac = norm(cross(tangent_r, tangent_s))
weight = wr * ws
area += jac * weight
for a, node_id in enumerate(face_nodes):
loads[node_id] -= TOP_PRESSURE * n[a] * jac * weight
return loads, area
def build_mesh() -> Mesh:
nodes: Dict[int, Point3] = {}
node_logic: Dict[int, Logical] = {}
lookup: Dict[Logical, int] = {}
elements: List[Element] = []
d_probe_element = 0
for k in range(N_Z):
for j in range(N_THETA):
for i in range(N_RADIAL):
if i == 0 and j == 0 and k == N_Z - 1:
d_probe_element = len(elements) + 1
elements.append(element_nodes(nodes, node_logic, lookup, i, j, k))
d_node = lookup[(0, 0, 2 * N_Z)]
top_loads, top_area = top_face_pressure_loads(nodes, elements)
return Mesh(
nodes=nodes,
node_logic=node_logic,
elements=elements,
d_node=d_node,
d_probe_element=d_probe_element,
top_loads=top_loads,
top_area=top_area,
)
def nodes_matching(mesh: Mesh, predicate) -> List[int]:
return sorted(node_id for node_id, logic in mesh.node_logic.items() if predicate(logic))
def write_id_set(handle, ids: Sequence[int]) -> None:
for index in range(0, len(ids), SET_LINE_WIDTH):
handle.write(", ".join(str(item) for item in ids[index : index + SET_LINE_WIDTH]))
handle.write("\n")
def nonzero_loads(loads: Dict[int, float]) -> List[Tuple[int, float]]:
return [(node_id, value) for node_id, value in sorted(loads.items()) if abs(value) > 1.0e-8]
def write_inp(path: Path, mesh: Mesh) -> None:
x_sym = nodes_matching(mesh, lambda logic: logic[1] == 2 * N_THETA)
y_sym = nodes_matching(mesh, lambda logic: logic[1] == 0)
outer_surface = nodes_matching(mesh, lambda logic: logic[0] == 2 * N_RADIAL)
outer_midplane = nodes_matching(
mesh,
lambda logic: logic[0] == 2 * N_RADIAL and logic[2] == N_Z,
)
loads = nonzero_loads(mesh.top_loads)
total_load = sum(value for _, value in loads)
exact_area = 0.25 * math.pi * (OUTER_A * OUTER_B - INNER_A * INNER_B)
with path.open("w", encoding="ascii", newline="\n") as handle:
handle.write("*HEADING\n")
handle.write("FemLite NAFEMS LE10 thick plate pressure benchmark\n")
handle.write(
f"** inner_ellipse=({INNER_A:.10E},{INNER_B:.10E}), "
f"outer_ellipse=({OUTER_A:.10E},{OUTER_B:.10E}), "
f"thickness={THICKNESS:.10E}\n"
)
handle.write(
f"** top_pressure={TOP_PRESSURE:.10E}, integrated_top_area={mesh.top_area:.10E}, "
f"exact_top_area={exact_area:.10E}, total_Fz={total_load:.10E}\n"
)
handle.write(
f"** D_NODE={mesh.d_node}, D_PROBE_ELEMENT={mesh.d_probe_element}, "
"D_COORD=(2.0,0.0,0.6), NAFEMS_s22_D=-5.38E6\n"
)
handle.write("*NODE\n")
for node_id in sorted(mesh.nodes):
x, y, z = mesh.nodes[node_id]
handle.write(f"{node_id}, {x:.10E}, {y:.10E}, {z:.10E}\n")
handle.write("*ELEMENT, TYPE=C3D20, ELSET=THICK_PLATE\n")
for elem_id, elem in enumerate(mesh.elements, start=1):
handle.write(f"{elem_id}, " + ", ".join(str(node_id) for node_id in elem) + "\n")
handle.write("*ELSET, ELSET=D_PROBE\n")
handle.write(f"{mesh.d_probe_element}\n")
handle.write("*NSET, NSET=ALL_NODES, GENERATE\n")
handle.write(f"1, {len(mesh.nodes)}, 1\n")
handle.write("*NSET, NSET=X_SYM\n")
write_id_set(handle, x_sym)
handle.write("*NSET, NSET=Y_SYM\n")
write_id_set(handle, y_sym)
handle.write("*NSET, NSET=OUTER_SURFACE\n")
write_id_set(handle, outer_surface)
handle.write("*NSET, NSET=OUTER_MIDPLANE_Z\n")
write_id_set(handle, outer_midplane)
handle.write("*NSET, NSET=D_POINT\n")
handle.write(f"{mesh.d_node}\n")
handle.write("*MATERIAL, NAME=STEEL\n")
handle.write("*DENSITY\n")
handle.write(f"{DENSITY:.10E}\n")
handle.write("*ELASTIC\n")
handle.write(f"{YOUNG_MODULUS:.10E}, {POISSON_RATIO:.10E}\n")
handle.write("*SOLID SECTION, ELSET=THICK_PLATE, MATERIAL=STEEL\n")
handle.write("*BOUNDARY\n")
handle.write("X_SYM, 1, 1, 0.0\n")
handle.write("Y_SYM, 2, 2, 0.0\n")
handle.write("OUTER_SURFACE, 1, 2, 0.0\n")
handle.write("OUTER_MIDPLANE_Z, 3, 3, 0.0\n")
handle.write("*CLOAD\n")
for node_id, value in loads:
handle.write(f"{node_id}, 3, {value:.10E}\n")
handle.write("*STEP\n")
handle.write("*STATIC\n")
handle.write(
f"{STATIC_INITIAL_INCREMENT:.10E}, {STATIC_TOTAL_TIME:.10E}, "
f"{STATIC_MIN_INCREMENT:.10E}, {STATIC_MAX_INCREMENT:.10E}\n"
)
handle.write("*END STEP\n")
def main() -> None:
output_dir = Path(__file__).resolve().parent
write_inp(output_dir / "thick_plate_le10.inp", build_mesh())
if __name__ == "__main__":
main()
Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

+1 -1
View File
@@ -1,3 +1,3 @@
@echo off
call "%~dp0..\run_example_case.bat" "%~dp0" "thick_plate" "--static-linear" "thick_plate_pressure_smoke.inp" "1"
call "%~dp0..\run_example_case.bat" "%~dp0" "thick_plate_le10" "--static-linear" "thick_plate_le10.inp" "1"
exit /b %errorlevel%
File diff suppressed because it is too large Load Diff
@@ -1,41 +0,0 @@
*HEADING
FemLite V4.8 compact NAFEMS LE10 thick plate pressure smoke case
** Quarter-plate C3D8 surrogate for the thick-plate pressure documentation.
** Full elliptical-hole stress concentration is outside this smoke-case claim.
*NODE
1, 0.0, 0.00, 0.0
2, 2.0, 0.00, 0.0
3, 2.0, 1.75, 0.0
4, 0.0, 1.75, 0.0
5, 0.0, 0.00, 0.6
6, 2.0, 0.00, 0.6
7, 2.0, 1.75, 0.6
8, 0.0, 1.75, 0.6
*ELEMENT, TYPE=C3D8, ELSET=THICK_PLATE
1, 1, 2, 3, 4, 5, 6, 7, 8
*NSET, NSET=X_SYM
1, 4, 5, 8
*NSET, NSET=Y_SYM
1, 2, 5, 6
*NSET, NSET=OUTER_EDGE
2, 3, 6, 7
*NSET, NSET=Z_SUPPORT
2, 3
*NSET, NSET=TOP_FACE
5, 6, 7, 8
*MATERIAL, NAME=STEEL
*DENSITY
7850.0
*ELASTIC
2.10E11, 0.30
*SOLID SECTION, ELSET=THICK_PLATE, MATERIAL=STEEL
*BOUNDARY
X_SYM, 1, 1, 0.0
Y_SYM, 2, 2, 0.0
OUTER_EDGE, 1, 2, 0.0
Z_SUPPORT, 3, 3, 0.0
*STEP
*STATIC
*CLOAD
TOP_FACE, 3, -8.75E5
*END STEP