non uniform distributed load
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
non uniform distributed load
Does anyone know of a way of applying a non uniform distributed load on a face using freecad?
I have tried reading the calculix manual but couldnt get my head around the way calculix code is written.
Any help would be greatly appreciated
I have tried reading the calculix manual but couldnt get my head around the way calculix code is written.
Any help would be greatly appreciated
Re: non uniform distributed load
Hi Taufeeq1, welcome to the FreeCAD forum.
I have moved your topic to the FEM forum.
I have moved your topic to the FEM forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: non uniform distributed load
what exactly do you mean by a nonuniform face load?
Re: non uniform distributed load
Worst case you can make it you're self with a CLOAD or DLOAD just add on every node or face another load.
Not nice but i wasn't able to see all the examples... http://www.feacluster.com/CalculiX/ccx_ ... ode403.php
Not nice but i wasn't able to see all the examples... http://www.feacluster.com/CalculiX/ccx_ ... ode403.php
Re: non uniform distributed load
what could be don as work around:
- split the face into new faces, by sketcher and boolean fragments
- use uniform face load on each face
- split the face into new faces, by sketcher and boolean fragments
- use uniform face load on each face
Re: non uniform distributed load
An approach to program this, would be something similar like the mesh settings for GMSH. So one can set values at the edges of a face and an interpolation routine would be needed, that sets the intermediate values for all mesh-faces or nodes of this face.
Openfoam allows to define a field, for example a flow field for the inlet of some tube that has the velocity distribution of a laminar flow. Such a field is than used to set the boundary conditions at an cross section of that tube.
This looks like a feature request with a lot of programming work required.
Ulrich
Openfoam allows to define a field, for example a flow field for the inlet of some tube that has the velocity distribution of a laminar flow. Such a field is than used to set the boundary conditions at an cross section of that tube.
This looks like a feature request with a lot of programming work required.
Ulrich
Re: non uniform distributed load
I would aasume u need this: http://www.feacluster.com/CalculiX/ccx_ ... de241.html
But there is no uniformal distributed option in it....
But there is no uniformal distributed option in it....
Re: non uniform distributed load
we would not need it, we could calculate the dload for every element face.
Re: non uniform distributed load
Attached one can find a small example, howto apply a nonuniform pressure load.
There is plate from shell elements with a circluar shaped face.
The face at the center should get a cosine shaped pressure distribution.
workflow:
- ensure Edit->Preferences->FEM->Calculix->InputFileSplitting is checked
- load "cosine shaped pressure load.FCStd"
- delete object "NonUniformLoad"
- activate Analysis
- "Write inp file" in CalculiXccxTools task view
- execute macro "ApplyNonUniformLoad.FCMacro" and wait for finishing (see report view)
- "Run Calculix" in CalculiXccxTools task view
result:
file:
macro:
Code: Select all
import Draft
import Part
import os
import sys
import tempfile
import math
# pressure load distribution p = f(x,y,z) [MPa]
def UniformLoad(x, y, z):
p = math.cos (math.sqrt (x*x + y*y) / 20 * math.pi / 2)
return p
doc = App.ActiveDocument
mesh = doc.getObjectsByLabel("FEMMeshGmsh")[0].FemMesh
## hardcoded user input ##
LoadFace = doc.getObject("CompoundFilter").Shape.Face3 # face to apply pressure load
LoadDisplayScale = 20. # scaling of vectors for pressure visualization [mm/MPa}
##
ElementFaces = mesh.getFacesByFace(LoadFace)
print ("No of Element Faces: " + str(len(ElementFaces)))
print ("Element Faces: " + str(ElementFaces))
# get WorkingDir
WorkingDir = FreeCAD.ParamGet('User parameter:BaseApp/Preferences/Mod/Fem/General').GetString("WorkingDir")
if not WorkingDir:
WorkingDir = doc.getObject("CalculiXccxTools").WorkingDir
if not WorkingDir:
WorkingDir = tempfile.gettempdir()
print ("WorkingDir: " + WorkingDir)
if not WorkingDir:
raise SystemExit
# create INP file pressure section
# has to be included into master INP file
with open (WorkingDir + "/FemMeshGmsh_Pressure.inp", "w") as f:
f.write ("***********************************************************\n")
f.write ("** Element + CalculiX face + load in [MPa]\n")
f.write ("** written by " + (os.path.basename(__file__)) + "\n")
f.write ("** FemConstraintPressure\n")
f.write ("*DLOAD\n")
f.write ("** FemConstraintPressure: face load\n")
VGroup = Draft.makeVisGroup()
VGroup.Label = "NonUniformLoad"
VGroup.ViewObject.LineColor = (0.000,1.000,0.000)
VGroup.ViewObject.ShapeColor = (1.000,0.000,0.000)
VGroup.ViewObject.Transparency = 80
for n in ElementFaces:
Gui.updateGui()
Nodes = mesh.getElementNodes(n)
print ("Nodes of Elem (" + str(n) + "): " + str(Nodes))
Points = []
if len(Nodes) == 3:
# for 1st order faces
Points.append(mesh.getNodeById(Nodes[0]))
Points.append(mesh.getNodeById(Nodes[1]))
Points.append(mesh.getNodeById(Nodes[2]))
elif len(Nodes) == 6:
# for 2nd order faces
Points.append(mesh.getNodeById(Nodes[0]))
Points.append(mesh.getNodeById(Nodes[3]))
Points.append(mesh.getNodeById(Nodes[1]))
Points.append(mesh.getNodeById(Nodes[4]))
Points.append(mesh.getNodeById(Nodes[2]))
Points.append(mesh.getNodeById(Nodes[5]))
else:
print ("Error: ElementFace: " + str(n) + " NodeCount: " + str(len(Nodes)) + " Hint: Only 3 or 6 nodes per face allowed")
break
print (Points)
Face = Draft.makeWire (Points, closed = True, face = True)
VGroup.addObject(Face)
Xm = Face.Shape.CenterOfMass.x
Ym = Face.Shape.CenterOfMass.y
Zm = Face.Shape.CenterOfMass.z
print ("CenterOfMass: X" + str(Xm) + " Y" + str(Ym) + " Z" + str(Zm))
ElementFaceLoad = UniformLoad(Xm, Ym, Zm)
print ("ElementFaceLoad: " + str(ElementFaceLoad))
normal = Face.Shape.normalAt(0,0)
print ("Face normal: " + str(normal))
# visualize pressure vector
Load = Draft.makeLine(Face.Shape.CenterOfMass, LoadDisplayScale * ElementFaceLoad * normal + Face.Shape.CenterOfMass)
VGroup.addObject(Load)
# write to INP file
f.write (str(n) + ",P," + str(ElementFaceLoad)+ "\n")
print ("==============================")
print "ready"
done with:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13516 (Git)
Build type: Release
Branch: master
Hash: 7101d9a89d49ed718d42611a81f1097b723e5ad2
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)