|
[Sponsors] |
From boundary (fvPatchField) get solver iteration counts |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 19, 2020, 14:43 |
From boundary (fvPatchField) get solver iteration counts
|
#1 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
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. |
|
March 21, 2020, 06:11 |
|
#2 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 373
Rep Power: 11 |
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. |
|
|
|
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 08:30 |
Question about adaptive timestepping | Guille1811 | CFX | 25 | November 12, 2017 18:38 |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
fluent divergence for no reason | sufjanst | FLUENT | 2 | March 23, 2016 17:08 |
Low Mixing time Problem | Mavier | CFX | 5 | April 29, 2013 01:00 |