发布时间:2025-06-24 17:52:54 作者:北方职教升学中心 阅读量:315
本文以对一个shell单元类型的TPMS施加周期性边界条件进行力学均匀化的过程为例讲解。2、
nforc在用abaqus cae对odb进行显示的时候,显示的是节点的nforc的一个平均值。假设节点a同时被3个单元共享,那么云图上显示的大概是节点a在单元1、查了一下资料,发现nforc提取力的方向和表面力的方向是相反的。周期性边界条件是通过节点间用equation限制位移关系来实现变形的,而在load模块中没有对任何实体节点施加位移边界条件(仅对参考点施加了位移)。有一些视频或者博客例如视频1和博客2对这个进行了一定的解释。这种在cae中不太方便实现,我写了python脚本来提(pythonset.txt是我想要提取的节点的集set编号),例如:
# -*-coding:mbcs -*-from part import *from material import *from section import *from assembly import *from step import *from interaction import *from load import *from mesh import *from optimization import *from job import *from sketch import *from visualization import *from connectorBehavior import *import mathimport osimport numpy as npimport xyPlot#odb_path ='D:/australia2024/TPMS/tpms-matlabcode/HJPminisurf/test/main1.odb'odb_path =os.path.abspath(__doc__)+'/'+'main1.odb'myodb =openOdb(path=odb_path)lastframe=myodb.steps['Step-1'].frames[-1]rf1=lastframe.fieldOutputs['NFORC1']rf2=lastframe.fieldOutputs['NFORC2']rf3=lastframe.fieldOutputs['NFORC3']file_path=odb_path =os.path.abspath(__doc__)+'/'+'pythonset.txt'file =open(file_path,'r')infos =file.readlines()file.close()setid =[int(line.strip())forline in infos]setRF=[]fortmpid in setid:tmpregion =myodb.rootAssembly.nodeSets['B-'+str(tmpid)]setrf1 =rf1.getSubset(region=tmpregion).values setrf1 =[item.data foritem in setrf1]setrf1=sum(setrf1)setrf2 =rf2.getSubset(region=tmpregion).values setrf2 =[item.data foritem in setrf2]setrf2=sum(setrf2)setrf3 =rf3.getSubset(region=tmpregion).values setrf3 =[item.data foritem in setrf3]setrf3=sum(setrf3)setRF.append([tmpid,setrf1,setrf2,setrf3])# resultfile =open(os.path.abspath(__doc__)+'/'+'result1.txt','w')# np.savetxt(resultfile,np.array(setRF),fmt='%d %.9f %.9f %.9f',delimiter=' ')file=os.path.abspath(__doc__)+'/'+'result1.txt'with open(file,'w')as f:forrow in setRF:row_str =' '.join(map(str,row))f.write(row_str +'\n')f.close()myodb.close()print('finish')# print(np.array(setRF))
注意事项2:NFORC的方向和我们设想的相反
在对TPMS进行均匀化处理时,其实是把TPMS单胞等效成一个均质的立方体。Fy、我对TPMS沿x方向进行拉伸位移加载。因而可以看到RF的云图全为0值,如下图
NFORC提取节点力
此时应当打开场输出中的NFORC而非RF,如下图
abaqus帮助文档对nforc的解释为 “Forces at the nodes of the element caused by the stress in the element (internal forces in the global coordinate system).” 表明这个力是根据单元的应力插值到节点上得到的。FzpfaceXplus;%BB1C1C面上的所有集合编号,包含点线面pfaceYplus;%ABCD面上的所有集合编号,包含点线面pfaceZplus;%AA1B1B面上的所有集合编号,包含点线面ylength =1;% 你需要的值xlength =1;% 你需要的值zlength =1;% 你需要的值% 查找索引列表对应的行并提取对应的行[is_found,idx]=ismember(pfaceXplus,data(:,1));forcefaceXplus =data(idx(is_found),:);forcefaceXplus=forcefaceXplus(:,2:4);[is_found,idx]=ismember(pfaceYplus,data(:,1));forcefaceYplus =data(idx(is_found),:);forcefaceYplus=forcefaceYplus(:,2:4);[is_found,idx]=ismember(pfaceZplus,data(:,1));forcefaceZplus =data(idx(is_found),:);forcefaceZplus=forcefaceZplus(:,2:4);%加负号的原因是nforc的结果和free body的方向相反sigma11=-sum(forcefaceXplus(:,1))/ylength/zlength;sigma12=-sum(forcefaceXplus(:,2))/ylength/zlength;sigma13=-sum(forcefaceXplus(:,3))/ylength/zlength;sigma21=-sum(forcefaceYplus(:,1))/xlength/zlength;sigma22=-sum(forcefaceYplus(:,2))/xlength/zlength;sigma23=-sum(forcefaceYplus(:,3))/xlength/zlength;sigma31=-sum(forcefaceZplus(:,1))/xlength/ylength;sigma32=-sum(forcefaceZplus(:,2))/xlength/ylength;sigma33=-sum(forcefaceZplus(:,3))/xlength/ylength;
额外说明
可以看到abaqus在对TPMS施加周期性边界条件后进行均匀化弹性张量的计算过程中,结果确实有
sigma12=sigma21这种对称性,所以我们选择一个面按照约定的法则进行提取分量即可