Supporting explicit quantity types in the Quantity types #1078
Replies: 1 comment
-
Essentially, we should keep track of and propagate the unit quantity rather than the dimension of the values. Unit Quantity: Pressure, Velocity, Force, Torque, Work etc. We can associate a Unit Quantity Map ( { Unit Quantity : power }) with every real value solver setting or expression/report definition value. (e.g. boundary_conditions.inlet['inlet1'].vmag ==> {Velocity : 1}, Volume Integral of Pressure at fluid ==> { Pressure: 1, Volume: 1}. We can also associate a unit to a Unit Quantity. (e.g. Pa implies Pressure, N imples Force). So, Quantity(1, "Pa") is associated with { Pressure : 1}, whereas Quantity(1, "N m") is associated with { Force : 1, Length : 1}. We can have rules for simplification of Quantity maps. e.g. { Force : 1, Length : 1} can be simplified to { Work : 1}. Mathematical operations will automatically propagate the unit quantity map. For addition/subtraction etc, the term with the simpler unit quantity map will win. |
Beta Was this translation helpful? Give feedback.
-
This follows some discussion with @h-krishnan. At the moment, Quantity is in terms of units without the context of specific quantity types. But if the intended quantity type is known, that would lead to a more appropriate choice of units for a given Quantity objects.
Consider some use cases
Beta Was this translation helpful? Give feedback.
All reactions