# Problem 14.16 Compressor Duty and State Properties after Ammonia Compression¶

Ammonia at 100 °C and 5 bar is compressed to a pressure of 10 bar. The thermal efficiency of the process is 0.8; and the mechanical efficiency is 0.9. What is the compressor duty per mole and the temperature of the outlet?

## Solution¶

This is just another compression problem.

:

# Set the conditions and imports
from scipy.constants import bar
from thermo import ChemicalConstantsPackage, PRMIX, CEOSLiquid, CEOSGas, FlashPureVLS
fluid = 'ammonia'
constants, correlations = ChemicalConstantsPackage.from_IDs([fluid])

T1 = 100 + 273.15
P1 = 5*bar
P2 = 10*bar
zs = 

eta_isentropic = 0.8
eta_mechanical = 0.9

eos_kwargs = dict(Tcs=constants.Tcs, Pcs=constants.Pcs, omegas=constants.omegas)
liquid = CEOSLiquid(PRMIX, HeatCapacityGases=correlations.HeatCapacityGases,
eos_kwargs=eos_kwargs)
gas = CEOSGas(PRMIX, HeatCapacityGases=correlations.HeatCapacityGases,
eos_kwargs=eos_kwargs)
flasher = FlashPureVLS(constants, correlations, liquids=[liquid], gas=gas, solids=[])

state_1 = flasher.flash(T=T1, P=P1)
state_2_ideal = flasher.flash(S=state_1.S(), P=P2)
# Compute the change in enthalpy
delta_H_ideal = (state_2_ideal.H()-state_1.H())

The actual power is 3148 W/mol