|
[Sponsors] |
October 5, 2017, 15:51 |
Implement a turbulence model in OF-v1706
|
#1 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi everyone,
I am trying to implement some changes to a turbulence model in OF-v1706. I have read some previous posts and blogs like Hassan´s (http://hassankassem.me/posts/newturbulencemodel/) about how to do it, but I am still getting errors and I am confused between the changes in the different versions. What I have done so far is simply try to compile a OF turbulence model without making any real changes, so: 1) As in previous versions of OF, copy the kOmegaSSTIDDES .H and .C files into a folder in $WM_PROJECT_USER_DIR/src/, then I made the necessary changes to the file names and instances. Create Make/file and Make/options 2) If I understand correctly in the newer versions of OF, you now have to add also turbulentTransportModels.C and *.H, and do the according modifications as explained in Hassan´s blog. wmake libso and it did not work. I get lots of errors and it seems that I am missing a library, but I am not sure. This is my Make/options: Code:
EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -libturbulenceModels \ -lfiniteVolume \ -lmeshTools Code:
In file included from /home/mary/OpenFOAM/OpenFOAM-v1706/src/TurbulenceModels/turbulenceModels/lnInclude/kOmegaSSTDES.H:54:0, from kOmegaSST_SIDDES.H:50, from turbulentTransportModels.C:136: /home/mary/OpenFOAM/OpenFOAM-v1706/src/TurbulenceModels/turbulenceModels/lnInclude/DESModel.H:55:28: error: expected template-name before ‘<’ token public LESeddyViscosity<BasicTurbulenceModel> ^ Thanks, Mary |
|
October 16, 2017, 13:47 |
Did you create a makeTurModel.C file
|
#3 |
New Member
Ehimen
Join Date: Jun 2016
Posts: 12
Rep Power: 10 |
You need to create a separate makeTurModel.C file as specified in Hassan's blog. In the file, you need to determine if you are building an LES, RANS or DES model. In your case, you are creating I believe a DES model.
If you are using OpenFOAM 4, then add the following lines #include "kOmegaSSTIDDES.H" makeLESModel(kOmegaSSTIDDES); You are actually making a new 'LES' model. For OpenFOAM+, I believe that you can specify making a DES model template. Afterwards, you add makeTurModel.C to 'file' in the Make directory. If you still have problems, let me know. |
|
October 16, 2017, 16:39 |
|
#4 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Thanks Ehimen for your help.
That is exactly what I did! And I still got the errors. What I am not sure is if I have to recompile ALL the turbulence models in my USER dir to be able to modify just one turbulence model (Like I mentioned in the post #2). I am using OF-v1706. |
|
October 17, 2017, 15:43 |
|
#5 |
New Member
John P
Join Date: Apr 2015
Posts: 7
Rep Power: 11 |
Check this site. They explain how to code it in 1706.
https://pingpong.chalmers.se/public/...ml?language=en |
|
October 18, 2017, 10:31 |
|
#6 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Thanks Petr for your help.
I followed the Chalmer´s instructions to implement a turbulence model. It worked, but I had to recompile all the turbulence models in my USER directory, to do a small change in only one turbulence model. I am not sure if that is the best way to do it, but it does the job. Thanks everyone. |
|
November 27, 2017, 08:12 |
Code for SST-RC
|
#7 |
Member
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 10 |
Dear Foamers,
thanks for the nice thread, especially Petr's link was very helpful. I try to implement the rotation/curvature correction to the SST turbulence model, according to https://turbmodels.larc.nasa.gov/sst.html My problem is that the SST approach is quite different and I don't know how to change the production term according to the curvature correction model. Can I just redefine the function 'Pk' in the new file 'kOmegaSSTRC.C'? Besides, I hope someone did it already and I hope to find someone who may load his code up to e.g. github. The old versions there on SST-RC cannot be used with the current implementation of the turbulence models in OF 1706. Best Regards, Peter |
|
November 27, 2017, 09:35 |
|
#8 |
Member
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Hi Peter,
I am not familiar with the rotation/curvature correction of the SST model, but it seems that in theory you only have to change the Pk term as you mentioned. However, in the new versions of OF (including v1706) the Pk term and the k-w equations for the SST model are not defined in kOmegaSST.C, but in kOmegaSSTBase.C. I think the more proper/efficient way to do it will be to create your_own_kOmegaSST.C that modifies the basic Pk (like it is done in kOmegaSSTLM turbulence model in OF). Hope I answered your question, Mary |
|
May 15, 2019, 01:02 |
error in OF1812+
|
#9 |
New Member
|
Hello,
I am using the method as prescribed on the Chalmers website (link attached) for OF-v1706 on OF-v1812. After I copy-pasted definition of correct() function and replaced the template name according to instructions, I compiled with ./Allmake. Hereafter I found 2 errors which are not expected: Code:
In file included from ../turbulenceModels/lnInclude/kOmegaSSTF.H:192:0, from turbulentTransportModels/turbulentTransportModels.C:76: ../turbulenceModels/lnInclude/kOmegaSSTF.C:93:51: error: definition of ‘void Foam::kOmegaSSTBase<BasicEddyViscosityModel>::correct()’ is not in namespace enclosing ‘Foam::kOmegaSSTBase<BasicEddyViscosityModel>’ [-fpermissive] void kOmegaSSTBase<BasicTurbulenceModel>::correct() ^ ../turbulenceModels/lnInclude/kOmegaSSTF.C:93:6: error: redefinition of ‘void Foam::kOmegaSSTBase<BasicEddyViscosityModel>::correct()’ void kOmegaSSTBase<BasicTurbulenceModel>::correct() ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ https://pingpong.chalmers.se/public/...o?item=3855255 any help is appreciated. Thanks |
|
August 6, 2019, 23:15 |
|
#11 |
New Member
Hamdani
Join Date: Nov 2011
Posts: 5
Rep Power: 15 |
I have the same problem.
Please let me know how you solve the problem. Thanks |
|
September 12, 2023, 17:13 |
|
#12 | |
New Member
Andrew McFadden
Join Date: May 2022
Posts: 3
Rep Power: 4 |
Quote:
I'm trying to apply a correction to the dissipation of k and epsilon for a compressibility correction modified turbulence model |
||
Tags |
compilation, of-v1706, turbulence model |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fluent :- turbulence Model | prince_pahariaa | FLUENT | 9 | May 20, 2016 04:41 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
What model of turbulence choose to study an external aerodynamics case | raffale | OpenFOAM | 0 | August 23, 2012 06:45 |
Discussion: Reason of Turbulence!! | Wen Long | Main CFD Forum | 3 | May 15, 2009 10:52 |
Why Turbulence models are not universal. | Senthil | Main CFD Forum | 4 | July 5, 2000 05:34 |