# Methanol ET {-}

```{rosmose Methanol}
! OSMOSE ET Methanol
```

This ET will use the following Layers

```{rosmose Methanol_layers}
: OSMOSE LAYERS Methanol

|Layer      |Display name   |shortname  |Unit       |Color  |
|:----------|:--------------|:----------|:----------|:------|
|ELEC       |Electricity    |elec       |kW         |yellow |

```


The methanol ET contains the following units

```{rosmose Methanol_units}
: OSMOSE UNIT Methanol

|unit name  |type   |
|:----------|:------|
|Methanol   |Process|
```

## Methanol Unit {-}

```{rosmose Methanol_params}
: OSMOSE UNIT_PARAM Methanol

|cost1|cost2|cinv1|cinv2|imp1|imp2|fmin|fmax|
|:----|:----|:----|:----|:---|:---|:---|:---|
|0    |0    |0    |0    |0   |0   |1   |1   |
```

**Methanol Unit Streams**

After importing the powers of your compressors and pumps in your Aspen model. you can use this ET to sum up everything and report your net electricity consumption.

```{rosmose} 
Power_consump = %MSC_power_tot%-%Electrolyzer_size%
```

```{rosmose Methanol_rs}
: OSMOSE RESOURCE_STREAMS Methanol

|layer      |direction|value                |
|:----------|:--------|:--------------------|
|ELEC       |in       |%Power_consump%      |
```

**Heat Streams**

```{rosmose Methanol_hs}
: OSMOSE HEAT_STREAMS Methanol


|name     |Tin         |Tout         |Hin  |Hout        |DT min/2|alpha|
|:--------|:-----------|:------------|:----|:-----------|:-------|:----|
|heater_1 |%T_AIR_1%   |%T_AIR_2%    |0    |%heater_1%  |2.5     |1    |
|heater_3 |%T_FUEL_1%  |%T_FUEL_2%   |0    |%heater_3%  |2.5     |1    |
|heater_4 |%T_FUEL_2%  |%T_FUEL_3%   |0    |%heater_4%  |2.5     |1    |
|heater_5 |%T_FUEL_3%  |%T_FUEL_4%   |0    |%heater_5%  |2.5     |1    |
|cooler_1 |%T_AIR_OUT% |%T_AIR_4%    |0    |%cooler_1%  |2.5     |1    |
|cooler_2 |%T_FUEL_OUT%|%T_LTFUEL%   |0    |%cooler_2%  |2.5     |1    |
|MSC_cooler_1 |%MSC_cooler_1_Tin% |%MSC_cooler_1_Tout% |0    |%MSC_cooler_1_Duty%  |2.5     |1    |
|MSC_cooler_2 |%MSC_cooler_2_Tin% |%MSC_cooler_2_Tout% |0    |%MSC_cooler_2_Duty%  |2.5     |1    |
|HX_1    |%T_S1%      |%T_S2%       |0    |%HX1_Duty%  |2.5     |1    |
|HX_2    |%T_S4%      |%T_S5%       |0    |%HX2_Duty%  |2.5     |1    |
|HX_3    |%T_S7%      |%T_S8%       |0    |%HX3_Duty%  |2.5     |1    |
|R_1     |%T_S3%      |%T_S4%       |0    |%R1%        |2.5     |1    |
|reb     |%reb_ti%    |%reb_to%     |0    |%reb_Q%     |2.5     |1    |
|cond    |%cond_ti%   |%cond_to%    |0    |%cond_Q%    |2.5     |1    |

``` 

```{r, echo = F}
K1 = 2.2897 # purchase cost correlation coefficient for centrifugal compressor 
K2 = 1.3604
K3 = -0.1027
P1 = 450    # kW, minimum power
P2 = 3000   # kW, maximum power
C1 = K1+K2*log10(P1)+K3*(log10(P1))**2  # purchase cost of the compressor (450 kW)
C2 = K1+K2*log10(P2)+K3*(log10(P2))**2  # purchase cost of the compressor (3000 kW)
Cinv2 = (C2-C1)/(P2-P1) # slope
Cinv1 = C1-Cinv2*P1     # intercept
# print(Cinv2)            # the coefficients required in rosmose
# print(Cinv1)
```


```{rosmose compressor C1 in 2001} 
Cinv2 = 0.0002361273    [-] # slope
Cinv1 = 5.069913        [-] # intercept
Cp_C1 = 10**(%Cinv2%*%MSC_power_tot%+%Cinv1%) [$] # purchase cost of C1
FBM_C1 = 5.75           [-] # bare module cost factor, stainless steel
CEPCI_2001 = 394        [-]
CEPCI_2022 = 813        [-]
CBM_C1 = %FBM_C1%*%Cp_C1%*%CEPCI_2022%/%CEPCI_2001%  [$] # bare module cost in 2022
```

```{rosmose reactor R1 tube} 
m_fluid = %V_R1%/3600   [m3/s]      # volumetric flow rate
dt = 0.025	            [m]         # inner diamater in industrial fixed bed reactors
v_fluid = 1             [m/s]       # velocity based on an industrial multitubular reactor
N_tubes = %m_fluid%/(%v_fluid%*0.25*3.1415*%dt%**2)        [-]  # number of tubes
reactor_volume = 3.835  [m3]        # reactor volume
L_tubes = %reactor_volume%/(%N_tubes%*0.25*3.1415*%dt%**2) [m]  # length of tube
t_tube = 0.0021         [m]	        # tube thickness
C_steel = 0.783	        [$/kg]	    # price of steel
rho_steel = 8000        [kg/m3]	    # density of steel
CBM_tubes = %N_tubes%*0.25*3.1415*((%dt%+2*%t_tube%)**2-%dt%**2)*%L_tubes%*%rho_steel%*%C_steel% [$]    # bare module cost of tubes
# check pressure drop
vf_bed = 0.98           [-]         # void fraction of bed
vis_fluid = 0.0000166	[N2/m2]		# Ns/m2, viscosity
rho_fluid = 5.05		[kg/m3] 	# density
dp = 0.005				[m]			# particle effective diameter
delt_P_tube = (150*(1-%vf_bed%)**2*%vis_fluid%*%v_fluid%/(%vf_bed%**3*%dp%**2)+1.75*(1-%vf_bed%)*%rho_fluid%*%v_fluid%**2/(%vf_bed%**3*%dp%))*%L_tubes% [Pa]
```

```{rosmose reactor R1 shell} 
a = 1.25 				[-]         # decide pitch, coefficient for triangular
db = (%dt%+2*%t_tube%)*(%N_tubes%/0.319)**(1/2.142)	[m]     # bundle diameter
b = 0.098				[m]			# shell bundle clearance
ds = %db%+%b% 			[m]			# shell diameter
N_baffles = 3 			[-]			# number of baffles
s_baffles = %ds%/%N_baffles%    [m]			# baffle spacing
pitch = %a%*(%dt%+2*%t_tube%)	[m]	        # pitch
A_shell = (%pitch%-%dt%-2*%t_tube%)*%ds%*%s_baffles%/%pitch%    [m2]	# shell area
U = 0.14						[kW/m2K]	# heat transfer coefficient
t_HTF_in = 220					[°C]	    # inlet temperature
t_HTF_out = 240					[°C]	    # outlet temperature
Cp = 2.162 						[kJ/kg°C]	# specific heat
m_HTF = -%Q_R1%/(%Cp%*(%t_HTF_out%-%t_HTF_in%)) [kg/s] # mass flow rate of heat transfer fluid
t_shell = 0.007				    [m]         # shell thickness
M_shell = 2*3.1415*(%ds%/2)*%L_tubes%*%t_shell%*%rho_steel% [kg]    # shell weight
CBM_shell = 10000+29*%M_shell%**0.85  [$]   # bare module cost of shell
# check pressure drop
H_shell = %m_HTF%/%A_shell%     [kg/m2s] 	# flux
rho_HTF = 878.6					[kg/m3]	    # density (average of two temperature), need to chcek the tabel 
v_HTF = %H_shell%/%rho_HTF%    	[m/s]	    # velocity of HTF
dse = 1.1*(%pitch%**2-0.917*(%dt%+2*%t_tube%)**2)/(%dt%+2*%t_tube%)     [m]  # shell side equivalent diameter hydraulic diameter
vis_HTF = 0.00000032		    [Ns/m2] 	# viscosity of heat transfer fluid
c = 0.51 						[-]	        # friction
delt_P_shell = 8*%c%*(%ds%/%dse%)*(%N_baffles%+1)*(0.5*%rho_HTF%*%v_HTF%**2) [Pa]
```

```{rosmose reactor R1 head and total} 
CEPCI_2007 = 510        [-]
CEPCI_2022 = 813        [-]
V_shell_head = 3.1415*%ds%**2*%t_shell%          [m3]   # volume of enclosure
CBM_head  = %V_shell_head%*%rho_steel%*%C_steel% [$]	# bare module cost of head
CBM_reactor = (%CBM_head%+%CBM_shell%+%CBM_tubes%)*%CEPCI_2022%/%CEPCI_2007% [$]	# careful about the year
```


<!-- ```{rosmose}
: TAGS DISPLAY_TAGS [nvuD]
CBM_C1
CBM_tubes
delt_P_tube
CBM_shell
delt_P_shell
CBM_reactor
``` -->



