CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

accessing thermophysical properties on a lower level

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 24, 2013, 10:20
Default accessing thermophysical properties on a lower level
  #1
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 11
romant is on a distinguished road
Hej,

I have a question about the accessing thermophysical properties on a lower level than the ones given.

I would like to obtain for example rho at a certain temperature, which is not the cell temperature, therefore I can't use the normal approach via
Code:
volScalarField rho = thermo.rho();
or similar, since this gives me only access to the whole field (or sub fields later on).

I would like to be able to just obtain rho, without a specific cell attached to it, similar to
Code:
scalar rho = thermo.rho(pressure, temperature);
in order to use it as a iteration value in a function.

I know that these functions exist in the thermophysical properties like icoPolynomial, however, they are not accessible, since this class is templated into heRhoThermo, which does not provide these functions, as far as I can see.

Does anybody have an idea on how to access this?
__________________
~roman
romant is offline   Reply With Quote

Old   October 25, 2013, 03:32
Default
  #2
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 198
Rep Power: 7
Chris Lucas is on a distinguished road
Hi,

as far as I know, this is not possible without some minor changes. I still use OF2.1 so you must find the equivalent file in OF2.2.

An easy way is to add a dummy function in the thermo class called by the solver (e.g. basicPsiThermo), which returns the value if the class already knows the fields and has access to the mixture class (this is not true for basicPsiThermo). If not, return a dummy value. Then, in the real thermo classes (e.g. hPsiThermo) you redefine the function (function overload) so that the correct value is returned.

Have a look at my realGasThermo library. In basicPsiThermo I added an additional function so that the solver gets access to the new fields.


Christian
Chris Lucas is offline   Reply With Quote

Old   October 25, 2013, 12:06
Default
  #3
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 152
Rep Power: 10
dkxls will become famous soon enough
Depends on your mixture type. If your thermo class is a 'basicMultiComponentMixture', then you should have (or can add) in your solver something like this:
Code:
    basicMultiComponentMixture& composition = thermo.composition();
and you get the per species thermo properties like this:
Code:
    scalar rhoSpecie0 = composition.rho(0, 1e5, 273.15);
For a 'basicMixture', i.e. single component mixture, this doesn't work anymore. So you would need some own coding.

May I ask what you want to do with the "raw" thermo data?
dkxls is offline   Reply With Quote

Old   October 28, 2013, 05:15
Default
  #4
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 11
romant is on a distinguished road
Quote:
Originally Posted by dkxls View Post
Depends on your mixture type. If your thermo class is a 'basicMultiComponentMixture', then you should have (or can add) in your solver something like this:
Code:
    basicMultiComponentMixture& composition = thermo.composition();
and you get the per species thermo properties like this:
Code:
    scalar rhoSpecie0 = composition.rho(0, 1e5, 273.15);
For a 'basicMixture', i.e. single component mixture, this doesn't work anymore. So you would need some own coding.

May I ask what you want to do with the "raw" thermo data?

I am trying to implement advanced wall functions, for which I need the thermophysical properties of the fluid in points at a distance y away from the wall. This distance y does not correspond to a fixed point in the grid space. It could be the edge of the thermal or momentum sublayer, for which I have a temperature and then need the the thermophysical properties of the fluid.
__________________
~roman
romant is offline   Reply With Quote

Old   October 28, 2013, 09:25
Default
  #5
Senior Member
 
dkxls's Avatar
 
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 152
Rep Power: 10
dkxls will become famous soon enough
Sorry, I not really familiar with wall function modeling. So, no further ideas...
dkxls 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
Error in thermophysical properties (chtMultiRegionFoam) mukut OpenFOAM Pre-Processing 17 September 3, 2014 07:54
table properties for thermophysical properties romant OpenFOAM Running, Solving & CFD 1 August 12, 2014 08:41
Water properties at micro level sunilpatil Main CFD Forum 0 August 12, 2013 08:57
Adding layers goes wrong with SnappyHexMesh Elise OpenFOAM Native Meshers: snappyHexMesh and Others 1 April 22, 2013 02:32
Boundary layer in a pipe Clementhuon OpenFOAM Native Meshers: snappyHexMesh and Others 6 March 12, 2012 13:41


All times are GMT -4. The time now is 22:52.