Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
Fixed Material Stream phase property cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
DanWBR committed Nov 1, 2017
1 parent 17d4334 commit 8f146e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
34 changes: 5 additions & 29 deletions DWSIM.Thermodynamics/Material Stream/MaterialStream.vb
Original file line number Diff line number Diff line change
Expand Up @@ -664,35 +664,11 @@ Namespace Streams

If ASource.Phases.ContainsKey(i) Then

Phases(i).Properties.temperature = ASource.Phases(i).Properties.temperature.GetValueOrDefault
Phases(i).Properties.pressure = ASource.Phases(i).Properties.pressure.GetValueOrDefault
Phases(i).Properties.density = ASource.Phases(i).Properties.density.GetValueOrDefault
Phases(i).Properties.enthalpy = ASource.Phases(i).Properties.enthalpy.GetValueOrDefault
Phases(i).Properties.entropy = ASource.Phases(i).Properties.entropy.GetValueOrDefault
Phases(i).Properties.molar_enthalpy = ASource.Phases(i).Properties.molar_enthalpy.GetValueOrDefault
Phases(i).Properties.molar_entropy = ASource.Phases(i).Properties.molar_entropy.GetValueOrDefault
Phases(i).Properties.compressibilityFactor = ASource.Phases(i).Properties.compressibilityFactor.GetValueOrDefault
Phases(i).Properties.heatCapacityCp = ASource.Phases(i).Properties.heatCapacityCp.GetValueOrDefault
Phases(i).Properties.heatCapacityCv = ASource.Phases(i).Properties.heatCapacityCv.GetValueOrDefault
Phases(i).Properties.molecularWeight = ASource.Phases(i).Properties.molecularWeight.GetValueOrDefault
Phases(i).Properties.thermalConductivity = ASource.Phases(i).Properties.thermalConductivity.GetValueOrDefault
Phases(i).Properties.speedOfSound = ASource.Phases(i).Properties.speedOfSound.GetValueOrDefault
Phases(i).Properties.volumetric_flow = ASource.Phases(i).Properties.volumetric_flow.GetValueOrDefault
Phases(i).Properties.jouleThomsonCoefficient = ASource.Phases(i).Properties.jouleThomsonCoefficient.GetValueOrDefault
Phases(i).Properties.excessEnthalpy = ASource.Phases(i).Properties.excessEnthalpy.GetValueOrDefault
Phases(i).Properties.excessEntropy = ASource.Phases(i).Properties.excessEntropy.GetValueOrDefault
Phases(i).Properties.compressibility = ASource.Phases(i).Properties.compressibility.GetValueOrDefault
Phases(i).Properties.bubbleTemperature = ASource.Phases(i).Properties.bubbleTemperature.GetValueOrDefault
Phases(i).Properties.bubblePressure = ASource.Phases(i).Properties.bubblePressure.GetValueOrDefault
Phases(i).Properties.dewTemperature = ASource.Phases(i).Properties.dewTemperature.GetValueOrDefault
Phases(i).Properties.dewPressure = ASource.Phases(i).Properties.dewPressure.GetValueOrDefault
Phases(i).Properties.viscosity = ASource.Phases(i).Properties.viscosity.GetValueOrDefault
Phases(i).Properties.kinematic_viscosity = ASource.Phases(i).Properties.kinematic_viscosity.GetValueOrDefault
Phases(i).Properties.molarflow = ASource.Phases(i).Properties.molarflow.GetValueOrDefault
Phases(i).Properties.massflow = ASource.Phases(i).Properties.massflow.GetValueOrDefault
Phases(i).Properties.massfraction = ASource.Phases(i).Properties.massfraction.GetValueOrDefault
Phases(i).Properties.molarfraction = ASource.Phases(i).Properties.molarfraction.GetValueOrDefault
Phases(i).Properties.bulk_modulus = ASource.Phases(i).Properties.bulk_modulus.GetValueOrDefault
Dim props = ASource.Phases(i).Properties.GetType().GetProperties()

For Each p In props
p.SetValue(Phases(i).Properties, p.GetValue(ASource.Phases(i).Properties))
Next

End If

Expand Down
4 changes: 2 additions & 2 deletions DWSIM/Utilities/Phase Envelope/FormPhEnv.vb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ Public Class FormPhEnv

End Try

If TypeOf AttachedTo.PropertyPackage Is PropertyPackages.PengRobinsonPropertyPackage Or _
TypeOf AttachedTo.PropertyPackage Is PropertyPackages.SRKPropertyPackage Then
If TypeOf DirectCast(AttachedTo, Streams.MaterialStream).PropertyPackage Is PropertyPackages.PengRobinsonPropertyPackage Or _
TypeOf DirectCast(AttachedTo, Streams.MaterialStream).PropertyPackage Is PropertyPackages.SRKPropertyPackage Then
Me.chkStabCurve.Enabled = True
chkpip.Enabled = True
Else
Expand Down

0 comments on commit 8f146e2

Please sign in to comment.