CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   STAR-CCM+ (http://www.cfd-online.com/Forums/star-ccm/)
-   -   Setting mass flow rate profile at an inlet (http://www.cfd-online.com/Forums/star-ccm/100544-setting-mass-flow-rate-profile-inlet.html)

 MentalVacancy April 26, 2012 15:10

Setting mass flow rate profile at an inlet

Hello everyone,

I am trying to create a field function at the inlet of a circular pipe rather than just an average value.

I want to use the classic:

u(r) = 2* Vavg (1-(r^2/R^2))

I am not really sure how to go about defining radial position in STAR to define this profile.

Thanks

 rwryne April 26, 2012 15:57

Quote:
 Originally Posted by MentalVacancy (Post 357279) Hello everyone, I am trying to create a field function at the inlet of a circular pipe rather than just an average value. I want to use the classic: u(r) = 2* Vavg (1-(r^2/R^2)) I am not really sure how to go about defining radial position in STAR to define this profile. Thanks

Never done this, but I can see two ways:

1) set up a cylindrical coordinate system (Tools->Coordinate Systems)

---or----

2) Just use the relation that r = sqrt(x^2+y^2). your field function will probably be long and ugly but should work. Itll be much more clean if your axis system has its orgin somewhere along the center axis of your pipe

 MentalVacancy April 26, 2012 16:38

Thanks for such a quick reply.

I am trying to set up the spherical coordinate system, as you suggested. It does appear to be an appropriate choice. I am having some trouble determining the coordinates of the center of my pipe, however. I have an imported mesh and cant seem to find the coordinate object properties for my inlet boundary.

 MentalVacancy April 26, 2012 17:05

Used the ruler tool to find some rough coordinates and hopefully ballpark the center of my pipe. Stay tuned.

 LuckyTran April 27, 2012 01:36

Quote:
 Originally Posted by rwryne (Post 357283) Never done this, but I can see two ways: 1) set up a cylindrical coordinate system (Tools->Coordinate Systems) ---or---- 2) Just use the relation that r = sqrt(x^2+y^2). your field function will probably be long and ugly but should work. Itll be much more clean if your axis system has its orgin somewhere along the center axis of your pipe
I've never set up an alternative coordinate system to get around this problem but, method 2 should work. I've done it bunch of times for much more complicated functions also.

Quote:
 Originally Posted by MentalVacancy (Post 357297) Used the ruler tool to find some rough coordinates and hopefully ballpark the center of my pipe. Stay tuned.
Did you not setup the geometry? If you know where the pipe center is, you would not need to use the ruler.

 rwryne April 27, 2012 08:32

Quote:
 Originally Posted by MentalVacancy (Post 357293) Thanks for such a quick reply. I am trying to set up the spherical coordinate system, as you suggested. It does appear to be an appropriate choice. I am having some trouble determining the coordinates of the center of my pipe, however. I have an imported mesh and cant seem to find the coordinate object properties for my inlet boundary.

I do not think spherical would work. You will have to use cylindrical to get it right.

However, I think method two (using sqrt(x^2+y^2)) would be the best bet.

 abdul099 April 28, 2012 07:45

Even when using the sqrt approach, you still need to know where the center of your tube is. It's not just x and y, but it would by something like sqrt((x-x0)²+(y-y0)²). Just imagine, the center coordinates of your tube wouldn't be near the origin but 1000 miles away. What would you put in for x and y?

Anyway, the field function will be less complicated with the coordinate system. You will get the center coordinate by creating a minimum and maximum report for each position x, y and z of your inlet and subtracting minimum from maximum.
You can get the normal vector of your inlet boundary as well by creating a surface average report for Area at your inlet boundary.

 MentalVacancy June 26, 2012 15:14

Hello everyone,

Thanks for the support.

So my field function now has the following shape:

21.778*2*(1-((mag2(\$\$X(@CoordinateSystem("Laboratory.Inlet_Coo rdinates"))) +mag2(\$\$Y(@CoordinateSystem("Laboratory.Inlet_Coor dinates"))))/0.005181))

Where 21.778 is my Vavg and 0.005181 is my R2.

When I attempt to run this, I get an error stating " Unable to compute field function MyName on faces of boundary "inlet" Please check that the function is defined there.

Am I defining my variables correctly?

Thanks.

 rwryne June 26, 2012 15:47

Quote:
 Originally Posted by MentalVacancy (Post 357279) u(r) = 2* Vavg (1-(r^2/R^2))
Quote:
 Originally Posted by MentalVacancy (Post 368422) Hello everyone, Thanks for the support. So my field function now has the following shape: 21.778*2*(1-((mag2(\$\$X(@CoordinateSystem("Laboratory.Inlet_Coo rdinates"))) +mag2(\$\$Y(@CoordinateSystem("Laboratory.Inlet_Coor dinates"))))/0.005181)) Where 21.778 is my Vavg and 0.005181 is my R2. When I attempt to run this, I get an error stating " Unable to compute field function MyName on faces of boundary "inlet" Please check that the function is defined there. Am I defining my variables correctly? Thanks.
Think you're almost there, but not quite.

You should be using position or centroid (not sure of difference, if any, for faces)

I think this will work:

Code:

`2*21.778*(1-(pow(\$\$Position(@CoordinateSystem("Laboratory.Inlet_Coordinates"))[0],2)+pow(\$\$Position(@CoordinateSystem("Laboratory.Inlet_Coordinates"))[1],2))/0.005181)`

 MentalVacancy June 26, 2012 16:42

Quote:
 Originally Posted by rwryne (Post 368424) Think you're almost there, but not quite. You should be using position or centroid (not sure of difference, if any, for faces) I think this will work: Code: `2*21.778*(1-(pow(\$\$Position(@CoordinateSystem("Laboratory.Inlet_Coordinates"))[0],2)+pow(\$\$Position(@CoordinateSystem("Laboratory.Inlet_Coordinates"))[1],2))/0.005181)`
Seems to have worked! Thanks for all the help!

 MentalVacancy June 27, 2012 11:46

I may have spoken too soon. I believe I may have been setting the problem up incorrectly. Instead of just a mass flow inlet, should a mass flux style (still under mass flow inlet) inlet be used instead? Choosing this option actually allows for a choice of coordinate system when choosing your field function. If I just use the above equation for a "magnitude" (I tried the other choices as well) coordinate system, I once again get the function undefined here error.

Perhaps someone can explain how STAR defines its functions or flow profiles at an interface like this inlet? I cannot seem to find it in the manual. Just from looking at a regular run, it does seem like there is some sort of flow profile assigned to inlets rather than an averaged mass flux over the surface. Can anyone provide any insight?

Thanks again.

 abdul099 July 6, 2012 19:54

Quote:
 Originally Posted by rwryne (Post 368424) You should be using position or centroid (not sure of difference, if any, for faces)
Centroid references the cell center. Position references the vertices of a cell.

MentalVacany, for me it looks more like a velocity inlet would be a better choice. Your u(r) equation defines a velocity, no mass flux, right?

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