Agent Skills
› Cai-aa/CAE-Agent-Hub
› csv-export
csv-export
GitHub将Abaqus固化仿真结果导出为CSV,包含节点坐标和位移。支持不同铺层方案对比、回弹分析及扩展应力等字段,用于数据导出与结果比较。
触发场景
用户需要导出仿真结果为CSV格式
进行不同铺层配置的回弹或变形对比分析
需要从ODB中提取节点坐标和位移数据
安装
npx skills add Cai-aa/CAE-Agent-Hub --skill csv-export -g -y
SKILL.md
Frontmatter
{
"name": "csv-export",
"description": "Export curing simulation results to CSV with node coordinates and displacements. Invoke when user needs CSV output, data export, or result comparison."
}
CSV Export
Description
Export curing simulation results to CSV with node coordinates and displacements. Invoke when user needs CSV output, data export, or result comparison.
Content
CSV Format
The exported CSV file uses the following column format:
Node,X,Y,Z,U1,U2,U3
Node: Node label (integer)X, Y, Z: Node coordinatesU1, U2, U3: Displacement components from the sp step last frame
Complete Export Script
import os
from abaqusConstants import *
work_dir = 'C:\\Users\\...\\work_directory'
recipes = ['P8_mold_recipe_1', 'P8_mold_recipe_2', 'P8_mold_recipe_3']
for name in recipes:
odb_path = os.path.join(work_dir, name + '.odb')
odb = session.openOdb(name=name+'_odb', path=odb_path, readOnly=True)
inst = odb.rootAssembly.instances['P8-1']
last_frame = odb.steps['sp'].frames[-1]
u_field = last_frame.fieldOutputs['U']
u_map = {}
for val in u_field.values:
u_map[val.nodeLabel] = (val.data[0], val.data[1], val.data[2])
csv_path = os.path.join(work_dir, name + '.csv')
lines = ['Node,X,Y,Z,U1,U2,U3']
for node in inst.nodes:
nid = node.label
x, y, z = node.coordinates
if nid in u_map:
u1, u2, u3 = u_map[nid]
lines.append('%d,%.6f,%.6f,%.6f,%.6f,%.6f,%.6f' % (nid, x, y, z, u1, u2, u3))
with open(csv_path, 'w') as f:
f.write('\n'.join(lines))
odb.close()
Output Details
- 8-ply model: 5445 nodes exported
- 4-ply model: 3025 nodes exported
- Data is extracted from the sp step (springback) last frame, which represents the final deformation
Usage Scenarios
Comparing Ply Layups
Use the CSV output to compare different ply layup configurations:
- Symmetry analysis of deformation patterns
- Identifying maximum displacement locations
- Comparing springback magnitudes across recipes
Extending with Additional Fields
The script can be extended to include additional field outputs by adding more columns:
# Add stress (S) components
s_field = last_frame.fieldOutputs['S']
s_map = {}
for val in s_field.values:
s_map[val.elementLabel] = val.data
# Add state variables (SDV1-4)
sdv1_field = last_frame.fieldOutputs['SDV1']
sdv1_map = {}
for val in sdv1_field.values:
sdv1_map[val.elementLabel] = val.data
Available additional fields:
S— Stress (6 components: S11, S22, S33, S12, S13, S23)PE— Plastic strainSDV1toSDV4— State variables
Notes
- Use the
%operator for string formatting (Abaqus uses Python 2.7) - Always close the ODB after processing each recipe
- The CSV files are saved in the same work directory as the ODB files
- Node coordinates are retrieved from
instance.nodes, not from a COORD field output
版本历史
- cb4d869 当前 2026-10-19 04:34


