is support for units Gauss, Oersted and Weber sensible?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
uwestoehr
Posts: 1542
Joined: Sun Jan 27, 2019 3:21 am

is support for units Gauss, Oersted and Weber sensible?

Postby uwestoehr » Sun Jan 05, 2020 3:03 pm

I recently added unit support for FC in order to perform in future electromagnetic simulations. However these three units are not yet supported: Gauss, Weber, Oersted and I am reluctant if I should add support for them or not.

Bernd, what do you think as our FEM expert? Werner, you added units recently too, what is your opinion?

as reference the list of currently supported units:
Expressions#Units
wmayer wrote:.
bernd wrote:.
wmayer
Site Admin
Posts: 15937
Joined: Thu Feb 19, 2009 10:32 am

Re: is support for units Gauss, Oersted and Weber sensible?

Postby wmayer » Sun Jan 05, 2020 6:08 pm

Bernd, what do you think as our FEM expert? Werner, you added units recently too, what is your opinion?
You can have a look at OCC's Units.dat file that contains all supported units. It also includes Gauss, Weber and Oersted. So feel free to add it to FreeCAD, too.
User avatar
uwestoehr
Posts: 1542
Joined: Sun Jan 27, 2019 3:21 am

Re: is support for units Gauss, Oersted and Weber sensible?

Postby uwestoehr » Sun Jan 05, 2020 9:14 pm

wmayer wrote:
Sun Jan 05, 2020 6:08 pm
Bernd, what do you think as our FEM expert? Werner, you added units recently too, what is your opinion?
You can have a look at OCC's Units.dat file that contains all supported units. It also includes Gauss, Weber and Oersted. So feel free to add it to FreeCAD, too.
Thanks for the pointer: https://github.com/3drepo/occt/blob/mas ... /Units.dat

So I will add them and also the missing temperature unit Fahrenheit for the imperial system.
User avatar
uwestoehr
Posts: 1542
Joined: Sun Jan 27, 2019 3:21 am

Re: is support for units Gauss, Oersted and Weber sensible?

Postby uwestoehr » Sun Jan 05, 2020 10:44 pm

uwestoehr wrote:
Sun Jan 05, 2020 9:14 pm
So I will add them and also the missing temperature unit Fahrenheit for the imperial system.
Here is the PR: https://github.com/FreeCAD/FreeCAD/pull/2863

I could not add support for °C because we only support factors to calculate the value in Quantity.cpp. For °F it is even more complex since the span of 1 °F <> 1 K.
I don't know if it is wort supporting these 2 units, despite for thermic simulations °C might be convenient.
chrisb
Posts: 25107
Joined: Tue Mar 17, 2015 9:14 am

Re: is support for units Gauss, Oersted and Weber sensible?

Postby chrisb » Sun Jan 05, 2020 11:30 pm

uwestoehr wrote:
Sun Jan 05, 2020 10:44 pm
For °F it is even more complex since the span of 1 °F <> 1 K.
Isn't this the same situation as with mm vs. inch?
User avatar
uwestoehr
Posts: 1542
Joined: Sun Jan 27, 2019 3:21 am

Re: is support for units Gauss, Oersted and Weber sensible?

Postby uwestoehr » Mon Jan 06, 2020 12:39 am

chrisb wrote:
Sun Jan 05, 2020 11:30 pm
uwestoehr wrote:
Sun Jan 05, 2020 10:44 pm
For °F it is even more complex since the span of 1 °F <> 1 K.
Isn't this the same situation as with mm vs. inch?
No, because 1 in = 2,54 cm. So you have a fixed factor. The calculation for °C is an addition, not a multiplication.
For °F the calculation is: ([°F] + 459.67) * ​5/9 K
wmayer
Site Admin
Posts: 15937
Joined: Thu Feb 19, 2009 10:32 am

Re: is support for units Gauss, Oersted and Weber sensible?

Postby wmayer » Mon Jan 06, 2020 9:19 am

uwestoehr wrote:
Mon Jan 06, 2020 12:39 am
chrisb wrote:
Sun Jan 05, 2020 11:30 pm
uwestoehr wrote:
Sun Jan 05, 2020 10:44 pm
For °F it is even more complex since the span of 1 °F <> 1 K.
Isn't this the same situation as with mm vs. inch?
No, because 1 in = 2,54 cm. So you have a fixed factor. The calculation for °C is an addition, not a multiplication.
For °F the calculation is: ([°F] + 459.67) * ​5/9 K
Then just omit this stuff.
User avatar
bernd
Posts: 10062
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: is support for units Gauss, Oersted and Weber sensible?

Postby bernd » Mon Jan 06, 2020 10:10 am

uwestoehr wrote:
Sun Jan 05, 2020 9:14 pm
wmayer wrote:
Sun Jan 05, 2020 6:08 pm
You can have a look at OCC's Units.dat file that contains all supported units. It also includes Gauss, Weber and Oersted. So feel free to add it to FreeCAD, too.
Thanks for the pointer: https://github.com/3drepo/occt/blob/mas ... /Units.dat
wow I did not know about this. Added link to the wiki in Units
User avatar
uwestoehr
Posts: 1542
Joined: Sun Jan 27, 2019 3:21 am

Re: is support for units Gauss, Oersted and Weber sensible?

Postby uwestoehr » Mon Jan 06, 2020 1:31 pm

wmayer wrote:
Mon Jan 06, 2020 9:19 am
Then just omit this stuff.
I did so in my PR.