jaheyns / CfdOF

Computational Fluid Dynamics (CFD) for FreeCAD based on OpenFOAM solver
GNU Lesser General Public License v3.0
449 stars 85 forks source link

Meshes and STL geometry always seem to be scaled by (1000, 1000, 1000) irrespective of FreeCAD base units #80

Closed oliveroxtoby closed 1 year ago

oliveroxtoby commented 1 year ago

In GitLab by @icojb25 on Mar 24, 2022, 06:56

The scaling in surfaceTransformPoint utility call is always applied, irrespective of whether the FreeCAD base units are specified in M/KG/s or mm/KG/s. I have not looked too deep into the code to see whether theres some hard and fast reason that all models are built in the mm/KG/s regime, but it might be possible to check the master units scheme and leave out the scaling if its not required.

It seems there is likely a way to get the user object and check their units preferences.

This would save users subtle mistakes (for those who like to work in M/K/S) and make the implementation more flexible / robust in general.

oliveroxtoby commented 1 year ago

In GitLab by @oliveroxtoby on Mar 24, 2022, 07:12

Agreed, this is definitely a bug if it only works with certain unit systems. It is fixed as 1000 as I believed this was tied to an internal FreeCAD units system which is always in mm, but perhaps I have missed something. I'll do some testing with other unit systems.

oliveroxtoby commented 1 year ago

In GitLab by @oliveroxtoby on Mar 25, 2022, 15:00

Hi @icojb25, would you mind uploading a simple case to demonstrate the issue? I realise I have actually been working in mks myself for a long while and haven't noticed any issues.

As I said, certain things happen in fixed freecad internal units which are always in mm, which can confuse matters.

oliveroxtoby commented 1 year ago

In GitLab by @icojb25 on Mar 25, 2022, 23:13

hi @oliveroxtoby I'll need to think about what the steps were, unforunately i was still playing around with the functionality at the time, but essentially, I believe i modelled a part in a particular unit system, and then when used in cfdOF it ended up grossly too small (?). I cant remember if it was a pre-existing part modelled in another MKS unit system.

I think in general a review of the unit system needs to be confirmed as I wasnt quite sure about the inputs for the t-model quantities either, some of which FC seems to manage conversion for and not. It may just be me getting up to speed with the system, but it felt like there were some potential inconsistencies. :thinking:

oliveroxtoby commented 1 year ago

In GitLab by @oliveroxtoby on May 22, 2022, 19:12

Closing for now - feel free to reopen once you have steps to reproduce.