CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Access UMean at particular run time

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jmt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 28, 2021, 10:23
Default Access UMean at particular run time
  #1
New Member
 
Abhishek Mukherjee
Join Date: Sep 2014
Posts: 6
Rep Power: 11
absrocks is on a distinguished road
Hi, I am running an interfoam simulation in which I need to calculate UMean periodically. My required time period is 0.01s, within which Umean needs to be computed. Then in the next time period (0.01s interval), UMean will be calculated without considering UMean at the previous time period. I have achieved this with the following condition.

Code:
 U
        {
            mean         on;
	    prime2Mean   on;
            base         time;
        }
	
        );
        enabled         true;
    log             true;
    writeControl    outputTime;
    restartOnRestart    false;
    restartOnOutput     false;
    periodicRestart     true;
    restartPeriod       0.01;
However, I need to access the UMean for the previous time period to calculate UPrime. For example, if the run time is 0.012s, I need UMean at 0.01s (before reinitialization of UMean) and use that Umean to calculate UPrime for the next 0.01s. But I am not sure how do I access UMean in the previous time period.
The only solution I can think of saving the data at 0.01s interval (which will be costly in my case) so that I can access UMean from the latest output data, though I am not sure how do I access UMean from last written data.
Any help is appreciated!

Last edited by absrocks; June 29, 2021 at 10:30.
absrocks is offline   Reply With Quote

Old   July 1, 2021, 20:06
Default
  #2
New Member
 
Abhishek Mukherjee
Join Date: Sep 2014
Posts: 6
Rep Power: 11
absrocks is on a distinguished road
Hi any idea?
absrocks is offline   Reply With Quote

Old   July 2, 2021, 09:36
Default
  #3
jmt
Member
 
Julian
Join Date: Sep 2019
Posts: 32
Rep Power: 6
jmt is on a distinguished road
I don't have a solution but some thoughts. You could create a custom field in your solver that writes the previous UMean field (e.g., UMean_old or similar) to disk and uses that for the UPrime calculation.

Perhaps there's a way to overwrite the purgeWrite option for this custom field so that the simulation only saves the most recent field and deletes the previous ones?
absrocks likes this.
jmt is offline   Reply With Quote

Old   July 7, 2021, 20:29
Default
  #4
New Member
 
Abhishek Mukherjee
Join Date: Sep 2014
Posts: 6
Rep Power: 11
absrocks is on a distinguished road
Thanks, Julian for your suggestion, I finally managed to implement that in solver. I mainly looked at the fieldAverage.C and created two fields, one will store the old Umean and the other field will calculate the current Umean.
absrocks 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
bash script for pseudo-parallel usage of reconstructPar kwardle OpenFOAM Post-Processing 42 May 7, 2024 23:17
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
calculation diverge after continue to run zhajingjing OpenFOAM 0 April 28, 2010 04:35


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