View Issue Details

IDProjectCategoryView StatusLast Update
0002318OpenFOAMBugpublic2016-11-05 23:30
Reporterjoegi Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformopensuse 42.1OSopensuse 42.1OS Versionopensuse 42.1
Summary0002318: Turbulence model is not runtime selectable
DescriptionI am using the latest 4.x version, and I realized that the turbulence model can't be switch off/on using the option turbulence off/on in the dictionary turbulenceProperties.

This option used to work with previous versions.

jg
Steps To ReproduceTry to run any case with a turbulence model and try to turn off/on the turbulence model in the dictionary turbulenceProperties
TagsNo tags attached.

Activities

henry

2016-11-05 08:03

manager   ~0007091

I am unable to reproduces this issue, when I set

RAS
{
    // Tested with kEpsilon, realizableKE, kOmega, kOmegaSST, v2f,
    // ShihQuadraticKE, LienCubicKE.
    RASModel kEpsilon;

    turbulence off;

    printCoeffs on;
}

in tutorials/incompressible/simpleFoam/pitzDaily/constant/turbulenceProperties

the case runs without solving for turbulence as expected.

joegi

2016-11-05 09:02

viewer   ~0007092

Ok, let me be a little bit more specific. I also checked the tutorials and they are working fine.

I am running using incompressible and compressible solvers, and in controlDict I have many functionObjects: filedMinMax, surfaceRegion (for massflow, average pressure in a patch, areaverage of u in a patch), yPlus. Maybe the problem is related to this combination of function objects.

Btw in my case setup, the option of log off/on only works with the function object fieldMinMax.

The case I am running is rather a big one, so I will try to setup a small case.

joegi

2016-11-05 19:06

viewer   ~0007102

Hi,

In this link, you can download a dummy case:

https://www.dropbox.com/s/fmvs7luxd3arc60/dummy.tar.gz?dl=0

If you use rhoSimpleFoam and try to turn on/off turbulence on the fly, it doesn't work. Also, it's not possible to turn on/off the logs (screen output) of the functions objects.

I have seen similar behavior with unsteady solvers and incompressible solvers as well. However, so far only using kOmegaSST.

j

henry

2016-11-05 20:51

manager   ~0007105

I am unable to reproduce the problem of switching-off turbulence, it works for all the cases I have tested. I do not see any relationship between the switching of the turbulence models and the logging from functionObjects.

wyldckat

2016-11-05 21:16

updater   ~0007108

@joegi: I've taken a look into your case "dummy.tar.gz" and it's not possible to run it because:

  --> FOAM FATAL IO ERROR:
  Cannot find patchField entry for maxY

  file: /home/ofuser/mantis/bug2318/case/0/p.boundaryField from line 27 to line 59.


I tried turning off turbulence with the tutorial case "compressible/rhoSimpleFoam/squareBend" while it was running, by editing the file "constant/turbulenceProperties" and changing "turbulence" from "on" to "off" within the block "RAS"...
... and the equations for k and epsilon are no longer solved from that point onward.


Are you 100% certain that you don't have in your real case this entry in "controlDict"?

  runTimeModifiable false;

joegi

2016-11-05 21:40

viewer   ~0007110

The case should be working fine, I just checked it. I also download the case in

https://www.dropbox.com/s/fmvs7luxd3arc60/dummy.tar.gz?dl=0

and is working fine, don't know what could be your problem.

I am using OF4.x and you should run the case using rhoSimpleFoam. By the way, the case is ready to run, you don't need to generate the mesh, just unpack and run the solver.

I am in front of the computer and I can't turn off/on the turbulence on-the-fly (from the turbulenceProperties dictionary).

The issue with the function objects is not important, but you can verified it as well.

Have in mind that I see this behavior only with the komegasst model.

I am 101% sure that runTimeModifiable is set to true. I can modified for instance fvSchemes, fvSolutions, and so on, but I can't modify turbulenceProperties.

wyldckat

2016-11-05 22:20

updater   ~0007111

OK, now I see what you mean. I was using foamRunTutorials to run the case, which had run blockMesh.

And indeed, the k-omega SST equations continue to be solved... very interesting... give me a few minutes to see if I'm able to pinpoint the origin of the problem.

wyldckat

2016-11-05 22:27

updater   ~0007112

Confirmed with the tutorial case "incompressible/simpleFoam/pitzDaily", using the model kOmegaSST in OpenFOAM 4.x.

wyldckat

2016-11-05 22:35

updater   ~0007113

Sorry, forgot to mention that I had confirmed with the tutorial "incompressible/simpleFoam/pitzDaily", when changing the file while the solver had already run for several iterations (time steps)...

joegi

2016-11-05 22:43

viewer   ~0007114

You can also check the issue with the functionObjects, they can't be turn on/off using the log keyword (except for minmaxfield).

wyldckat

2016-11-05 22:56

updater   ~0007115

@joegi: Could you please open a separate bug report for that? I've already pinpointed the bug for kOmegaSST and am testing if the solution works...

I did see about an hour or so ago that something weird was going on with yPlus, which doesn't log anything to the solver output... but it looks like there is something weird going on with more than one function object, therefore it's preferable to keep track of that separately, since there are lilely a lot more function objects affected by the bug.

wyldckat

2016-11-05 23:02

updater   ~0007116

@Henry: I've pinpointed the first issue, where the wrong read method is being called:

  @@ -376,7 +376,7 @@ kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::kOmegaSST
   template<class TurbulenceModel, class BasicTurbulenceModel>
   bool kOmegaSST<TurbulenceModel, BasicTurbulenceModel>::read()
   {
  - if (BasicTurbulenceModel::read())
  + if (TurbulenceModel::read())
       {
           alphaK1_.readIfPresent(this->coeffDict());
           alphaK2_.readIfPresent(this->coeffDict());


at least when compared to kEpsilon:

       if (eddyViscosity<RASModel<BasicTurbulenceModel>>::read())


But either I'm missing a build somewhere, or there is another detail I'm still missing...

wyldckat

2016-11-05 23:09

updater  

kOmegaSSTBase.C.4x (12,423 bytes)

wyldckat

2016-11-05 23:10

updater  

kOmegaSSTBase.C.dev (12,845 bytes)

joegi

2016-11-05 23:10

viewer   ~0007117

Ok great.

I have a list with a couple problems with a few functionObjects. I was about to report the one on yPlus.

I am also doing some testing, but I think I am having problems with codefixedvalue as well.

What I see strange is that all these problems happens when using komega-sst

wyldckat

2016-11-05 23:12

updater   ~0007118

@Henry: I've confirmed that this fixes the problem. Had to rebuild the library folder "src/TurbulenceModels/incompressible" for this to be properly built... somehow wmake missed it...

Attached are the following files:

  - kOmegaSSTBase.C.4x - for replacing in OpenFOAM 4.x the file "src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.C"

  - kOmegaSSTBase.C.dev - for replacing in OpenFOAM-dev, the same file path "src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.C"

wyldckat

2016-11-05 23:19

updater   ~0007119

@joegi:
> What I see strange is that all these problems happens when using komega-sst

That may be a coincidence, but again, a separate bug report will make it easier to work through the problems with the function objects.

henry

2016-11-05 23:30

manager   ~0007120

Resolved in OpenFOAM-dev by commit c3fdc191c2e648ba210902bf848c02614af728a1

Resolved in OpenFOAM-4.x by commit c4b8d5e443e91ddec6766d992d830bcbaba60af6

Issue History

Date Modified Username Field Change
2016-11-05 05:56 joegi New Issue
2016-11-05 08:03 henry Note Added: 0007091
2016-11-05 09:02 joegi Note Added: 0007092
2016-11-05 19:06 joegi Note Added: 0007102
2016-11-05 20:51 henry Note Added: 0007105
2016-11-05 21:16 wyldckat Note Added: 0007108
2016-11-05 21:40 joegi Note Added: 0007110
2016-11-05 22:20 wyldckat Note Added: 0007111
2016-11-05 22:27 wyldckat Note Added: 0007112
2016-11-05 22:35 wyldckat Note Added: 0007113
2016-11-05 22:43 joegi Note Added: 0007114
2016-11-05 22:56 wyldckat Note Added: 0007115
2016-11-05 23:02 wyldckat Note Added: 0007116
2016-11-05 23:09 wyldckat File Added: kOmegaSSTBase.C.4x
2016-11-05 23:10 wyldckat File Added: kOmegaSSTBase.C.dev
2016-11-05 23:10 joegi Note Added: 0007117
2016-11-05 23:12 wyldckat Note Added: 0007118
2016-11-05 23:12 wyldckat Assigned To => henry
2016-11-05 23:12 wyldckat Status new => assigned
2016-11-05 23:19 wyldckat Note Added: 0007119
2016-11-05 23:30 henry Status assigned => resolved
2016-11-05 23:30 henry Resolution open => fixed
2016-11-05 23:30 henry Fixed in Version => 4.x
2016-11-05 23:30 henry Note Added: 0007120