Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline GerardLardner  
#1 Posted : 04 February 2021 20:52:30(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 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 account. New Registrations are disabled.

Offline ElSid  
#2 Posted : 04 February 2021 21:18:57(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 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 sense

Edited by user 04 February 2021 21:20:54(UTC)  | Reason: Not specified

Offline ElSid  
#3 Posted : 04 February 2021 22:50:17(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Jean,
Flow rate is "T/hr"? Shouldn't it be "kg/hr"?
Offline GerardLardner  
#4 Posted : 05 February 2021 03:59:01(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: ElSid Go to Quoted Post
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 sense


Forgive 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.

Offline GerardLardner  
#5 Posted : 05 February 2021 04:06:05(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
For that, we use Δp XTR [Transmitter].
We have lot about atmosphere ... maybe useful otherwise.
Cheers ... Jean


Can you elaborate please. I see dimly what you are suggesting but I can't see how it works in SMath (or Mathcad).
Offline Razonar  
#6 Posted : 05 February 2021 06:05:19(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: GerardLardner Go to Quoted Post
...
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:

Clipboard01.jpg

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.
Offline GerardLardner  
#7 Posted : 05 February 2021 11:46:08(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
BTW, (...) ITS-90 specifies triple point of water 0.01 °C, thus: 273.16 °K
0 °K [-273.15] is approximate.


Thank you; yes, I am aware of that.
Offline GerardLardner  
#8 Posted : 05 February 2021 11:53:21(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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.
Offline mkraska  
#9 Posted : 05 February 2021 14:25:40(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 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://smath.com/wiki/SMath_with_Plugins.ashx
Offline ElSid  
#10 Posted : 06 February 2021 00:30:27(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 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 forward

p = 101.29 * [(T + 273.1)/288.08]^5.256 from Metric atmospheric correction.
This is similar to the function that I have for IP

Edited by user 06 February 2021 00:46:59(UTC)  | Reason: Added psia descriptor; ADDED NASA site

Offline ElSid  
#11 Posted : 06 February 2021 00:53:53(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 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 IP

I 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-calculations
Quote:
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

Offline GerardLardner  
#12 Posted : 06 February 2021 02:15:17(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: mkraska Go to Quoted Post
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?
Offline ElSid  
#13 Posted : 06 February 2021 02:40:29(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
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 Clapping
Offline GerardLardner  
#14 Posted : 06 February 2021 03:06:57(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: ElSid Go to Quoted Post
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 IP


Interesting 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

Offline GerardLardner  
#15 Posted : 06 February 2021 03:49:54(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Did you visit post 19 ?
In post 19, you can offset by whatever ± 0.12345678987654321


I 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

Offline mkraska  
#16 Posted : 06 February 2021 15:43:45(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: GerardLardner Go to Quoted Post
Originally Posted by: mkraska Go to Quoted Post
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)


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?


I think you have to leave the language files untouched. The length of the file and the replacement handling is probably hardwired at compile-time.

This implies that you don't get a correct description in the insert units dialog and in the dynamic assistant.

Yet you can define and use the units as you described in the topic starter post.
Here, I demonstrate this with the german atü unit (Atmosphere Overpressure/Überdruck)

Once you are happy with your definitions, ask the developers to add these units by default. This has happened in the past, so there is a chance.

BTW, I'd expect many new users to fail with correct usage of such units as they aren't aware of the difference between absolute and difference units, much like the frequently popping up questions on temperature and temperature differences.

Page1.png
Page1.sm (13kb) downloaded 12 time(s).
Units.zip (5kb) downloaded 14 time(s).

I had to zip Units.xml, because xml is blocked for attachments.

Edited by user 06 February 2021 15:46:26(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline GerardLardner  
#17 Posted : 08 February 2021 12:29:43(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: mkraska Go to Quoted Post
Here, I demonstrate this with the german atü unit (Atmosphere Overpressure/Überdruck)


Thank you. I have not had time to look at this properly but, at first glance and as you have defined it, the German atü unit does rather look like it is the same as barg (gauge pressure) at sea level. Second look: as before, except for the 101325 multiplier; if the multiplier was 100000 and the offset was 101325, it would be barg.

Edited by user 08 February 2021 13:31:42(UTC)  | Reason: Not specified

Offline ElSid  
#18 Posted : 08 February 2021 17:11:29(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
Originally Posted by: GerardLardner Go to Quoted Post
Interesting 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.

WMO Link, FIXED link above WMO Pressure Reduction Formula. I realized, after Jean posted the graph, I sent a scratch version, so be careful with UoM() function in that example. Using a CAS program like SMath allows us to use actual definitions, like the NASA or ASHRAE formula, which is traceable.

What I was getting at is that you can define your own units. Using the apostrophe (' ), it turns the definition blue like the other defined units ....
Check out defining sound. I asked for help there with decibel (dB ). This "unit" is not built in so I had to define it. Other units, like inches water or feet of water (I'm in the US) I do the same. I have a file that I save as units definitions and then "include" that file in my calculations so I can use "my" custom units

As to your last post, pressure IS linear when it comes to change. As SMath is similar to MathCAD in this regard, see Working with Temperatures

Edited by user 08 February 2021 21:39:59(UTC)  | Reason: Added working with Temperature Link. FIXED WMO Link Had a coma

Offline GerardLardner  
#19 Posted : 08 February 2021 21:39:56(UTC)
GerardLardner


Rank: Advanced Member

Groups: Registered
Joined: 09/11/2013(UTC)
Posts: 32
Ireland
Location: Leinster

Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: ElSid Go to Quoted Post
Originally Posted by: GerardLardner Go to Quoted Post
https://www.wmo.int/pages/prog/www/IMOP/meetings/SI/ET-Stand-1/Doc-10_Pressure-red.pdf


The link should work now. For some reason the forum software had included the comma in my sentance in the hyperlink; simply removing the comma at the end of the address in the error page makes it work.
Offline ElSid  
#20 Posted : 08 February 2021 23:19:03(UTC)
ElSid


Rank: Advanced Member

Groups: Registered
Joined: 05/03/2009(UTC)
Posts: 433
Man
United States
Location: USA

Was thanked: 17 time(s) in 15 post(s)
I'm attaching the functions using the built in definitions. The NASA equations align very well with ASHRAE formulas once a sign error was fixed.
Atmospheric Adjustment ASHRAE NASA.sm (25kb) downloaded 18 time(s).
If memory serves, Jean has posted some sheets with ISA references. Differences between ASHRAE and NASA solutions in the Troposphere due "rounding" (e.g. in the exponent).
Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.