Skip to content

Commit

Permalink
added a humidity spec and MaterialCompounds ambuiguity solution
Browse files Browse the repository at this point in the history
  • Loading branch information
longemen3000 committed Oct 25, 2020
1 parent 54db48b commit 741efd4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/state_type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,20 @@ function _state_from_type(x::Type{ThermodynamicState{S,C}}) where {S,C}
has_compound = true
comp_spec = spec
break
elseif spec isa HumiditySpec
end
end

#double iteration, used in moist air to create an invalid
#state where compound and humidity spec are present
#in this case, the resulting type is MultiPT instead of HumPT
for spec in state_specs
if (spec isa HumiditySpec) & !has_compound
has_compound = true
comp_spec = spec
break
end
end

if !has_compound
comp_spec = SingleComponent()
end
Expand Down

0 comments on commit 741efd4

Please sign in to comment.