View Issue Details

IDProjectCategoryView StatusLast Update
0003510OpenFOAMFeaturepublic2020-09-30 11:42
Reporterjoegi Assigned Towill  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionsuspended 
Platformopensuse 15.1OSOtherOS Version(please specify)
Summary0003510: residualControl does not have any effect when using the functionOnject scalarTransport
DescriptionI am setting a case using simpleFoam and the functionObject scalarTransport.

It seems that residualControl does not have any effect on the transported scalar field (T in my case).

I would expect the solver to stop when reaching he predefined tolerance of T, but it does not stop.

On the other hand, residualControl works fine for the fields U and p.

If I use the solver scalarTransport, residualControl works as expected.
Steps To ReproduceIn the attached case run the script run_all.sh:

sh run_all.sh

The tolerance of the transported scalar is high, so I would expect the solver to stop immediacy, but it does not.
TagsNo tags attached.

Activities

joegi

2020-06-20 15:18

viewer  

bg.tar.gz (29,597 bytes)

henry

2020-06-20 15:26

manager   ~0011397

That is correct, residual control does not apply to functionObjects.

joegi

2020-06-20 15:37

viewer   ~0011398

Ok, thanks for the clarification.

Maybe it can be a good idea to add a residual control for the functionObjecct scalarTransport, maybe in the definition of the functionObject. I will see if I can do it.

joegi

2020-06-20 15:40

viewer   ~0011399

Btw, maybe adding a note to avoid confusion can be a good idea.

In this case the solver prints out this info:

SIMPLE: Convergence criteria found
        T: tolerance 10

So I was expecting the solver to stop immediately.

henry

2020-06-20 16:27

manager   ~0011400

The specification

SIMPLE: Convergence criteria found
        T: tolerance 10

is read by the residual control class but it cannot know if it needed, i.e. it does not know if you are running simpleFoam with a functionObject or scalarTransportFoam. It would be VERY complicated to maintain and update a list of controls which may or will be used by a solver given that functionObjects and fvOptions are run-time selected and users can write their own solvers. If you know a simple way in which all solvers can know what residual controls might or will be used and issue appropriate messaged please send a patch for review.

will

2020-06-23 11:17

manager   ~0011406

On further consideration, it turns out that this isn't too hard to fix. There is already a database, of sorts, which contains residuals for all fields wherever the solution takes place (solver, sub model or functionObject). All that is required is to ensure that the solution control classes (pimple, simple and pimpleMultiRegion) check convergence criteria after Time::run is called, so that the functionObject-s have been called. This has now been done in both 7 and dev by the following commits:

https://github.com/OpenFOAM/OpenFOAM-7/commit/b3905ba2cdfbd54a05cf43417199381dad949d04
https://github.com/OpenFOAM/OpenFOAM-dev/commit/c6089ae3a65f608a60d665c2baa45158ce954789

will

2020-09-30 11:42

manager   ~0011563

Unfortunately it has come to our attention that this change resulted in a number of function objects not executing at the converged timestep, so streamlines, graphs, etc..., are not being generated at the end of the run. The change has as such been reverted in version 8 and in dev.

https://github.com/OpenFOAM/OpenFOAM-8/commit/6e604954fa3e864e4522fb228b8d6e05e9aded59
https://github.com/OpenFOAM/OpenFOAM-dev/commit/2362899f3e2929e065056e9c8a7659b1908f2f7c

It may be possible to create a system which permits residual control of solutions within function objects
as well as maintaining the now restored behaviour at the end of execution, but it would require significantly more effort. This bug is therefore closed pending funding.

Issue History

Date Modified Username Field Change
2020-06-20 15:18 joegi New Issue
2020-06-20 15:18 joegi File Added: bg.tar.gz
2020-06-20 15:26 henry Note Added: 0011397
2020-06-20 15:26 henry Category Bug => Feature
2020-06-20 15:37 joegi Note Added: 0011398
2020-06-20 15:40 joegi Note Added: 0011399
2020-06-20 16:27 henry Note Added: 0011400
2020-06-23 11:17 will Assigned To => will
2020-06-23 11:17 will Status new => resolved
2020-06-23 11:17 will Resolution open => fixed
2020-06-23 11:17 will Fixed in Version => 7
2020-06-23 11:17 will Note Added: 0011406
2020-09-30 11:42 will Status resolved => closed
2020-09-30 11:42 will Fixed in Version 7 =>
2020-09-30 11:42 will Note Added: 0011563
2020-09-30 11:42 will Resolution fixed => suspended