Creating inputs

In order to run an analysis in Fatlab, the following inputs are required:

  1. Model file
  2. FE stress files (unit load cases)
  3. 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.

1.1 ANSYS

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
/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

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.

2.1 ANSYS

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.

Example:

***** 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 (.csv)

  1. In the Simulation pane: Right click “Results” and Select “List Stress, Displacement, Strain”.
  2. On the List Results pane: Select “SX” and “N/mm2” under Component and “Range” under Advanced.
  3. Press the green OK button and choose “Save” on the dialog that appears.

Example:
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 (.ste)

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:

simulation_keep_temp_files

 

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.

Example loads file

Example loads file

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

5 thoughts on “Creating inputs

  1. Andreas D.

    Dear Mikkel,

    is Fatlab capable of dealing with 3 dimensional input signals (for example 3 time series like Fx(t), Fy(t), Fz(t))? I think it should work somehow within the Load(Variable) concept using Load(Var1,Var2).

    BR,
    Andreas

    Reply
    1. admin Post author

      Hi Andreas

      Certainly. Fatlab can handle as many load signals as you like. You just make more columns in the loads file. Several of the examples include multiple loads. Also, you can use different scaling/interpolation techniques for the different loads. E.g. one load can scale the FE stresses linearly, whereas another may be interpolating.

      BR Mikkel

      Reply
  2. Andreas D.

    Dear Mikkel,

    thank you for your response! Well, I looked through the examples and found out that it is possible to do a linear combination (superposition) of the stress states. Like having Fx and all the stress files, Fy and all the stress files and Fz and all the stress files. Fatlab is then searching for a combined stress state of the actual loading situation Fx(t), Fy(t) and Fz(t) given in the load-time history. Thats already a great feature! Also it is possible to have a 2D interpolation for example Fx with a dependency of Fy. So, what I’m looking for is an interpolation feature for Fx(Fy,Fz): one load and two variables.

    My problem is, due to all the nonlinearities in my model, the stress state depends on the spatial loading situation. For example, if a have 3 external displacements, my stress state a) sx(sy,sz=0) is different than stress state b) sx(sy,sz=2).

    I tried to extend the 2D interpolation feature to 3D with two dependent variables but my attempt was not successful so far. If I have success I’ll let you know.

    BG Andreas

    Reply
    1. admin Post author

      Ok, now I get it… You’re right, Fatlab cannot do this as it is, but I think you should be able to manipulate the 2D interpolation feature in calc_stress_nonlinear(). It may require modifying the UI also in some places, which I suppose can be more difficult. Please let me know if you suceed.

      BR Mikkel

      Reply
  3. Andreas D.

    Dear Mikkel,

    got it! I don’t know if it makes sense to post all the changes in a comment. What I did was to add an extra option “3D Interpolation” in the setup model window. If activated, Fatlab changes the next two entries to Var1/Var2 (similar to the 2D interpolation idea). In “calc_stress_nonlinear.m” I added an extra array “ULC_stress_3D” with the shape (max_ULC_per_load,max_ULC_per_load,max_ULC_per_load). In the beginning I made a mistake with the order of F,V,W in interp3: Matlab requests the order V,F,W. Here and there I made some extra changes regarding error treatment, but basically that’s it. I went through the whole code with the matlab search function for all files with “2D interpolation” and added extra options for the 3D one. If you are interested in specific code changes, I think it’s better if you contact me per mail. I’ve also added some other features (more elastomer / rubber specific ones) so sending my modified files is probably not the best idea as there are too many changes in it. I will sort the interpolation code changes out if there is any interest.

    BR Andreas

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.