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

Defining velocity as a function of density

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By evcelica
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2019, 00:10
Default Defining velocity as a function of density
  #1
Member
 
Hamda
Join Date: Jul 2018
Posts: 80
Rep Power: 8
Hamda is on a distinguished road
Hello,


I am working on a problem in which mass flow rate is constant. I specified mass flow rate in "inlet" boundary condition. But after seeing the results (velocity and density) I realized that the mass flow rate wasn't constant. It should be mentioned the fluid is helium and it is considered as an ideal gas. Now I was wondering how I can define mass flow rate as a constant value into pre CFX or if I can't do that, How can I define velocity or density as a function of each other to keep mass flow rate constant.


Many thanks in advance
Hamda is offline   Reply With Quote

Old   August 1, 2019, 00:36
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Then use a mass flow rate inlet. Isn't that obvious? Or is there some problem with this option?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 1, 2019, 02:24
Default
  #3
Member
 
Hamda
Join Date: Jul 2018
Posts: 80
Rep Power: 8
Hamda is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Then use a mass flow rate inlet. Isn't that obvious? Or is there some problem with this option?
I mentioned that . but after seeing results I saw that it wasn't constant at inlet and outlet.
Hamda is offline   Reply With Quote

Old   August 1, 2019, 02:43
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
So isn't the question then why is your mass flow rate apparently changing?

How are you calculating mass flow rate? Please attach an image of your geometry and your output file.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 1, 2019, 09:07
Default
  #5
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,186
Rep Power: 23
evcelica is on a distinguished road
Mass flow rate should be constant, your solution is most likely not converged, or you arte calculating something wrong.
evcelica is offline   Reply With Quote

Old   August 1, 2019, 09:29
Default
  #6
Member
 
Hamda
Join Date: Jul 2018
Posts: 80
Rep Power: 8
Hamda is on a distinguished road
My calculation was converged and I checked the mass flow rate by evaluating density and velocity. Since mass flow rate is:
density*velocity*A
Attached Images
File Type: jpg cfd.jpg (46.9 KB, 11 views)
Hamda is offline   Reply With Quote

Old   August 1, 2019, 09:31
Default
  #7
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Details matter. Exactly how did you calculate it?

The most accurate way of calculating it is to use the CEL expression massFlow(). What function did you use?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 1, 2019, 09:55
Default
  #8
Member
 
Hamda
Join Date: Jul 2018
Posts: 80
Rep Power: 8
Hamda is on a distinguished road
I calculated density and velocity assuming A as a constant value. I didn't use any expression for mass flow rate.
Hamda is offline   Reply With Quote

Old   August 1, 2019, 15:16
Default
  #9
Senior Member
 
Erik
Join Date: Feb 2011
Location: Earth (Land portion)
Posts: 1,186
Rep Power: 23
evcelica is on a distinguished road
We need to know your exact expression.
for example:
"ave(Density*Velocity)@Outlet * A" will be wrong, and is mesh dependent.
(ave(Density)@Outlet * ave(Velocity)@Outlet)*A will also be wrong, but a different wrong.

The mass flow in and out should be properly reported near the end of your out file.
you can also check P-mass imbalances in the solver manager to see if it is ~0%
Hamda likes this.
evcelica is offline   Reply With Quote

Old   August 1, 2019, 16:49
Default
  #10
Member
 
Hamda
Join Date: Jul 2018
Posts: 80
Rep Power: 8
Hamda is on a distinguished road
Quote:
Originally Posted by evcelica View Post
We need to know your exact expression.
for example:
"ave(Density*Velocity)@Outlet * A" will be wrong, and is mesh dependent.
(ave(Density)@Outlet * ave(Velocity)@Outlet)*A will also be wrong, but a different wrong.

The mass flow in and out should be properly reported near the end of your out file.
you can also check P-mass imbalances in the solver manager to see if it is ~0%
I didnt use any expression. I just check the value of density and velocity at inlet and outlet
As you see in picture 1 fluid should pass through the spheres and so the mass flow rate area is not constant but for inlet and outlet the area is the same. But as you see the value of "density * velocity" is not the same at inlet and outlet.

How can I check P-mass? In pre cfx? I didn't see "solver manager" do you mean solver control?
As you see in CFD-post , the value of mass flow rate is unknown.
Attached Images
File Type: png pic 1).png (50.2 KB, 8 views)
File Type: jpg Screenshot (190).jpg (89.6 KB, 11 views)
File Type: jpg Screenshot (191).jpg (103.2 KB, 9 views)
File Type: png Screenshot (192).png (35.9 KB, 12 views)
Hamda is offline   Reply With Quote

Old   August 1, 2019, 17:51
Default
  #11
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
This is a classic example of an XY problem: http://xyproblem.info/

Your original question was how to make velocity a function of pressure, but the real problem is that you are not calculating mass flow rate correctly. If you calculated mass flow rate correctly then your apparent problem will disappear and everything will work.

To calculate mass flow rates accurately use the massFlow() function in CEL.

Your method is inaccurate as you appear to be using a single value of density and velocity over the inlet and outlet. In reality it is going to vary, and the average of (density*velocity) does not equal the average of (density) * average of (velocity). This is why your mass flow calculations are wrong.

To check p-mass imbalance look in the final reports in the output file, or add an imbalance monitor in Solver Manager.
Hamda likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   August 2, 2019, 00:33
Default
  #12
Member
 
Hamda
Join Date: Jul 2018
Posts: 80
Rep Power: 8
Hamda is on a distinguished road
Quote:
Originally Posted by evcelica View Post
We need to know your exact expression.
for example:
"ave(Density*Velocity)@Outlet * A" will be wrong, and is mesh dependent.
(ave(Density)@Outlet * ave(Velocity)@Outlet)*A will also be wrong, but a different wrong.

The mass flow in and out should be properly reported near the end of your out file.
you can also check P-mass imbalances in the solver manager to see if it is ~0%
I checked P-mass imbalances in the solver manager and it is 0%
Hamda is offline   Reply With Quote

Old   August 2, 2019, 00:39
Default
  #13
Member
 
Hamda
Join Date: Jul 2018
Posts: 80
Rep Power: 8
Hamda is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
This is a classic example of an XY problem: http://xyproblem.info/

Your original question was how to make velocity a function of pressure, but the real problem is that you are not calculating mass flow rate correctly. If you calculated mass flow rate correctly then your apparent problem will disappear and everything will work.

To calculate mass flow rates accurately use the massFlow() function in CEL.

Your method is inaccurate as you appear to be using a single value of density and velocity over the inlet and outlet. In reality it is going to vary, and the average of (density*velocity) does not equal the average of (density) * average of (velocity). This is why your mass flow calculations are wrong.

To check p-mass imbalance look in the final reports in the output file, or add an imbalance monitor in Solver Manager.

I checked p-mass and it seems that the mass flow rate is constant

P-Mass-fluid |
+--------------------------------------------------------------------+
Boundary : Inlet 8.4650E-03
Boundary : Outlet -8.4579E-03
-----------
Domain Imbalance : 7.1051E-06





Thanks, dear ghorrocks and evcelica
so many things I have learned about CFX from you.
Hamda 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
VELOCITY vs VELOCITY IN STN FRAME vs RELATIVE VELOCITY everest20 FLUENT 1 July 13, 2015 09:35
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
A girl fail to plot velocity profile when mesh changes + Wall function asherah STAR-CCM+ 0 February 19, 2010 18:45
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23


All times are GMT -4. The time now is 04:48.