fcFEM - FEA from start to finish

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

Jut an update of where I am with this ...

I am cleaning up the code ahead of posting it as FOSS. Also putting a lot of TODO comments for ease of reference.

I updated the Matplotlib facility so that on the basis of how far you got on the curve you can decide to stop the calculation or continue by adding more load steps. I find this really intuitive and handy.

It’s not going as fast as I had hoped because I need adapt the interface elements to deal with load stepping, even for elastic response.
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

This is now ready for use:

https://github.com/HarryvL/fcFEM

Have fun !
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: fcFEM - FEA from start to finish

Post by bernd »

Good Morning Harry,

wow, very cool stuff. Surely I will play with this, but it seams to me it is not done in 5 minutes ... :D

cheers bernd
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

Hi Bernd, it also took a while to put together :shock: . Load stepping and iteration are fully automated ... so that should help in getting up to speed with it and producing some results ;) However, now the framework is there it will be relatively easy to extend.
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

Please note that (for now) some material parameters need to be entered in the main macro fcFEM.FCMacro. The control parameters are best left unchanged unless you are brave and want to experiment. Perhaps the only exception is out_disp, because it allows you to chose between total or incremental displacements.

Code: Select all

# material input values - TODO: merge with FEM WB input dialogues
gravity = -0.0e-5   # specific gravity acting in z-direction [N/mm3]
sig_yield = 100.0   # yield stress [MPa] for volume elements (von Mises material)
shr_yield = 100.0   # yield stress [MPa] for interface elements (Coulomb material)
kn = 1.0            # interface elastic normal stiffness factor (0.0 < kn <1.0)
ks = 0.0            # interface elastic shear stiffness factor (0.0 < ks <1.0)

# control input values - TODO: merge with FEM WB input dialogues
out_disp = -1000    # +n: output total discplacment at step n ; -n: output incremental discplacement at step n (if n>last step then n=last step)
nstep=10            # number of load steps per run (default = 10)
iterat_max=20       # max number of iterations per step - this triggers a scale-down and restart
error_max=1.0e-03   # convergence tolerance (default = 1.0e-03)
relax = 1.2         # numerical over-relaxation (1.0 < relax < 1.5; default = 1.2)
scale_re = 2.0      # scale factor for re-start (default = 2.0)
scale_up = 1.2      # scale up for fast convergence (default = 1.2)
scale_dn = 1.2      # scale down for slow convergence (default = 1.2)
I will post the relevant parameter selections that go with the case studies in my repo so you can give them a try.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: fcFEM - FEA from start to finish

Post by bernd »

HarryvL wrote: Sat Mar 30, 2019 6:58 am Please note that (for now) some material parameters need to be entered in the main macro fcFEM.FCMacro.
I saw already. I could not resist to spend an hour to browse your repo :mrgreen:
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

HarryvL wrote: Sat Mar 30, 2019 6:58 am I will post the relevant parameter selections that go with the case studies in my repo so you can give them a try.
Excavations in clay:

Code: Select all

gravity = -2.0e-5   # specific gravity acting in z-direction [N/mm3]
sig_yield = 0.01   # yield stress [MPa] for volume elements (von Mises material)
shr_yield = 100  # yield stress [MPa] for interface elements (Coulomb material) - irrelevant, not used yet
kn = 1.0            # interface elastic normal stiffness factor (0.0 < kn <1.0) - not used for the clay examples
ks = 0.0            # interface elastic shear stiffness factor (0.0 < ks <1.0) - not used for the clay examples 
Beam:

Code: Select all

gravity = -0.0e-5   # specific gravity acting in z-direction [N/mm3]
sig_yield = 100   # yield stress [MPa] for volume elements (von Mises material)
shr_yield = 100  # yield stress [MPa] for interface elements (Coulomb material) - irrelevant, not used yet
kn = 1.0            # interface elastic normal stiffness factor (0.0 < kn <1.0)
ks = 1.0            # interface elastic shear stiffness factor (0.0 < ks <1.0) - no slip
Circular punch:

Code: Select all

gravity = -0.0e-5   # specific gravity acting in z-direction [N/mm3]
sig_yield = 100000   # yield stress [MPa] for volume elements (von Mises material) - suppress plasticity
shr_yield = 100  # yield stress [MPa] for interface elements (Coulomb material) - irrelevant, not used yet
kn = 1.0            # interface elastic normal stiffness factor (0.0 < kn <1.0)
ks = 0.0            # interface elastic shear stiffness factor (0.0 < ks < 0.0)
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

I moved my fcFEM.FCMacro and femTools.py out of the .FreeCAD/Macro folder to a local clone of my fcFEM repository. However, if I now run this fcFEM.FCMacro from the FreeCAD macro panel it returns an error that it cannot load module femTools. I put an __init__.py in the development directory and also did "export PYTHONPATH="${PYTHONPATH}:/my development path", which correctly show up in sys.path. However, despite all of this I still get: "<type 'exceptions.ImportError'>: No module named femTools". Can anybody help me resolve this? Thanks, Harry
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

Something else ... I just pulled and built the latest FC source from femconcrete and it broke my fcFEM macro :shock: It looks like an additional parameter was added to the FemInputWriter constructor? I simply put another None at the initiation call of the relevant object and now it works again, but it makes me worry that any call to FC API is vulnerable? Also, it would mean that the macro would either work with 0.17/0.18 or 0.19, but not both. Any suggestions on how to manage this? Thanks, Harry
User avatar
HarryvL
Veteran
Posts: 1285
Joined: Sat Jan 06, 2018 7:38 pm
Location: Netherlands

Re: fcFEM - FEA from start to finish

Post by HarryvL »

I installed the Intel Performance Libraries and Distribution for Python on my Ubuntu 16.04 system following the instructions here: https://software.intel.com/en-us/articl ... n-apt-repo.

I tested the plate-with-hole example with 10 elasto-plastic steps. Intel MKL gave me a speed increase of approximately a factor 3. Not bad, but I have no idea if this is a typical improvement I should expect or if I should be able to squeeze more out of this library? Doe anybody have experience with this?

Next: Reverse Cuthill McKee band width reduction and use of a banded Cholesky solver. Let's see how fast this can get :D
Post Reply