Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
00a9d48
fortran: tighten validity checks
dmey Feb 14, 2019
295f1b0
fix typo and add max iter count
dmey Feb 18, 2019
9bc075c
fix fortran
dmey Feb 23, 2019
d335075
C: tighten val checks
dmey Feb 23, 2019
08e8586
fix c
dmey Feb 23, 2019
e3dfe51
js: tighten up val checks
dmey Feb 23, 2019
fc06d99
fix fortran
dmey Feb 23, 2019
c11a5a4
fix fortran
dmey Feb 23, 2019
7df076f
fix logic
dmey Feb 23, 2019
1f2297c
VBA: tighten val checks
dmey Feb 24, 2019
72f5f63
add test for clamping humratio to 10e-7
dmey Feb 24, 2019
155670f
minor: 1E-7 -> 1e-7
dmey Feb 24, 2019
7cd1bed
start index at 0 on all langs
dmey Feb 24, 2019
7b09d0d
reduce value of MIN_ITER_COUNT: 5 -> 3.
dmey Feb 24, 2019
d24a332
remove MIN_ITER_COUNT
dmey Mar 4, 2019
52232e2
fix convergence in GetTDewPointFromVapPres
dmey Mar 12, 2019
4573c17
typo
dmey Mar 12, 2019
e1feda8
Merge remote-tracking branch 'origin/master' into dmey/tighten-validi…
dmey Mar 16, 2019
398c83b
GetTDewPointFromVapPres: add simple test to check convergence (#27)
dmey Mar 16, 2019
2983b23
add conv tests for js, py, f and c
dmey Mar 16, 2019
bc4393c
remove discontinuity code in saturated pressure func
dmey Mar 16, 2019
5cbae56
py finish adding BoundedHumRatio + modify range in tests for conv in IP
dmey Mar 17, 2019
e9519e2
fix js tests by inreasing the timelimit in mocha from 2 to 40 s
dmey Mar 17, 2019
05c5fef
C: integrate chnages from python version
dmey Mar 17, 2019
65fba5f
F, c, js: integrate changes from python version [wip]
dmey Mar 18, 2019
d56465a
fortran make loop in GetTDewPointFromVapPres same in other impl
dmey Mar 19, 2019
4f63e28
Merge remote-tracking branch 'origin/master' into dmey/tighten-validi…
dmey Mar 19, 2019
474e724
Add convergence test for VBA/Excel (#28)
didierthevenard Mar 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
GetTDewPointFromVapPres: add simple test to check convergence (#27)
  • Loading branch information
dmey authored Mar 16, 2019
commit 398c83b0029e5874e7604b21328b6907caca609f
8 changes: 8 additions & 0 deletions tests/js/test_psychrolib_si.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ it('test_VapPres_TDewPoint', function () {
expect(psyjs.GetTDewPointFromVapPres(60.0, VapPres)).to.be.closeTo(50.0, 0.001)
});

// Test of relationships between wet bulb temperature and relative humidity
// This test was known to cause a convergence issue in GetTDewPointFromVapPres
// in versions of PsychroLib <= 2.0.0
it('test_TWetBulb_RelHum', function () {
var TWetBulb = psyjs.GetTWetBulbFromRelHum(7, 0.61, 100000)
checkRelDiff(TWetBulb, 3.92667433781955, 0.001)
});

// Test of relationships between humidity ratio and vapour pressure
it('test_HumRatio_VapPres', function () {
var HumRatio = psyjs.GetHumRatioFromVapPres(3169.7, 95461) // conditions at 25 C, std atm pressure at 500 m
Expand Down
19 changes: 19 additions & 0 deletions tests/test_psychrolib_si.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2018 D. Thevenard and D. Meyer. Licensed under the MIT License.
# Test of PsychroLib in SI units for Python, C, and Fortran.

import numpy as np
import pytest

pytestmark = pytest.mark.usefixtures('SetUnitSystem_SI')
Expand Down Expand Up @@ -68,6 +69,24 @@ def test_VapPres_TDewPoint(psy):
VapPres = psy.GetVapPresFromTDewPoint(50.0)
assert psy.GetTDewPointFromVapPres(60.0, VapPres) == pytest.approx(50.0, abs = 0.001)

# Test of relationships between wet bulb temperature and relative humidity
# This test was known to cause a convergence issue in GetTDewPointFromVapPres
# in versions of PsychroLib <= 2.0.0
def test_TWetBulb_RelHum(psy):
TWetBulb = psy.GetTWetBulbFromRelHum(7, 0.61, 100000)
assert TWetBulb == pytest.approx(3.92667433781955, rel = 0.001)

# Test that the NR in GetTDewPointFromVapPres converges.
# This test was known problem in versions of PsychroLib <= 2.0.0
# def test_GetTDewPointFromVapPres_convergence(psy):
# TDryBulb = np.arange(30, 40, 0.1)
# RelHum = np.arange(0.1, 0.9, 0.01)
# Pressure = np.arange(101010, 120000)
# for T in TDryBulb:
# for RH in RelHum:
# for p in Pressure:
# psy.GetTWetBulbFromRelHum(T, RH, p)

# Test of relationships between humidity ratio and vapour pressure
# Humidity ratio values to test against are calculated with Excel
def test_HumRatio_VapPres(psy):
Expand Down
8 changes: 8 additions & 0 deletions tests/vba/test_psychrolib_si.bas
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ Sub test_VapPres_TDewPoint()
Call TestExpression("GetTDewPointFromVapPres", GetTDewPointFromVapPres(60#, VapPres), 50#, abst:=0.001)
End Sub

' Test of relationships between wet bulb temperature and relative humidity
' This test was known to cause a convergence issue in GetTDewPointFromVapPres
' in versions of PsychroLib <= 2.0.0
Sub test_TWetBulb_RelHum()
TWetBulb = GetTWetBulbFromRelHum(7, 0.61, 100000)
Call TestExpression("GetTWetBulbFromRelHum", TWetBulb, 3.92667433781955, relt:=0.001)
End Sub

' Test of relationships between humidity ratio and vapour pressure
' Humidity ratio values to test against are calculated with Excel
Sub test_HumRatio_VapPres()
Expand Down