CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Need help with Compressible flow with DEFINE_SPECIFIC_HEAT

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 6, 2012, 11:51
Default Need help with Compressible flow with DEFINE_SPECIFIC_HEAT
  #1
Member
 
Join Date: Feb 2011
Posts: 48
Rep Power: 6
highhopes is on a distinguished road
Hi everyone,
I am simulating a compressible flow with the energy equation on. However I need to define the specific heat using a udf. I can get the cp values I want but I might also need a viable approximation for enthalpy in the same macro. For this aim, pressure and density seems necessary because cp=sigma(cpi)+pressure/density where cpi is the partial specific heat which I have no problem with.
However I cannot use the pressure in the macro because as I have read on other topics posted in the forum, transfer of cell info into the macro seems impossible. Has anyone dealt with an issue of this sort? Is there a workaround?
highhopes is offline   Reply With Quote

Old   July 6, 2012, 15:13
Default
  #2
akm
New Member
 
Join Date: Jan 2010
Location: United Kingdom
Posts: 27
Rep Power: 7
akm is on a distinguished road
just an idea..

you can turn off the energy equation and solve energy field using a user-defined scalar. any heat generation or viscous heating can be added as scalar sources. buoyancy effect can be added as source term to the momentum equation. heat flux or constant temperature at wall can be modelled using scalar profile. and so on...
and finally your specific heat problem will be solved because the scalar diffusivity is defined on per-cell basis -- DEFINE_DIFFUSIVITY(name, c, t, i) -- scalar diffusivity of each cell is calculated separately, so you can use the cell pressure and density in the definition.

a lot of work, i know. but it will solve the issue.
akm is offline   Reply With Quote

Old   July 6, 2012, 16:04
Default
  #3
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,098
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
Quote:
Originally Posted by highhopes View Post
...transfer of cell info into the macro seems impossible...
If I understand you correctly, you want to READ cell or face values to use them for calculations inside the UDF?
Thats easily feasible. For the cell Temperature for example, use
C_T(c,t)

Don't know the expressions for density or pressure by heart, but the UDF Manual surely does.
flotus1 is offline   Reply With Quote

Old   July 6, 2012, 20:14
Default
  #4
Member
 
Join Date: Feb 2011
Posts: 48
Rep Power: 6
highhopes is on a distinguished road
akm, I tried replacing temperature with a user defined scalar variable however unfortunately the results of a simplified run I did earlier did not match. Probably I could not define all the terms of UDS equation to mimic the energy equation. How do you suggest that I find all the required terms?
And would you suggest adding the rate of (pressure/density) as a source term for enthalpy?
I would seriously use uds instead of temperature in order to define open boundary at the outlet. However I cannot be sure because I probably did some stuff wrong the first time.

flotus1, I could not find a way to access the cell and thread indices through DEFINE_SPECIFIC_HEAT and return the specific heat value for the corresponding cell.
highhopes is offline   Reply With Quote

Old   July 7, 2012, 00:52
Default
  #5
akm
New Member
 
Join Date: Jan 2010
Location: United Kingdom
Posts: 27
Rep Power: 7
akm is on a distinguished road
what kind of flow are you dealing with exactly ??
akm is offline   Reply With Quote

Old   July 7, 2012, 02:36
Default
  #6
Senior Member
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 1,098
Rep Power: 19
flotus1 will become famous soon enoughflotus1 will become famous soon enough
Not sure what the manual says about the DEFINE_SPECIFIC_HEAT subroutine.
But you might be able to use DEFINE_PROPERTY(name,c,t) instead.

Worked fine in one of my setups.
flotus1 is offline   Reply With Quote

Old   July 7, 2012, 17:07
Default
  #7
Member
 
Join Date: Feb 2011
Posts: 48
Rep Power: 6
highhopes is on a distinguished road
akm, I am modelling compressible flow at elevated temperatures with specific heat capacity values dependent on temperature in a tabulated manner.

flotus1, I am using fluent 12.1 and I cannot see the name of the DEFINE_PROPERTY macro name in the list when I want to specify specific heat. I can only access my udf using DEFINE_SPECIFIC_HEAT using this version of fluent.
highhopes is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Natural Convection using Compressible Flow (chtMultiRegionFOAM) msarkar OpenFOAM 2 September 7, 2010 00:13
Compressible flow, no data at the outlet mireis FLUENT 1 July 28, 2010 05:22
help with compressible flow BC's (need subsonic flow) meangreen Main CFD Forum 5 July 24, 2010 13:16
Compressible Fluid Flow in COMSOL Multiphysics BBG Main CFD Forum 1 November 19, 2008 15:05
Solving unsteady compressible low speed flow atit Main CFD Forum 8 July 31, 2000 13:19


All times are GMT -4. The time now is 03:20.