CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   turbulentDFSEMInlet boundary condition for LES (https://www.cfd-online.com/Forums/openfoam-programming-development/206611-turbulentdfseminlet-boundary-condition-les.html)

cryabroad September 10, 2018 04:30

turbulentDFSEMInlet boundary condition for LES
 
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.

mAlletto September 12, 2018 08:55

It seems that the random number used in eddy.H ("cachedRandom.H") is not implemented in the openfoam.org version.

cryabroad September 18, 2018 22:20

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

mAlletto September 19, 2018 09:18

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 :)

cryabroad September 19, 2018 23:34

I will definitely try that and see how it goes.

mAlletto September 20, 2018 02:03

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.

cryabroad September 20, 2018 23:20

Sounds great! I'll work on it and get back to you.

cryabroad October 14, 2018 02:55

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

mAlletto October 14, 2018 13:38

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

cryabroad October 15, 2018 01:41

Thank you for the information Michael, I will definitely check these out!

mAlletto October 15, 2018 05:06

A by the way, did you compile the github version of the inflow generator with a newer OF version of the 2.4?

cryabroad October 30, 2018 02:28

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 July 8, 2020 16:17

Quote:

Originally Posted by cryabroad (Post 713477)
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.

fedvasu July 10, 2020 00:12

Quote:

Originally Posted by cryabroad (Post 713477)
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

zhangyan July 10, 2020 05:14

Quote:

Originally Posted by fedvasu (Post 777358)
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 July 10, 2020 20:16

Quote:

Originally Posted by zhangyan (Post 777399)
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?

sadsid July 10, 2021 14:20

Quote:

Originally Posted by fedvasu (Post 777465)
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.


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