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/)
-   -   Error compiling DES in OpenFoam v1612+ (https://www.cfd-online.com/Forums/openfoam-programming-development/188425-error-compiling-des-openfoam-v1612.html)

VisMart May 30, 2017 02:49

Error compiling DES in OpenFoam v1612+
 
Hi everyone,

I'm finding some problems when compiling DES model (even with any modifications) in OpenFoam v1612+. I've tried to recompile, for example, Smagorinsky (LES) and a RAS model, and everything went perfectly, the problem is DES. In this new OF version DES models source are in different path than usual. Does somebody know the problem with DES recompilation? I created the "maketurmodel.C" described for Hassan Kassem in http://hassankassem.me/posts/newturbulencemodel/, and it works for RAS and LES, but it does not for DES models...

Thank you guys.

hk318i June 1, 2017 09:19

Hi,

I think the problem is related to this commit [LINK] which has been merged from OpenFOAM-dev into OpenFOAM-plus. The propose of this commit is to simplify the process of adding a new model by changing the few macros. I'm surprised that you managed to compile a LES model but not managed to compile a DES model, because DES is of type LESmodel. Moreover, both are compiled using the same macros. It would be helpful, to share the exact error and the test code.

Best wishes,
Hassan

VisMart June 1, 2017 10:24

3 Attachment(s)
Quote:

Originally Posted by hk318i (Post 651199)
Hi,

I think the problem is related to this commit [LINK] which has been merged from OpenFOAM-dev into OpenFOAM-plus. The propose of this commit is to simplify the process of adding a new model by changing the few macros. I'm surprised that you managed to compile a LES model but not managed to compile a DES model, because DES is of type LESmodel. Moreover, both are compiled using the same macros. It would be helpful, to share the exact error and the test code.

Best wishes,
Hassan



Hi Hassan,

I don't know what is exactly happening, but in OF v1612+ DES models are located in different path than OF 4 and headers are different. Moreover, in OF v1612+ DES models are based in "DESModel.H" (this doesn't exist in v4), and in the v4 they are still based in "LESeddyViscosity.H". I think this is the main difference and the reason of the problem. I solved this issue adding to the headers of "makeTurModel.C" the following:

#include "LESeddyViscosity.H"
#include "bound.H"
#include "wallDist.H"

I can now compile DES Models, but I did not probe them yet. I will run a case shortly.

I attach an image with the first errors (with the previous headers not included), and the "maketurModel" files.

If you know what is the real problem and you think my solution is not good and it will not work, I really appreciate your advices.

Thank you Hassan!

hk318i June 2, 2017 08:20

Hi,

Indeed there is something not clear here but the following points could be confirmed:
  • DESModel<> class is inherited from DESModelBase and LESeddyViscosity<>, so DESModel is of type DESModelBase + LESeddyViscosity<>.
  • Despite the fact that in OpenFOAM-plus DES models are in a separate folder, they still within the same namespace Foam::LESModels::
  • Some of these models are in OpenFOAM-4 with as a small modification in the structure.
  • The new macros are included in OpenFOAM-dev and OpenFOAM-plus only not OpenFOAM-4
To compile a new model based on the new macros, you don't have to define a new macro as per my blog post. Simply have "maketurModel" file like this
Code:

#include "turbulentTransportModels.H"
#include "mykEpsilon.H"
makeRASModel(mykEpsilon);

Where "turbulentTransportModels.H" is the original header from OpenFOAM, you don't have to copy or modify it, just link it in "files". That is because the new macros separate the typedefs and the addition to the runTime table.


Having said that, it seems that for LESmodels in general, there is a missing step. I tested quickly using "dynamicKEqn" but the compiler complied about missing headers. With kOmegaSSTIDDES, I got the same error as in your case plus "fvOptions.H" was missing. I hadn't enough time to investigate more but it seems that there are missing headers.


Best Regards,
Hassan

VisMart July 18, 2017 09:11

Acoustic Library implementation in OF v1612
 
Hello Hassan,

I want to told you that I am running a "Modified SA IDDES" simulation with the model I finally compile, as I told you in this post the past month. It seems to work fine, but simulations are still running.

Now I am trying to compile this Acoustic Library (https://github.com/unicfdlab/libAcou...r/OpenFOAM-4.1), specifically the Curle's Analogy, in OpenFOAM v1612+. But unfortunately I get some errors like:

"analogies/AcousticAnalogy/AcousticAnalogy.C:72:18: error: ‘files’ was not declared in this scope"

and others similars, due to the named "files" variable. I think problems comes from differences in functionObjects implementation for these two versions. Acoustic Analogy is based in functionObjects like "forces", and I noticed that OF v4 source has the files "wrtieFiles" (plural) and "writeFile" (singular), where the mentioned "files" variable is defined. However, source code in OF v1612 only has the "writeFile" files. writeFiles seems to be a template for writeFile.

I don't know how can I solve this issue because it's probably a major incompatibility in the structure of OpenFOAM versions. Maybe some information about functionObject implementation in v1612 could help, and I can try to adapt "AcousticAnalogy.C" to v1612... Do yo know any tutorial or information about that?.

Thanks a lot.

Best regards.

VisMart


All times are GMT -4. The time now is 08:38.