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

From boundary (fvPatchField) get solver iteration counts

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 19, 2020, 13:43
Default From boundary (fvPatchField) get solver iteration counts
  #1
Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 93
Rep Power: 5
Gerry Kan is on a distinguished road
Howdy folks:

This question might seem a bit odd, but here it goes.

I implemented a boundary condition which updates the scalar / vector values of selected boundaries at regular simulated time intervals by reading an external file. While the BC picks up the external file at the correct times, I noticed that it rereads the file at every outer (PIMPLE) and inner (pressure correction) iteration during that time step.

The natural to do, I suppose, is to pass some kind of counter or flag, which tells the boundary condition whether the solver is at its first outer and inner iterations, thus signalling the boundary to read the external file at that time.

There is a certain "global" registry called "db" in the fvPatchField, from which I can access some global states from the solver (e.g., runtime), but I don't know whether I can introduce new objects / variables into the db object, or better, obtain information about the solver's state (i.e., inner / outer loop iteration count) from there.

Any insight on this would be greatly appreciated.

Gerry.
Gerry Kan is offline   Reply With Quote

Old   March 21, 2020, 05:11
Default
  #2
Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 93
Rep Power: 5
Gerry Kan is on a distinguished road
I figured it out, and it is quite straightforward. It appears that any global variable will have visibility from all modules.

Having said that, I have compiled and linked the boundary condition into the solver, i.e., the .so for the BC is referenced in Make/options under the solver's source code directory. I don't know if the same applies if the .so is loaded at runtime into the solver as a. function object.

Gerry.
Gerry Kan is offline   Reply With Quote

Reply

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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 17:38
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 03:21
fluent divergence for no reason sufjanst FLUENT 2 March 23, 2016 16:08
Low Mixing time Problem Mavier CFX 5 April 29, 2013 00:00


All times are GMT -4. The time now is 22:46.