View Issue Details

IDProjectCategoryView StatusLast Update
0003510OpenFOAMFeaturepublic2020-06-23 11:17
ReporterjoegiAssigned Towill 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformopensuse 15.1OSOtherOS Version(please specify)
Product Version7 
Fixed in Version7 
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

reporter  

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

reporter   ~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

reporter   ~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

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