-
Notifications
You must be signed in to change notification settings - Fork 2
Getting started with NeqSim in Matlab
The following steps describes how to set up NeqSim Matlab fo first use:
1. Update the pathstring variable in pathNeqSim file The pathNeqSim.m file needs to be set up with the correct path to the installation. The pathstring variable has to be set to the base directory where neqsimmatlab is on the local disk.
- Set up the database connection (change only needed if external database will be used) By default neqsimmatlab uses the embedded parameter database (Derby database). If an alternative external database should be used, the connection string to the database need to be set:
neqsim.util.database.NeqSimDataBase.setDataBaseType("Derby");
neqsim.util.database.NeqSimDataBase.setConnectionString("jdbc:derby:classpath:data/neqsimthermodatabase");
-
Run the pathNeqSim.m script in Matlab
-
Enter the following script to check that neqsimmatlab works correctly:
fluid1 = thermo('srk');
fluid1 .addComponent('methane', 10.0);
fluid1 .addComponent('propane', 1.0);
fluid1 .addComponent('n-hexane', 1.0);
fluid1 .addComponent('water', 1.0);
fluid1 .createDatabase(1);
fluid1 .setMixingRule(2);
fluid1 .setMultiPhaseCheck(1);
TPflash(fluid1,0);
fluid1