|
[Sponsors] |
February 15, 2019, 02:25 |
Dictionary in turbulence model
|
#1 |
Senior Member
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 16 |
laplaceFilter has two types of constructor as follows:
//~ Construct from components laplaceFilter(const fvMesh& mesh, scalar widthCoeff); //~ Construct from IOditionary laplaceFilter(const fvMesh& mesh, const dictionary&); Both of them require dictionary. In turbulence model source file, "laplaceFilter lf(this->mesh(),dictionary)" instead of "laplaceFilter(this->mesh(),this->dictionary())" could pass the compilation. The latter gives errors. One of the keys of laplaceFilter is read a coefficient named "widthCoeff" once the 2nd argument of constructor is dictionary. Therefore, "laplaceFilter lf(this->mesh(),dictionary)" may pass the compilation, but my question is what's "dictionary" here, or can laplaceFilter read "widthCoeff"? Otherwise, how can I get the right dictionary here? Another question is that I need the delta time of the evolution, could "dictionary" here give the deltaT value (or another name?) ? Or any other way to get delta time? Thanks in advance! |
|
February 16, 2019, 01:15 |
Which type of deltaTValue() is correct?
|
#2 |
Senior Member
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 16 |
Dear all, any clue to the "dictionary" in the turbulence model?
As to the second question about delta time, I find two kinds of call to deltaTValue function (is this function the right one to return delta time?) can pass the compilation as follows: this->mesh_.time().deltaTValue(); this->runTime_.deltaTValue(); Do they return the same and proper value of delta time? If not, which one is correct? PS:I also find the another similar way as follows: this->runTime_.deltaT().value(); Are all of them correct and can they return the wanted delta time? |
|
February 18, 2019, 15:48 |
|
#3 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 8 |
Hey NewKid,
It looks like you took a direct look at the source code, which is a good idea. But I'm still not sure what you're trying to accomplish. More information would be helpful. From a quick research I could find that they are different LES filters all derived from a base class LESFilter allowing for runtime selection between the different filters. However, in my version (16.12) I found out that these filters are barely used (only few models are making use of the filters). As you correctly figured out, there are two constructors available in order to construct a laplaceFilter object - one making use of a dictionary and the other one by directly prescribing a scalar (which will influence the behaviour of the filter, obviously). What you could do in order to use such a laplaceFilter - type object is to instantiate it in your own application. Code:
#include "laplaceFilter.H" int main() { ... #include "createMesh.H" ... // instantiate laplaceFilter with scalar constructor laplaceFilter myLESfilter(mesh,42); // or 2. alternatively by defining a dictionary (IOdictionary) and // prescribing the scalar inside the dictionary - dict constructor // laplaceFilter myLESfilter(mesh,myFilterDict); ... // use filter ... return 0; } Code:
/* include appropriate headers */ int main() { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" while(runTime.run()) { runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; Info<<"deltaT - runtime " << runTime.deltaT().value() << nl; // the other approaches } Info<< "End\n" << endl; return 0; } Cheers RP |
|
February 18, 2019, 21:31 |
|
#4 |
Senior Member
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 16 |
Hi RP,
Yes, I have been modifying the source code of one turbulence model to consider the interactions between the gas and the injected liquid based on E-L method. Regarding the first question, now I use the scalar argument read from the "dictionary" instead of use the "dictionary" directly. This will be tested in the coming computation. Regarding the 2nd one, the reason why I do not give it a test till now is that all this happen in the .so file, direct test in an application is OK? Maybe I should try it in the OF/test folders. Cheers! LT |
|
February 18, 2019, 22:16 |
|
#5 |
Senior Member
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 16 |
Hi RP,
I've tested "runTime().deltaTValue()" and "runTime().deltaT().value()" in one modified solver, they return the same value as follows: (first round) deltaT=2.94118e-06 Time=2.94118e-06 //Above is original tips runTime().deltaTValue(): 2.94118e-06 runTime().deltaT().value():2.94118e-06 //Above is what I try (second round) deltaT=3.36134e-06 Time=6.30252e-06 //Above is original tips runTime().deltaTValue(): 3.36134e-06 runTime().deltaT().value():3.36134e-06 //Above is what I try Anyway, application does not support code like "this->mesh_.time().deltaTValue()" . Cheers! LT |
|
Tags |
delta time, dictionary, laplacefilter |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question about matching of solver and turbulence model | louistse | OpenFOAM Running, Solving & CFD | 1 | February 1, 2017 22:36 |
Error in Two phase (condensation) modeling | adilsyyed | CFX | 15 | June 24, 2015 20:42 |
Overflow Error in Multiphase Modelling with Two Continuous Fluids | ashtonJ | CFX | 6 | August 11, 2014 15:32 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
Wrong calculation of nut in the kOmegaSST turbulence model | FelixL | OpenFOAM Bugs | 27 | March 27, 2012 10:02 |