Error

 2 Pages12>
 Previous Topic Next Topic
 GerardLardner #1 Posted : 04 February 2021 20:52:30(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) This request comes up from time to time but as far as I can see it has never been ruled out as impossible or undesirable.Could we please have a means to define "offset variables" like barg or psig (gauge pressure, i.e. the pressure differential between a measured process and the atmospheric pressure), and also to simplify using differential pressure (difference between two pressures). In the latter case, the pressure differences could be expressed as deltaUnit (ΔPa or Δbar or Δpsi, etc.), like SMath already does for Change temperatures. It would seem to be no more impossible to implement this, for pressures, than the already existing ability to use temperatures in degrees Celsius or degrees Farenheit, which are offsets from Kelvin and Rankine respectively.Is there any reason why it cannot (or should not) be made available in SMath - apart from the developer's time to do it and his other priorities.Edited by user 04 February 2021 20:56:43(UTC)  | Reason: Not specified
 Wanna join the discussion?! Login to your SMath Studio Forum forum accountor Register a new forum account.
 ElSid #2 Posted : 04 February 2021 21:18:57(UTC) Rank: Advanced MemberGroups: Registered Joined: 05/03/2009(UTC)Posts: 424Location: USAWas thanked: 15 time(s) in 13 post(s) Not required. Temperature is a special definition. If you want to "create" your own definition, it's simple, start with apostrophe (' )and type the new variable. A change in pressure is linear, so define it as ΔPsi:=psi. If you get into absolute values, there are equations that help define it at set elevation (I did this based on ASHRAE), but it's still linear. Hope this makes senseEdited by user 04 February 2021 21:20:54(UTC)  | Reason: Not specified
 ElSid #3 Posted : 04 February 2021 22:50:17(UTC) Rank: Advanced MemberGroups: Registered Joined: 05/03/2009(UTC)Posts: 424Location: USAWas thanked: 15 time(s) in 13 post(s) Jean,Flow rate is "T/hr"? Shouldn't it be "kg/hr"?
 GerardLardner #4 Posted : 05 February 2021 03:59:01(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) Originally Posted by: ElSid Not required. Temperature is a special definition. If you want to "create" your own definition, it's simple, start with apostrophe (' )and type the new variable. A change in pressure is linear, so define it as ΔPsi:=psi. If you get into absolute values, there are equations that help define it at set elevation (I did this based on ASHRAE), but it's still linear. Hope this makes senseForgive me if I am misunderstanding you; what you say makes sense in the context of differential pressure variables; but it seems to me it does not answer the question in relation to offset variables. The example I suggested was the question of gauge pressures (usually measured relative to atmospheric pressure) and absolute pressures. Most pressure gauges or process pressure sensors give gauge pressure. But many process calculations require absolute pressure values. At sea level, 0 barg = 1.01325 bara; an offset that varies noticeably with altitude and also slightly with weather conditions. I would like to have an easy way to define atmospheric pressure (nominally 1.01325 bara at sea level), to be able to write a process pressure as say 40 barg, and have SMath understand that the process pressure is 41.01 bara. This is the same as SMath understanding that 15°C is actually 288.15 K. The Celsius temperature is offset from the Kelvin value by 273.15°; likewise gauge pressure is offset from absolute pressure by the value of the atmospheric pressure.
 GerardLardner #5 Posted : 05 February 2021 04:06:05(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) Originally Posted by: Jean Giraud For that, we use Δp XTR [Transmitter].We have lot about atmosphere ... maybe useful otherwise.Cheers ... JeanCan you elaborate please. I see dimly what you are suggesting but I can't see how it works in SMath (or Mathcad).
 Razonar #6 Posted : 05 February 2021 06:05:19(UTC) Rank: Advanced MemberGroups: Registered Joined: 28/08/2014(UTC)Posts: 813Was thanked: 433 time(s) in 282 post(s) Originally Posted by: GerardLardner ...Is there any reason why it cannot (or should not) be made available in SMath - apart from the developer's time to do it and his other priorities.For instance I don't know if your propose of Δ's it's an standard nor it have the same logic than temperature scales, even I think that it's a great idea. For example Wolfram alpha use psid and kPad for "differential pressure". For see that you can try with "3 kPa + 2 kPad" or "3 psi + 2 psid" at wolframalpha.com and check which logic it follows.As workaround you can define your own convert function for show pressures, given that you know if a pressure x is absolute or gage:Notice that UnitsOf returns an error for unknows units, but UoM works. Also I'm not prety sure if if that convertions is correct, but it's justo for show the idea about how to show abs or gauge pressures.Best regards.Alvaro.
 GerardLardner #7 Posted : 05 February 2021 11:46:08(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) Originally Posted by: Jean Giraud BTW, (...) ITS-90 specifies triple point of water 0.01 °C, thus: 273.16 °K0 °K [-273.15] is approximate.Thank you; yes, I am aware of that.
 GerardLardner #8 Posted : 05 February 2021 11:53:21(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) Originally Posted by: Jean Giraud The Δp XTR is build with two responding diaphragms, very accurate.Oh, a physical device, a normal differential pressure sensor. OK. I thought you were referring to a calculation technique; my misunderstanding.
 mkraska #9 Posted : 05 February 2021 14:25:40(UTC) Rank: Advanced MemberGroups: Registered Joined: 15/04/2012(UTC)Posts: 1,689Was thanked: 930 time(s) in 588 post(s) You might try to hack the file "units.xml" in folder "entries" in your SMath installation directory.There is a section Non-linear units. Try to understand the logic of how temperature units are defined and extend that to pressure units. Note that the id-attributes refer to line numbers in the language file (in lang\Text_xxx.lang)Beware that sheets based on non-standard SMath configurations aren't portable. Thus, as soon as you are happy with your hack, you should ask for integration into the standard distribution.I once added some special units to the file and integrated it in my portable distribution (see link in the signature). Yet these units weren't essential, so I dropped them later in order to limit the maintenance effort of the portable distribution. Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wi...th%20with%20Plugins.ashx
 ElSid #10 Posted : 06 February 2021 00:30:27(UTC) Rank: Advanced MemberGroups: Registered Joined: 05/03/2009(UTC)Posts: 424Location: USAWas thanked: 15 time(s) in 13 post(s) This is one of the RARE times I will disagree with BOTH Alvaro and Jean.Are you a member of ASHRAE? I have function, based on ASHRAE equation (IP units), that calculates the local atmospheric pressure (14.7 psi is only at sea level) based on site elevation. I use this for all of my "gas" calculations.I really need to learn the ins and outs of the CoolProp plugin, it may have something there too.Let me see if my manual has the SI formula ...BTW, when I add atmospheric, I use a defined multiplier of (' )psia. This now allows me to carry the calculations as psia moving forwardp = 101.29 * [(T + 273.1)/288.08]^5.256 from Metric atmospheric correction.This is similar to the function that I have for IPEdited by user 06 February 2021 00:46:59(UTC)  | Reason: Added psia descriptor; ADDED NASA site
 ElSid #11 Posted : 06 February 2021 00:53:53(UTC) Rank: Advanced MemberGroups: Registered Joined: 05/03/2009(UTC)Posts: 424Location: USAWas thanked: 15 time(s) in 13 post(s) I'm not arguing the offset, it's the just add 1ATM or whatever. There are functions that can be created based on site elevation that allow us to calculate the "required" offset (site atmospheric pressure in this case).As modified in my response above ...Quote:p = 101.29 * [(T + 273.1)/288.08]^5.256 from Metric atmospheric correction.This is similar to the function that I have for IPI add this to my gauge pressure and modify the units to (' )psia moving forward. Well documented and works like a charm.New reference German - standard-atmosphere-calculationsQuote:derived from properties at sea level, with n=5.2561, and where H is the altitude in meters:P=101325×(1−2.25569×10^−5×H)^5.25616 [Pa] Metric Atmospheric Adjustment.sm (6kb) downloaded 12 time(s).Edited by user 06 February 2021 01:20:12(UTC)  | Reason: Added German site
 GerardLardner #12 Posted : 06 February 2021 02:15:17(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) Originally Posted by: mkraska You might try to hack the file "units.xml" in folder "entries" in your SMath installation directory.There is a section Non-linear units. Try to understand the logic of how temperature units are defined and extend that to pressure units. Note that the id-attributes refer to line numbers in the language file (in lang\Text_xxx.lang)Hi Martin,That looks a very promising approach; I think I understand in principle what changes are required; I would need to create a new Non-linear section under Pressure units. This approach may not offer any obvious possibility for setting the offset (atmospheric pressure as an absolute pressure) to anything other than a single fixed value, but the fixed value approach is assumed in most inductrial plants and steam turbine installations - certainly on all that I have worked on in the UK, Ireland and Belgium.I notice the id-attributes appear to refer to line numbers + 9 in the Text_XXX.lang files; as if the count starts after the first 8 lines, i.e. id attribute1 refers to line 9 in the Text_XXX.lang files. All the .lang files I have inspected have the same number of lines as a header (obvious when you think about it for more than a second).I have tried making some initial changes in Units.xml to add a definition block for barg and corresponding additions at the end of Text_ENG.lang, but any change to either file leaves SMath unable to load. Is there some other detail, come other file cross-reference, I need to address as well?
 ElSid #13 Posted : 06 February 2021 02:40:29(UTC) Rank: Advanced MemberGroups: Registered Joined: 05/03/2009(UTC)Posts: 424Location: USAWas thanked: 15 time(s) in 13 post(s) Originally Posted by: Jean Giraud NASA is already in correct units.I have the OIAC flight altitude correction.I don't deal with flight/space, so first formula is all I need for compressed air or gasses, but I use the IP variant
 GerardLardner #14 Posted : 06 February 2021 03:06:57(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) Originally Posted by: ElSid This is one of the RARE times I will disagree with BOTH Alvaro and Jean.p = 101.29 * [(T + 273.1)/288.08]^5.256 from Metric atmospheric correction.This is similar to the function that I have for IPInteresting reference. Thank you. In the past I have used this one: https://www.wmo.int/page.../Doc-10_Pressure-red.pdf , in particular equation (4) on page 6, to calculate atmospheric pressure for sites at altitudes high enough for the simple assumption of atmospheric pressure = 1.01325 bara to be significantly erroneous.Edited by user 08 February 2021 21:41:44(UTC)  | Reason: Hyperlink doesnt work with a comma at the end
 GerardLardner #15 Posted : 06 February 2021 03:49:54(UTC) Rank: MemberGroups: Registered Joined: 09/11/2013(UTC)Posts: 27Location: LeinsterWas thanked: 3 time(s) in 3 post(s) Originally Posted by: Jean Giraud Did you visit post 19 ? In post 19, you can offset by whatever ± 0.12345678987654321I think we are losing sight of the requirement; perhaps I expressed it badly in the OP. It is for a simple means to change the display units of pressure in SMath to gauge pressure, whether barg or psig. Sure, I do all the calculations in absolute units as necessary. But for presentation purposes it is useful to have a simple way to display certain pressures as gauge pressures, even though they are used as absolute pressures in the calculation. I can (I do) make a conversion as needed; but it would be a simplification if it was possible just to define the result pressure unit as a gauge pressure and have the result displayed in gauge pressure units. The calculation would be made internally in the base unit (Pa) but displayed in the unit of choice, occasionally as a gauge pressure - the same as having a result in terms of temperature where one can define the result display unit as °C rather than K, for the benefit of less technical readers.I am grateful for all the suggestions for calculating pressure changes due to atmospheric pressure. Truely, I appreciate that people here do try to be most helpful.Edited by user 06 February 2021 03:56:20(UTC)  | Reason: Not specified