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

turbulentDFSEMInlet boundary condition for LES

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By cryabroad
  • 1 Post By fedvasu
  • 1 Post By zhangyan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2018, 05:30
Default turbulentDFSEMInlet boundary condition for LES
  #1
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
Hi all,

For LES it is suggested that the DFSEM (Divergence-free synthetic eddy method) should be used as the boundary condition at the inlet. After google it, I found that it is available starting from OpenFOAM1606 (the one downloaded from www.openfoam.com). Check this link for example, https://www.openfoam.com/releases/op...conditions.php.

However, it seems like this BC is not supported in OpenFOAM downloaded from www.openfoam.org, even for the latest version OpenFOAM 6.0. I also tried to copy the source and header files from the .com one to the .org one and then compile the BC (after some minor cleaning of the code of course), but got error messages like this

Code:
In file included from lnInclude/eddy.H:253:0,
                 from turbulentDFSEMInletFvPatchVectorField.H:85,
                 from turbulentDFSEMInletFvPatchVectorField.C:26:
lnInclude/eddyI.H: In member function ‘Foam::scalar Foam::eddy::epsi(Foam::Random&) const’:
lnInclude/eddyI.H:35:19: error: ‘class Foam::Random’ has no member named ‘sample01’
     return rndGen.sample01<scalar>() > 0.5 ? 1 : -1;
                   ^
lnInclude/eddyI.H:35:34: error: expected primary-expression before ‘>’ token
     return rndGen.sample01<scalar>() > 0.5 ? 1 : -1;
                                  ^
lnInclude/eddyI.H:35:36: error: expected primary-expression before ‘)’ token
     return rndGen.sample01<scalar>() > 0.5 ? 1 : -1;
                                    ^
In file included from turbulentDFSEMInletFvPatchVectorField.H:368:0,
                 from turbulentDFSEMInletFvPatchVectorField.C:26:
turbulentDFSEMInletFvPatchVectorFieldTemplates.C: In member function ‘Foam::tmp<Foam::Field<Type> > Foam::turbulentDFSEMInletFvPatchVectorField::interpolateBoundaryData(const Foam::word&) const’:
turbulentDFSEMInletFvPatchVectorFieldTemplates.C:75:21: error: there are no arguments to ‘fileHandler’ that depend on a template parameter, so a declaration of ‘fileHandler’ must be available [-fpermissive]
         fileHandler().filePath
                     ^
turbulentDFSEMInletFvPatchVectorFieldTemplates.C:75:21: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
turbulentDFSEMInletFvPatchVectorFieldTemplates.C:91:21: error: there are no arguments to ‘fileHandler’ that depend on a template parameter, so a declaration of ‘fileHandler’ must be available [-fpermissive]
         fileHandler().NewIFstream
                     ^
turbulentDFSEMInletFvPatchVectorField.C: In member function ‘void Foam::turbulentDFSEMInletFvPatchVectorField::writeLumleyCoeffs() const’:
turbulentDFSEMInletFvPatchVectorField.C:111:25: error: ‘fileHandler’ was not declared in this scope
             fileHandler().filePath
                         ^
turbulentDFSEMInletFvPatchVectorField.C: In member function ‘const Foam::pointToPointPlanarInterpolation& Foam::turbulentDFSEMInletFvPatchVectorField::patchMapper() const’:
turbulentDFSEMInletFvPatchVectorField.C:233:12: error: no match for ‘operator*’ (operand type is ‘Foam::autoPtr<Foam::pointToPointPlanarInterpolation>’)
     return *mapperPtr_;
It seems to suggest that some of the classes are defined differently between the two OpenFOAM? Am I missing something here?

Thank you in advance.
cryabroad is offline   Reply With Quote

Old   September 12, 2018, 09:55
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
It seems that the random number used in eddy.H ("cachedRandom.H") is not implemented in the openfoam.org version.
mAlletto is offline   Reply With Quote

Old   September 18, 2018, 23:20
Default
  #3
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
Hi mAlletto,

Thank you for your input, and you are absolutely right. The random number class used in the .org version and .com version have different member functions, and the .org one has a couple of more member functions. Initially I was going to modify the random number class in the .org version (I mainly work on this one) according to the .com one, but soon found out that the coding will need substantial efforts instead of minor changes. As for now my plan is to implement my own turbulentDFSEMInlet boundary condition (in a much simplified way, if I can) in the .org version.

I still have questions about why the .org version doesn't implement this type of boundary condition, is the code not running very well or not good enough? Or I simply missed it in the .org version?

Thank you again for reading my post.

Ruiyan
cryabroad is offline   Reply With Quote

Old   September 19, 2018, 10:18
Default
  #4
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Actually I have no idea why this boundary condition is not implemented in the .org version.


But maybe if you are able to get a version which is running also in the .org version you can try to submit it and look if it is accepted
mAlletto is offline   Reply With Quote

Old   September 20, 2018, 00:34
Default
  #5
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
I will definitely try that and see how it goes.
cryabroad is offline   Reply With Quote

Old   September 20, 2018, 03:03
Default
  #6
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Having a first look on the DFSE method in the .com version I saw that the two base classes from which the boundary condition is derived from are also present in the .org version.


So i would guess it is not to complicated to take the sources of the .com version and try to compile it with the .org version.


After that one has to check if the two base classes are implemented in the same way.



If this is the case one has to check if the header files included in the .com version are present in the .org version.



If not as a first step i would put them together in a subfolder and link against to them.


After that try to compile it.



If you proceed in this way and post the errors you get maybe i can help you out.
mAlletto is offline   Reply With Quote

Old   September 21, 2018, 00:20
Default
  #7
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
Sounds great! I'll work on it and get back to you.
cryabroad is offline   Reply With Quote

Old   October 14, 2018, 03:55
Default
  #8
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
Hi Alletto,

Just want to get back to you on the discussions we had before. After trying to compile the DFSEM B.C. in the .org version of OF for a while I found it being very hard for me. Instead, I searched through this forum and found a similar B.C.-the inflowGenerator developed at Rostock. Right now I've been testing this B.C. for a while and it works well.

I think these two B.C. both adopt the idea of synthetic eddies. The DFSEM is divergence free but the inflowGenerator may be not.

Thanks.

Ruiyan
cryabroad is offline   Reply With Quote

Old   October 14, 2018, 14:38
Default
  #9
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
I think the method of the guys of Rostock is divergence free. I die not check the equations implemented in the github code but they pubished a divergencefree Methode a while ago

https://www.researchgate.net/publica...vortex_dipoles

It is however only made for isotropic turbulence. A Mord general method is published but not availabel online (at least what I could Figuren out)

https://www.researchgate.net/publica...ary_Anisotropy
mAlletto is offline   Reply With Quote

Old   October 15, 2018, 02:41
Default
  #10
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
Thank you for the information Michael, I will definitely check these out!
cryabroad is offline   Reply With Quote

Old   October 15, 2018, 06:06
Default
  #11
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
A by the way, did you compile the github version of the inflow generator with a newer OF version of the 2.4?
mAlletto is offline   Reply With Quote

Old   October 30, 2018, 03:28
Default
  #12
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
Sorry Michael for the late response.

I am using OF-4.x, and I compiled the inflow generator in LEMOS-2.4.x, which you can find here: https://github.com/LEMOS-Rostock/LEMOS-2.4.x. It is in folder LEMOS-2.4.x/libLEMOS-2.4.x/boundaryConditions/inflowGenerator/

Cheers,

Ruiyan
fedvasu likes this.
cryabroad is offline   Reply With Quote

Old   July 8, 2020, 17:17
Default
  #13
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Quote:
Originally Posted by cryabroad View Post
Sorry Michael for the late response.

I am using OF-4.x, and I compiled the inflow generator in LEMOS-2.4.x, which you can find here: https://github.com/LEMOS-Rostock/LEMOS-2.4.x. It is in folder LEMOS-2.4.x/libLEMOS-2.4.x/boundaryConditions/inflowGenerator/

Cheers,

Ruiyan
I was able to compile that inflowGenerator in OF-6 with one change, creating a random vector by hand, as vector01 function is removed in random class.
cryabroad likes this.
fedvasu is offline   Reply With Quote

Old   July 10, 2020, 01:12
Default
  #14
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Quote:
Originally Posted by cryabroad View Post
Sorry Michael for the late response.

I am using OF-4.x, and I compiled the inflow generator in LEMOS-2.4.x, which you can find here: https://github.com/LEMOS-Rostock/LEMOS-2.4.x. It is in folder LEMOS-2.4.x/libLEMOS-2.4.x/boundaryConditions/inflowGenerator/

Cheers,

Ruiyan
Hi Ruiyan,

Could you please tell me, how to use this? in U, "decayingTurbulenceInfowGenerator", not found among BCs,Do I have to create my own dummy solver with links to the newly compiled libray?

I tried running pimpleFoam, it did not work
fedvasu is offline   Reply With Quote

Old   July 10, 2020, 06:14
Default
  #15
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
Quote:
Originally Posted by fedvasu View Post
Hi Ruiyan,

Could you please tell me, how to use this? in U, "decayingTurbulenceInfowGenerator", not found among BCs,Do I have to create my own dummy solver with links to the newly compiled libray?

I tried running pimpleFoam, it did not work

Hi
I've made it compilable in OpenFOAM-7.
Here is my code and reference case:
https://github.com/ZhangYanTJU/boundaryConditions
fedvasu likes this.
__________________
https://openfoam.top
zhangyan is offline   Reply With Quote

Old   July 10, 2020, 21:16
Default
  #16
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Quote:
Originally Posted by zhangyan View Post
Hi
I've made it compilable in OpenFOAM-7.
Here is my code and reference case:
https://github.com/ZhangYanTJU/boundaryConditions
Great, I have a question, is this for anisotropic turbulence as described in the new paper or the old (2007) isotropic version?
fedvasu is offline   Reply With Quote

Old   July 10, 2021, 15:20
Default
  #17
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Quote:
Originally Posted by fedvasu View Post
Great, I have a question, is this for anisotropic turbulence as described in the new paper or the old (2007) isotropic version?
Hi, I have issues with LEMOS implementation. If you managed to apply this then please let me know how to implement it. I am using OF-6.
sadsid is offline   Reply With Quote

Reply


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
Accessing multiple boundary patches from a custom boundary condition file ripudaman OpenFOAM Programming & Development 0 October 22, 2014 19:34
Radiation interface hinca CFX 15 January 26, 2014 18:11


All times are GMT -4. The time now is 06:07.