Advice on approcah for humidity conversions in c#

  • Thread starter Thread starter a_programmer
  • Start date Start date
  • Tags Tags
    Humidity
Click For Summary
SUMMARY

The discussion focuses on implementing humidity conversions in C# using psychometric functions. The user sought advice on converting relative humidity to absolute humidity and vice versa, utilizing variables such as dry bulb temperature, altitude, and pressure. The Sonntag and Magnus formulas were recommended for calculating saturated vapor pressure. Ultimately, the user successfully applied the provided formula to achieve accurate humidity calculations.

PREREQUISITES
  • Understanding of C# programming language
  • Familiarity with psychrometric principles
  • Knowledge of the Sonntag and Magnus formulas for vapor pressure calculations
  • Basic concepts of humidity measurement and conversion
NEXT STEPS
  • Research the implementation of the Sonntag formula in C# for vapor pressure calculations
  • Explore the Magnus-Tetens approximation for humidity conversions
  • Learn about psychrometric charts and their applications in HVAC systems
  • Investigate numerical methods for solving recursive equations in programming
USEFUL FOR

Software engineers, HVAC professionals, and anyone involved in environmental monitoring or climate control systems would benefit from this discussion.

a_programmer
Messages
2
Reaction score
0
Hello all,

First off, I would just like to say hello, as I am a new member :)

I was hoping for some advice on implementing humidity conversions in code.
I have spent about 4-5 days trawling the internet for helpful psychometric functions to help convert relative humidity to absolute humidity and back.

Despite numerous attempts, I have failed in implementing anything that will output anything but garbage values. While I may appreciate some of you are thinking that this is a programming problem, i assure you it isn't.

The only variables I have to play around with are the dry bulb temperature of the air, the altitude, the pressure at that altitude and the absolute humidity for the relative humidity calculation ( and vice versa ). I do not have the dew point.

At this juncture, I would be happy to use something like the Sonntag or Magnus formula.
As a software engineer, this is very much out of my league. Thus, if anyone could give some advice on appropriate approaches, I would be most appreciative.



A Programmer
 
Engineering news on Phys.org
Hello, colleague :)

//Saturated vapor pressure knowledge (by Sonntag or Magnus formula) is quite enough.

double RelativeHumidity(double AbsoluteHumidity, double Temperature)
{
return AbsoluteHumidity / SaturatedVaporPressure(Temperature);
}
 
Hi Graniar,

Thanks very much for the help. I got it cracked in the end; i used the exact same formula you quoted to get AH, and i just did a recursive search with an increasingly narrow search to provide a decently accurate estimation for the RH.

Thanks again,

A_Programmer
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
11K
Replies
4
Views
5K
  • · Replies 8 ·
Replies
8
Views
4K
Replies
5
Views
4K
Replies
8
Views
8K