# Need help for constructing UDF for specific heat

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 26, 2020, 11:25 Need help for constructing UDF for specific heat #1 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 Hi, Does anyone know whether it is possible to make a UDF that defines specific heat of gaseous fluids as being dependent on both temperature and thermal conductivity? If so, can someone guide me or point me in the direction I need to go for this? I'm a really new user to ANSYS Workbench (I just started using it a month ago) and I'm unfamilliar with coding too . Thanks for reading this far and thanks in advance for helping me out.

 March 26, 2020, 11:36 Specific Heat UDF #2 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 UDF for specific heat is different from UDFs for other properties. Since it is linked with the enthalpy, you also need to provide equation for the enthalpy within the same UDF. Look at the example given at https://www.afs.enea.it/project/nept...udf/node51.htm This is only a function of temperature. It can be a function of mass fraction of species in case of species transport. However, to make it a function of thermal conductivity, either thermal conductivity should be a constant or a function of temperature or species mass fraction itself so that the expression for the thermal conductivity could be calculated within the UDF and then used to determine . __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum

 March 26, 2020, 12:26 #3 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 Does that mean that the first line of the code: DEFINE_SPECIFIC_HEAT( name, T, Tref, h, yi) would have to include a thermal conductivity term in it? Does that mean I have to find an equation that describes this in the first place? This is for a simulation of the combustion of kerosene in air inside a tunnel. Btw, would you know where I can find a quick tutorial on writing a UDF? I'm honestly going in blind here. I can roughly understand code but have no idea how to write it

 March 26, 2020, 12:47 UDF Macros #4 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 DEFINE_ macros are defined within Fluent and user cannot modify those. Therefore, there is no way to access thermal conductivity within DEFINE_SPECIFIC_HEAT. There are other DEFINE_ macros where almost everything can be accessed but DEFINE_SPECIFIC_HEAT is rather specific. To learn about UDF writing there are multiple options online. As far as this specific requirement is concerned, this would be rather simple if you know the equations for specific heat and thermal conductivity (or if thermal conductivity is constant). __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum

 March 26, 2020, 13:14 #5 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 I can try finding the equations online. I think the thermal conductivity should be dependent on the temperature according to the kinetic theory because the simulation is dealing with combustion. So this means that I have to find an equation that describes specific heat of the gas in terms of the thermal conductivity, right? Or should these be two separate equations? I'm really slow at this. Thanks for bearing it with me

 March 26, 2020, 14:06 UDF and Equation #6 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 Well, you are doing it other way around. Usually, people use UDF only if they have to use an equation. Otherwise, use the inbuilt features. You mentioned in your first post that you need to model specific heat where it is a function of thermal conductivity. This implies you already have an equation. If you do not have an equation, then I would suggest you use the available features first. Only if you do not get satisfactory predictions, use UDFs. __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum

 March 27, 2020, 01:41 #7 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 This is actually for my coursework where I have to replicate the results of another report but it didn't provide the equations for this relationship. Right now, I'm trying to replicate their exact setup and they stated that, "For each fluid, the specific heat is dependent of the temperature and thermal conductivities." When I used the default settings for the specific heats of the fluids, the combustion temperatures were around 1400 deg C, which was almost 10 times higher than their simulated and experimental data. That's why I'm resorting to using a UDF but I have no idea how

 March 27, 2020, 03:37 Specific Heat and Thermal Conductivity #8 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 being a function of thermal conductivity is a very bold statement and wrong in most cases. There might be a few rare scenarios where this might hold but not under standard conditions. Secondly, combustion may not always require as high temperature as 1400 but it can certainly not happen at 140 . Even in a laminar flame of candle, temperature is 600 at the wick and 1400 at the outermost region. So, most likely your results are correct and not of the paper. __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum

 March 27, 2020, 04:27 #9 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 Ohhh... I see... Thanks for the clarification! Just now, I had a feeling that maybe my temperature plot might be recording from the wrong area because the shape of my temperature plot is similar to theirs. Only that the temperatures are 10 times higher. They recorded their temperature 90 cm above the combustion source, is it possible for the temperatures to be in the 80-160 deg C range? They used kerosene as fuel.

 March 27, 2020, 04:46 Experimental Data #10 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 Experiments don't lie but the results of the experiment can if the data is not retrieved properly. If they have also done it numerically, then they might have given information about the properties. What fluids are they using? __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum

 March 27, 2020, 05:05 #11 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 They used air going in at 1 m/s and kerosene set at the base of the tunnel. They specified the kerosene have a mass flowrate of 1.51 g/s. They also used the Species Transport model and the Eddy Dissipation option for the Turbulence-Chemistry Interaction.

 March 27, 2020, 05:11 Air-Kerosene #12 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 That's good. Neither for air nor for kerosene is the specific heat a function of thermal conductivity. If a detailed mechanism is used, then, with a very small possibility, there might be some radicals with their specific heat as a function of thermal conductivity. But that won't change the specific heat of kerosene as whole. Secondly, kerosene in air has an adiabatic flame temperature of 2093 , so, it is not really possible to have such low temperature and still sustain the flame. __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum

 March 27, 2020, 06:00 #13 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 Ahhh... Thanks! So does that mean that the temperatures that I got are reasonable? By the way, why does my temperature plot look like this? https://ibb.co/BsSqL3M

 March 27, 2020, 06:27 Temperature Plot #14 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 Because you are using a whole plane for plotting xy plot. You need to create lines to plot xy plot. __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum

 March 27, 2020, 09:08 #15 New Member   Natasha Join Date: Mar 2020 Posts: 8 Rep Power: 2 Another question: Why does my combustion contour plot look like this ( https://ibb.co/mNH4WVW )? While theirs look like this ( https://ibb.co/j4zqjxk )?

 March 27, 2020, 09:43 Simulation #16 Senior Member     Vinerm Join Date: Jun 2009 Location: Nederland Posts: 1,305 Blog Entries: 1 Rep Power: 21 Their simulation appears to be transient and what they have shown could be an instantaneous contour, attached to the upper wall, most likely due to Coanda effect. __________________ Regards, Vinerm PM to be used if and only if you do not want something to be shared on the Forum