|
[Sponsors] |
March 30, 2016, 05:00 |
Error compiling new turbulence model
|
#1 |
New Member
Join Date: Feb 2016
Posts: 6
Rep Power: 10 |
I'm trying to compile a new turbulence model (modified SpalartAllmaras) in openFOAM 3.0.1 and I'm having errors I don't know how to fix.
A minimal script of what I want to do just taking the original Spalart Allmaras model, renaming it and trying to compile is: Code: Code:
#!/bin/bash # # Copy original files srcDIR=$FOAM_SRC"/TurbulenceModels/turbulenceModels/RAS/SpalartAllmaras" ownDIR=$FOAM_USER_APPBIN"/sameSpalartAllmaras" mkdir -p $ownDIR cp $srcDIR/* $ownDIR # Rename original 'SpalartAllmaras' to 'sameSpalartAllmaras' in files sed -i s/SpalartAllmaras/sameSpalartAllmaras/g $ownDIR/* mv $ownDIR/SpalartAllmaras.C $ownDIR/sameSpalartAllmaras.C mv $ownDIR/SpalartAllmaras.H $ownDIR/sameSpalartAllmaras.H mkdir $ownDIR/Make # Create Make/options cat <<EOF > $ownDIR/Make/options EXE_INC = \\ -I\$(LIB_SRC)/finiteVolume/lnInclude \\ -I\$(LIB_SRC)/meshTools/lnInclude \\ -I\$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude LIB_LIBS = \\ -lfiniteVolume \\ -lmeshTools EOF # Create Make/files cat <<EOF > $ownDIR/Make/files sameSpalartAllmaras.C EXE = \$(FOAM_USER_APPBIN)/sameSpalartAllmaras LIB = \$(FOAM_USER_LIBBIN)/libmyincompressibleRASModels EOF # Compile cd $ownDIR wclean lib wmake libso Code:
In file included from /usr/.../openfoam/3.0.1/intel-openmpi/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/messageStream.H(216), ... /usr/.../openfoam/3.0.1/intel-openmpi/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/OSstream.H(52): warning #654: overloaded virtual function "Foam::Ostream::write" is only partially overridden in class "Foam::OSstream" ... /usr/.../openfoam/3.0.1/intel-openmpi/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude/processorPolyPatch.H(112): warning #1125: function "Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::movePoints(const Foam::Field<PointType> &) [with Face=Foam::face, FaceList=Foam::SubList, PointField=const Foam::pointField &, PointType=Foam::point]" is hidden by "Foam::processorPolyPatch::movePoints" -- virtual function override intended? void movePoints(PstreamBuffers&, const pointField&); Code:
sameSpalartAllmaras.C(40): error: function "Foam::RASModels::sameSpalartAllmaras<BasicTurbulenceModel>::chi" has already been defined tmp<volScalarField> sameSpalartAllmaras<BasicTurbulenceModel>::chi() const I encounter similar errors when trying to compile other OF 3.0.x turbulence models (1, 2) posted on github by users of this forum. Am I missing something very basic or are the Make/* files incomplete? Do you know where is the problem? I posted this question as a reply to another thread with a similar topic some days ago. Let me know if I should delete it. |
|
March 30, 2016, 12:03 |
|
#2 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Hello,
First, both codes on Github are working fine. The only trick to compile first one is to modify the options to locate findroot function. The second one works fine using OpenFOAM-dev not OpenFOAM-3.0. What is missing from your code is "makeMyCompressibleTurbulenceModel.C" and "makeMyIncompressibleTurbulenceModel.C" for compressible and incompressible flow. Try to use the same structure as on these codes. It is just a macro, that's all. Bw, Hassan |
|
March 31, 2016, 06:21 |
|
#3 |
New Member
Join Date: Feb 2016
Posts: 6
Rep Power: 10 |
Thanks! I've managed to make it work using the same structure as helio's code.
Do you know if there is any central repository with turbulence models implemented in OpenFOAM? |
|
March 31, 2016, 06:42 |
|
#4 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
You are welcome.
Sorry, Currently I'm working on FSI in inviscid flow and not following the new turbulence models. I was just curious about the new C++ implementation of turbulence models in new OF version. |
|
October 24, 2016, 10:36 |
SpalartAllmaras RC
|
#5 |
Member
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 11 |
Dear Foamers,
I would like to create the SpalartAllmaras tubulence model with Rotation/Curvature Correction (SA-RC), see e.g. here: https://turbmodels.larc.nasa.gov/spalart.html in OF version 3.0.1. Fortunately, H. Kassem shows here http://hassankassem.me/posts/newturbulencemodel/ how to introduce new turbulence models for OF 3.0.x. Very great - thanks a lot! Besides, I found the source code for the SA-RC model here http://hobbyfoam.blogspot.de/2015/02...curvature.html for OF version 2.3.0. Thanks also!! If I merge both, I do not accomplish. Particularly, I am not sure how to introduce the correction function 'fr1' at the end of the '.C' file and the way how 'fr1' is calculated several lines above. The error is strange. 1.) The compiler does not complain. 2.) Using the airFoil2D tutorial test case requires setting a divScheme in system/fvSchemes for Sxx (...) 3.) Using a 3D wing testcase leads to the following error type: Code:
Foam::error::printStack(Foam::Ostream&) makeTurModel.C SpalartAllmarasRC.H SpalartAllmarasRC.C The 'Make' directory contains: files: Code:
makeTurModel.C LIB = $(FOAM_USER_LIBBIN)/libSpalartAllmarasRC Code:
EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfiniteVolume \ -lmeshTools |
|
October 26, 2016, 11:53 |
|
#6 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Hi,
I am glad that my post helped you. Regarding this error because it is not a compiler error, it is not easy to pinpoint the source of it without extensive testing. From my point of view, this code looks fine except lines 101 and 115 (.C file). These lines are dangerous because if W or S is zero, SqrW and SqrD will be zero as well. This could be the source of error but I don't know alot about W or S values, therefore I could be wrong about that. Best Wishes, Hassan Kassem |
|
November 4, 2016, 08:29 |
|
#7 |
Member
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 11 |
@Hassan:
Thank you very much for watching my code! This seemed to be the major error, as the model is running now. Nevertheless, a printStack-error occurs after some time. If I find a solution, I will upload the core here... |
|
November 11, 2016, 07:48 |
turbulence model compilation erroe
|
#8 | |
Member
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10 |
Quote:
I am trying to compile my dynamicsmagorinsky model in openfoam 3.0.x but getting following error : symbol lookup error: /home/adlak/OpenFOAM/adlak-3.0.x-cfdsupport/platforms/linux64Gcc49DPInt32Opt/lib/libdynamicSmagorinsky.so: undefined symbol: _ZNK4Foam9LESModels18dynamicSmagorinskyINS_15EddyD iffusivityINS_18ThermalDiffusivityINS_27Compressib leTurbulenceModelINS_11fluidThermoEEEEEEEE2CkEv If any one can help then it will be a great help for me. I followed steps given here http://hassankassem.me/posts/newturbulencemodel/ |
||
November 21, 2016, 17:14 |
|
#9 |
Member
Mohamed Elghorab
Join Date: May 2016
Location: Coventry, Engalnd
Posts: 41
Rep Power: 10 |
Dear Adlak,
I'm new in openfoam and try also to implement my own turbulence model. I have many new parameters to add but I don't know how to define them inside the UEqn. for example, I have in my new UEqn. a vector C where: C=x*y*z where (x,y,z) are vectors so if you please can you help me in how I can define C in the same file of UEqn.?? Thanks in advance |
|
November 22, 2016, 04:41 |
|
#10 |
Member
Peter
Join Date: Nov 2015
Location: Hamburg, Germany
Posts: 57
Rep Power: 11 |
I think you should not focus on UEqn.C, but rather watch a similar turbulence model (similar to the one you want to implement) and modify it.
As said already above, here http://hassankassem.me/posts/newturbulencemodel/ you find a good overview of how to do that. Regards, Peter |
|
November 22, 2016, 07:52 |
|
#11 | |
Member
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10 |
Quote:
I dont think u need to modify UEqn. If u want to modify then u should modify ur newturbulencemodel.c and .h file accordingly. And for compilation u can follow the steps given here http://hassankassem.me/posts/newturbulencemodel/ I am also trying to do that but not succeed at. |
||
November 23, 2016, 11:38 |
|
#12 |
Member
Mohamed Elghorab
Join Date: May 2016
Location: Coventry, Engalnd
Posts: 41
Rep Power: 10 |
Thanks a lot for your quick reply. Now I will come back and search again in that way and I will tell you with the news
|
|
December 5, 2016, 09:36 |
|
#13 |
Member
Mohamed Elghorab
Join Date: May 2016
Location: Coventry, Engalnd
Posts: 41
Rep Power: 10 |
Hi Adlak,
I think I did it but when I tried to run it I got some error message at t=550 sec like : srun: Job step aborted: Waiting up to 5 seconds for job step to finish. slurmstepd: error: *** STEP 222951.0 ON cnode57 CANCELLED AT 2016-12-04T13:42:26 DUE TO TIME LIMIT *** I tried to google it but actually there is no specific way to pass this error, Do you have any comment on that and how to solve it?? Mohamed |
|
December 6, 2016, 05:13 |
|
#14 | |
Member
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10 |
Quote:
|
||
December 7, 2016, 09:44 |
|
#15 |
Member
Mohamed Elghorab
Join Date: May 2016
Location: Coventry, Engalnd
Posts: 41
Rep Power: 10 |
Hi adlak,
Thanks a lot I realized that it was due to the max. time for my job on the cluster. Thanks again |
|
December 10, 2016, 05:20 |
|
#16 | |
Member
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10 |
Quote:
I am trying to compile dynamicLagrangian model but getting following error : #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libpthread.so.0" #3 ? in "/lib/x86_64-linux-gnu/libm.so.6" #4 pow in "/lib/x86_64-linux-gnu/libm.so.6" #5 Foam:ow(Foam::Field<double>&, Foam::UList<double> const&, double const&) at ??:? #6 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:ow<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, Foam::dimensioned<double> const&) at ??:? #7 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam:ow<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&, double const&) at ??:? #8 Foam::LESModels:LM<Foam::IncompressibleTurbulenc eModel<Foam::transportModel> >::correct() at ??:? #9 ? at ??:? #10 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #11 ? at ??:? Floating point exception (core dumped) can anyone help me ? |
||
February 8, 2017, 05:04 |
|
#17 | |
New Member
CHUNG Ching Chun
Join Date: Aug 2016
Location: Tin Shui Wai, New Territories, Hong Kong
Posts: 11
Rep Power: 10 |
Quote:
|
||
February 26, 2017, 02:30 |
|
#18 | |
New Member
Bo Kong
Join Date: Oct 2016
Location: China
Posts: 22
Rep Power: 10 |
Quote:
dynamicSmagorinsky.C:155:6: error: ‘template<class BasicTurbulenceModel> class Foam::LESModels::dynamicSmagorinsky’ used without template parameters bool dynamicSmagorinsky::read() ^ dynamicSmagorinsky.C: In function ‘bool Foam::LESModels::read()’: dynamicSmagorinsky.C:159:9: error: ‘filter_’ was not declared in this scope filter_.read(this->coeffDict()); ^ dynamicSmagorinsky.C:159:22: error: invalid use of ‘this’ in non-member function filter_.read(this->coeffDict()); ^ dynamicSmagorinsky.C: In member function ‘virtual void Foam::LESModels::dynamicSmagorinsky<BasicTurbulenc eModel>::correct(const Foam::tmp<Foam::GeometricField<Foam::Tensor<double >, Foam::fvPatchField, Foam::volMesh> >&)’: dynamicSmagorinsky.C:180:16: error: ‘kMin_’ was not declared in this scope bound(k_, kMin_); ^ dynamicSmagorinsky.C:180:21: error: there are no arguments to ‘bound’ that depend on a template parameter, so a declaration of ‘bound’ must be available [-fpermissive] bound(k_, kMin_); ^ Do you know how to solve these problems? Thanks~ |
||
September 12, 2020, 07:36 |
|
#19 | |
New Member
Jiaui Zhang
Join Date: Aug 2018
Location: Changsha, China
Posts: 17
Rep Power: 8 |
Quote:
You can add the head file #include "bound.H" |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error in Two phase (condensation) modeling | adilsyyed | CFX | 15 | June 24, 2015 20:42 |
Overflow Error in Multiphase Modelling with Two Continuous Fluids | ashtonJ | CFX | 6 | August 11, 2014 15:32 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
Wrong calculation of nut in the kOmegaSST turbulence model | FelixL | OpenFOAM Bugs | 27 | March 27, 2012 10:02 |
Low Reynolds k-epsilon model | YJZ | ANSYS | 1 | August 20, 2010 14:57 |