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

Dictionary in turbulence model

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2019, 01:25
Question Dictionary in turbulence model
  #1
Senior Member
 
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 15
NewKid is on a distinguished road
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!
NewKid is offline   Reply With Quote

Old   February 16, 2019, 00:15
Question Which type of deltaTValue() is correct?
  #2
Senior Member
 
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 15
NewKid is on a distinguished road
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?
NewKid is offline   Reply With Quote

Old   February 18, 2019, 14:48
Default
  #3
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7
raumpolizei is on a distinguished road
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;
}
Regarding your second question - I would suggest you create a small generic application and test it out .
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;
}
Sorry for typos in the code, I have not tested it.
Cheers
RP
raumpolizei is offline   Reply With Quote

Old   February 18, 2019, 20:31
Wink
  #4
Senior Member
 
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 15
NewKid is on a distinguished road
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
NewKid is offline   Reply With Quote

Old   February 18, 2019, 21:16
Wink
  #5
Senior Member
 
LT
Join Date: Dec 2010
Posts: 104
Rep Power: 15
NewKid is on a distinguished road
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
NewKid is offline   Reply With Quote

Reply

Tags
delta time, dictionary, laplacefilter

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Question about matching of solver and turbulence model louistse OpenFOAM Running, Solving & CFD 1 February 1, 2017 21:36
Error in Two phase (condensation) modeling adilsyyed CFX 15 June 24, 2015 19:42
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 14:32
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
Wrong calculation of nut in the kOmegaSST turbulence model FelixL OpenFOAM Bugs 27 March 27, 2012 09:02


All times are GMT -4. The time now is 17:26.