CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Need help for constructing UDF for specific heat

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 26, 2020, 11:25
Red face Need help for constructing UDF for specific heat
  #1
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
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.
polkadot2013 is offline   Reply With Quote

Old   March 26, 2020, 11:36
Default Specific Heat UDF
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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 C_p.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 26, 2020, 12:26
Default
  #3
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
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
polkadot2013 is offline   Reply With Quote

Old   March 26, 2020, 12:47
Default UDF Macros
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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 publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 26, 2020, 13:14
Default
  #5
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
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
polkadot2013 is offline   Reply With Quote

Old   March 26, 2020, 14:06
Default UDF and Equation
  #6
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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 publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 27, 2020, 01:41
Default
  #7
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
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
polkadot2013 is offline   Reply With Quote

Old   March 27, 2020, 03:37
Default Specific Heat and Thermal Conductivity
  #8
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
C_p 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 ^oC but it can certainly not happen at 140 ^oC. Even in a laminar flame of candle, temperature is 600 ^oC at the wick and 1400 ^oC 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 publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 27, 2020, 04:27
Default
  #9
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
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.
polkadot2013 is offline   Reply With Quote

Old   March 27, 2020, 04:46
Default Experimental Data
  #10
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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 publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 27, 2020, 05:05
Default
  #11
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
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.
polkadot2013 is offline   Reply With Quote

Old   March 27, 2020, 05:11
Default Air-Kerosene
  #12
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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 ^oC, 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 publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 27, 2020, 06:00
Default
  #13
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
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
polkadot2013 is offline   Reply With Quote

Old   March 27, 2020, 06:27
Default Temperature Plot
  #14
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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 publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   March 27, 2020, 09:08
Default
  #15
New Member
 
Natasha
Join Date: Mar 2020
Posts: 9
Rep Power: 6
polkadot2013 is on a distinguished road
Another question:

Why does my combustion contour plot look like this ( https://ibb.co/mNH4WVW )? While theirs look like this ( https://ibb.co/j4zqjxk )?
polkadot2013 is offline   Reply With Quote

Old   March 27, 2020, 09:43
Default Simulation
  #16
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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 publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Surface Heat Transfer Coefficient driven by a UDF, using coupled wall ryanbezz11 CFD Freelancers 1 March 16, 2018 03:01
Doubt - Variable Heat Flux input - UDF Neethu_N FLUENT 1 December 19, 2017 11:48
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
UDF for heat convection coefficient with fixed surface temperature Boo85 Fluent UDF and Scheme Programming 2 July 10, 2012 18:43
heat flow UDF on coupled surface (wall-shadow wall) Friedmann Fluent UDF and Scheme Programming 0 August 5, 2010 10:25


All times are GMT -4. The time now is 07:11.