New Constraint - Pressure

About the development of the FEM module/workbench.

Moderator: bernd

frabice
Posts: 32
Joined: Mon Jun 09, 2014 6:21 pm
Location: Paris, France

Re: New Constraint - Pressure

Post by frabice »

I tried your branch but I have a problem with testing. When I try to mesh, the result is an empty mesh. I don't have any error message.
What I did:
- Create a cube in the Part WB
- Switch to FEM WB
- Create a mechanical analysis
- Assign a material (steel)
- Select the cube and create a mesh with default parameters

Any idea on what I am missing?
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: New Constraint - Pressure

Post by PrzemoF »

That doesn't work for me either. There is a problem with FreeCAD and netgen.. What I'm using instead is gmsh and macro GMSHMesh that you can find here: [1]. The workflow:
1. Create a part, cube for example
2. Start the macro
3.Select the part (click on anything, face, line or point)
4. Run the macro - it generates a mesh using gmsh (it has to be installed on your system)
5. Close the marce
6. Select the mesh
7. Now click on New Analysis - it will take the mesh and then you can add constraints, material and so on.

[1] https://github.com/psicofil/Macros_FreeCAD
frabice
Posts: 32
Joined: Mon Jun 09, 2014 6:21 pm
Location: Paris, France

Re: New Constraint - Pressure

Post by frabice »

Thank you, now that works!

I have a problem at the Calculix stage now... In fact it was not installed the first time I tried so I tried to install it but I have an error when building the source. I follow the instructions I found there : http://www.dhondt.de/INST_CCX_2_8_MAC_02_10_2015.pdf. I am on Mac OS 10.9.5.

I have this error at compilation:

Code: Select all

/usr/local/bin/g++ -Wall -O3 -pthread  -I ../../../SPOOLES.2.2 -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE -DMATRIXSTORAGE -c biosav.c
biosav.c: In function ‘void biosav(int*, int*, char*, int*, double*, double*, double*, int*, int*, int*)’:
biosav.c:168:70: error: invalid conversion from ‘void*’ to ‘void* (*)(void*)’ [-fpermissive]
  pthread_create(&tid[i],NULL,(void *)biotsavartmt,(void *)&ithread[i]);
                                                                      ^
In file included from biosav.c:23:0:
CalculiX.h:1647:5: note: initializing argument 3 of ‘int pthread_create(_opaque_pthread_t**, const pthread_attr_t*, void* (*)(void*), void*)’
 int pthread_create (pthread_t *thread_id, const pthread_attr_t *attributes,
     ^
make: *** [biosav.o] Error 1
That is probably not the right place to discuss that. Should I open a new thread?
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: New Constraint - Pressure

Post by bernd »

The new pressure constraint works good for me.

The blue arrows do not turn the direction on activating the reverse button but the pressure does. BTW How is the possitive (non reverse) direction defined?

The units of the force jump arbitrary between Pa, kPa and GPa.

Do we really need the reverse button? We could just use a minus before the force value instead but the arrows do not turn than becaus of minus so may be keep the reverse button.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: New Constraint - Pressure

Post by PrzemoF »

frabice wrote:[..]That is probably not the right place to discuss that. Should I open a new thread?
Yes, it's a good idea. Compiling ccx from the sources is hard even if you're experienced developer :shock: Try to find a binary file.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: New Constraint - Pressure

Post by PrzemoF »

bernd wrote:The new pressure constraint works good for me.
The blue arrows do not turn the direction on activating the reverse button but the pressure does. BTW How is the possitive (non reverse) direction defined?
The units of the force jump arbitrary between Pa, kPa and GPa.
Do we really need the reverse button? We could just use a minus before the force value instead but the arrows do not turn than becaus of minus so may be keep the reverse button.
Thanks for testing! I have some problems with the arrows, so probably I mixed something. The units are jumping it's a normal behaviour of input field, but I think I could try to control it. Using negative values would make the code a bit simpler, but "reverse" check box is used in many other places - that's why I kept it. I'll try to get rid of it and we'll see how it looks.

Answer to BTW :) there is no direction at all. I removed it as pressure should be directionless. If you see a direction somewhere in the code new code it needs to be removed. All we have is "reversed" variable that changes sign (+/-) in ccxInpWriter, but that will be gone as well when I implement negative pressure values.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: New Constraint - Pressure

Post by bernd »

PrzemoF wrote:... The units are jumping it's a normal behaviour of input field, but I think I could try to control it....
Neverless there seams a bug in units anyway. Tested in:
przemo/pressure_v2
przemo/pressure_no_reverse

Put in the values and click on ok and reopen the object.

100 Pa --> 100 Pa --> ok
100 kPa --> 100 kPa --> ok
100 MPa --> 100 GPa --> wrong --> 100 MPa = 0.1 GPa
100 GPa --> 1e+08 Pa -> wrong --> 100 GP = 1e+11 Pa
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: New Constraint - Pressure

Post by PrzemoF »

Thanks for testing! There was a problem with units system [1], also Stress wasn't handled the same way as pressure [2]. I'll rebase the branches to master and force push both. What's your opinion: the reverse check box should stay to keep the user experience consistent with other constraints or we should remove it making the code simpler and allowing use of negative pressure values (my vote goes to this option)?

[1] https://github.com/FreeCAD/FreeCAD_sf_m ... efcd925ffb
[2] https://github.com/FreeCAD/FreeCAD_sf_m ... 851043c8eb

Edit: Both branches force pushed, please test again. If there are no other problems I'll send a pull request with one of the versions.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: New Constraint - Pressure

Post by bernd »

PrzemoF wrote:... What's your opinion: the reverse check box should stay to keep the user experience consistent with other constraints or we should remove it making the code simpler and allowing use of negative pressure values ... ? ... please test again.
I will but not until later today.
Post Reply