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

Automatically change fvSchemes after a certain number of iterations

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2018, 13:25
Default Automatically change fvSchemes after a certain number of iterations
  #1
Member
 
James Gross
Join Date: Nov 2017
Posts: 77
Rep Power: 8
jgross is on a distinguished road
Hi OFers,

I would like to be able to automatically change the schemes after a certain number of iterations has passed (or when a certain threshold of residuals has been reached). I can't do this manually as this will be part of a larger optimisation loop.

I was thinking it could be possible to define two different fvSchemes (e.g. fvSchemes0 and fvSchemes1) and to write a script that will write over fvSchemes after the threshold has been reached. If I do this bash, this requires knowledge of solver progress, which I can't currently access (unless I read in the log file, but that could be a pain).

Furthermore, the difference between the two files is only a few lines. If I want to make global changes, I have to manually change both. It would be much preferred to have a way of doing this with a single fvSchemes file, but if that's not possible, I can write two.

Does anyone have any experience with this or any help/advice to offer?

James
jgross is offline   Reply With Quote

Old   February 16, 2018, 04:26
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi James,

You can use the timeActivatedFileUpdate functionObject.

For information use the source guide and click on functionObjects. There you can search many, if not all currently available functionObjects.

Regards,
Tom
salehi144 and C. Okubo like this.
tomf is offline   Reply With Quote

Old   February 16, 2018, 13:16
Default
  #3
Member
 
James Gross
Join Date: Nov 2017
Posts: 77
Rep Power: 8
jgross is on a distinguished road
Hi Tom,

Thanks for the reply. I am using OF-extend, which apparently doesn't have functionObjects (performed a search through all the files to be sure). It does seem to have a utility called timeDependentFvSolutionFvSchemes, which is exactly what I want.

Unfortunately, when I test it, I get
Code:
--> FOAM FATAL ERROR: 
This Foam-version does not have the facilities to overwrite fvSolution in memory.
which is activated when FOAM_SOLUTION_HAS_NO_READ_WITH_DICT is triggered.

Seems like OF-extend 4.0 can't use either of these utilities. Anyone have any ideas/solutions?

James
jgross 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
Segmentation fault when using reactingFOAM for Fluids Tommy Floessner OpenFOAM Running, Solving & CFD 4 April 22, 2018 13:30
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50
[OpenFOAM.org] OF2.3.1 + OS13.2 - Trying to use the dummy Pstream library aylalisa OpenFOAM Installation 23 June 15, 2015 15:49
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34


All times are GMT -4. The time now is 08:51.