Jump to content
Sign in to follow this  

Recommended Posts

All, 

I am trying to write a user defined function for Cp and enthalpy, but I found the documentation a little confusing.   

 

the enthalpy and Cp data i have is obtained from RefProp (NIST Reference Fluid Properties database) and attached to this post.  

 

from heat transfer/Thermodynamics equations: deltaH = Cp(T) * deltaT.  But, Acusolve's documentation states that for a user defined function, both enthalpy and Cp must be provided:

"acuSolve has no way of calculating the specific heat from the enthalpy, so both must be supplied by the user defined function" - from the Command Reference Manual.

 

from the file I attached, a Cp and H are provided at a given temperature.  However, I do not know if I should just provide those values to Acusolve, or is there a relationship that i'm missing?  I want to stay away from the phase change and address the latent heat issue later.  For now, i want to focus on either all liquid or vapor analysis.  

 

I come from a structural background, and my CFD skills are a little rusty. So far, I've been able to write user defined functions for density, viscosity, and conductivity, which are working.  I have also been staying away from the phase change temperature, so the problems i've been running stay in the liquid phase.  ultimately, I would like to address the phase change, but that is another problem for another day.  

 

hopefully i was clear enough for somebody to help me.  

 

 

 

methaneEnthalpyCpData.txt

Share this post


Link to post
Share on other sites

Given that you have enthalpy as a function of temperature, you should be able to use piecewise linear enthalpy for the specific heat type rather than user function.  The curve fit variable  will be temperature.

Share this post


Link to post
Share on other sites

Acupro, 

 

i considered that, unfortunately, I forgot to mention that I also have temperature dependent data at several pressures.  The ultimate goal was to create a user defined functions to account for the pressure.  

 

Ideally, I would like to use a user defined function that mimics a piecewise linear relationship, but uses different parameters for different pressures.  

Share this post


Link to post
Share on other sites

There is an example of a UDF for specific heat in the Command Reference Manual - same chapter to which you referred earlier.  In the element loop it defines both cp[elem] and outvec[elem] which would be the enthalpy.  You may be able to use that as a guide.  You may be better off contacting the support team for assistance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×