Skip to content

Commit a52db87

Browse files
committed
bug fixes
1 parent 5ba891d commit a52db87

25 files changed

Lines changed: 423 additions & 60 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ obj
1717
/DTLTest3/bin/Release
1818
/DWSIM/bin/Release
1919
*.suo
20+
/.vs/DTL/v15/Server/sqlite3

DTL.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.40629.0
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.28010.2003
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DTL", "DWSIM\DTL.vbproj", "{34BE2D2D-9B3C-4C12-8C90-732E21CD7CB1}"
66
EndProject
@@ -60,4 +60,7 @@ Global
6060
GlobalSection(SolutionProperties) = preSolution
6161
HideSolutionNode = FALSE
6262
EndGlobalSection
63+
GlobalSection(ExtensibilityGlobals) = postSolution
64+
SolutionGuid = {AA0A61F3-6EE0-4247-9830-8C8B619D69E2}
65+
EndGlobalSection
6366
EndGlobal

DTL.v12.suo

-11.5 KB
Binary file not shown.

DTLTest/DTLTest.vbproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<SchemaVersion>2.0</SchemaVersion>
88
<ProjectGuid>{B444F627-6E4F-467E-B736-F9D117849788}</ProjectGuid>
99
<OutputType>Exe</OutputType>
10-
<StartupObject>DTLTest.Module1</StartupObject>
10+
<StartupObject>DTLTest.test</StartupObject>
1111
<RootNamespace>DTLTest</RootNamespace>
1212
<AssemblyName>DTLTest</AssemblyName>
1313
<FileAlignment>512</FileAlignment>
@@ -61,6 +61,7 @@
6161
</ItemGroup>
6262
<ItemGroup>
6363
<Compile Include="Module1.vb" />
64+
<Compile Include="Module2.vb" />
6465
<Compile Include="My Project\AssemblyInfo.vb" />
6566
<Compile Include="My Project\Application.Designer.vb">
6667
<AutoGen>True</AutoGen>

DTLTest/Module2.vb

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Imports DTL.DTL.SimulationObjects.PropertyPackages
2+
Imports System.Linq
3+
Module test
4+
Sub Main()
5+
Dim dtlc As New DTL.Thermodynamics.Calculator()
6+
dtlc.Initialize()
7+
dtlc.SetDebugLevel(0)
8+
'Peng-Robinson Property Package
9+
Dim prpp As PropertyPackage = dtlc.GetPropPackInstance("Peng-Robinson (PR)")
10+
Dim FlashAlg As Integer = 2 'Nested loops VLE
11+
Dim compounds As String() = New String() {"Methane", "Isobutane", "N-decane"}
12+
Dim molefractions As Double() = New Double() {0.8, 0.1, 0.1}
13+
Dim P As Double = 80 'bar
14+
Dim T As Double = 30 'C
15+
prpp.SetParameterValue(Parameter.FlashAlgorithmFastMode, 0)
16+
Dim result As Auxiliary.FlashAlgorithms.FlashCalculationResult
17+
result = dtlc.CalcEquilibrium(DTL.Thermodynamics.Calculator.FlashCalculationType.PressureTemperature,
18+
FlashAlg, P * 101325, T + 273.15, prpp, compounds, molefractions, Nothing, 0)
19+
If result.ResultException Is Nothing Then
20+
Dim vmolefractions() As Double
21+
Dim lmolefractions() As Double
22+
Dim fv As Double
23+
Console.Write("Vapor mole fraction ")
24+
fv = result.GetVaporPhaseMoleFraction
25+
Console.Write(fv)
26+
Console.Write(vbCrLf)
27+
'Vapor Phase compound mole fractions:
28+
Console.Write("Vapor compound mole fractions ")
29+
vmolefractions = result.GetVaporPhaseMoleFractions
30+
For count = 0 To UBound(vmolefractions)
31+
Console.Write(vmolefractions(count) & " ")
32+
Next
33+
Console.Write(vbCrLf)
34+
'Liquid Phase 1 compound mole fractions:
35+
Console.Write("Liquid compound mole fractions ")
36+
lmolefractions = result.GetLiquidPhase1MoleFractions
37+
For count = 0 To UBound(lmolefractions)
38+
Console.Write(lmolefractions(count) & " ")
39+
Next
40+
Console.Write(vbCrLf)
41+
Dim PropValues As Object
42+
PropValues = dtlc.CalcProp(prpp, "viscosity", "mole", "Vapor", compounds, T + 273.15, P * 101325, vmolefractions)
43+
Console.Write("Vapor viscosity ")
44+
Console.Write(PropValues(0).ToString & vbTab)
45+
Console.Write(vbCrLf)
46+
PropValues = dtlc.CalcProp(prpp, "viscosity", "mole", "Liquid", compounds, T + 273.15, P * 101325, lmolefractions)
47+
Console.Write("Liquid viscosity ")
48+
Console.Write(PropValues(0).ToString & vbTab)
49+
Console.Write(vbCrLf)
50+
Console.Write("Surface Tension ")
51+
PropValues = dtlc.CalcTwoPhaseProp(prpp, "surfaceTension", "UNDEFINED", "Vapor", "Liquid", compounds, T + 273.15, P * 101325, vmolefractions, lmolefractions)
52+
Console.Write(PropValues(0).ToString & vbTab)
53+
Console.Write(vbCrLf)
54+
Else
55+
Console.Write(vbCrLf)
56+
Console.WriteLine("Error calculating flash: " & result.ResultException.Message.ToString)
57+
Console.Write(vbCrLf)
58+
End If
59+
Console.Write(vbCrLf)
60+
Console.WriteLine("Press any key to continue...")
61+
Console.ReadKey(True)
62+
End Sub
63+
End Module

DTLTest3/Program.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
52
using System.Threading.Tasks;
63
using System.Diagnostics;
74
using DTL.DTL.SimulationObjects.PropertyPackages;
85
using DTL.DTL.SimulationObjects.Streams;
9-
using DTL;
106

117
namespace DTLTest3
128
{
@@ -15,7 +11,7 @@ class Program
1511
static void Main(string[] args)
1612
{
1713

18-
Test1();
14+
Test2();
1915

2016
}
2117

@@ -25,8 +21,8 @@ static void Test1()
2521

2622
DTL.Thermodynamics.Calculator dtlc = new DTL.Thermodynamics.Calculator();
2723
dtlc.Initialize();
28-
string[] comps = new string[] { "Ethane", "Methane" };
29-
double[] fracs = new double[] { 0.5, 0.5 };
24+
string[] comps = new string[] { "Ethane", "Methane", "Propane" };
25+
double[] fracs = new double[] { 0.5, 0.5, 1e-6 };
3026

3127
double[] critpt = dtlc.CalcTrueCriticalPoint("PR", comps, fracs);
3228

DWSIM/DTL.vbproj

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3+
<Import Project="..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props" Condition="Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props')" />
34
<PropertyGroup>
45
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
56
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -10,7 +11,7 @@
1011
<StartupObject>
1112
</StartupObject>
1213
<RootNamespace>DTL</RootNamespace>
13-
<AssemblyName>DTL</AssemblyName>
14+
<AssemblyName>DWSIM.Thermodynamics</AssemblyName>
1415
<MyType>Windows</MyType>
1516
<IsWebBootstrapper>false</IsWebBootstrapper>
1617
<ManifestCertificateThumbprint>9811384C174DFC8254FB98B174DA65366428B233</ManifestCertificateThumbprint>
@@ -48,28 +49,30 @@
4849
<ApplicationVersion>0.0.0.%2a</ApplicationVersion>
4950
<UseApplicationTrust>false</UseApplicationTrust>
5051
<BootstrapperEnabled>true</BootstrapperEnabled>
52+
<NuGetPackageImportStamp>
53+
</NuGetPackageImportStamp>
5154
</PropertyGroup>
5255
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
5356
<DebugSymbols>true</DebugSymbols>
5457
<DebugType>pdbonly</DebugType>
5558
<DefineDebug>false</DefineDebug>
5659
<DefineTrace>true</DefineTrace>
5760
<OutputPath>bin\Debug\</OutputPath>
58-
<DocumentationFile>DTL.xml</DocumentationFile>
61+
<DocumentationFile>DWSIM.Thermodynamics.xml</DocumentationFile>
5962
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
6063
<WarningsAsErrors>
6164
</WarningsAsErrors>
6265
<UseVSHostingProcess>true</UseVSHostingProcess>
6366
<RemoveIntegerChecks>true</RemoveIntegerChecks>
64-
<Optimize>true</Optimize>
67+
<Optimize>false</Optimize>
6568
</PropertyGroup>
6669
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
6770
<DebugType>pdbonly</DebugType>
6871
<DefineDebug>false</DefineDebug>
6972
<DefineTrace>true</DefineTrace>
7073
<Optimize>false</Optimize>
7174
<OutputPath>bin\Release\</OutputPath>
72-
<DocumentationFile>DTL.xml</DocumentationFile>
75+
<DocumentationFile>DWSIM.Thermodynamics.xml</DocumentationFile>
7376
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
7477
<WarningsAsErrors>
7578
</WarningsAsErrors>
@@ -82,7 +85,7 @@
8285
<DefineDebug>false</DefineDebug>
8386
<DefineTrace>false</DefineTrace>
8487
<OutputPath>bin\x86\Debug\</OutputPath>
85-
<DocumentationFile>DTL.xml</DocumentationFile>
88+
<DocumentationFile>DWSIM.Thermodynamics.xml</DocumentationFile>
8689
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
8790
<DebugType>Full</DebugType>
8891
<PlatformTarget>x86</PlatformTarget>
@@ -93,7 +96,7 @@
9396
<DebugSymbols>true</DebugSymbols>
9497
<DefineTrace>false</DefineTrace>
9598
<OutputPath>bin\x86\Release\</OutputPath>
96-
<DocumentationFile>DTL.xml</DocumentationFile>
99+
<DocumentationFile>DWSIM.Thermodynamics.xml</DocumentationFile>
97100
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
98101
<DebugType>Full</DebugType>
99102
<PlatformTarget>x86</PlatformTarget>
@@ -105,7 +108,7 @@
105108
<DebugSymbols>true</DebugSymbols>
106109
<DefineTrace>true</DefineTrace>
107110
<OutputPath>bin\x86\</OutputPath>
108-
<DocumentationFile>DTL.xml</DocumentationFile>
111+
<DocumentationFile>DWSIM.Thermodynamics.xml</DocumentationFile>
109112
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
110113
<DebugType>pdbonly</DebugType>
111114
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -115,7 +118,7 @@
115118
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'x86|x86' ">
116119
<DebugSymbols>true</DebugSymbols>
117120
<OutputPath>bin\x86\x86\</OutputPath>
118-
<DocumentationFile>DTL.xml</DocumentationFile>
121+
<DocumentationFile>DWSIM.Thermodynamics.xml</DocumentationFile>
119122
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42353,42354,42355</NoWarn>
120123
<DebugType>Full</DebugType>
121124
<PlatformTarget>x86</PlatformTarget>
@@ -255,6 +258,7 @@
255258
</EmbeddedResource>
256259
</ItemGroup>
257260
<ItemGroup>
261+
<None Include="ILMerge.props" />
258262
<None Include="My Project\Application.myapp">
259263
<Generator>MyApplicationCodeGenerator</Generator>
260264
<LastGenOutput>Application.Designer.vb</LastGenOutput>
@@ -345,7 +349,18 @@
345349
<EmbeddedResource Include="bin\x86\Release\data\NIST-MODFAC_IP.txt" />
346350
<EmbeddedResource Include="bin\x86\Release\data\NIST-MODFAC_RiQi.txt" />
347351
</ItemGroup>
352+
<ItemGroup>
353+
<Content Include="ILMergeOrder.txt" />
354+
</ItemGroup>
348355
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
356+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
357+
<PropertyGroup>
358+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
359+
</PropertyGroup>
360+
<Error Condition="!Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.props'))" />
361+
<Error Condition="!Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets'))" />
362+
</Target>
363+
<Import Project="..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets" Condition="Exists('..\packages\MSBuild.ILMerge.Task.1.0.5\build\MSBuild.ILMerge.Task.targets')" />
349364
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
350365
Other similar extension points exist, see Microsoft.Common.targets.
351366
<Target Name="BeforeBuild">

DWSIM/ILMerge.props

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- -->
5+
<!-- ILMerge project-specific settings. Almost never need to be set explicitly. -->
6+
<!-- for details, see http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx -->
7+
<!-- -->
8+
<!-- *** set this file to Type=None, CopyToOutput=Never *** -->
9+
10+
<!-- If True, all copy local dependencies will also be merged from referenced projects whether they are referenced in the current project explicitly or not -->
11+
<ILMergeTransitive>true</ILMergeTransitive>
12+
13+
<!-- Extra ILMerge library paths (semicolon-separated). Dont put your package dependencies here, they will be added automagically -->
14+
<ILMergeLibraryPath></ILMergeLibraryPath>
15+
16+
<!-- The solution NuGet package directory if not standard 'SOLUTION\packages' -->
17+
<ILMergePackagesPath></ILMergePackagesPath>
18+
19+
<!-- The merge order file name if differs from standard 'ILMergeOrder.txt' -->
20+
<ILMergeOrderFile></ILMergeOrderFile>
21+
22+
<!-- The strong key file name if not specified in the project -->
23+
<ILMergeKeyFile></ILMergeKeyFile>
24+
25+
<!-- The assembly version if differs for the version of the main assembly -->
26+
<ILMergeAssemblyVersion></ILMergeAssemblyVersion>
27+
28+
<!-- added in Version 1.0.4 -->
29+
<ILMergeFileAlignment></ILMergeFileAlignment>
30+
31+
<!-- added in Version 1.0.4, default=none -->
32+
<ILMergeAllowDuplicateType></ILMergeAllowDuplicateType>
33+
34+
<!-- If the <see cref="CopyAttributes"/> is also set, any assembly-level attributes names that have the same type are copied over into the target assembly -->
35+
<ILMergeAllowMultipleAssemblyLevelAttributes></ILMergeAllowMultipleAssemblyLevelAttributes>
36+
37+
<!-- See ILMerge documentation -->
38+
<ILMergeAllowZeroPeKind></ILMergeAllowZeroPeKind>
39+
40+
<!-- The assembly level attributes of each input assembly are copied over into the target assembly -->
41+
<ILMergeCopyAttributes></ILMergeCopyAttributes>
42+
43+
<!-- Creates a .pdb file for the output assembly and merges into it any .pdb files found for input assemblies, default=true -->
44+
<ILMergeDebugInfo></ILMergeDebugInfo>
45+
46+
<!-- Target assembly will be delay signed -->
47+
<ILMergeDelaySign></ILMergeDelaySign>
48+
49+
<!-- Types in assemblies other than the primary assembly have their visibility modified -->
50+
<ILMergeInternalize></ILMergeInternalize>
51+
52+
<!-- The path name of the file that will be used to identify types that are not to have their visibility modified -->
53+
<ILMergeInternalizeExcludeFile></ILMergeInternalizeExcludeFile>
54+
55+
<!-- XML documentation files are merged to produce an XML documentation file for the target assembly -->
56+
<ILMergeXmlDocumentation>true</ILMergeXmlDocumentation>
57+
58+
<!-- External assembly references in the manifest of the target assembly will use full public keys (false) or public key tokens (true, default value) -->
59+
<ILMergePublicKeyTokens></ILMergePublicKeyTokens>
60+
61+
<!-- Types with the same name are all merged into a single type in the target assembly -->
62+
<ILMergeUnionMerge></ILMergeUnionMerge>
63+
64+
<!-- The version of the target framework, default 40 (works for 45 too) -->
65+
<ILTargetPlatform></ILTargetPlatform>
66+
67+
</PropertyGroup>
68+
</Project>

DWSIM/ILMergeOrder.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# this file contains the partial list of the merged assemblies in the merge order
2+
# you can fill it from the obj\CONFIG\PROJECT.ilmerge generated on every build
3+
# and finetune merge order to your satisfaction

DWSIM/My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
1212
<Assembly: AssemblyDescription("DWSIM Thermodynamics Library (DTL)")>
1313
<Assembly: AssemblyCompany("DWSIM Project")>
1414
<Assembly: AssemblyProduct("DWSIM")>
15-
<Assembly: AssemblyCopyright("Copyright 2007-2016 Daniel Wagner O. de Medeiros")>
15+
<Assembly: AssemblyCopyright("Copyright 2007-2018 Daniel Wagner O. de Medeiros")>
1616
<Assembly: AssemblyTrademark("DWSIM")>
1717

1818
<Assembly: ComVisible(True)>
@@ -31,7 +31,7 @@ Imports System.Runtime.InteropServices
3131
' by using the '*' as shown below:
3232
' <Assembly: AssemblyVersion("1.0.*")>
3333

34-
<Assembly: AssemblyVersion("3.3.0")>
34+
<Assembly: AssemblyVersion("3.4.0")>
3535
'<Assembly: AssemblyFileVersion("1.6")>
3636

3737
<Assembly: NeutralResourcesLanguageAttribute("pt-BR")>

0 commit comments

Comments
 (0)