test request, new constraints, including contact and thermomechanical analysis

About the development of the FEM module/workbench.

Moderator: bernd

Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

test request, new constraints, including contact and thermomechanical analysis

Post by bernd »

I have been spending some time to rebase the development which was done by the forum member vdwalts and makkemal. Here we are, lot's of improvements to the FEM module. There where some threads about the new tools already. This topic takes it all together rebased on master. I would like to get feedback before I'm gone make a pull request.

cheers bernd

branch:
https://github.com/berndhahnebach/FreeC ... onstraints

new tools and features:
- new constraints
-- constraint contact
-- constraint plane rotation
-- constraint temperature
-- constraint heatflux
-- constraint initial temperature

- new analysis
-- thermomechanical analysis

- new calculix solverattributes
-- nonlinear geometry
-- max iterations
-- matrix solver type

- reference selection improvements
-- constraint pressure
-- constraint displacement

- results
-- add shear stress and prinzipal stress
-- make a widget for user defined result calculations
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: test request, new constraints, including contact and thermomechanical analysis

Post by bernd »

example file plane rotation:
fem--plane_rotation.fcstd
(585.09 KiB) Downloaded 110 times
example file theromomechanical analysis:
fem--thermomechanical.fcstd
(14.97 KiB) Downloaded 112 times
example file contact:
fem--beam_bend_transient_contact.fcstd
(52.19 KiB) Downloaded 131 times
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: test request, new constraints, including contact and thermomechanical analysis

Post by vejmarie »

Just have launched a build, by the end of the day I shall be able to report some feedback ;)
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: test request, new constraints, including contact and thermomechanical analysis

Post by makkemal »

I attach an example of transient thermal analysis.

Plotting the Max temp over time gives the following
figure_1.png
figure_1.png (26.26 KiB) Viewed 3856 times

Code for plot

Code: Select all

"""
import FreeCAD
import numpy as np
import matplotlib.pyplot as plt

#Get list of anylysis memebers
members=FreeCAD.ActiveDocument.Analysis.Member

time=[]
temp=[]

for member in members:
     if member.isDerivedFrom("Fem::FemResultObject"):
        memresult=member
        #Check first object and toggle visibility to oppesite 
#        P1=np.array(memresult.PrincipalMax)
#        P2=np.array(memresult.PrincipalMed)
#        P3=np.array(memresult.PrincipalMin)
#        Von=np.array(memresult.StressValues)
        T=np.array(memresult.Temperature)
#        dispvectors=np.array(memresult.DisplacementVectors)
#        x=np.array(dispvectors[:, 0])
#        y=np.array(dispvectors[:, 1])
#        z=np.array(dispvectors[:, 2])
        #Print messages for testing
        #FreeCAD.Console.PrintMessage(str(member.Name)+" \n")
        #FreeCAD.Console.PrintMessage(str(member.Time)+" \n")
        #Save the value you need 
        time.append(member.Time)
        temp.append(max(T))
        
        
# plot with various axes scales
plt.figure(1)
plt.plot(time,temp)
plt.title('Maximum Temprature vs time')
plt.xlabel('Time (S)')
plt.ylabel('Temprature (K)')
plt.show()
Attachments
thermal transient.fcstd
(62.57 KiB) Downloaded 98 times
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: test request, new constraints, including contact and thermomechanical analysis

Post by makkemal »

Static contact test
contact.png
contact.png (62.99 KiB) Viewed 3853 times
Attachments
Contact test(Cylinder).fcstd
(354.66 KiB) Downloaded 176 times
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: test request, new constraints, including contact and thermomechanical analysis

Post by sgrogan »

Compiles and passes all self tests on Win x64. I'll run the provided examples, so far looks good. Thanks for the work everybody :)
"fight the good fight"
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: test request, new constraints, including contact and thermomechanical analysis

Post by vejmarie »

sgrogan wrote:Compiles and passes all self tests on Win x64. I'll run the provided examples, so far looks good. Thanks for the work everybody :)
I have been able to make it works on Xenial too. (ubuntu 64bits).

Bernd, just a quick Feedback, I am a little bit lost on how we setup the thermal property. I am a daily user of a code called Flotherm from Mentor, and most of the time the process on thermal is as follow

-> Select volume material -> which is providing thermal conductivity/heat capacity and surface finishing is providing thermal resistance at the boundaries
-> Allocate a heat flux in Watts (I know, this is for electronic engineers ;)) to the volume instead of a face

-> Warm it up (aka run the simulation)
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: test request, new constraints, including contact and thermomechanical analysis

Post by makkemal »

Bernd, just a quick Feedback, I am a little bit lost on how we setup the thermal property. I am a daily user of a code called Flotherm from Mentor, and most of the time the process on thermal is as follow

-> Select volume material -> which is providing thermal conductivity/heat capacity and surface finishing is providing thermal resistance at the boundaries
-> Allocate a heat flux in Watts (I know, this is for electronic engineers ;)) to the volume instead of a face

-> Warm it up (aka run the simulation)
The thermal properties (thermal conductivity and heat capacity) are a material property and has been added to materials section.
The heat transfer coefficient is a value the user needs to add (calculate by some other means taking surface finish into account)
The finite element the calculates the temperature and deformations. This the way Calculix handles the calculation (All commercial FEM code I have used does the same). Please note stresses and temperate are calculated simultaneously which is different than just a thermal calculation

I suspect Flowtherm is a finite volume method which would have a totally different approach the the problem.
User avatar
makkemal
Posts: 395
Joined: Wed Apr 29, 2015 12:41 pm
Location: South Africa
Contact:

Re: test request, new constraints, including contact and thermomechanical analysis

Post by makkemal »

A simple clamped beam problem to explain why you would want Thermomechanical analysis attached.
The beam is clamped thus preventing thermal expansion.(which induces stress)
The same heat transfer coefficient is applied to each end although different ambient temperature is specified.
The beam reaches a steady state temperature between the two ambient temperatures but due the lack of thermal expansion results in a constant stress across the beam.

In industrial power plants you have steam running through pipes, various books exist that specify heat transfer coefficient for different steam conditions. If you ramp you steam temperature up or down to fast it will results in a broken, by specifying the heat transfer and running transients problematic operating conditions can be identified through simulation(when one section does not heat up a fast as another section)
Attachments
Beam_clamped.fcstd
(14.62 KiB) Downloaded 88 times
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: test request, new constraints, including contact and thermomechanical analysis

Post by sgrogan »

I've tested all the examples, and although I don't fully understand how everything works yet, I don't get crashes and everything appears to work as advertised. Unless others have issues I think a pull request soon would be good so bernd doesn't have to go through the rebase exercise again.
Thanks again all involved lots more tools to play with :)
"fight the good fight"
Post Reply