CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   STAR-CCM+ (http://www.cfd-online.com/Forums/star-ccm/)
-   -   Obtaining Cross-Sectional Averaged Data (http://www.cfd-online.com/Forums/star-ccm/95739-obtaining-cross-sectional-averaged-data.html)

rks171 December 30, 2011 18:28

Obtaining Cross-Sectional Averaged Data
 
I need to extract the average velocity for a section of my flow region. My first approach was to create a constrained plain derived part and then make a surface averaged report of the velocity for that plane. However, I need the cross-section averaged velocity in several locations along the path of the flow. So I used the 'multiple sections' feature of the constrained plane part to make several planes. The problem is that my report only gives one velocity... the average of all the planes. I need the velocity for each plane individually. I know I can just make a separate constrained plane for each flow location, but I need to extract the average velocity in several other locations such that I'd need around 70 planes in total and I'm hoping I don't have to go through the long process of making a plane and a report for each one and then also making a table for each one to extract the data from the code.

I also tried to just use a table to monitor the velocity at the multiple section constrained plane, but this gives local velocities. So I figured, all I need to do is output the area of each cell and then I can do a quick area-averaging of the local velocities in excel. However, for some reason, starccm+ won't output the cross-sectional areas of the cells.

So can anybody either offer up some advice for a different way to tackle this or let me know how you get the cross-sectional area of a mesh cell.

kyle December 30, 2011 22:06

You are right, you need to set up a separate constrained plane for each location. Of course, don't do it manually... record/write a macro. This is a very simple task for a first macro.

RobertB December 31, 2011 15:05

If you are having problems getting areas out of CCM+, one possible solution is to create a field function with the value 1. Then you can use the post processing features to get areas.

rks171 January 3, 2012 14:08

Writing the macro was the ticket for me. I hit record, created one constrained plane, one surface averaged report for that constrained plane, and one field mean monitor (time-averaged) of that report. Then I brushed up on my java programming skills and opened up the resulting .java file and put a for loop around the code that looped over each axial and lateral location of each plane. Making up the arrays with the contrained plane dimensions and names of the planes took me about 2 hours I'd say, and it successfully produced all the planes I'll need for getting my area-averaged velocities.

madhuvc January 16, 2012 15:29

what if we need to calculate cell averaged velocity?. I need to calculate cell velocity and area of each cell to calculate an index. Is there a way to output those?. I was able to output the velocity as a XYZ Table, but I have issues with the area. please help..

rks171 January 16, 2012 17:07

I was in that same boat, but I never did figure out how to get the cross-sectional areas of cells. When I would include the area field function in the XYZ table, it would always just come up blank. I tried to figure that out for a while and then just gave up. I needed the average velocity for a given constrained cross-section, so I was able to make a constrained plane and then create a surface-averaged report for that plane and choose velocity as my field function.

Nealcaffrey December 1, 2014 08:26

Finding Cross sectional area
 
1 Attachment(s)
1. Create a user defined Field function of

Type :Scalar
Function name :Area1
Definition : 1

2. Create a Report of Surface Integral

Choose Scalar Field Function : Area1
Parts : Constrained Plane section which you created manually for finding areas.
Units : mm^2.


3. Run the Report, you will obtain the Crosssectional Area


All times are GMT -4. The time now is 16:21.