Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions lib/osut/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ module OSut
# returned if a valid surface tilt [0, PI] is provided. Otherwise, generic
# tilt-independent air film resistances are returned instead.
#
# @param [:to_sym] surface type, e.g. :roof, :wall, :partition, :ceiling
# @param [Numeric] surface tilt (in rad), optional
# @param type [:to_sym] surface type, e.g. :roof, :wall, :partition, :ceiling
# @param tilt [Numeric] surface tilt (in rad), optional
#
# @return [Float] surface air film resistance(s)
# @return [0.0] if invalid input (see logs)
Expand Down Expand Up @@ -587,7 +587,7 @@ def resetUo(lc = nil, film = nil, index = nil, uo = nil, uniq = false)
mt.setName(id)

unless mt.setThermalResistance(r)
return invalid("Failed #{id}: RSi#{r.round(2)}", mth)
return invalid("Failed #{id}: RSi#{r.round(2)}", mth, 0, DBG, 0.0)
Copy link
Copy Markdown
Member Author

@brgix brgix Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method filmResistances() should always return a real number - not the OSlg default nil.

end

lc.setLayer(index, mt)
Expand Down Expand Up @@ -621,11 +621,11 @@ def resetUo(lc = nil, film = nil, index = nil, uo = nil, uniq = false)
mt.setName(id)

unless mt.setThermalConductivity(k)
return invalid("Failed #{id}: K#{k.round(3)}", mth)
return invalid("Failed #{id}: K#{k.round(3)}", mth, 0, DBG, 0.0)
end

unless mt.setThickness(d)
return invalid("Failed #{id}: #{(d*1000).to_i}mm", mth)
return invalid("Failed #{id}: #{(d*1000).to_i}mm", mth, 0, DBG, 0.0)
end

lc.setLayer(index, mt)
Expand Down
2 changes: 1 addition & 1 deletion lib/osut/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

module OSut
VERSION = "0.9.0".freeze
VERSION = "0.9.1".freeze
end
4 changes: 2 additions & 2 deletions spec/osut_tests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5399,7 +5399,7 @@ module M
deg = i * 45
rad = deg * Math::PI/180
rsi = OpenStudio::Model::PlanarSurface.stillAirFilmResistance(rad)
per = "%.2f" % (100 * (r - rsi) / r)
# per = "%.2f" % (100 * (r - rsi) / r)
# puts "#{i}: #{deg}: #{r.round(5)}: #{rsi.round(5)} #{per} %"
#
# 0: 0: 0.10743: 0.10604 1.29 % horizontal, facing up
Expand Down Expand Up @@ -5575,7 +5575,7 @@ module M
expect(tilt.round(4)).to eq((Math::PI / 2).round(4))

r1 = OpenStudio::Model::PlanarSurface.stillAirFilmResistance(tilt) * 2
r2 = surface.filmResistance
r2 = adjacent.filmResistance
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better test.

r3 = mod1.filmResistances(:partition)
r4 = mod1.filmResistances(:partition, tilt)
expect(r1.round(3)).to eq(0.239)
Expand Down
Loading