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

How do I get density

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 9, 2012, 21:49
Default How do I get density
  #1
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 4
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, 10:48
Default
  #2
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 197
Rep Power: 7
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, 23:53
Default
  #3
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 4
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, 03:54
Default
  #4
Senior Member
 
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 197
Rep Power: 7
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, 19:55
Default
  #5
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 4
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 20:49.
bme79 is offline   Reply With Quote

Old   June 12, 2012, 20:49
Default
  #6
New Member
 
Maxim
Join Date: May 2012
Posts: 5
Rep Power: 4
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

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


All times are GMT -4. The time now is 23:28.