1 /***************************************************************************/ 2 /* CONFIGURATION OF THE OPERATING SYSTEM */ 3 /* */ 4 /* If Windows platform, put a "0" */ 5 /* If Linux, Unix or Mac platform, put a "1" */ 6 /* */ 7 #define PLATFORM 1 /* */ 8 /***************************************************************************/ 9 10 #include <iostream> 11 #include <fstream> 12 #include <cmath> 13 14 // #include <iomanip> 15 // #include <cstring> 16 // #include <cctype> 17 #include <cstdlib> 18 // #include <ctime> 19 using namespace std; 20 21 22 double arrondi ( double x , int n ); 23 24 25 #define ARRONDI 1 // arrondir ou pas 26 27 #define DEBUG 0 //choose the debug (1) or normal (0) mode 28 #define MUTE 0 //choose 1 to avoid all screen output, 0 to have the normal display 29 #define EPS 1e-10 //the software "0" 30 31 // Platform-dependant declarations 32 #define WIN 0 /* all versions */ 33 #define OTHER 1 /* Unix, Linux, SunOS, MacIntosh */ 34 #define MESSAGES "runtime/messages.r" 35 #define RUNTIME "runtime/" 36 #define DATA "data/" 37 38 //useful constants 39 #define R 0.0821 //ideal gas constant in atm.l/mol.K 40 #define MAX_TEMP 3000.0 //Maximal temperature in the process 41 #define pi 3.14159265358979323846 //the pi number 42 #define MAX_DIM 30 43 #define MAX_STREAM 30 44 #define MAX_UNIT 30 45 46 //For the chemical class 47 #define MAX_ERROR 0 48 #define MAX_WARNING 10 49 50 //For the secant solver 51 #define TOL_SECANT 1e-8 52 #define MAX_ITER_SECANT 250 53 54 //For the bissection solver 55 #define TOL_BISSECTION 1e-8 56 #define MAX_ITER_BISSECTION 250 57 58 //For the Newton solver 59 #define TOL_NEWTON 1e-6 60 #define MAX_ITER_NEWTON 250 61 #define STEP_NEWTON 1e-3 62 63 //For the Runge-Kutta solver 64 #define N_INTER 250 65 #define MAX_ITER_RK N_INTER+1 66 67 //For the Wegstein solver 68 #define MIN_THETA -3.0 69 #define MAX_THETA 1.0 70 #define TOL_WEGSTEIN 1e-3 71 #define MAX_ITER_WEGSTEIN 50 72 73 //For the stream flashing 74 #define TOL_BP 1e-3 75 #define TOL_DP 1e-3 76 77 //For the burner 78 #define TOL_BURN 1e-4 79 80 //For the column 81 #define MAX_PLATES 500 82 #define MIN_PLATES 1 83 84 //For the flash 85 #define TOL_FLASH 1e-2 86 87 //For the cost estimtiors 88 #define MS_2001 1094.0 89 #define MS_YEAR 1139.0 90