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'; |
---|

70 | |
---|

71 | end |
---|

72 | |
---|

73 | CaseStudy CS_Batch as BatchProcess |
---|

74 | |
---|

75 | VARY |
---|

76 | |
---|

77 | Q = [505e3: 100: 506e3] * 'W'; |
---|

78 | |
---|

79 | RESPONSE |
---|

80 | |
---|

81 | T; |
---|

82 | |
---|

83 | end |
---|