FEM-Hydrostatic pressure constraint help/request

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

FEM-Hydrostatic pressure constraint help/request

Post by -alex- »

Hi everyone,

Here I would ask about hydrostatic pressure.
In FEM WB there is a pressure constraint Image FEM_ConstraintPressure , but as far as I know there is no any hydrostatic pressure constraint.
I did not find relevant information on the forum for the least, I only found informations about the DLOAD card concerning the actual pressure constraint:
https://forum.freecadweb.org/viewtopic.php?f=18&t=10692

As far I am concerned when I need to achieve such kind of analysis I split a shell model, lets say a tank filled with concrete, then I apply a pressure at each level following the well known formula: P = density x gravity x height = Rho x G x H.
But it's a rough way to do, pretty fastidious, maybe there is actually a more easy way to do by using FEM WB, I don't know, tell me.
Below is a picture illustrating what I'm talking about.

If such hydrostatic feature doesn't exist, maybe one could code it?
Just a though: I assume a feature like this one should include a reference plane or surface to define the height level 0. The DLOAD card would be weighed by the Rho*G*H value. The height would be about the distance from the reference plane up to the center of the tetraedral element witch is concerned, following the normal direction of reference plane.
BTW, I have no skills concerning programming, so... now I let talk FEM WB gurus ;)

Alex

Hydrostatic-pressure-tank-concrete.png
Hydrostatic-pressure-tank-concrete.png (356.91 KiB) Viewed 3064 times
Hydrostatic-pressure-tank.FCStd
(646.58 KiB) Downloaded 150 times


OS: Windows 10
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.19.16502 (Git)
Build type: Release
Branch: master
Hash: 06962535fa9ff348acca1b893cc4239908fb8bae
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: French/France (fr_FR)
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FEM-Hydrostatic pressure constraint help/request

Post by Jee-Bee »

some info from the *DLOAD card (https://www.feacluster.com/CalculiX/ccx ... de241.html)
The surface loading is entered as a uniform pressure with distributed load type label Px where x is the number of the face. Thus, for pressure loading the magnitude of the load is positive, for tension loading it is negative. For nonuniform pressure the label takes the form PxNUy, and the user subroutine dload.f must be provided. The label can be up to 20 characters long. In particular, y can be used to distinguish different nonuniform loading patterns (maximum 16 characters). A typical example of a nonuniform loading is the hydrostatic pressure.
So indeed *DLOAD is the right one for creating hydrostatic pressure constraints.
I think that if you are interested in (helping)programming that someone is willing to help you.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FEM-Hydrostatic pressure constraint help/request

Post by Jee-Bee »

I have just checked github and the presure constraint is defined here:
https://github.com/FreeCAD/FreeCAD/blob ... essure.cpp
https://github.com/FreeCAD/FreeCAD/blob ... Pressure.h

I think that best is to add some options that are only needed for non-uniform distribututed loads. But i'm not well known with this kind of stuff that i know what other properties or methods are...
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM-Hydrostatic pressure constraint help/request

Post by bernd »

Mhh what we need would be a linear distributed pressure load. The hydrostatic pressure would just be one special case of this. For this we would need to calculate any DLOAD for any fe mesh face of the gemetrical face the load is applied too. We gone do similar calculations for force constraint but for nodes. Means it is doable.

It might be even simpler to archive this by the use of force constraint or a copy of force constraint.

First of all we need to define how would such load be defined.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM-Hydrostatic pressure constraint help/request

Post by bernd »

Probably the fastest and easiest solution would be a macro which creates constraints force or constraint pressure with different loads. This should be straight forward and doable even with little knowledge of Python.

See https://github.com/FreeCAD/FreeCAD/blob ... #L119-L126 or FEM_Tutorial_Python for how to add constraints by Python.

Such a macro could even be integrated as an utility into FreeCAD FEM master
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM-Hydrostatic pressure constraint help/request

Post by bernd »

load the file run the code ...

Code: Select all

from ObjectsFem import makeConstraintPressure as make_pressure
doc = App.ActiveDocument
max_pressure = 11000
for i, f in enumerate(doc.Cut.Shape.Faces):
    pobj = make_pressure(doc)
    pobj.Pressure = max_pressure * (len(doc.Cut.Shape.Faces) - i) / len(doc.Cut.Shape.Faces)
    pobj.References = [(doc.Cut, ('Face{}'.format(i + 1)))]

doc.recompute()
may be the load value calculation could improved. If cutting the face is done by Python too all is fully parametric ... BTW an array might be faster than 10 clones ... :oops:
Attachments
hydrostatic-pressure.FCStd
(18.06 KiB) Downloaded 120 times
User avatar
-alex-
Veteran
Posts: 1856
Joined: Wed Feb 13, 2019 9:42 pm
Location: France

Re: FEM-Hydrostatic pressure constraint help/request

Post by -alex- »

Thank you guys for advises and to show me the way. I would like to progress about programming and learning python, however as I'm concerned that's a huge challenge because of my newbie skills... I hope I will overcome by improving my very tiny skills in programming.
bernd wrote: Thu Jul 11, 2019 10:18 am load the file run the code ...
Works like a charme 8-)
That's a way to ease the processe concerning simple splited models, BTW I don't understand more than 10% of your code :oops:
Anyway, I'll focus about your previous posts concerning the way to deal with DLOAD on mesh faces and so on.
paul18
Posts: 202
Joined: Sat Jul 19, 2014 7:44 pm
Location: France

Re: FEM-Hydrostatic pressure constraint help/request

Post by paul18 »

in section 6 of calculix/ccx doc (see pages 303, 304, 306), you'll see that pressure is not applied as it stand, but through nodal forces instead so that the loading remains energetically equivalent; by linear interpollation I guess, you've to find the right values so that the force is the one resulting from the hydrostatic pressure, haven't you?

Paul
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FEM-Hydrostatic pressure constraint help/request

Post by Jee-Bee »

paul18 wrote: Sat Jul 13, 2019 4:31 pm in section 6 of calculix/ccx doc (see pages 303, 304, 306),
Please can you add a link to right topic of here " http://feacluster.com/CalculiX/ccx_2.13/doc/ccx/ " since section and page numbers can change per version?
paul18
Posts: 202
Joined: Sat Jul 19, 2014 7:44 pm
Location: France

Re: FEM-Hydrostatic pressure constraint help/request

Post by paul18 »

I've been speaking about the latest release
http://www.dhondt.de/ccx_2.15.pdf

Paul
Post Reply