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

How to print solver info. every N steps to screen (e.g.Terminal)?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2021, 10:36
Question How to print solver info. every N steps to screen (e.g.Terminal)?
  #1
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 14
keepfit is on a distinguished road
Dear Foamers,

I don't want see the OF solver screen-info. every step. Instead, let the solution info. to be printed to screen every N steps. How to achieve this?

I know that we can switch off those screen info. in the OF's global controlDict (1 to 0):

Code:
$HOME/OpenFOAM/$WM_PROJECT_VERSION/controlDict

SolverPerformance   1;
lduMatrix           1;
I was wondering, is there anyway we can keep these options on, and make them run in *interval*? In case if Courant number or any important scalar/vector_magnitude exceed their limits, we force the OF solver to print details to screen. I think this would reduce some CPU usage, and get ride of redundant screen output info.

Last edited by keepfit; October 18, 2021 at 15:06.
keepfit is offline   Reply With Quote

Old   October 23, 2021, 12:56
Default
  #2
Member
 
s1291's Avatar
 
Join Date: Aug 2017
Location: Algeria
Posts: 98
Rep Power: 8
s1291 is on a distinguished road
I don't know if it is possible or not to achieve that via tweaking of the global controlDict or switches. One way I can think of is, to disable the output then use a function object to print that information.

Maybe using something like solverInfo function object? you can then change the writeInterval of that FO accordingly.

Of course, You can also achieve that using a custom function object/coded function object.
s1291 is offline   Reply With Quote

Old   October 25, 2021, 01:08
Talking
  #3
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 14
keepfit is on a distinguished road
Quote:
Originally Posted by s1291 View Post
I don't know if it is possible or not to achieve that via tweaking of the global controlDict or switches. One way I can think of is, to disable the output then use a function object to print that information.

Maybe using something like solverInfo function object? you can then change the writeInterval of that FO accordingly.

Of course, You can also achieve that using a custom function object/coded function object.
thanks for the hint!

Actually I am coding a new CFD framework that is compatible with OF in terms of high level syntax, but the low level ( fv discretization, field interpolation, BCs and sparse linear system ...) functionaries are written with pure C++17 data structure/STL. The Ax=B is solved by third-party linear solvers (e.g. Petsc). By doing this, I will be finally free of OF's overly-complicated APIs after so many years headache , and could 100% focus on actual algorithms .
keepfit is offline   Reply With Quote

Reply

Tags
interval, solver performance, timesteps


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
[Gmsh] gmshToFoam generates patches with 0 faces and 0 points Simurgh OpenFOAM Meshing & Mesh Conversion 4 August 25, 2023 07:58
Unsteady Restart Divergence pro_ SU2 6 May 20, 2020 15:17
Working directory via command line Luiz CFX 4 March 6, 2011 20:02
compressible two phase flow in CFX4.4 youngan CFX 0 July 1, 2003 23:32
More info about MAC solver Maciej Matyka Main CFD Forum 3 June 13, 2001 04:11


All times are GMT -4. The time now is 21:11.