|
[Sponsors] |
Is an average out of several steady-state solution iterations possible? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 25, 2019, 09:30 |
Is an average out of several steady-state solution iterations possible?
|
#1 |
New Member
Moritz
Join Date: Aug 2016
Posts: 14
Rep Power: 10 |
Hi all,
I am working on my masters thesis in at the moment. Last time I did CFD was with OpenFoam, now its CFX, Version 16.2. Is it possible (and if yes, how) to make an average out of several (oscillating) steady-state solution iterations (e.g. with backup files of several iterations)? You may wonder why I don't want to do a transient simulation, because there I can easily time average: The model is too big and there are not enough high perfomance computing ressources for that, so the idea is, to get a reasonable/similar result by averaging the oscillating steady-state solution. I found a similar topic for FLUENT (How to get average flow quantities from oscillating steady solver results in FLUENT), but there it seems to be difficult as well. I would appreciate any advice and ideas! Regards Moritz |
|
July 25, 2019, 19:53 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
You can't estimate transient behaviour from the pseudo-time evolution of a steady state simulation. Steady state simulations have several transient terms removed from the equations (as those terms go to zero in a steady state flow), so you are not solving the full equations.
You are just going to have to find the resources to run this as a full transient simulation.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
July 29, 2019, 09:29 |
|
#3 |
New Member
Moritz
Join Date: Aug 2016
Posts: 14
Rep Power: 10 |
Thank you Glenn for your respond!
I totally agree with you, it is not physical and I am aware of the terms which get removed in steady state. I just wanted to see myself, how big the difference would be between an average out of "pseudo-time evolution of a steady state simulation" and the average out of a transient simulation, because I could imagine that there are cases where the average out of steady-state iterations is waay of to the transient timestep average and cases where they are closer together depending on the "amount of time-dependency"?! Or are they always way of? |
|
July 29, 2019, 20:19 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
You are correct, in some cases the pseudo time approach you are using will be very close, and in some cases it will be way off. It all depends on how important the terms which are ignored are.
To answer your original question: You might be able to use case comparison in CFD-Post to do this. No guarantees, it was not intended to do this. If I was going to do this I would use a more capable post processor like Ensight, Fieldview or Tecplot as they certainly can do it. Alternately you could export your variables in a CSV file at the various time positions and manually calculate the averages with something like matlab or python.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
July 29, 2019, 21:07 |
fluent
|
#5 |
Senior Member
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15 |
In ANSYS Fluent there is a pseudo-transient option for steady state simulations. Is time averaging available with that?
|
|
August 6, 2019, 09:12 |
|
#6 |
New Member
Moritz
Join Date: Aug 2016
Posts: 14
Rep Power: 10 |
Thank you very much Svetlana and Glenn! And sorry for not replying immediately, but it took me some time to work on my approach/one approach ghorrocks suggested.
I’m doing my simulations in CFX. So I don’t think that pseudo-transient option in Fluent is of any help I have access to Tecplot 360 2018 but I’m not familiar with it. Do you have an idea Glenn how it is possible there? Maybe it’s straight forward… My supervisor preferred that I use tools which are known by the team. So I found a way to obtain what I want and I would like to share it with you: In CFX Pre I defined Backup files to be written out in every iteration (you have to change the value of “delete backup files” in the Expert Parameters (I/O Control) to “f” to avoid, that the previous Backup file gets deleted). In the Backup tab (output control) I use the “selected variables” option to backup the variable(s) I’m interested in. The include mesh option is not necessarily needed to safe memory. Unfortunately I didn’t find any option to export a csv file directly from a steady state simulation iteration (in transient it’s possible). After the simulation I open the result file in CFD Post and load the backup files via the time step selector and the variable from the backup can be visualized. Afterwards I coded/recorded a session file, which loads every timestep one after another and exports the value of the desired variable on the desired location to a csv file. It’s a good idea to include the Face Connectivity in one csv file in case the data shall be imported back into CFD Post later. For the export I used the Type “BC Profil” and Boundary data “Hybrid” , more on this in the User Guide. Afterwards I created a Matlab script, which reads in all the csv files, calculates an (arithmetic) average over the steady state iterations and visualizes it. Be careful if you calculate an mean value of your variable in Matlab: if your mesh is not equidistant , the result is wrong. You first have to interpolate the data onto an equidistant mesh in matlab. Looong way to go, but I’ve got what I wanted In my case it takes around 4h to export the data in CFD Post for 1000 Iterations, around 1h in Matlab. Now I can evaluate if this approach in my case is valid, compare the results with handcalculations/experiment/transient simulation… However if anyone else has to do this, I’m happy to help with the session file/Matlab script. And if you have any advice for improving my approach, I would appreciate it. |
|
August 6, 2019, 20:53 |
|
#7 |
Senior Member
Svetlana Tkachenko
Join Date: Oct 2013
Location: Australia, Sydney
Posts: 416
Rep Power: 15 |
G'day Mojo,
1) "(you have to change the value of “delete backup files” in the Expert Parameters (I/O Control) to “f” to avoid, that the previous Backup file gets deleted)" is brilliant, thank you for sharing it. 2) You can write a tecplot macro to export the value of the desired variable on the desired location to a csv file. This could speed it up somewhat: you could call it from the command line instead of doing this in cfd-post every time. 3) 1h to average csv data in matlab? Wow. How many points and how many time steps have you got? Regards, Svetlana |
|
August 7, 2019, 03:57 |
|
#8 |
New Member
Moritz
Join Date: Aug 2016
Posts: 14
Rep Power: 10 |
Hello Svetlana,
1) you're welcome 2) thanks, I might give it a try! 3) ahh well, to be precise, I create figures of every timstep (the value of my variable at the current timestep and the arithmetic mean of my variable until my current timestep) and save them as pictures and video. That's what needs time, the reading in and calculation is done in a few minutes. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ and u+ values with low-Re RANS turbulence models: utility + testcase | florian_krause | OpenFOAM | 114 | August 23, 2023 06:37 |
Segmentation fault when using reactingFOAM for Fluids | Tommy Floessner | OpenFOAM Running, Solving & CFD | 4 | April 22, 2018 13:30 |
Free surface issues with interDyMFoam for hydroturbine | oumnion | OpenFOAM Running, Solving & CFD | 0 | October 6, 2017 15:05 |
Cannot run the code properly: very large time step continuity error | crst15 | OpenFOAM Running, Solving & CFD | 9 | December 14, 2014 19:17 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |