|
[Sponsors] |
May 6, 2020, 05:08 |
Sampling turbulent fluctuation
|
#1 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
Howdy Foamers:
I am wondering if there is a way to have OpenFOAM (line) samples *not* generate a dataset for each output interval. For my validation case I would like to determine basic turbulent statistics (i.e., mean and fluctuation). For this purpose I take defined sampling line in the domain within controlDict. This will generate a dataset for each output interval, in my case each time step. However, to match my LDA measurements, I need to sample my output at a very high frequency for a fairly long time (like 1 kHz for 1 hour). This is to ensure both the mean (duration) and fluctuations (frequency) are correctly represented in my openFOAM run. The caveat is that, since with samples, openFOAM creates a directory for each sampling interval, I will end up having 3.6 million directories. I don't know if our Linux Cluster (on the OS side) would allow so many directories to be created, not to mention the time it would take to go through the files in each directory (a lesser problem, I would argue). Is there another way to have openFOAM concatenate output sample data so that I don't end up having millions of directories, if this is at all possible in any OS? Thanks in advance, Gerry. |
|
May 6, 2020, 17:22 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
I am not sure that sample creates a new directory and file at each write step in OpenFOAM; but, in any case, you can call a systemCall FO which can concatenate two files, and subsequently delete the former one at each time-step. Does it make sense?
FYI: I am sure that the cluster will not allow you more than 100k-500k files/dirs.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
May 8, 2020, 04:23 |
|
#3 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
Dear Herpes:
A system call in a cluster environment is probably not a very good idea. Lags in disk I/O, and the fact that computation might take place elsewhere and copied back to your working directory, would pose serious challenge in sychronizing your system call with the output. I know that not all clusters do that, some of the ones I use do. Not to mention, doing anything that involves deleting output during a computation, you risk losing data. You will find yourself pulling out your hair very quickly, especially if your jobs take weeks to complete. Having said that, I think it might be a better choice to write a script to monitor progress of the OpenFOAM output and move them to sub-folders accordingly. The combination and deletion of the data can take place afterwards, when I know everything is in a safe place. Gerry. P.S. - Judging from the links you attached in your signature on your posts, I assume you are commercially affiliated with ESI, and you answering user questions on CFD-online forms part of your regular support activity? If that is the case, I would strongly suggest you revise the way you respond to them. The helpfulness of your comments notwithstanding, they do come across as being rather condescending. Last edited by Gerry Kan; May 8, 2020 at 05:31. |
|
May 8, 2020, 06:40 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Edited:
Nobody is paying me to be here (all free work - free time to try to help others as much as I can), and I must refuse your perception/opinion for the 95% of my posts, I'm afraid. Most of the time, it is just international English: see an example potentialFoam, erasing the U and p fields.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror Last edited by HPE; May 8, 2020 at 17:50. |
|
May 11, 2020, 08:59 |
|
#5 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 737
Rep Power: 14 |
Perhaps consider taking a different tack. Presumably this is an LES or DNS simulation? How about using the fieldAverage functionObject to calculate mean and mean square statistics, and then when you have averaged for long enough, run the sample as a postProcessing exercise on the mean and rms fields.
Good luck! |
|
May 12, 2020, 05:07 |
|
#6 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
Dear Tobermory:
Thanks. Yes, it is an LES simulation. The fieldAverage function will come in handy, but at the moment I need to extract point measurements for mean and fluctuations along different line stations. I am still in the process of figuring out what to do. Thanks, Gerry. |
|
May 12, 2020, 05:14 |
|
#7 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 737
Rep Power: 14 |
Understood. Here's the thing though (and I only realised this recently) - you can always run your sampling as a post processing activity, choosing what time step(s) you want to run it on. You don't have to do your sampling during the run (unless you want to save the time history of the samples). For example, with pisoFoam, you can run pisoFoam -postProcess. When you do that, instead of continuing the run, it just runs any postprocessing function objects.
So, if you have run your LES simulation for a while and have developed a time-averaged field at say time t1, you can then play around with as many different samples as you wish, all on the t1 data fields, as a postprocessing activity. Just a suggestion. May not work for you, but have a think. |
|
May 13, 2020, 05:30 |
|
#8 | |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
Quote:
I have used this feature before, and this requires you to have the solution already computed and saved, so that it is available for sampling / probing for the time requested. If you are talking about 1 ms for an hour, it's going to be a lot of data. In fact, much worse than having just 3.6 milliion line sample data. In the meantime I talked to my cluster manager. He believes that the OS *should* be able to handle 3.6 million directories, but the only issue is how long it takes to list all of them. Previously I had a case with only 360k directories (I think, I was sampling at 10 ms) and it took "a long time" (again I didn't take a stop watch, but it was very long) for an ls operation in my script to retrieve the listing. The compromise seems to be to have another process monitor the postProcessing output and move them to a directory tree structure, each with a more manageable number of subdirectories containing the sampled data. Thanks for your suggestions, though, Gerry. |
||
May 13, 2020, 05:33 |
|
#9 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 737
Rep Power: 14 |
Understood - sounds like you have a good plan. Good luck!
|
|
Tags |
sampling frequency |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Oscillating Flat plate in turbulent region | Shiv1510 | Main CFD Forum | 7 | May 5, 2020 04:36 |
Problem with divergence | TDK | FLUENT | 13 | December 14, 2018 07:00 |
3D velocity fluctuation profiles from a file in initialization section using LES. | Aramisss | CFX | 0 | July 8, 2015 17:24 |
Turbulent Boundary Layer on a Flat Plate | Hoshang Garda | FLUENT | 1 | November 27, 2013 11:24 |
low turbulent reynold number | C-CARE | CFX | 4 | March 12, 2004 07:36 |