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

How do I get density

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 9, 2012, 20:49
Default How do I get density
  #1
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 13
bme79 is on a distinguished road
Could some one please help me out.
I need to get a density in a cell. I am using rhoPimpleFoam and the code is

forAll(mesh.C(), celli)
{
scalar rro=rho[celli];
.....
}

I am getting an error. "error: invalid types ‘float[Foam::label {aka int}]’ for array subscript"

I spend two day tryng to understand why I can not get density.

Please help me out.
bme79 is offline   Reply With Quote

Old   June 11, 2012, 09:48
Default
  #2
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

have a look at hPsiThermo.C

Kind Regards,
Christian
Chris Lucas is offline   Reply With Quote

Old   June 11, 2012, 22:53
Default
  #3
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 13
bme79 is on a distinguished road
Thank you Christian for your reply, but it did not help me. I looked to this file and it did not tell me how to get density.

Could you please describe what I should check in this file.

Quote:
Originally Posted by Chris Lucas View Post
Hi,
have a look at hPsiThermo.C
Kind Regards,
Christian
bme79 is offline   Reply With Quote

Old   June 12, 2012, 02:54
Default
  #4
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 202
Rep Power: 17
Chris Lucas is on a distinguished road
Hi,

get the pressure and psi of the cell (as seen in class function calculate) and multiply them (have a look at hPsiThermo.H)

Best Regards,
Christian
Chris Lucas is offline   Reply With Quote

Old   June 12, 2012, 18:55
Default
  #5
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 13
bme79 is on a distinguished road
One more question.

My rho[celli]=psi[celli]*p[celli]

I can get p[celli] but when I try to get psi[celli] I am getting error.

How can I get a p[celli] ???

Thank you one more time.

QUOTE=Chris Lucas;365934]Hi,

get the pressure and psi of the cell (as seen in class function calculate) and multiply them (have a look at hPsiThermo.H)

Best Regards,
Christian[/QUOTE]

Last edited by bme79; June 12, 2012 at 19:49.
bme79 is offline   Reply With Quote

Old   June 12, 2012, 19:49
Default
  #6
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 13
bme79 is on a distinguished road
One more question.

My rho[celli]=psi[celli]*p[celli]

I can get p[celli] but when I try to get psi[celli] I am getting error.

How can I get a p[celli] ???

Thank you one more time.

QUOTE=Chris Lucas;365934]Hi,

get the pressure and psi of the cell (as seen in class function calculate) and multiply them (have a look at hPsiThermo.H)

Best Regards,
Christian[/QUOTE]
bme79 is offline   Reply With Quote

Reply


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
A problem about density in liquid air definition alloveyou CFX 2 June 14, 2012 14:20
Variable Density Function ryzd FLUENT 1 August 25, 2011 14:16
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23
Warning 097- AB Siemens 6 November 15, 2004 04:41
variable density water Atit Koonsrisuk CFX 2 July 24, 2003 03:07


All times are GMT -4. The time now is 02:56.