Viscoelastic Relaxation Test
The purpose of this file is to show a more a bit more realistic examle of using Fortress. A relaxtion test is a test where the deformation of a material is held constant and the stress slowly decreases due to the viscoelastic effects.
The main program sets the model parameters and executes the main loop. It prints the results in a syntax comptible with Octave for plotting.
And we also have the constitutive driver which gives the stress response from a given strain. This code is kept neutral as it comes to types and it is determined from the calling function.
and an additional support function was needed
Best effort was made to have the code render as nicely as possible, but some limitations with the current renderer exists. The author of this code is new to Fortress and would appreciate any corrections in the code, be it potentional bugs or bad design and usage.
Comments
I have a few suggestions, but keep in mind that I am not an expert either. I would choose viscoElastic1D(...) instead of ViscoElastic1D(...), because the general convention is to use initial capitals only for type names, not functions or variables. Another suggestion would be to not specify the types of the constants in run(), e.g.: E = 210.0 TIMES 10^9, just as you do in ViscoElastic1D(...), but this of course is subjective. Also, from your comment, the for loop should be split:
This way the calculations are parallel, even if the output is sequential. The second loop could also be written as:
which I find more concise.
Sorry, I didn't pay attention. Since every element depends on the previous one, my previous suggestion is wrong. It should be:
Author: Thanks for the comments, I have made some corrections and uploaded the current complete file. Feel free to modify and replace it.
Attachments
-
RelaxationTest.fss
(2.8 KB) - added by Micket
10 months ago.
Complete source for the relaxation test

