CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Averaging over iterations for steady-state simulation

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2021, 13:15
Arrow Averaging over iterations for steady-state simulation
  #1
New Member
 
Join Date: Apr 2021
Posts: 2
Rep Power: 0
CFD student is on a distinguished road
Hi all,

I'm currently doing a steady-state simulation in a parallel fluent environment. The results (inlet mass flow, outlet mass flow, total temperature at a specific created surface...) all vary in a certain band, the iterations don't lead to a 'constant' value.

Is there any possibility to let Fluent automatically write the average value of the last 1000 iterations of e.g. the total temperature to an output file?

If not, is it possible to do this with an UDF? I'm completely new to UDF's so a bit of help/a starting point is much appreciated!


Thanks in advance!
CFD student is offline   Reply With Quote

Old   April 26, 2021, 23:41
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,848
Rep Power: 29
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
why don't you want to write variable into file and get average value later, for instance in excel?
it's the easiest way if you have a few monitors.
pakk likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   April 27, 2021, 03:03
Default
  #3
New Member
 
Join Date: Apr 2021
Posts: 2
Rep Power: 0
CFD student is on a distinguished road
Im doing batch simulations, so I have about 6 monitors and 100 simulations. Copying results to excel would take loads of time.

Thank you for your suggestion!
CFD student is offline   Reply With Quote

Old   April 27, 2021, 04:25
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,947
Rep Power: 24
pakk will become famous soon enough
If you really want to do it in Fluent:
*Make a global array with 1000 values.
*make a global index.
*after every time step:
- set the monitor value in the array, at the location of the index.
- increase the index by one (modulo 1000)
- calculate the average value of your array, and save it /print it.

There are many other ways to do it, but this is the easiest way I could think of.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".
pakk is offline   Reply With Quote

Old   April 27, 2021, 05:51
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,848
Rep Power: 29
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
make a script ,for example in python or any other language, to get 1000 last values from file and to calculate average value.
this will be much easier comparing to UDF. And more flexible.

in case you want to proceed with UDF, Ansys Fluent Customization manual, look for DEFINE_ON_DEMAND macro, there is good example on how to get average temperature

for your case you will use DEFINE_EXECUTE_AT_END to calculate and write variables after each iteration

my recommendation: make it works for single core computation and later move to parallel
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   April 28, 2021, 10:10
Default Iterations for simulation with schiaparelli capsule?
  #6
New Member
 
Join Date: Mar 2021
Posts: 13
Rep Power: 2
jean@cfd is on a distinguished road
temperature limited to 1.000000e+01 in 1 cells on zone 4
43 6.2712e-02 1.5462e-02 2.2252e+00 4.0021e+00 1.1799e-01 1.1802e+01 3.5830e-01 3.8173e+00 6.1537e-02 5.9306e+04 2.3388e+04 6.0264e+04 3656:11:52 99964

reversed flow in 941 faces on pressure-outlet 9.

time step reduced in 25 cells due to excessive temperature change

absolute pressure limited to 1.000000e+00 in 1 cells on zone 4

temperature limited to 1.000000e+01 in 1 cells on zone 4
44 6.2213e-02 1.4892e-02 2.1214e+00 3.8880e+00 1.1235e-01 1.1824e+01 3.5848e-01 3.8248e+00 6.1033e-02 5.9061e+04 2.3360e+04 6.0090e+04 3430:17:51 99963

reversed flow in 940 faces on pressure-outlet 9.

time step reduced in 26 cells due to excessive temperature change

absolute pressure limited to 1.000000e+00 in 1 cells on zone 4

temperature limited to 1.000000e+01 in 1 cells on zone 4
45 6.1251e-02 1.3971e-02 2.0221e+00 3.7188e+00 1.0513e-01 1.3652e+01 4.1026e-01 4.4168e+00 6.0076e-02 5.8774e+04 2.3335e+04 5.9885e+04 3355:05:22 99962

FOR MY RESEARCH ON RE ENTRY VEHICLES MY ITERATIONS ARE COMING LIKE THIS WITH CONVERGENCE?
jean@cfd is offline   Reply With Quote

Old   April 28, 2021, 12:37
Default
  #7
Senior Member
 
Join Date: Nov 2013
Posts: 1,947
Rep Power: 24
pakk will become famous soon enough
Yes for your research on re entry vehicles your iterations are coming like this with convergence.

Or possibly for your research your iterations are going like that with convergence.

I'm sorry, did you ask a question?
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build".

Last edited by pakk; April 28, 2021 at 13:58.
pakk is offline   Reply With Quote

Reply

Tags
averaging, iteration averaging, iterations, parallel, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Compressible flows with larger Courant numbers Tobi OpenFOAM Running, Solving & CFD 5 February 26, 2021 16:20
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 06:49
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
Compressor Simulation using rhoPimpleDyMFoam Jetfire OpenFOAM Running, Solving & CFD 107 December 9, 2014 14:38
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37


All times are GMT -4. The time now is 14:52.