CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Spanwise averaging of three-dimensional field

Register Blogs Community New Posts Updated Threads Search

Like Tree24Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 23, 2017, 10:16
Default
  #21
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
I attached syntactically updated version of the tool, which could be compiled with OF1612+.

Without warranty of any kind, of course. :]

PS: In contrast to 'postChannel's collapsing fields onto a line, 'postSpanwiseAverage' returns volScalarFields of the size of the entire computational grid. Yet, each slice of computational domain's fields in the homogeneous direction is the same. Then, therefore, it is your responsibility to sample the fields onto whatever shape you want.
Attached Files
File Type: zip postSpanwiseAverage-1612+.zip (33.6 KB, 126 views)

Last edited by HakikiCanakkaleli; July 7, 2017 at 14:12. Reason: addition to the comments
HakikiCanakkaleli is offline   Reply With Quote

Old   July 3, 2017, 07:28
Default
  #22
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hello

how does it work, this tool? I remember that there was one around the forum that provides you the nodes values, not the cell ones.

For the moment, what I do is to add in my control dict some surfaces definition, and then I average them using Python. Maybe it would be easier with PyFOAM, but I have no idea about it.
agustinvo is offline   Reply With Quote

Old   July 4, 2017, 06:38
Default
  #23
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
Your question is ambiguous to me, I'm afraid. What do you mean by 'how does it work, this tool?': you want to know how to use the tool or how the tool performs its assigned task?
HakikiCanakkaleli is offline   Reply With Quote

Old   January 15, 2018, 10:18
Default
  #24
New Member
 
benqing Liu
Join Date: Sep 2017
Posts: 8
Rep Power: 9
benqing is on a distinguished road
Quote:
Originally Posted by syavash View Post
Nice job Gregory! But I think your code may ignore some cells when trying to match x and y coordinates. I have applied your routine to my case, a 3-D channel homogeneous is z direction.
I could get a nice smooth field of velocity, but when noting the legend bar, I could see that the velocity range is half of that which should be!!
Actually, I have developed a similar utility/code for Ansys Fluent and it also suffers from the same issue.
Due to writing precision of the grid generator tool (Gambit and ICEM CFD in my case), not the entire cells aligned in z direction have THE EXACT similar x and y coordinates. So, it is normal that the code ignores some cells and their contributions to the velocity field are neglected.
For fixing this problem, I introduced a tolerance factor in my case which somewhat improved span-wise averaging.
Can you do the same in your routine?

P.S.: Is it possible to include pressure field as well??

Regards,
Syavash
Hello Syavash
I met the same question ,when used Gregory's utility,but "velocity range is half of that which should be!!",did you slove this problem?

Regards,
benqing
benqing is offline   Reply With Quote

Old   January 16, 2018, 04:36
Default
  #25
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by benqing View Post
Hello Syavash
I met the same question ,when used Gregory's utility,but "velocity range is half of that which should be!!",did you slove this problem?

Regards,
benqing
Hi Benqing,

Did you use postSpanwiseAverage tool? I found it very helpful.

Regards,
Syavash
syavash is offline   Reply With Quote

Old   January 16, 2018, 07:56
Default
  #26
New Member
 
benqing Liu
Join Date: Sep 2017
Posts: 8
Rep Power: 9
benqing is on a distinguished road
Quote:
Originally Posted by syavash View Post
Hi Benqing,

Did you use postSpanwiseAverage tool? I found it very helpful.

Regards,
Syavash
I get it ,thank you!

Regard,
Benqing
benqing is offline   Reply With Quote

Old   February 20, 2019, 11:36
Smile Averaging Tool in the Cyclic Direction (avgCyclicDir)
  #27
New Member
 
Arnau Pont Vílchez
Join Date: Jun 2018
Location: Terrassa, Barcelona, Spain
Posts: 1
Rep Power: 0
arnaupont is on a distinguished road
Hi everybody,

I think that this tool can be useful for those who are interested in this post.
https://github.com/arnaupv/avgCyclicDir (version 0.9.0).

Main features:
* OpenFoam v1706.
* Cyclic direction is automatically detected.
* It averages all *Mean files (accepts any kind of field).
* A mesh with a unique control volume in the cyclic direction is created. So, sampling tools can be used without problems).
* Fields are saved in postPorcessing/avgCyclicDir/

Main shortcomings:
* Only one cyclic direction is currently allowed.
* Patches are not included (set to 0 by default).
* Sequential (not parallelized).
* The mesh must be structured in the cyclic direction.

As it can be seen in the GitHub repository, the tool is underdevelopment but the results are pretty good! I will highly appreciate your comments and help for addressing the current shortcomings.

I hope it helps!

Arnau
arnaupont is offline   Reply With Quote

Old   September 22, 2019, 11:02
Default
  #28
New Member
 
Han
Join Date: Dec 2017
Location: USA
Posts: 9
Rep Power: 8
whhjken1 is on a distinguished road
Hi Arnau,

The avgCyclicDir utility that you developed is just what I need in postProcessing LES results of a turbulent pipe flow. However, there are some errors when I compiled your code, which I believe is due to the syntactics because my OpenFOAM is version 4.0. So I was wondering if you could test other versions of OpenFOAM and make relevant modifications to your codes. Thanks a lot.

Han
arnaupont likes this.
whhjken1 is offline   Reply With Quote

Old   September 22, 2019, 11:07
Default
  #29
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
IMHO,

The new OpenFOAM utilities such as:

columnAverage

patchEdgeSet

might be used for spanwise averaging channel-like flow statistics.
Bazinga, zhangyan and Luttappy like this.
HPE is offline   Reply With Quote

Old   September 23, 2019, 10:39
Default
  #30
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
Quote:
Originally Posted by HPE View Post
IMHO,

The new OpenFOAM utilities such as:

columnAverage

patchEdgeSet

might be used for spanwise averaging channel-like flow statistics.
Yes, thank you!

The other user-provided tools did not work for me (of6) but the columnAverage function executed by of1906 for of6 cases works like a charm.

edit: i realized that it does indeed work for U and p. However, if I try to average fields such as Q or vorticitiy I get an error saying the fields are not found. Any idea how to fix this issue?

Last edited by Bazinga; September 24, 2019 at 04:16.
Bazinga is offline   Reply With Quote

Old   October 17, 2019, 10:24
Default Update
  #31
New Member
 
Han
Join Date: Dec 2017
Location: USA
Posts: 9
Rep Power: 8
whhjken1 is on a distinguished road
Quote:
Originally Posted by whhjken1 View Post
Hi Arnau,

The avgCyclicDir utility that you developed is just what I need in postProcessing LES results of a turbulent pipe flow. However, there are some errors when I compiled your code, which I believe is due to the syntactics because my OpenFOAM is version 4.0. So I was wondering if you could test other versions of OpenFOAM and make relevant modifications to your codes. Thanks a lot.

Han
Hi Foamers,

Arnau has updated the original codes to other versions of OpenFOAM. I tested it using my LES results on the heat transfer of supercritical fluids in a circular pipe under OpenFOAM 4.x and 6, it works pretty well in these two versions. It is highly recommended to use this tool in postProcessing the spanwise averaging of flow or temperature field in cylinder coordinate.

Han
arnaupont likes this.
whhjken1 is offline   Reply With Quote

Old   November 14, 2019, 07:32
Default
  #32
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Quote:
Originally Posted by Bazinga View Post
edit: i realized that it does indeed work for U and p. However, if I try to average fields such as Q or vorticitiy I get an error saying the fields are not found. Any idea how to fix this issue?
Have you executed 'Q' or 'vorticity' function objects before executing 'columnAverage'?
HPE is offline   Reply With Quote

Old   November 14, 2019, 08:56
Default
  #33
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
Quote:
Originally Posted by HPE View Post
Have you executed 'Q' or 'vorticity' function objects before executing 'columnAverage'?
Yes. I can see them in e.g. Paraview. However, columnAverage pretends that it can not find them.
Bazinga is offline   Reply With Quote

Old   November 14, 2019, 09:40
Default
  #34
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
No, I meant this: in controlDict, did you execute the function objects in that order?

Code:
functions
{
    #include "vorticity"
    #include "columnAverage"
}
but not

Code:
functions
{
    #include "columnAverage"
    #include "vorticity"
}
HPE is offline   Reply With Quote

Old   November 14, 2019, 09:55
Default
  #35
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
I did not. IIRC I added Q and vorticity to the time directories by something like "pimpleFoam -postProcess -func Q" in the terminal. I'll check your approach and come back to this thread during the weekend.

Thanks for your help!
Bazinga is offline   Reply With Quote

Old   November 20, 2019, 09:45
Default
  #36
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
The suggestion above works for vorticity and Q.

There is only one more challenge: The columnAverage seems to average for each half of the span-wise direction, i.e., I get an averaged field till the half length of my cylinder, after which a second averaged field for the remaining half is shown. This happens for all values, also p, U etc.

Any ideas? I can upload my files in necessary of course.
Bazinga is offline   Reply With Quote

Old   November 20, 2019, 09:48
Default
  #37
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Could you please upload your cases for the reproduction?
HPE is offline   Reply With Quote

Old   November 20, 2019, 10:00
Default
  #38
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
Sure, here it is

https://www.dropbox.com/sh/wnwqum10if415bs/AADAj-0HM77k2HyKgv_dvI8Ia?dl=0

Its like 1.2 GB. In the 33 time directory I zipped the results of the following command

Code:
pimpleFoam -postProcess -latestTime
You can also see a screenshot from Paraview where I am showing the pressure averaging.

Thanks for your help!
Attached Images
File Type: jpg Selection_333.jpg (185.3 KB, 24 views)
Bazinga is offline   Reply With Quote

Old   November 26, 2019, 06:06
Default
  #39
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Curious.

On the other hand, `postProcess` utility does not contain `columnAverage` yet. If you execute `postProcess -list` command, you will see that `columnAverage` is not there. So it should not affect `columnAverage` results. Or did it?

Since you have the `columnAverage` fields, and I took a slice downstream of the cylinder, and you are right: There is an asymmetric pattern.

This utility AFAIK is experimental, and community supported. Would you mind to issue a ticket in the bug tracker: https://develop.openfoam.com/Develop...AM-plus/issues

EDIT: A minimal working example would be great.

EDIT-2: If this is not possible for you, I may pursue this issue in the medium term.
HPE is offline   Reply With Quote

Old   November 26, 2019, 06:18
Default
  #40
Senior Member
 
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16
Bazinga is on a distinguished road
Quote:
Originally Posted by HPE View Post
Curious.

On the other hand, `postProcess` utility does not contain `columnAverage` yet. If you execute `postProcess -list` command, you will see that `columnAverage` is not there. So it should not affect `columnAverage` results. Or did it?

Since you have the `columnAverage` fields, and I took a slice downstream of the cylinder, and you are right: There is an asymmetric pattern.

This utility AFAIK is experimental, and community supported. Would you mind to issue a ticket in the bug tracker: https://develop.openfoam.com/Develop...AM-plus/issues

EDIT: A minimal working example would be great.

EDIT-2: If this is not possible for you, I may pursue this issue in the medium term.
Dear HPE,

Thanks for the help. I should find some time during the weekend and come back to this thread afterwards.
Bazinga 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
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
Starting field averaging using libFunctionObject after certain time eelcovv OpenFOAM Programming & Development 25 December 7, 2015 23:28
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Averaging field over a spatial direction fs82 OpenFOAM 10 August 12, 2009 11:44
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51


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