Error in Step 3 "Compile ML turbulence model"
chandukec opened this issue · 7 comments
Hi,
This is really very interesting work, was trying with the OpenFOAM v1906, and was able to complete all the steps till Step 2. In the Step 3, when I am running wclean && wmake libso
it is giving an error which says:
ML_SA_CG.C: In member function ‘virtual void Foam::RASModels::ML_SA_CG<BasicTurbulenceModel>::correct()’:
ML_SA_CG.C:378:64: error: there are no arguments to ‘IFstream’ that depend on a template parameter, so a declaration of ‘IFstream’ must be available [-fpermissive]
RectangularMatrix<doubleScalar>mean_std_vals(IFstream("means")());
^
ML_SA_CG.C:378:64: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
ML_SA_CG.C: In instantiation of ‘void Foam::RASModels::ML_SA_CG<BasicTurbulenceModel>::correct() [with BasicTurbulenceModel = Foam::IncompressibleTurbulenceModel<Foam::transportModel>]’:
maketurbulentTransportModels.C:29:23: required from here
ML_SA_CG.C:378:56: error: ‘IFstream’ was not declared in this scope
RectangularMatrix<doubleScalar>mean_std_vals(IFstream("means")());
I think this is the problem related to OpenFOAM version, is it not doable at all with the OpenFOAM v 1906 and had to install/work-with OpenFOAM 5? Thanks in advance :)
Like you've mentioned - this may be an OpenFOAM v1906 issue. We only tested and deployed with OpenFOAM 5. I would suggest hard coding an array that you manually embed means into within the turbulence model.
Thanks a lot for your prompt reply and clarification. Sorry for my ignorance, but could you please elaborate how to fix it (manually embed means into within the turbulence model)? If it's difficult I will install OpenFOAM 5 and try to work with it.
I tried to install OpenFOAM 5 but was not able to do that, since when I am trying to install it using
sudo apt-get -y install openfoam5
following the instructions of https://openfoam.org/download/5-0-ubuntu/ it is throwing an error which says
E: Unable to locate package openfoam5
so it seems that this OpenFOAM version is outdated. If you have some way of installing the OpenFOAM 5, please share. Thanks a lot for your help.
Hi - my apologies for not responding sooner.
Before installing OpenFOAM 5 perhaps you could try what is demonstrated here. So the purpose of using the mean and standard deviation entries in ML_SA_CG.C:378
is to enable the user to put these ML-related scaling parameters into a text file for OpenFOAM to read at run-time.
One workaround is to do what I have done in the ML_LES/ML_LES_Model/
directory where these parameters have been explicitly embedded into the turbulence model.
So you can eliminate the RectangularMatrix<doubleScalar>mean_std_vals(IFstream("means")());
statements and just initialize a double precision array to store the values given in the text file here
I hope that clarifies your question.
Thanks a lot Romit for your consistent help and for your valuable time for explaining me so nicely. Please excuse me that I am not very good at C++ so instead of reading the values from the file as you have mentioned I have kind of hard coded these values in the "ML_SA_CG.C" , eventually it worked perfectly. Thanks again for your help. Now I could run the Testing case using the simpleFoam_ML successfully. Is there any good or easy way to plot the graphs as you have done in your paper? How to go forward from this step to plotting the graphs etc ? Sorry for asking you too much.
Glad to know you were able to get the test case running. We did not use anything very fancy for plotting - just your basic Paraview and export to *.csv to use matplotlib from python. However, if you are exploring efficient visualization for OpenFOAM cases - I would highly recommend Turbulucid (see here) for setting up your new pipelines.
Many thanks Romit for your kind help.