[254] | 1 | |
---|
| 2 | using "types"; |
---|
| 3 | |
---|
| 4 | #* |
---|
| 5 | * Batch Reactor model based on gPROMS sample |
---|
| 6 | *# |
---|
| 7 | Model BatchReactor |
---|
| 8 | PARAMETERS |
---|
| 9 | Density(4) as dens_mol(Brief="Component Densities"); |
---|
| 10 | Ac(4) as Real(Brief="Specific enthalpy coeficient A", Unit='J/mol/K'); |
---|
| 11 | Bc(4) as Real(Brief="Specific enthalpy coeficient B", Unit='J/mol/K/K'); |
---|
| 12 | |
---|
| 13 | k0 as Real(Brief="Arrenius constant", Unit='m^3/s/mol'); |
---|
| 14 | Ea as Real(Brief="Activation energy", Unit='J/mol'); |
---|
| 15 | Hr as Real(Brief="Reaction enthalpy", Unit='J/mol'); |
---|
| 16 | |
---|
| 17 | Nu(4) as Real(Brief="Stoichiometric coefficients"); |
---|
| 18 | R as Real(Brief="Ideal gas constant", Default=8.314, Unit='J/K/mol'); |
---|
| 19 | Tref as temperature(Brief="Reference temperature", Default=298); |
---|
| 20 | |
---|
| 21 | VARIABLES |
---|
| 22 | Holdup(4) as mol; |
---|
| 23 | C(4) as conc_mol; |
---|
| 24 | TotalVolume as volume; |
---|
| 25 | ReactionRate as Real(Unit='mol/m^3/s'); |
---|
| 26 | ReactionConstant as Real(Unit='m^3/s/mol'); |
---|
| 27 | TotalH as energy; |
---|
| 28 | H(4) as energy_mol; |
---|
| 29 | T as temperature; |
---|
| 30 | Q as power; |
---|
| 31 | |
---|
| 32 | EQUATIONS |
---|
| 33 | "Mass balance" |
---|
| 34 | diff(Holdup) = Nu*ReactionRate*TotalVolume; |
---|
| 35 | |
---|
| 36 | "Energy balance" |
---|
| 37 | diff(TotalH) = ReactionRate*TotalVolume*(-Hr) + Q; |
---|
| 38 | |
---|
| 39 | "Reaction rate" |
---|
| 40 | ReactionRate = ReactionConstant*C(1)*C(2); |
---|
| 41 | |
---|
| 42 | "Reaction constant" |
---|
| 43 | ReactionConstant = k0 * exp(-Ea/(R*T)); |
---|
| 44 | |
---|
| 45 | "Concentrations" |
---|
| 46 | Holdup = C * TotalVolume ; |
---|
| 47 | TotalVolume = sum(Holdup/Density) ; |
---|
| 48 | "Reactor energy content" |
---|
| 49 | TotalH = sum(Holdup*H) ; |
---|
| 50 | H = Ac * ( T - Tref ) + Bc * ( T^2 - Tref^2 ) / 2 ; |
---|
| 51 | end |
---|
| 52 | |
---|
| 53 | FlowSheet BatchProcess as BatchReactor |
---|
| 54 | SET |
---|
| 55 | Density = [ 10.0E3, 8.0E3, 11.0E3, 11.0E3 ] * 'mol/m^3' ; |
---|
| 56 | Ac = [ 150.0, 175.0, 200.0, 175.0 ] * 'J/mol/K'; |
---|
| 57 | Bc = [ 0.0, 0.0, 0.0, 0.0 ] * 'J/mol/K/K' ; |
---|
| 58 | Nu = [ -1, -1, +1, +1 ] ; |
---|
| 59 | |
---|
| 60 | k0 = 5E-4 * 'm^3/s/mol'; |
---|
| 61 | Ea = 15000.0 * 'J/mol'; |
---|
| 62 | Hr = 55000.0 * 'J/mol'; |
---|
| 63 | |
---|
| 64 | SPECIFY |
---|
| 65 | Q = 505e3 * 'W'; |
---|
| 66 | |
---|
| 67 | INITIAL |
---|
| 68 | Holdup = [100.0, 100.0, 1.0, 1.0 ] * 'mol'; |
---|
| 69 | T = 293.0 * 'K'; |
---|
[456] | 70 | |
---|
[254] | 71 | end |
---|
| 72 | |
---|
| 73 | Estimation BatchEst as BatchProcess |
---|
| 74 | ESTIMATE |
---|
| 75 | # PARAMETER START LOWER UPPER UNIT |
---|
| 76 | k0 0.0008 0.0001 0.0010 'm^3/s/mol'; |
---|
| 77 | Ea 12000 10000 20000 'J/mol'; |
---|
| 78 | Hr 50000 35000 75000 'J/mol'; |
---|
| 79 | |
---|
| 80 | EXPERIMENTS |
---|
| 81 | # DATA FILE WEIGTH |
---|
| 82 | "BatchReactor.dat" 1; |
---|
| 83 | |
---|
| 84 | OPTIONS |
---|
[456] | 85 | |
---|
[254] | 86 | NLPSolver( |
---|
[456] | 87 | MaxIterations = 1000, |
---|
[659] | 88 | #File = "complex" |
---|
| 89 | File = "ipopt_emso" |
---|
[254] | 90 | ); |
---|
| 91 | end |
---|