Command Line Mode
Command Line Mode
If you want to optimize your simulation using external software, you can run DWSIM in command line
mode. The process itself is very simple: DWSIM opens the simulation file without showing the interface, and
any changes you want to do to any variable in the simulation are input in a XML file. Also, if you want to read
variables after the calculation, you can specify them in the input file. DWSIM then writes another XML file
with the values and units of the variables you defined.
Argument Description
-commandline Runs DWSIM in command line mode.
-nosplash Prevents the splash screen from showing.
-savechanges Save changes to the simulation file after running.
-show <VALUE> Define if a window is shown to display calculation details. <VALUE> is 0 to
hide, 1 to show. If omitted DWSIM will run without showing the window.
-locale <VALUE> Changes the locale settings of the current run. Also affects how DWSIM
manages decimal and thousand separators. <VALUE> is the locale string and
currently can be “en-US” (English - USA), “pt-BR” (Brazilian Portuguese) or
“es” (Spanish). If omitted, DWSIM will use the current locale defined in
previous normal (graphical interface) runs.
-simfile <VALUE> Defines the simulation file to read. <VALUE> is the relative (to the current
directory) or absolute path of the .dwsim file, between quotes.
-input <VALUE> Defines the input XML file. <VALUE> is the relative (to the current directory) or
absolute path of the file, between quotes.
-output <VALUE> Defines the output XML file. <VALUE> is the relative (to the current directory)
or absolute path of the file, between quotes.
The example below shows how to run DWSIM in command line mode from a command line window
(or a batch file). It assumes that all the necessary files are in the same path, which is also the path of DWSIM
executable file.
dwsim.exe -commandline -nosplash -show 1 -locale "en-US" -simfile "cavett15.dwsim" -input "input2.xml" -
output "results.xml"
This command tells DWSIM to run in command line mode, not showing the splash screen, using English
(USA) as the locale. The simulation file is “cavett15.dwsim” and the input and output XML files are
“input2.xml” and “results.xml” respectively. When you execute this command, DWSIM will show the following
window prior to writing to the output XML file:
1
When this window closes, the simulation has been run and you can open the output XML file to view the
results.
<DWSIMXMLFile>
<Configuration>
<UnitsSystem Mode="Default" Name="" />
<Simulation NumberOfRuns="1" FormattedOutput="Yes" />
<PureCompoundProperties>
<Compound Name="C7+">
<Property Name="Molar_Weight" Value="210.00" />
<Property Name="Critical_Temperature" Value="702.800" Unit="K" />
<Property Name="Critical_Pressure" Value="21.70" Unit="atm" />
<Property Name="Acentric_Factor" Value="0.6775" />
</Compound>
</PureCompoundProperties>
<PropertyPackages>
<PropertyPackage Name="PP_1">
<Parameter Name="PP_FLASHALGORITHM" Value="3" />
<InteractionParameters>
<InteractionParameter Comp1="C7+" Comp2="Carbon Dioxide" kij="0.12" />
<InteractionParameter Comp1="C7+" Comp2="Nitrogen" kij="0.12" />
<InteractionParameter Comp1="C7+" Comp2="Hydrogen Sulfide" kij="0.05" />
</InteractionParameters>
</PropertyPackage>
</PropertyPackages>
</Configuration>
<InputParameters>
<SimulationObjects>
<Object Name="MAT-000">
<Property ID="PROP_MS_0" Value="100" />
<Property ID="PROP_MS_1" Value="6000" />
</Object>
</SimulationObjects>
</InputParameters>
<OutputParameters>
<SimulationObjects>
<Object Name="VALV-000">
<Property ID="PROP_VA_3" Name="" Value="" Unit=""/>
2
</Object>
<Object Name="MAT-001">
<Property ID="PROP_MS_0" Name="" Value="" Unit=""/>
<Property ID="PROP_MS_7" Name="" Value="" Unit=""/>
</Object>
<Object Name="MAT-000">
<Property ID="PROP_MS_7" Name="" Value="" Unit=""/>
</Object>
</SimulationObjects>
</OutputParameters>
</DWSIMXMLFile>
3
InputParameters In this section we define the objects which will be modified before the simulation
is run.
Object Name Define the name of the object whose properties you will modify
before running the simulation.
Property ID Self-explanatory. The ID of the property which will have its
value modified.
Property Value The value of the property you defined with the ID attribute.
Please note that this value works in conjunction with the units
system you defined above (which can be either the one
selected in the simulation or the one you indicated in this input
XML file).
OutputParameters In this section we define the objects whose properties will be read after the
simulation is run.
Object Name Define the name of the object whose properties you will read
after running the simulation.
Property ID Self-explanatory. The ID of the property which will have its
value read.
Property Name The name of the property (localized according to the locale
setting) will be written by DWSIM to the output file.
Property Value The value of the property will be written by DWSIM to the
output file.
Property Unit The unit of the property will be written by DWSIM to the output
file.
4
Inside-Out, 2 = Global Setting, 3 =
Three-Phase Inside-Out, 4 = Two-
Phase Gibbs Min., 5 = Three-Phase
Gibbs Min., 6 = Three-Phase Hybrid
NL/IO)
PP_USEEXPLIQDENS 0 0, 1 Use Experimental Liquid Density
Data
PP_USEEXPLIQTHERMALCOND 1 0, 1 Use Experimental Liquid Thermal
Conductivity Data
PP_USE_EOS_LIQDENS 0 0, 1 Use EOS for Liquid Density
PP_USE_EOS_VOLUME_SHIFT 0 0, 1 Use Peneloux Volume Translation
correction
Parameter ID Description
Molar_Weight Molecular Weight
Critical_Temperature Critical Temperature
Critical_Pressure Critical Pressure
Critical_Volume Critical Volume
Critical_Compressibility Critical Compressibility
Acentric_Factor Acentric Factor
Z_Rackett Rackett Parameter
PR_Volume_Translation_Coefficient Peng-Robinson Volume Translation Coefficient (si = ci/bi)
SRK_Volume_Translation_Coefficient SRK Volume Translation Coefficient (si = ci/bi)
CS_Acentric_Factor Chao-Seader Acentric Factor
CS_Solubility_Parameter Chao-Seader Solubility Parameter
CS_Liquid_Molar_Volume Chao-Seader Liquid Molar Volume
IG_Entropy_of_Formation_25C Ideal Gas Entropy of Formation at 25 C
IG_Enthalpy_of_Formation_25C Ideal Gas Enthalpy of Formation at 25 C
IG_Gibbs_Energy_of_Formation_25C Ideal Gas Gibbs Energy of Formation at 25 C
Dipole_Moment Dipole Moment
Vapor_Pressure_Constant_EqNo Vapor Pressure Equation Number (ChemSep-like)
Vapor_Pressure_Constant_A Vapor Pressure Equation A Constant
Vapor_Pressure_Constant_B Vapor Pressure Equation B Constant
Vapor_Pressure_Constant_C Vapor Pressure Equation C Constant
Vapor_Pressure_Constant_D Vapor Pressure Equation D Constant
Vapor_Pressure_Constant_E Vapor Pressure Equation E Constant
Ideal_Gas_Heat_Capacity_EqNo Ideal Gas Heat Capacity Equation Number (ChemSep-like)
Ideal_Gas_Heat_Capacity_Const_A Ideal Gas Heat Capacity Equation A Constant
Ideal_Gas_Heat_Capacity_Const_B Ideal Gas Heat Capacity Equation B Constant
Ideal_Gas_Heat_Capacity_Const_C Ideal Gas Heat Capacity Equation C Constant
Ideal_Gas_Heat_Capacity_Const_D Ideal Gas Heat Capacity Equation D Constant
Ideal_Gas_Heat_Capacity_Const_E Ideal Gas Heat Capacity Equation E Constant
5
Liquid_Viscosity_Const_EqNo Liquid Viscosity Equation Number (ChemSep-like)
Liquid_Viscosity_Const_A Liquid Viscosity Equation A Constant
Liquid_Viscosity_Const_B Liquid Viscosity Equation B Constant
Liquid_Viscosity_Const_C Liquid Viscosity Equation C Constant
Liquid_Viscosity_Const_D Liquid Viscosity Equation D Constant
Liquid_Viscosity_Const_E Liquid Viscosity Equation E Constant
Liquid_Density_Const_EqNo Liquid Density Equation Number (ChemSep-like)
Liquid_Density_Const_A Liquid Density Equation A Constant
Liquid_Density_Const_B Liquid Density Equation B Constant
Liquid_Density_Const_C Liquid Density Equation C Constant
Liquid_Density_Const_D Liquid Density Equation D Constant
Liquid_Density_Const_E Liquid Density Equation E Constant
Normal_Boiling_Point Normal Boiling Point
HVapA Heat of Vaporization Equation A Constant
HVapB Heat of Vaporization Equation B Constant
HVapC Heat of Vaporization Equation C Constant
HVapD Heat of Vaporization Equation D Constant
UNIQUAC_R UNIQUAC Model R Parameter
UNIQUAC_Q UNIQUAC Model Q Parameter
Binary Parameter ID
Property Package
kij kij A12 A21 A12
PC-SAFT
PC-SAFT Not used Not used Not used Not used
kij
Peng-Robinson (PR) PR kij Not used Not used Not used Not used
Soave-Redlich-Kwong (SRK) SRK kij Not used Not used Not used Not used
PRSV2-M PRSV2-M
Peng-Robinson-Stryjek-Vera 2 (PRSV2) Not used Not used Not used
kij kji
Peng-Robinson / Lee-Kesler (PR/LK) PR kij Not used Not used Not used Not used
UNIFAC PR kij Not used Not used Not used Not used
UNIFAC-LL PR kij Not used Not used Not used Not used
Modified UNIFAC (Dortmund) PR kij Not used Not used Not used Not used
NRTL NRTL
NRTL PR kij Not used NRTL Alpha
A12 (cal/mol) A21 (cal/mol)
UNIQUAC UNIQUAC
UNIQUAC PR kij Not used Not used
A12 (K) A21 (K)
Chao-Seader Not used Not used Not used Not used Not used
Grayson-Streed Not used Not used Not used Not used Not used
Lee-Kesler-Plöcker LKP kij Not used Not used Not used Not used
Raoult's Law Not used Not used Not used Not used Not used
COSMO-SAC (JCOSMO) PR kij Not used Not used Not used Not used
IAPWS-IF97 Steam Tables Not used Not used Not used Not used Not used
6
The output XML file is the same as the input one, with the exception that the names, values and
units of the variables which were defined to be read now appear in the OutputParameters section.
<DWSIMXMLFile>
<Configuration>
<UnitsSystem Mode="Default" Name="" />
<Simulation NumberOfRuns="2" FormattedOutput="Yes" />
…
</Configuration>
<InputParameters>
<SimulationObjects>
<Object Name="MAT-000">
<Property ID="PROP_MS_0" Value="100" />
<Property ID="PROP_MS_1" Value="6000" />
</Object>
</SimulationObjects>
</InputParameters>
<OutputParameters>
<SimulationObjects>
<Object Name="VALV-000">
<Property ID="PROP_VA_3" Name="Temperature Drop" Value="-10.99552" Unit="°C." />
</Object>
<Object Name="MAT-001">
<Property ID="PROP_MS_0" Name="Temperature" Value="89.00448" Unit="°C" />
<Property ID="PROP_MS_7" Name="Mixture Specific Enthalpy" Value="71.76271" Unit="kJ/kg"
/>
</Object>
<Object Name="MAT-000">
<Property ID="PROP_MS_7" Name="Mixture Specific Enthalpy" Value="71.76284" Unit="kJ/kg"
/>
</Object>
</SimulationObjects>
</OutputParameters>
</DWSIMXMLFile>
Property IDs
In order to read and write object property values, you need to know their IDs. A Property ID is a code
which uniquely defines a property of an object of any type. For example, “PROP_MS_0” is the ID for the
Temperature property of the Material Stream object. If you have the object name and the property ID, then
you can read and/or write to that property. This is the very principle of operation of the command line run
mode.
The table below shows the Property IDs for all object types available in DWSIM:
7
PROP_MS_13 Vapor Phase Molar Weight
PROP_MS_14 Vapor Phase Specific Enthalpy
PROP_MS_15 Vapor Phase Specific Entropy
PROP_MS_16 Vapor Phase Molar Enthalpy
PROP_MS_17 Vapor Phase Molar Entropy
PROP_MS_18 Vapor Phase Thermal Conductivity
PROP_MS_19 Vapor Phase Kinematic Viscosity
PROP_MS_20 Vapor Phase Dynamic Viscosity
PROP_MS_21 Vapor Phase Heat Capacity (Cp)
PROP_MS_22 Vapor Phase Heat Capacity Ratio (Cp/Cv)
PROP_MS_23 Vapor Phase Mass Flow
PROP_MS_24 Vapor Phase Molar Flow
PROP_MS_25 Vapor Phase Volumetric Flow
PROP_MS_26 Vapor Phase Compressibility Factor
PROP_MS_27 Vapor Phase Molar Fraction
PROP_MS_28 Vapor Phase Mass Fraction
PROP_MS_29 Vapor Phase Volumetric Fraction
PROP_MS_30 Liquid Phase (Mixture) Density
PROP_MS_31 Liquid Phase (Mixture) Molar Weight
PROP_MS_32 Liquid Phase (Mixture) Specific Enthalpy
PROP_MS_33 Liquid Phase (Mixture) Specific Entropy
PROP_MS_34 Liquid Phase (Mixture) Molar Enthalpy
PROP_MS_35 Liquid Phase (Mixture) Molar Entropy
PROP_MS_36 Liquid Phase (Mixture) Thermal Conductivity
PROP_MS_37 Liquid Phase (Mixture) Kinematic Viscosity
PROP_MS_38 Liquid Phase (Mixture) Dynamic Viscosity
PROP_MS_39 Liquid Phase (Mixture) Heat Capacity (Cp)
PROP_MS_40 Liquid Phase (Mixture) Heat Capacity Ratio (Cp/Cv)
PROP_MS_41 Liquid Phase (Mixture) Mass Flow
PROP_MS_42 Liquid Phase (Mixture) Molar Flow
PROP_MS_43 Liquid Phase (Mixture) Volumetric Flow
PROP_MS_44 Liquid Phase (Mixture) Compressibility Factor
PROP_MS_45 Liquid Phase (Mixture) Molar Fraction
PROP_MS_46 Liquid Phase (Mixture) Mass Fraction
PROP_MS_47 Liquid Phase (Mixture) Volumetric Fraction
PROP_MS_48 Liquid Phase (1) Density
PROP_MS_49 Liquid Phase (1) Molar Weight
PROP_MS_50 Liquid Phase (1) Specific Enthalpy
PROP_MS_51 Liquid Phase (1) Specific Entropy
PROP_MS_52 Liquid Phase (1) Molar Enthalpy
PROP_MS_53 Liquid Phase (1) Molar Entropy
PROP_MS_54 Liquid Phase (1) Thermal Conductivity
PROP_MS_55 Liquid Phase (1) Kinematic Viscosity
PROP_MS_56 Liquid Phase (1) Dynamic Viscosity
PROP_MS_57 Liquid Phase (1) Heat Capacity (Cp)
PROP_MS_58 Liquid Phase (1) Heat Capacity Ratio (Cp/Cv)
PROP_MS_59 Liquid Phase (1) Mass Flow
8
PROP_MS_60 Liquid Phase (1) Molar Flow
PROP_MS_61 Liquid Phase (1) Volumetric Flow
PROP_MS_62 Liquid Phase (1) Compressibility Factor
PROP_MS_63 Liquid Phase (1) Molar Fraction
PROP_MS_64 Liquid Phase (1) Mass Fraction
PROP_MS_65 Liquid Phase (1) Volumetric Fraction
PROP_MS_66 Liquid Phase (2) Density
PROP_MS_67 Liquid Phase (2) Molar Weight
PROP_MS_68 Liquid Phase (2) Specific Enthalpy
PROP_MS_69 Liquid Phase (2) Specific Entropy
PROP_MS_70 Liquid Phase (2) Molar Enthalpy
PROP_MS_71 Liquid Phase (2) Molar Entropy
PROP_MS_72 Liquid Phase (2) Thermal Conductivity
PROP_MS_73 Liquid Phase (2) Kinematic Viscosity
PROP_MS_74 Liquid Phase (2) Dynamic Viscosity
PROP_MS_75 Liquid Phase (2) Heat Capacity (Cp)
PROP_MS_76 Liquid Phase (2) Heat Capacity Ratio (Cp/Cv)
PROP_MS_77 Liquid Phase (2) Mass Flow
PROP_MS_78 Liquid Phase (2) Molar Flow
PROP_MS_79 Liquid Phase (2) Volumetric Flow
PROP_MS_80 Liquid Phase (2) Compressibility Factor
PROP_MS_81 Liquid Phase (2) Molar Fraction
PROP_MS_82 Liquid Phase (2) Mass Fraction
PROP_MS_83 Liquid Phase (2) Volumetric Fraction
PROP_MS_84 Aqueous Phase Density
PROP_MS_85 Aqueous Phase Molar Weight
PROP_MS_86 Aqueous Phase Specific Enthalpy
PROP_MS_87 Aqueous Phase Specific Entropy
PROP_MS_88 Aqueous Phase Molar Enthalpy
PROP_MS_89 Aqueous Phase Molar Entropy
PROP_MS_90 Aqueous Phase Thermal Conductivity
PROP_MS_91 Aqueous Phase Kinematic Viscosity
PROP_MS_92 Aqueous Phase Dynamic Viscosity
PROP_MS_93 Aqueous Phase Heat Capacity (Cp)
PROP_MS_94 Aqueous Phase Heat Capacity Ratio (Cp/Cv)
PROP_MS_95 Aqueous Phase Mass Flow
PROP_MS_96 Aqueous Phase Molar Flow
PROP_MS_97 Aqueous Phase Volumetric Flow
PROP_MS_98 Aqueous Phase Compressibility Factor
PROP_MS_99 Aqueous Phase Molar Fraction
PROP_MS_100 Aqueous Phase Mass Fraction
PROP_MS_101 Aqueous Phase Volumetric Fraction
Energy Stream PROP_ES_0 Power
Valve PROP_VA_0 Calculation Mode
PROP_VA_1 Pressure Drop
PROP_VA_2 Outlet Pressure
PROP_VA_3 Temperature Drop
9
Pipe Segment PROP_PS_0 Pressure Drop
PROP_PS_1 Temperature Drop
PROP_PS_2 Heat Exchanged
Pump PROP_PU_0 Pressure Increase (Head)
PROP_PU_1 Efficiency
PROP_PU_2 Delta-T
PROP_PU_3 Power Required
Tank PROP_TK_0 Pressure Drop
Separator Vessel PROP_SV_0 Separation Temperature
PROP_SV_1 Separation Pressure
Compressor PROP_CO_0 Pressure Increase (Head)
PROP_CO_1 Efficiency
PROP_CO_2 Delta-T
PROP_CO_3 Power Required
Turbine PROP_TU_0 Pressure Drop
PROP_TU_1 Efficiency
PROP_TU_2 Delta-T
PROP_TU_3 Power Generated
Heater PROP_HT_0 Pressure Drop
PROP_HT_1 Efficiency
PROP_HT_2 Outlet Temperature
PROP_HT_3 Heat Added
PROP_HT_4 Delta-T
Cooler PROP_CL_0 Pressure Drop
PROP_CL_1 Efficiency
PROP_CL_2 Outlet Temperature
PROP_CL_3 Heat Removed
PROP_CL_4 Delta-T
Recycle PROP_RY_0 Maximum Iterations
PROP_RY_1 Mass Flow Tolerance
PROP_RY_2 Temperature Tolerance
PROP_RY_3 Pressure Tolerance
PROP_RY_4 Mass Flow Error
PROP_RY_5 Temperature Error
PROP_RY_6 Pressure Error
Energy Recycle PROP_ER_0 Maximum Iterations
PROP_ER_1 Power Tolerance
PROP_ER_2 Power Error
Conversion Reactor PROP_CR_0 Pressure Drop
Equilibrium Reactor PROP_EQ_0 Pressure Drop
Gibbs Reactor PROP_GR_0 Pressure Drop
CSTR PROP_CS_0 Pressure Drop
PFR PROP_PR_0 Pressure Drop
Heat Exchanger PROP_HX_0 Global Heat Transfer Coefficient (U)
PROP_HX_1 Heat Exchange Area (A)
PROP_HX_2 Heat Load
Shortcut Column PROP_SC_0 Reflux Ratio
10
PROP_SC_1 Heavy Key Molar Fraction
PROP_SC_2 Light Key Molar Fraction
PROP_SC_3 Condenser Pressure
PROP_SC_4 Reboiler Pressure
PROP_SC_5 Minimun Reflux Ratio
PROP_SC_6 Minimum Stages
PROP_SC_7 Optimal Feed Stage
PROP_SC_8 Stripping Liquid Molar Flow
PROP_SC_9 Rectify Liquid Molar Flow
PROP_SC_10 Stripping Vapor Molar Flow
PROP_SC_11 Rectify Vapor Molar Flow
PROP_SC_12 Condenser Duty
PROP_SC_13 Reboiler Duty
Distillation Column PROP_DC_0 Condenser Pressure
PROP_DC_1 Reboiler Pressure
PROP_DC_2 Condenser Pressure Drop
PROP_DC_3 Reflux Ratio
PROP_DC_4 Distillate Molar Flow
PROP_DC_5 Condenser Duty
PROP_DC_6 Reboiler Duty
PROP_DC_7 Number of Stages
Absorption Column PROP_AC_0 Top Stage Pressure
PROP_AC_1 Bottom Stage Pressure
PROP_AC_2 Number of Stages
Reboiled Absorber PROP_RA_0 Top Stage Pressure
PROP_RA_1 Reboiler Pressure
PROP_RA_2 Boil-Up Ratio
PROP_RA_3 Reboiler Duty
PROP_RA_4 Number of Stages
Refluxed Absorber PROP_RF_0 Condenser Pressure
PROP_RF_1 Bottom Stage Pressure
PROP_RF_2 Condenser Pressure Drop
PROP_RF_3 Reflux Ratio
PROP_RF_4 Distillate Molar Flow
PROP_RF_5 Condenser Duty
PROP_RF_6 Number of Stages
11