In order to run an analysis in Fatlab, the following inputs are required:
- Model file
- FE stress files (unit load cases)
- Loads file
Although not strictly necessary, it is good practice to create a work folder for each analysis and store all files here.
A macro (fatlab.mac) is supplied with Fatlab examples, which assists in the generation of the inputs from ANSYS; however it must be modified by the user to fit the analysis at hand.
1. Model file
The model file contains a complete description of the FE model, i.e. a list of nodes, elements and element types. This file is used for visualizing the model and results in Fatlab.
Issue the following APDL commands in a macro. If appropriate a subset of the model can be selected beforehand such that e.g. support/loading structures are excluded.
! open rst
! export model
/PAGE, 1E9,, 1E9,, ! one billion lines per page (disable headers)
Supported elements: SOLID186, SOLID187, SOLID185, PLANE42, PLANE82, PLANE182, PLANE183, SHELL63, SHELL181, SHELL281.
1.2 SolidWorks Simulation
In SolidWorks Simulation, the model file is exported through the GUI:
- Go to “Simulation” in the main menu and select “Export…”.
- Select “Simulation files (
*.geo)”. Remember to check “Export FEM only”.
- Save the file.
1.3 Custom CSV format
A special comma-separated file format have been created in order to make it easier to import a model from a currently unsupported FE program. Using this format, the export of any FE program can be translated using the below syntax and then imported into Fatlab.
Only lines starting with T, N or E are read for element type, nodes and elements, respectively. So there can be several header lines, also in between. Syntax should be self-explanatory from below and attached examples. Trailing commas are insignificant and there are no requirements to the width of the file.
Supported element names are the same as for ANSYS.
Element types: T, element type no., element name T,1,PLANE182 T,2,PLANE182 Nodes: N, node no., x, y, z N,1,10,4,0 N,2,11,5,0 N,3,10.19051411,4.018315542,0 N,4,10.37404947,4.072591249,0 N,5,10.543883,4.160838943,0 Elements: E, element no., material no., element type no., node i, node j, ... E,1,1,1,220,332,241,241 E,2,1,1,225,244,243,243 E,3,1,1,225,219,230,245 E,4,1,1,219,225,243,242
2. FE stress files (unit load cases)
FE stress files are lists of stress components for each node in the model. A separate unit LC stress file must be generated for each load on the model (at least one). In case of a non-linear model, two or more FE stress files may be used. These files are used by Fatlab when calculating the stress-time histories through superposition.
In ANSYS the FE stress files are generated by listing the nodal stress results for a unit load case by issuing
PRNSOL,S. Use the supplied macro (
fatlab.mac) to generate the unit stress files from ANSYS. Note that it is not allowed to change the format of the export, since it is read in a fixed-column-width manner.
***** POST1 NODAL STRESS LISTING *****
CALCULATED LOAD CASE= 0
THE FOLLOWING X,Y,Z VALUES ARE IN GLOBAL COORDINATES
NODE SX SY SZ SXY SYZ SXZ
1 0.99868-0.45298E-04 0.80668E-01-0.33606E-09 0.50760E-07-0.74208E-05
2 0.99215 0.46994E-06 0.76008E-01 0.37790E-09 0.35704E-07-0.15339E-04
3 0.98175 0.23177E-05 0.78480E-01 0.12170E-08 0.42694E-07-0.19283E-04
4 0.96852 0.11462E-05 0.85047E-01 0.20723E-08 0.53371E-07-0.20807E-04
2.2 SolidWorks Simulation
Two options are available to generate FE stress files in Simulation. The stress results from an analysis can be exported to .csv files or the temporary .ste files can be used. The first options is probably the easiest, wheras the second is much faster.
2.2.1 Simulation (
- In the Simulation pane: Right click “Results” and Select “List Stress, Displacement, Strain”.
- On the List Results pane: Select “SX” and “N/mm2” under Component and “Range” under Advanced.
- Press the green OK button and choose “Save” on the dialog that appears.
11:52, Tuesday, December 09, 2014
Study name: Static 1
Units :N/mm^2 (MPa)
Selected reference : Front Plane
Node ,SX ,SY ,SZ ,TXY ,TXZ ,TYZ
1 ,-1.118e-001 ,-8.283e-001 ,-3.245e-002 ,-6.258e-003 , 2.933e-002 ,-1.586e-003
2 , 1.270e-002 ,-4.165e-001 ,-3.461e-002 , 1.4813-002 ,-2.208e-003 , 3.868e-002
3 , 9.427e-001 , 3.031e-001 , 1.040e-002 ,-5.420e-001 ,-5.522e-002 , 4.285e-002
4 , 2.483e+000 , 2.387e-001 , 3.011e-002 ,-6.330e-001 ,-6.891e-002 , 8.767e-003
5 , 2.911e+000 , 1.523e-001 , 2.406e-002 , 3.077e-001 , 1.400e-002 ,-1.479e-002
6 , 1.591e+000 , 4.218e-001 , 1.580e-002 , 7.324e-001 , 3.062e-002 , 6.758e-003
2.2.1 Simulation (
The binary .ste files is generated during the solution process in Simulation and holds strain and stress results. Per default, they are deleted during the final stage of a solution, however, they can be kept by checking Keep temporary database files in Simulation > Options > Default options > Results > Results folder:
Note that the order of the two last columns of stress export (TYZ and TXZ) are not consistent in ANSYS and SolidWorks Simulation. This is handled internally in Fatlab though (to comply with ANSYS format) and therefore no corrections are required from the user.
2.3 Custom CSV
Exactly 1 header line, then nodal stress results as below (1 node per line). Note the order of the shear stress components.
Stress export: node no., SX, SY, SZ, SXY, SYZ, SXZ 1,3.7834,0.26638,0,-3.00E-02,0,0 2,4.47E-03,-1.38E-02,0,1.68E-02,0,0 3,3.5674,0.29644,0,0.45747,0,0 4,2.9003,0.56618,0,0.76079,0,0 5,2.1031,0.6256,0,0.96773,0,0
3. Loads file
The loads file is an Excel spreadsheet containing a sheet for each load case. Each sheet then lists the time history for the loads, e.g. a sinusoidal curve or whatever trajectory preferred. The order of the loads must equal the order of the unit stress files. The loads file may also contain additional/irrelevant content, as long as it is separated from the load history by at least one empty column.
The top 3 lines must have the format shown below, i.e. number of repetitions of current load case, headers describing the time/load names and the associated units. The length of the time/load history can be chosen arbitrarily, as long as it describes at least one cycle.
Note that Fatlab does all calculations in [MPa]. The user must therefore ensure consistent units, such that loads multiplied with the FE stresses equals [MPa].
4. ANSYS Workbench
The input files for Fatlab can be generated easily in ANSYS Workbench by including a set of commands under Solution as shown in the figure below.
The Fatlab export commands should include the following APDL. Some minor adjustments will be necessary, i.e. setting the number of load steps, NLS, and naming them in the filename array.
!Fatlab prep macro rstname = 'file' NLS = 2 *DIM, filename, CHAR, NLS ! no. unit load cases filename(1) = 'Fx' filename(2) = 'Fy' /GRAPHICS,FULL ! open rst /POST1 FILE,%rstname%,rst set,1 ALLSEL ! export model /PAGE, 1E9,, 1E9,, ! one billion lines per page (disable headers) *GET,NET,ETYP,1,NUM,COUNT /OUTPUT,model,txt *DO,i,1,NET ETLIST,i *ENDDO NLIST,,,,COORD ELIST /OUTPUT ! export FE stress files (.fes) /FORMAT, , ,12,5, , !fix new output format in ANSYS v18 *DO,i,1,NLS set,i /OUTPUT,%filename(i)%,fes PRNSOL,S *ENDDO /OUTPUT