FEA mesh generating in Python API

39 views
Skip to first unread message

Peter Hauschild

unread,
Apr 9, 2024, 5:40:09 AMApr 9
to OpenVSP
Hi, I have some questions about the generating a FEA mesh in the Python API. I went through the .vspscript files, but could not find anything useful and i also checked the documentation.

1, How to add boudnary conditions?

I have the following code:
#Part - Fix Point
fp_1 = vsp.AddFeaPart(wing[0], struct_ind, vsp.FEA_FIX_POINT)
fp_2 = vsp.AddFeaPart(wing[0], struct_ind, vsp.FEA_FIX_POINT)
vsp.SetParmVal( vsp.FindParm( fp_2, "PosW", "FeaFixPoint" ), 0.5 )

#Boundry Conditions
vsp.SetParmVal( vsp.FindParm( fp_1, "Type", "FeaBC" ), 1 )
vsp.SetParmVal( vsp.FindParm( fp_1, "ConMode", "FeaBC" ), 1 )
vsp.Update()

I know, the BC part is bad, but i could not figure out how to do it properly. I'd like to have both Fixed Point have all of their movement constrained.

2, How to generate the mesh for Calculix?
For this question, i found the .vspscript, which doing a similar thing. Although that file was useful, i could not export the mesh. This is my code for this:

vsp.SetFeaMeshStructIndex( struct_ind)
analysis_name = "FeaMeshAnalysis"
#Set Defaults
vsp.SetAnalysisInputDefaults(analysis_name)
#vsp.SetIntAnalysisInput(analysis_name, "*Every other file*", [0])
vsp.PrintAnalysisInputs(analysis_name)
vsp.ExecAnalysis(analysis_name)

I also tried this:
filename = "T3_fea_WingGeom_Struct1_calculix.inp"
                       
parent_id = vsp.GetFeaStructParentGeomID(struct_id)
vsp.SetFeaMeshFileName(parent_id, struct_ind,vsp.FEA_CALCULIX_FILE_NAME,filename)
vsp.ComputeFeaMesh(struct_id,vsp.FEA_CALCULIX_FILE_NAME )

For both codes, i got no errors, and it also looks like doing something as it takes some time to finish, but no results are generated.
At this point I'm quite stuck as i could not find any answer or clue how to export mesh.

Any advice is greatly appreciated.
Peter

Reply all
Reply to author
Forward
0 new messages