CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

wmake doesn't compile a new turbulence model

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 25, 2025, 06:22
Default wmake doesn't compile a new turbulence model
  #1
New Member
 
Filippo
Join Date: Dec 2023
Location: Italy
Posts: 4
Rep Power: 3
filo00 is on a distinguished road
Hi everyone,
this is my first post. I am writing my master thesis in the implementation of a new turbulence model. I have OpenFOAM 12 compiled in my $HOME directory. I have tried to compile an existing turbulence model called myKEpsilon by watching the following YouTube tutorial:

http://www.youtube.com/watch?v=kfshFtULjt4&t=0s

The result is the same of the video. Compiler doesn't give me any error but the compilation failed. In fact, if I type 'myKEpsilon -help' the bash respond with 'command not found'. In addition myKEpsilon folder after the compilation weights only 120 Kb, while the order of magnitude is 2 Mb.

I had already tried to compile the same customize turbulent model with OpenFOAM 10 installed in "opt" directory (instead of $HOME directory).

I really appreciate your help!

Thanks,
Filippo

P.S.
I attached below what I see after the compilation
Attached Images
File Type: jpg error.jpg (76.5 KB, 20 views)
filo00 is offline   Reply With Quote

Old   March 27, 2025, 03:44
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 825
Rep Power: 16
Tobermory will become famous soon enough
I am not sure what you expected to see when typing 'myKEpsilon -help'. Try it for kEpsilon and you'll get the same result. Remember, you are compiling a turbulence model and not a solver.

Your first check should be whether it has actually generated any output - look in the path at the end of the sceenshot you attached and see if the .so library file has been generated. If it has, then all is okay.
Tobermory is offline   Reply With Quote

Old   March 27, 2025, 04:35
Default
  #3
New Member
 
Filippo
Join Date: Dec 2023
Location: Italy
Posts: 4
Rep Power: 3
filo00 is on a distinguished road
The .so file has been generated and it weights 16 KB. I tried to run a simple test case and I get the following error:
  1. Create time
  2. --> FOAM Warning :
  3. From function void* Foam::dlOpen(const Foam::fileName&, bool)
  4. in file POSIX.C at line 1247
  5. dlopen error : /home/filippo/OpenFOAM/OpenFOAM-12/platforms/linux64GccDPInt32Opt/lib/libphaseCompressibleMomentumTransportModels.so: undefined symbol: _ZTIN4Foam34compressibleMomentumTransportModelE
  6. --> FOAM Warning :
  7. From function bool Foam::dlLibraryTable:pen(const Foam::fileName&, bool)
  8. in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 106
  9. could not load "libmyKEpsilonMomentumTransportModels.so"
  10. Create mesh for time = 0
  11. Selecting solver incompressibleFluid
  12. Selecting viscosity model constant
  13. Selecting turbulence model type RAS
  14. Selecting RAS turbulence model myKEpsilon

  15. --> FOAM FATAL ERROR:
  16. Unknown RASModel type myKEpsilon
  17. Valid RASModel types:
  18. 19
  19. (
  20. LRR
  21. LamBremhorstKE
  22. LaunderSharmaKE
  23. LienCubicKE
  24. LienLeschziner
  25. RNGkEpsilon
  26. SSG
  27. ShihQuadraticKE
  28. SpalartAllmaras
  29. kEpsilon
  30. kOmega
  31. kOmega2006
  32. kOmegaSST
  33. kOmegaSSTLM
  34. kOmegaSSTSAS
  35. kkLOmega
  36. qZeta
  37. realizableKE
  38. v2f
  39. )

  40. From function static Foam::autoPtr<Foam::RASModel<BasicMomentumTranspor tModel> > Foam::RASModel<BasicMomentumTransportModel>::New(c onst alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const Foam::viscosity&) [with BasicMomentumTransportModel = Foam::incompressibleMomentumTransportModel; Foam::RASModel<BasicMomentumTransportModel>::alpha Field = Foam::geometricOneField; Foam::RASModel<BasicMomentumTransportModel>::rhoFi eld = Foam::geometricOneField; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]
  41. in file ../momentumTransportModels/lnInclude/RASModel.C at line 155.
  42. FOAM exiting

I modified "momentumTransport" and the "controlDict" as follows:

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 12
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "constant";
object momentumTransport;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

simulationType RAS;

RAS
{
model myKEpsilon;

turbulence on;

printCoeffs on;
}

// ************************************************** *********************** //



/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 12
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application foamRun;

solver incompressibleFluid;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 0.3;

deltaT 0.0001;

writeControl adjustableRunTime;

writeInterval 0.01;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo 5;

libs ("libmyKEpsilonMomentumTransportModels.so");
// ************************************************** *********************** //
filo00 is offline   Reply With Quote

Old   March 29, 2025, 11:05
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,713
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

First. We do have code tags to make clear text passages.
Second. As already mentioned, you probably compile a library and not an application. Hence typing "myKEpilson" does not make sense at all.
Third: show us your compilation output
Fourth: I did not checked the YouTube video but the lib you want to use was built for OpenFoam V12 or any other version?

Best Tobi
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 31, 2025, 16:17
Default
  #5
New Member
 
Filippo
Join Date: Dec 2023
Location: Italy
Posts: 4
Rep Power: 3
filo00 is on a distinguished road
Thanks Tobi!!

I solved the problem by changing some lines in Make/options file. I checked the previous libs and they were built for Open FOAM 12.

It helped me a lot the following article:

https://www.tfd.chalmers.se/~hani/ku...lenceModel.pdf

Thanks all again!!
filo00 is offline   Reply With Quote

Old   April 15, 2025, 09:13
Default
  #6
Member
 
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 99
Rep Power: 15
einstein_zee is on a distinguished road
Hi there,

If you still in doubt what is happening or want to know more this video "https://youtu.be/8QbW8zr8saU" might help.
einstein_zee is offline   Reply With Quote

Old   April 16, 2025, 10:10
Default
  #7
New Member
 
Filippo
Join Date: Dec 2023
Location: Italy
Posts: 4
Rep Power: 3
filo00 is on a distinguished road
I will watch your video as soon as possible. Thanks again for your time!!
filo00 is offline   Reply With Quote

Reply

Tags
compilation, openfoam coding, wmake problems

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 40 January 27, 2023 07:18
[OpenFOAM.org] Not found many .so files when installing OpenFOAM 6 lengjun OpenFOAM Installation 2 December 12, 2022 22:08
[GUIDE] Switching turbulence model to SpalartAllmaras gabrielfelix OpenFOAM Running, Solving & CFD 1 March 24, 2022 20:19
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 14:32
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 04:26


All times are GMT -4. The time now is 21:12.