# Enthalpy calculations
H1R=R*Tc*Pr1*(B01-Tr1*(dB01dTr1)+w*(B11-Tr1*(dB1dTr1))) #has to be given o
utput as -H1R
H2R=R*Tc*Pr2*(B02-Tr2*(dB02dTr2)+w*(B12-Tr2*(dB2dTr2))) #has to be given ou
tput as -H2R
# Entropy calculations
S1R=R*(-Pr1*(dB01dTr1+w*dB1dTr1)) #has to be given output as -S1R
S2R=R*(-Pr2*(dB02dTr2+w*dB2dTr2)) #has to be given output as -S2R
############################################################################
def take():
print"gas seems to form liquid "
print"Tr1,Tr2 are : ",Tr1,Tr2
print"Pr1,Pr2 are : ",Pr1,Pr2
############################################################################
# condition 1
if Tr1>=3.0 and Tr2>=3.0:
print"condition 1 true"
pitzer()
############################################################################
# condition 2
elif Tr1<=0.7 and Tr2<=0.7:
if Prsatr7>Pr1 and Prsatr7>Pr2:
print"condition 2 true"
pitzer()
else:
print"condition 2 fails"
print "Gas became liquid at this pressure"
print"Tr1,Tr2 are : ",Tr1,Tr2
print"Pr1,Pr2 are : ",Pr1,Pr2
###########################################################################
# condition 3
elif Tr1<3.0 and Tr2<3.0:
if Tr1>0.7 and Tr2>0.7:
Prul1=(((Tr1-0.7)/(3.0-0.7))*(3.0-Prsatr7))+Prsatr7
Prul2=(((Tr2-0.7)/(3.0-0.7))*(3.0-Prsatr7))+Prsatr7
print"highest pressure for temp T1 upto which pitzer_relations are valid
is",Prul1
print"highest pressure for temp T2 upto which pitzer_relations are valid
is",Prul2
if Pr1<Prul1 and Pr2<Prul2:
print "condition 3 true"
pitzer()
else:
print"condition 3.1 fails"
print"pressure is way too high thus no pitzer co-relations applied"
else:
print"condition 3.2 fails"
take()
else:
print"condition 3.3 fails"
take()
################################################################################
#