The examples presented in this section are presented in directory “TESTSAT/RUBY/EX15”.
An example in which composite classes interact with finite element Result classes is presented here. First, a “bottom” Group containing four elements of the bottom panel, which has a PCOMPG property. A load object, some components of which correspond to finite element Results is defined:
ld=ClaLoad.new
ld.Id="testLoad"
ld.setMembrane([0.03,0.0,0.1],"femFM","femSC","femFM")
ld.setFlexural([0.0,0.0,0.0],"femFM","femSC","femSC")
ld.setOutOfPlane([100.0,200.0],"femFM","femFM")
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Shell Forces",
"ElemCenters",bottom,[])
res.modifyRefCoordSys(db,"lamCS")
ld.setShellForces(res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Shell Moments",
"ElemCenters",bottom,[])
res.modifyRefCoordSys(db,"lamCS")
ld.setShellMoments(res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Strain Tensor",
"ElemCenters",bottom,["NONE"])
res.modifyRefCoordSys(db,"lamCS")
ld.setShellStrains(res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Curvature Tensor",
"ElemCenters",bottom,["NONE"])
res.modifyRefCoordSys(db,"lamCS")
ld.setShellCurvatures(res)
In the example, no thermal or moisture contribution has been taken into account in the loading. Only mechanical components have been defined. The example, is defined in such a way that all possible mechanical contributions are used: in-plane forces, out-of-plane forces, bending moments, average in-plane strain and curvature. All these components are defined as finite element Results. (This allows us later to compare the Results produced by FeResPost with those directly output by Nastran.) The modification of coordinate system is necessary because the loading components are required to be expressed in laminate axes. (The Nastran shell forces, moments, curvatures... are given in element axes.)
For later comparison of Results, several Results directly extracted from Nastran “op2” file are directly output in file “Reference.txt”.
os=File.open("Reference.txt","w")
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Shell Forces",
"ElemCenters",bottom,[])
res.modifyRefCoordSys(db,"lamCS")
Util::printRes(os,"Shell Forces",res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Shell Moments",
"ElemCenters",bottom,[])
res.modifyRefCoordSys(db,"lamCS")
Util::printRes(os,"Shell Moments",res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Strain Tensor",
"ElemCenters",bottom,["NONE"])
res.modifyRefCoordSys(db,"lamCS")
Util::printRes(os,"Strain Tensor",res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Curvature Tensor",
"ElemCenters",bottom,[])
res.modifyRefCoordSys(db,"lamCS")
Util::printRes(os,"Curvature Tensor",res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Stress Tensor",
"ElemCenters",bottom,[])
Util::printRes(os,"Stress Tensor",res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics","Strain Tensor",
"ElemCenters",bottom,[])
Util::printRes(os,"Strain Tensor",res)
res=db.getResultCopy("ORBIT_ONE_MS2_Z","Statics",
"Composite Failure Index, Tsai-Hill",
"ElemCenters",bottom,[])
Util::printRes(os,"Composite Failure Index, Tsai-Hill",res)
os.close()
As laminate allowables are not defined in Nastran, one modifies the laminate corresponding to the unique PCOMPG property by adding laminate allowables to it. Then the modified ClaLam is reinserted in the database, where it replaces the original one:
lam=compDb.getLaminateCopy(6)
allowables={}
allowables["sc"]=200.0e6
allowables["s1c"]=200.0e6
allowables["s2c"]=200.0e6
allowables["st"]=300.0e6
allowables["s1t"]=300.0e6
allowables["s2t"]=300.0e6
allowables["ss"]=100.0e6
allowables["s12"]=100.0e6
allowables["ilss"]=30.0e6
lam.insertAllowables(allowables)
compDb.insertLaminate(lam)
The failure indices to be calculated are also selected. The first one is calculated using ply material allowables, the others with the laminate allowables defined above. For the two last criteria, the most critical layer only is recovered for each element. The definition looks as follows:
criteria = [] criteria << ["TS FI","TsaiHill_c","FI",false,true] criteria << ["TW FI","TsaiWu","FI",true,true] criteria << ["TW FI Critical","TsaiWu","FI",true,false] criteria << ["ILSS FI Critical","Ilss","FI",true,false]
The following call to method “calcFiniteElementResponse” produces Results corresponding to the ClaLam object for which the method is called and writes Results in file “OneLaminate.txt”
theta=0.0
outputs=lam.calcFiniteElementResponse(ClaDb,theta,ld,[true,true,true],
["Shell Forces","Shell Moments", "Shell Curvatures",
"Average Strain Tensor"],
["Stress Tensor","Strain Tensor","Mechanical Strain Tensor"],
1.0,criteria)
os=File.open("OneLaminate.txt","w")
outputs.each do |id,res|
Util::printRes(os,id,res)
end
os.close
The following sequence does the same operation, but the method “calcFiniteElementResponse” is called for the DataBase object “db”.
theta=0.0
outputs=db.calcFiniteElementResponse(compDb,theta,ld,[true,true,true],
["Shell Forces","Shell Moments", "Shell Curvatures",
"Average Strain Tensor"],
["Stress Tensor","Strain Tensor","Mechanical Strain Tensor"],
1.0,criteria)
os=File.open("SeveralLaminates.txt","w")
outputs.each do |id,res|
Util::printRes(os,id,res)
end
os.close
For each element, “db” retrieves the property ID and selects in “compDb” the appropriate laminate with which the calculations are done. Of course, in this case, a single laminate is used and the Results should be the same as when the method is called for the “lam” laminate.
A few remarks on the example:
The example is done with a Group of 4 elements only. This has been done to allow an easy comparison of Results. One could do the example with a Group corresponding to the entire bottom panel to test the efficiency of the method. Also, composite Results can be calculated at corner of elements. (You will discover that the algorithms involved are very efficient, if you do not print the Results.)
The out-of-plane shear stress/strain components retrieved from Nastran OP2 file do not match exactly the values obtained with CLA classes. This is due to limitations of the CLA out-of-plane shear theory that have been highlighted in section II.1.6 of the present document. Results are similar though. Note also that the limitations of the out-of-plane shear theory is general and concerns Nastran as well as FeResPost so that none of the two results is really better than the other one.
In the example, Results calculated directly with Nastran are compared with those produced by FeResPost. This is one possible use of the “calcFiniteElementResponse” method, but not the only one. For example:
Results corresponding to deteriorated allowables can be produced due to manufacturing problems, or ageing...
Some calculation methods require modification of the loadings. sometimes, for example, curvature is neglected, or only partially taken into account for the calculations.
Also, with Nastran, composite Results can be produced, even when no laminate (PCOMP) properties have been modeled. This is the case when equivalent shell properties are modeled.
...
The examples given above are far from being exhaustive. The stress engineers experienced in composite calculations will very soon discover the advantages of the new method. This is particularly true when Nastran is used because its composite capabilities are poor. (Even though Patran compensates partially Nastran deficiencies with its optional “Laminate Modeler” tool.)
A simplified variant of the example is presented in “testCriteria.rb” file. There the failure indices are calculated using directly layered stresses read from Nastran op2 file. For example, the failure indices are calculated using the ClaLam method as follows:
outputs=lam.calcFiniteElementCriteria(compDb,stressRes,1.0,criteria)