|
[Sponsors] |
Adding New phaseCompressible Turbulence Model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 28, 2016, 06:07 |
Adding New phaseCompressible Turbulence Model
|
#1 |
New Member
Stefan Wenzel
Join Date: Mar 2013
Posts: 6
Rep Power: 13 |
Hello Foamers,
i try to add Rzehak's extension for bubble induced turbulence to the kOmegaSST model. See for example here: http://www.qucosa.de/fileadmin/data/...nhein-ICMF.pdf following the common procedure for adding new turbulence models: - copy similar model (e.g kOmegaSSTSato) - renaming files and functions - adding Make/files + Make/options - compiling using "wmake libso" i got the following error multiple times for all functions/objects: (example: ) kOmegaSSTRzehak.C:162:6: error: ‘virtual void Foam::RASModels::kOmegaSSTRzehak<BasicTurbulenceMo del>::correct()’ previously declared here void kOmegaSSTRzehak<BasicTurbulenceModel>::correct() AND kOmegaSSTSASRzehak.C:40:1: error: redefinition of ‘Foam::RASModels::kOmegaSSTRzehak<BasicTurbulenceM odel>::kOmegaSSTRzehak(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const transportModel&, const Foam::word&, const Foam::word&)’ kOmegaSSTRzehak<BasicTurbulenceModel>::kOmegaSSTRz ehak same procedure still works for "normal" compressible/incompressible turbulence models but not for phaseIncompressible/phaseCompressible models. I tried it with version 2.3.0/3.0.x and actual Openfoam-dev: same error in all versions. Guess it has something to do with template formulation of the models. Has anyone a suggestion how to add new phaseCompressible turbulence models to actual versions of OF? Thanks to the community and best regards Stefan |
|
May 2, 2016, 07:13 |
|
#2 |
New Member
Stefan Wenzel
Join Date: Mar 2013
Posts: 6
Rep Power: 13 |
just to make sure i didn't made a basic linking mistake here are my Make/files Make/options:
files: Code:
kOmegaSSTRzehak.C LIB = $(FOAM_USER_LIBBIN)/myPhaseIncompressibleRASModels Code:
EXE_INC = \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/RAS/RASModel \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/RAS/kEpsilon \ -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/PhaseIncompressibleTurbulenceModel \ -I$(LIB_SRC)/transportModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(WM_PROJECT_USER_DIR)/applications/solvers/orgTwoPhaseEulerFoam/twoPhaseSystem/lnInclude \ -I$(WM_PROJECT_USER_DIR)/applications/solvers/orgTwoPhaseEulerFoam/interfacialModels/lnInclude \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude LIB_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfluidThermophysicalModels \ -lturbulenceModels \ -lspecie \ -L$(FOAM_USER_LIBBIN) \ -lcompressibleOrgTwoPhaseSystem |
|
May 2, 2016, 09:38 |
|
#3 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Hello,
I did a quick search and as we suspected the problems comes from compiling the template class directly instead of initiating it. Additionally, compiling such library isn't that straight forward even in OF original code. Here what I found when I tried to compile a new phase compressible turbulence model; you need to add new file which calling a macro to initialize the template class like; Code:
$FOAM_SOLVERS/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/phaseCompressibleTurbulenceModels.C Code:
//copy all the header files makeBaseTurbulenceModel ( volScalarField, volScalarField, compressibleTurbulenceModel, PhaseCompressibleTurbulenceModel, ThermalDiffusivity, phaseModel ); #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, RAS, Type) #define makeLESModel(Type) \ makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, LES, Type) #include "kOmegaSSTRzehak.H" makeRASModel(kOmegaSSTRzehak.H); and here is a copy of the options file which I used, Code:
EXE_INC = \ -I$(FOAM_SOLVERS)/multiphase/twoPhaseEulerFoam/twoPhaseSystem/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(FOAM_SOLVERS)/multiphase/twoPhaseEulerFoam/interfacialModels/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude LIB_LIBS = \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lsolidThermo \ -lsolidSpecie \ -lturbulenceModels \ -lspecie \ -lfiniteVolume \ -lcompressibleTurbulenceModels \ -lmeshTools \ -lcompressibleEulerianInterfacialModels \ -lcompressibleTwoPhaseSystem I tested by linking it to a tutorial case for twoPhaseEulerFoam and the solver recognized it and started to complain about the wallDist fvSchemes. But having said that, there is another problem. The solver runs but complains first by showing a very long error. The main points of this error are; Code:
Duplicate entry laminar in runtime selection table TurbulenceModel Duplicate entry LES in runtime selection table TurbulenceModel I hope that will help you to fix this problem. Best wishes, Hassan Kassem |
|
May 2, 2016, 11:23 |
|
#4 |
New Member
Stefan Wenzel
Join Date: Mar 2013
Posts: 6
Rep Power: 13 |
Hello Hassan,
thank you so much! Your method solved the problem. The solver recognises the new turbulence model. I'm still faced to the same errors as you but i will post a solution here as soon as i found one. Thank you again, this was really a great help! Best regards, Stefan |
|
June 25, 2016, 07:31 |
|
#5 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Hello,
This problem comes from ``makeBaseTurbulenceModel`` macro which has two functions, initialize the base template class then add it to run time table. Using ``makeBaseTurbulenceModel`` as it is means re-adding the base models to the run time table again which cause this error. The following modified macro should solve the problem. Just replace everything (keep the header files) in ``myphaseCompressibleTurbulenceModels.C`` Note: This macro could be used for LES as well. Best wishes, Hassan Kassem Code:
#define createBaseTurbulenceModel( \ Alpha, Rho, baseModel, BaseModel, TDModel, Transport) \ \ namespace Foam \ { \ \ typedef TDModel<BaseModel<Transport>> \ Transport##BaseModel; \ typedef RASModel<EddyDiffusivity<Transport##BaseModel>> \ RAS##Transport##BaseModel; \ typedef LESModel<EddyDiffusivity<Transport##BaseModel>> \ LES##Transport##BaseModel; \ } #define makeRASModel(Type) \ makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, RAS, Type) #define makeLESModel(Type) \ makeTemplatedTurbulenceModel \ (phaseModelPhaseCompressibleTurbulenceModel, LES, Type) createBaseTurbulenceModel ( volScalarField, volScalarField, compressibleTurbulenceModel, PhaseCompressibleTurbulenceModel, ThermalDiffusivity, phaseModel ); #include "mykOmegaSSTSato.H" makeRASModel(mykOmegaSSTSato); Last edited by hk318i; June 25, 2016 at 14:33. |
|
June 30, 2016, 13:29 |
|
#6 |
New Member
Nicoḷ Scapin
Join Date: Apr 2016
Posts: 15
Rep Power: 10 |
Does your solution is still valid for OpenFOAM 3.0.x?
I notice that adding a new turbulence model in OpenFOAM 3.0.x is not so straightforward than in previous version |
|
June 30, 2016, 13:37 |
|
#7 | |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Quote:
This solution for OpenFOAM-3.0.0 and upward unless they changed again. |
||
June 30, 2016, 18:55 |
|
#8 |
New Member
Nicoḷ Scapin
Join Date: Apr 2016
Posts: 15
Rep Power: 10 |
Thanks for your answer. I follow your steps, but I failed when I compiled the solver with the command wmake libso. In fact, I get:
make: *** No rule to make target 'Make/linux64GccDPInt32Opt/myphaseCompressibleTurbulenceModels.C.dep', needed by 'Make/linux64GccDPInt32Opt/myphaseCompressibleTurbulenceModels.o'. Stop. I am pretty sure that it is a very basic error, but since I am at the beginning with OpenFOAM and with creating a new turbulent solver, I have not been able to solve it up to now. Thanks for your answer. |
|
June 30, 2016, 19:18 |
|
#9 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
You maybe need to run wclean first. In case, it did not wok, I'm attaching here two examples which you can use for comparison.
Bw, Hassan |
|
July 3, 2016, 19:53 |
|
#10 |
New Member
Nicoḷ Scapin
Join Date: Apr 2016
Posts: 15
Rep Power: 10 |
Hi Thanks for your help. Now I am able to compile it. Just last questions, when I run my solver, the case is not able to recognize the new turbulence model. I add at the end of my controldict the command libs ("libmyphaseCompressibleTurbulenceModels.so"), as you suggested in your guide; in fact, the new model is not put in the directory /OpenFOAM-3.0.x/src/TurbulenceModels/phaseCompressible/RAS to mantain pure the installed version of OpenFOAM.
By doing so, I obtained an error concerning the fact that my model has not been recognized among those available. |
|
July 4, 2016, 06:57 |
|
#11 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
The library name is incorrect, it should be exactly the same as in Make/file. For example for the attached mymixtureKEpsilon model
Code:
libs ("mymixtureKEpsilon.so"); |
|
July 27, 2016, 19:34 |
|
#12 |
New Member
Nicoḷ Scapin
Join Date: Apr 2016
Posts: 15
Rep Power: 10 |
Hi,
Up to now I succeded in compiling my new turbulence model. It works without errors. Nevertheless, I notice this warning: --> FOAM Warning : From function dlOpen(const fileName&, const bool) in file POSIX.C at line 1179 dlopen error : /cineca/prod/opt/applications/openfoam/3.0/openmpi--1.6.4--gnu--4.7.2/OpenFOAM-3.0.x/platforms/linux64GccDPInt32Opt/lib/libcompressibleTwoPhaseSystem.so: undefined symbol: _ZN4Foam2fv10optionList5debugE --> FOAM Warning : From function dlLibraryTable:pen(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99 could not load "mymixtureKEpsilon.so" If I use this model in my case, the solver correctly selects my turbulence model. However, this warning appears whenever I run checkMesh, decomposePar or other command that has to do with calling the controlDict. Even though, I obtained results I would like to solve this problem and avoid warnings. Thanks in advance for your help |
|
July 28, 2016, 09:14 |
|
#13 | |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Quote:
|
||
November 11, 2016, 08:10 |
|
#14 |
Member
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10 |
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 11, 2016, 10:11 |
|
#15 | |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Quote:
It is hard to debug such error without the code. BTW, are you using CFD-support windows version? |
||
November 14, 2016, 07:29 |
|
#16 | |
Member
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10 |
[/QUOTE][/QUOTE][/QUOTE][/QUOTE]
Quote:
It is OpenFoam-in-box based on openfoam 3.0.x for ubuntu. Give me ur email id. i will mail u my code. I have modified dynamickeqn model to make dynamicSmagorinsky model. |
||
November 16, 2016, 10:41 |
|
#17 | |
Member
W. Schuyler Hinman
Join Date: Apr 2013
Location: Calgary, Alberta, Canada
Posts: 38
Rep Power: 13 |
Quote:
Did you guys figure this out? I am having the same issue at run-time. I had just assumed it was something silly in my code. Curious to see if you guys found anything useful? What was the issue? Schuyler |
||
November 16, 2016, 10:51 |
|
#18 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
If it a common case, could anyone upload the code here with a test case or at least the steps to reproduce the error? It will be helpful for the community to keep a record of this case here.
Schuyler, could you please confirm which OF version have you tested? is it CFD-Support version? Best wishes, Hassan |
|
November 16, 2016, 11:25 |
|
#19 | |
Member
W. Schuyler Hinman
Join Date: Apr 2013
Location: Calgary, Alberta, Canada
Posts: 38
Rep Power: 13 |
Quote:
This is just a simple case to see if the model would run. I have run this model before using OpenFOAM 2.3 but wanted to update it to the newer version using the new format for the turbulence src. Schuyler |
||
November 16, 2016, 12:11 |
|
#20 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Hello Schuyle,
Thank you for uploading the code it helped a lot. The problem of your model is a missing defination of one function, namely Code:
tmp<volScalarField> fmu(const volScalarField& chi) const; Please keep us updated! Best wishes, Hassan |
|
Tags |
phasecompressible, phaseincompressible, tubulence model, turbulence, twophaseeulerfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding graviational acc. to turbulence model | fertinaz | OpenFOAM Programming & Development | 6 | December 12, 2020 01:04 |
chtMultiRegionSimpleFoam: strange error | samiam1000 | OpenFOAM Running, Solving & CFD | 26 | December 29, 2015 23:14 |
Turbulence model choice | dave13 | CFX | 3 | December 22, 2015 08:12 |
Compressible turbulence model issues | 351Cleveland | OpenFOAM | 5 | October 24, 2013 16:41 |
What model of turbulence choose to study an external aerodynamics case | raffale | OpenFOAM | 0 | August 23, 2012 06:45 |