Python Forum

Full Version: How to import the name of the fluid in CoolProp from an yml file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!
I have a file with this class

class AAA:

    def __init__(self,data):
   
        #self.fluid = data['fluid']
        self.H_p = data['H_p']
        self.P_p = data['P_p']

    def Calculate(self):
    
        self.T_wf = TempCalc(self.H_p,self.P_p)
where TempCalc is the function

def TempCalc(h,p):
    T_wf = PropsSI('T','H',h,'P',p,'air')
    return T_wf
that I have in another file.
It works, but I'd like to import also the name of the fluid (that I wrote in the .yml file with other inputs) and use it as input in PropsSI (CoolProp) instead of 'air'.
I tried with the above commented line and then I replaced 'air' with fluid, but it doesn't work.
Could someone suggest me a method to make it works?